/* E4Desk Help — tokens fiéis ao design system do arquivo E4Desk (Paper) */

:root {
  --color-bg: #FAFAF7;
  --color-sidebar: #F5F4EF;
  --color-surface: #FFFFFF;
  --color-sunken: #F5F3F0;
  --color-chip: #F0EDE8;
  --color-ink: #1C1B1A;
  --color-muted: #4A4A4A;
  --color-subtle: #6B6866;
  --color-border: #E0DCD6;
  --color-wash: #EFEDE7;
  --color-mark: #F3E2B3;
  --radius-3: 3px;
  --radius-5: 5px;
  --radius-7: 7px;
  --radius-11: 11px;
  --font-serif: "Instrument Serif", "Times New Roman", Times, serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --sidebar-width: 248px;
  --toc-width: 236px;
  --header-height: 64px;
  --shadow-sm: 0 1px 2px rgba(28, 27, 26, 0.05);
  --shadow-md: 0 8px 28px rgba(28, 27, 26, 0.12);
  --shadow-lg: 0 16px 48px rgba(28, 27, 26, 0.16);
  --focus: 0 0 0 3px rgba(28, 27, 26, 0.16);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100%;
}

body { min-height: 100vh; }

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.boot {
  margin: auto;
  padding: 80px 24px;
  color: var(--color-subtle);
  text-align: center;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  background: var(--color-ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-5);
}
.skip-link:focus { top: 12px; }

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header .menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-7);
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
}
.site-header .menu-btn:hover { background: var(--color-sunken); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img { width: 28px; height: 28px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-suffix {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 2px;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 360px;
  height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-subtle);
  text-align: left;
}
.header-search:hover { border-color: #cfc9c0; }
.header-search:focus-visible { outline: none; box-shadow: var(--focus); }
.header-search .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-subtle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-5);
  padding: 2px 6px;
  line-height: 1.3;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-7);
  color: var(--color-ink);
}
.icon-btn:hover { background: var(--color-sunken); }

/* ——— Layouts ——— */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.with-sidebar {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  padding: 24px 16px 64px 24px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin: 0 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  margin: 0 0 2px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-7);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.nav-item:hover { background: var(--color-wash); color: var(--color-ink); }
.nav-item.is-active {
  background: var(--color-chip);
  color: var(--color-ink);
}
.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-ink);
}
.nav-item .nav-name { flex: 1; min-width: 0; }
.nav-item .chevron {
  width: 14px;
  height: 14px;
  color: var(--color-subtle);
  transition: transform 0.15s ease;
}
.nav-item.is-expanded .chevron { transform: rotate(90deg); }

.nav-children {
  list-style: none;
  margin: 0 0 8px;
  padding: 0 0 4px 26px;
}
.nav-children a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-5);
  text-decoration: none;
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.4;
}
.nav-children a:hover { background: var(--color-wash); color: var(--color-ink); }
.nav-children a.is-active {
  background: var(--color-chip);
  color: var(--color-ink);
  font-weight: 500;
}

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.article-shell {
  flex: 1;
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.article-body {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 80px;
  max-width: 860px;
}

.toc {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 36px 24px 48px 8px;
  margin-left: auto;
}
.toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin: 0 0 12px;
}
.toc a {
  display: block;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-muted);
  padding: 5px 10px;
  border-left: 2px solid var(--color-border);
  margin-left: 2px;
}
.toc a:hover { color: var(--color-ink); }
.toc a.is-active {
  color: var(--color-ink);
  font-weight: 600;
  border-left-color: var(--color-ink);
}

/* ——— Home ——— */
.home-hero {
  text-align: center;
  padding: 72px 24px 32px;
}
.home-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.home-hero p {
  margin: 0 auto 28px;
  max-width: 540px;
  color: var(--color-subtle);
  font-size: 17px;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  height: 56px;
  padding: 0 8px 0 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  box-shadow: var(--shadow-sm);
}
.hero-search:focus-within { box-shadow: var(--focus), var(--shadow-sm); }
.hero-search svg { flex-shrink: 0; color: var(--color-subtle); }
.hero-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  min-width: 0;
}
.hero-search input::placeholder { color: var(--color-subtle); }
.hero-hint { color: var(--color-subtle); font-size: 13px; padding-right: 10px; white-space: nowrap; }

.section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 64px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 0;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  text-decoration: none;
  min-height: 168px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.collection-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: #d4cfc7;
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-7);
  background: var(--color-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
}
.collection-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.collection-card p {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
  flex: 1;
}
.collection-card .count {
  font-size: 13px;
  color: var(--color-subtle);
}

.featured-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.featured-card {
  display: block;
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  text-decoration: none;
}
.featured-card:hover { border-color: #d4cfc7; box-shadow: var(--shadow-sm); }
.featured-card .eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-subtle);
  margin-bottom: 6px;
}
.featured-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.featured-card p {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

/* ——— Collection / article typography ——— */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-subtle);
  margin: 0 0 20px;
}
.breadcrumb a { text-decoration: none; color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-ink); text-decoration: underline; }
.breadcrumb .sep { color: var(--color-border); }

.page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.lead {
  font-size: 17px;
  color: var(--color-muted);
  margin: 0 0 32px;
  max-width: 46rem;
}

.article-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.article-toolbar .page-title { flex: 1; margin-bottom: 0; }

.split-btn { position: relative; display: inline-flex; flex-shrink: 0; }
.split-main,
.split-caret {
  height: 36px;
  border: 1px solid var(--color-ink);
  background: var(--color-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.split-main {
  padding: 0 14px;
  border-radius: var(--radius-7) 0 0 var(--radius-7);
  border-right: 0;
}
.split-caret {
  width: 32px;
  padding: 0;
  border-radius: 0 var(--radius-7) var(--radius-7) 0;
  border-left: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.split-main:hover,
.split-caret:hover,
.split-main:focus-visible,
.split-caret:focus-visible { background: #2e2c2a; }
.split-btn.is-copied .split-main { background: #2d6a4f; border-color: #2d6a4f; }
.split-btn.is-copied .split-caret { background: #2d6a4f; border-color: #2d6a4f; }

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.popover button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: var(--radius-7);
  font-size: 14px;
  color: var(--color-ink);
}
.popover button:hover,
.popover button:focus-visible { background: var(--color-sunken); outline: none; }
.popover .hint {
  font-size: 12px;
  color: var(--color-subtle);
  margin-left: auto;
}

/* Content blocks */
.prose { margin-top: 28px; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2em 0 0.7em;
  line-height: 1.3;
  scroll-margin-top: 88px;
}
.prose h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 1.6em 0 0.55em;
  scroll-margin-top: 88px;
}
.prose p { margin: 0 0 0.9em; color: var(--color-ink); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose code,
.md-view code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--color-sunken);
  border-radius: var(--radius-3);
  padding: 1px 5px;
}

.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose li + li { margin-top: 0.4em; }

.steps { list-style: none; margin: 8px 0 20px; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  margin: 0 0 14px;
  align-items: start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-body { padding-top: 3px; }
.step-body strong { display: block; font-weight: 600; }
.step-body .step-detail {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 400;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  margin: 8px 0 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
th {
  background: var(--color-sunken);
  font-weight: 600;
  font-size: 13px;
}
tr:last-child td { border-bottom: 0; }

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  margin: 16px 0 20px;
}
.callout.warning {
  background: #F8F1E4;
  border-color: #E6D7B8;
}
.callout-icon { flex-shrink: 0; margin-top: 2px; }
.callout strong { display: block; margin-bottom: 2px; font-size: 14px; }
.callout p { margin: 0; font-size: 14px; color: var(--color-muted); }

.accordion { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 20px; }
.accordion-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  overflow: hidden;
}
.accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-top: -4px;
}
.accordion-item[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }
.accordion-item .acc-body {
  padding: 0 16px 16px;
  color: var(--color-muted);
  font-size: 15px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 20px;
}
.cmp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  padding: 16px;
}
.cmp-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.cmp-card p { margin: 0; font-size: 14px; color: var(--color-muted); }

.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 12px 0 24px;
  padding: 0;
  list-style: none;
}
.flow li {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 16px 16px 18px;
  position: relative;
}
.flow li:first-child { border-radius: var(--radius-7) 0 0 var(--radius-7); }
.flow li:last-child { border-radius: 0 var(--radius-7) var(--radius-7) 0; }
.flow li + li { border-left: 0; }
.flow .flow-index {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin-bottom: 4px;
}
.flow strong { display: block; margin-bottom: 4px; }
.flow p { margin: 0; font-size: 13px; color: var(--color-muted); }

/* Helpful + related */
.helpful {
  margin: 48px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.helpful p { margin: 0; font-weight: 600; }
.helpful-actions { display: flex; gap: 8px; }
.helpful button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-7);
  font-size: 14px;
  font-weight: 500;
}
.helpful button:hover { background: var(--color-sunken); }
.helpful button.is-on {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #fff;
}
.helpful .thanks { color: var(--color-muted); font-weight: 400; }

.related { margin: 40px 0 0; }
.related h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 14px;
}
.related ul { list-style: none; margin: 0; padding: 0; }
.related li + li { margin-top: 8px; }
.related a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  background: var(--color-surface);
  text-decoration: none;
}
.related a:hover { border-color: #d4cfc7; }
.related a strong { display: block; font-size: 15px; }
.related a span { display: block; margin-top: 4px; font-size: 13px; color: var(--color-muted); }

.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li + li { margin-top: 8px; }
.article-list a {
  display: block;
  padding: 16px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-7);
  text-decoration: none;
}
.article-list a:hover { border-color: #d4cfc7; box-shadow: var(--shadow-sm); }
.article-list a strong { display: block; font-size: 16px; font-weight: 600; }
.article-list a span { display: block; margin-top: 4px; font-size: 14px; color: var(--color-muted); }

.subcollection { margin-top: 36px; }
.subcollection h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}

.collection-page { padding: 36px 48px 80px; max-width: 880px; }

/* Markdown view */
.md-view { padding: 32px 48px 80px; max-width: 920px; }
.md-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.md-bar h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 auto 0 0;
  letter-spacing: -0.02em;
}
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-7);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: var(--color-sunken); }
.btn-ink {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #fff;
}
.btn-ink:hover { background: #2e2c2a; color: #fff; }
.btn-ink.is-copied { background: #2d6a4f; border-color: #2d6a4f; }

.md-pre {
  margin: 0;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-11);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-ink);
}

/* Legal */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.legal-page h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  margin: 0 0 16px;
}
.legal-page p { color: var(--color-muted); }

/* Footer — light mode, as validated in Paper */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid #E0DCD6;
  margin-top: auto;
}
.footer-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
.footer-brand .brand-name { color: #1C1B1A; }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4A4A4A;
  text-decoration: none;
}
.footer-social a:hover { background: var(--color-sunken); color: #1C1B1A; }
.footer-legal h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6B6866;
}
.footer-legal a {
  display: block;
  text-decoration: none;
  color: #1C1B1A;
  font-size: 14px;
  margin: 6px 0 0;
}
.footer-legal a:hover { text-decoration: underline; }

/* Search dialog */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 27, 26, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.dialog {
  width: min(680px, 100%);
  max-height: min(72vh, 720px);
  background: var(--color-surface);
  border-radius: var(--radius-11);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.dialog-search svg { color: var(--color-subtle); flex-shrink: 0; }
.dialog-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  min-width: 0;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  overflow: visible;
}
.pill {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
}
.pill:hover { background: var(--color-sunken); }
.pill.is-on {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #fff;
}
.results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 12px;
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-7);
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}
.result:hover, .result.is-active { background: var(--color-sunken); }
.result .rtitle { font-weight: 600; font-size: 14px; }
.result .rmeta { font-size: 12px; color: var(--color-subtle); margin-top: 2px; }
.result .rsnippet { font-size: 13px; color: var(--color-muted); margin-top: 4px; }
mark {
  background: var(--color-mark);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.results-empty, .results-hint {
  padding: 28px 16px;
  text-align: center;
  color: var(--color-subtle);
  font-size: 14px;
}
.dialog-foot {
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-subtle);
}
.dialog-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Drawer (mobile nav) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 27, 26, 0.35);
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: min(var(--sidebar-width), 86vw);
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  padding: 16px 16px 32px 20px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-7);
}

body.is-locked { overflow: hidden; }

/* Error */
.error-page { max-width: 640px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.error-page h1 { font-family: var(--font-serif); font-weight: 400; font-size: 40px; margin: 0 0 12px; }

/* Responsive */
@media (max-width: 1100px) {
  .toc { display: none; }
  .article-body { padding-right: 32px; }
  .cards-grid { grid-template-columns: 1fr; }
  .flow { flex-direction: column; }
  .flow li,
  .flow li:first-child,
  .flow li:last-child { border-radius: var(--radius-7); border-left: 1px solid var(--color-border); }
  .flow li + li { margin-top: 8px; border-left: 1px solid var(--color-border); }
}

@media (max-width: 900px) {
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { display: none; }
  .site-header .menu-btn { display: inline-flex; }
  .header-search { display: none; }
  .icon-btn { display: inline-flex; }
  .hero-hint { display: none; }
  .featured-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .collection-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 48px 16px 24px; }
  .section { width: calc(100% - 32px); }
  .article-body,
  .collection-page,
  .md-view { padding: 24px 16px 64px; }
  .article-toolbar { flex-direction: column; align-items: stretch; }
  .split-btn { align-self: flex-start; }
  .footer-inner {
    width: calc(100% - 32px);
    flex-direction: column;
    gap: 24px;
    padding: 28px 0 32px;
  }
  .site-header { padding: 0 12px; }
  .md-bar { flex-wrap: wrap; }
  .md-bar h1 { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ——— Visual alignment with validated Paper screens ——— */

.brand img,
.brand-suffix { display: none; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}
.footer-brand .brand-name { font-size: 24px; color: #1C1B1A; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.app-link {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-ink);
  white-space: nowrap;
}
.app-link:hover { text-decoration: underline; }

.header-search {
  margin-left: 0;
  min-width: 0;
  width: 220px;
  height: 36px;
  padding: 0 8px 0 14px;
  border-radius: var(--radius-7);
  background: var(--color-surface);
  gap: 8px;
}
.header-search .label { flex: 1; font-size: 13px; color: var(--color-subtle); }

.sidebar { padding: 20px 12px 48px 16px; }
.sidebar-label { display: none; }
.drawer .sidebar-label { display: block; }

.nav-item {
  padding: 6px 8px;
  font-size: 13.5px;
  font-weight: 500;
  gap: 8px;
  color: var(--color-ink);
}
.nav-item .nav-name {
  line-height: 1.3;
}
.nav-item.is-active {
  background: transparent;
  font-weight: 600;
}
.nav-item.is-expanded { background: transparent; }
.nav-item:hover { background: rgba(28, 27, 26, 0.04); }

.nav-children {
  padding: 2px 0 8px 14px;
  margin: 0 0 6px 16px;
  border-left: 1px solid var(--color-border);
}
.nav-children a {
  position: relative;
  padding: 5px 8px 5px 12px;
  font-size: 13px;
  color: var(--color-muted);
}
.nav-children a.is-active {
  background: transparent;
  color: var(--color-ink);
  font-weight: 600;
}
.nav-children a.is-active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-ink);
}

.section-label {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-subtle);
}
.section { padding: 16px 0 56px; }
.section + .section { padding-top: 8px; }
.home-hero { padding: 80px 24px 40px; }
.home-hero p { font-size: 16px; max-width: 560px; }

.hero-search {
  height: 52px;
  border-radius: 999px;
  padding: 0 10px 0 20px;
}
.hero-hint { padding-right: 6px; }

.collection-card {
  min-height: 0;
  gap: 8px;
  padding: 22px 22px 18px;
}
.card-icon {
  width: 24px;
  height: 24px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 4px;
}
.card-icon svg { width: 20px; height: 20px; }
.collection-card h3 { font-size: 15px; }
.collection-card p { font-size: 13.5px; line-height: 1.45; }

.featured-list {
  display: block;
  border-top: 1px solid var(--color-border);
}
.featured-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}
.featured-card:hover {
  box-shadow: none;
  border-color: var(--color-border);
  background: rgba(28, 27, 26, 0.02);
}
.featured-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.featured-card .eyebrow {
  margin: 0;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-subtle);
}

.article-list a {
  padding: 16px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}
.article-list li:first-child a { border-top: 1px solid var(--color-border); }
.article-list a:hover { box-shadow: none; border-color: var(--color-border); background: rgba(28, 27, 26, 0.02); }
.article-list a strong { font-size: 15px; }
.article-list a span { font-size: 13.5px; }

.subcollection h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}
.subcollection { margin-top: 20px; }

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}
.article-meta {
  margin: 0;
  font-size: 13px;
  color: var(--color-subtle);
}
.article-body .page-title { margin-bottom: 4px; }

.split-main,
.split-caret {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  font-weight: 500;
}
.split-caret { border-left: 0; }
.split-main:hover,
.split-caret:hover,
.split-main:focus-visible,
.split-caret:focus-visible {
  background: var(--color-sunken);
  color: var(--color-ink);
}
.split-btn.is-copied .split-main,
.split-btn.is-copied .split-caret {
  background: #2d6a4f;
  border-color: #2d6a4f;
  color: #fff;
}

.toc-title { letter-spacing: 0.08em; }
.prose { margin-top: 8px; }

.accordion { gap: 0; margin: 4px 0 24px; }
.accordion-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}
.accordion-item:first-child { border-top: 1px solid var(--color-border); }
.accordion-item summary {
  font-weight: 600;
  font-size: 15px;
  padding: 16px 0 16px 22px;
  position: relative;
  justify-content: flex-start;
}
.accordion-item summary::after {
  display: none;
}
.accordion-item summary::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  transform: translateY(-70%) rotate(-45deg);
  transition: transform 0.15s ease;
}
.accordion-item[open] summary::before {
  transform: translateY(-40%) rotate(45deg);
}
.accordion-item .acc-body {
  padding: 0 0 16px 22px;
  font-size: 15px;
}

.dialog { overflow: hidden; }
.dialog-search { position: relative; flex-shrink: 0; }
.dialog-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-5);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dialog-close:hover { background: var(--color-sunken); color: var(--color-ink); }
.results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.dialog-foot { flex-shrink: 0; }

.md-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.md-crumb {
  margin: 0;
  font-size: 13px;
  color: var(--color-subtle);
  flex: 1;
  min-width: 200px;
}
.md-actions { display: flex; gap: 8px; flex-shrink: 0; }
.md-bar h1 { display: none; }

.related a,
.helpful {
  /* keep cards for these utility blocks */
}

@media (max-width: 900px) {
  .site-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 0 12px;
  }
  .menu-btn { display: inline-flex; grid-column: 1; }
  .brand {
    grid-column: 2;
    justify-self: center;
  }
  .header-right { display: none; }
  .icon-btn {
    display: inline-flex;
    grid-column: 3;
    margin-left: 0;
    justify-self: end;
  }

  .collection-grid {
    display: block;
    border-top: 1px solid var(--color-border);
  }
  .collection-card {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 16px;
    min-height: 0;
    padding: 14px 2px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
  }
  .collection-card:hover {
    transform: none;
    box-shadow: none;
  }
  .collection-card .card-icon,
  .collection-card p { display: none; }
  .collection-card h3 { flex: 1; font-size: 15px; }
  .collection-card .count { margin-left: auto; font-size: 13px; }

  .featured-card { padding: 14px 2px; }
  .home-hero { padding: 36px 8px 20px; }
  .section { width: calc(100% - 32px); padding: 8px 0 40px; }

  .article-toolbar { flex-direction: column; align-items: flex-start; flex-wrap: wrap; }
  .split-btn { align-self: flex-start; }
}

@media (max-width: 640px) {
  .md-bar { flex-direction: column; align-items: flex-start; }
  .hero-search { height: 48px; }
}
