/*
  docs.uutrip.ai — static port of utran_wikiui wikiItemV2 article chrome.

  Sources (utran_wikiui/wiki-ui):
    tokens   src/global.less (:root --uua-*)  — UUTrip V2 Aqua
    shell    src/layouts/wikiLayouts/Layout.tsx
    header   src/components/wikiComponents/Header.tsx
    sidebar  src/components/wikiComponents/docsNav/SidebarLink*.tsx
    topic    src/components/wikiComponents/docsNav/TopicTitle.tsx
    toc      src/components/wikiComponents/docsNav/SecondaryNav.tsx
    prose    src/pages/wikiItemV2/page.module.scss + typography.ts
    prevnext src/components/wikiComponents/docsNav/PageNavigation.tsx
    footer   src/components/wikiComponents/Footer.tsx

  No Tailwind, no React: every page works with JS disabled. docs.js only adds
  the TOC scrollspy and the mobile drawer.
*/

:root {
  --uua-primary: #84c0cb;
  --uua-primary-hover: #79b4bf;
  --uua-accent: #7abec8;
  --uua-secondary: #2c3e50;
  --uua-page: #f4fbfc;
  --uua-surface: #fbfeff;
  --uua-surface-base: #ffffff;
  --uua-surface-low: #eff8fa;
  --uua-surface-high: #e8f4f6;
  --uua-border: #d7ebee;
  --uua-border-soft: #e3f0f2;
  --uua-muted: #6d8291;
  --uua-danger: #c44545;

  /* Text ramp — AA on --uua-page (see global.less). Never use aqua for text. */
  --uua-text-secondary: #4a5f6d;
  --uua-text-muted: #5d7383;
  --uua-link: #2b7382;
  --uua-link-hover: #1f5d6b;
  --uua-warning: #e6a23c;
  --uua-success: #34a853;

  --uua-radius-control: 10px;
  --uua-radius-nav: 12px;
  --uua-radius-dialog: 16px;
  --uua-radius-round: 999px;

  --uua-btn-secondary-bg: #f5fbfc;
  --uua-btn-secondary-border: #cae3e7;
  --uua-primary-shadow: 0 12px 28px rgba(132, 192, 203, 0.20);

  /*
    GenSenRounded2 TW is first, as on the wiki. The wiki injects it at runtime
    from ASSETS_HOST (~15MB/weight); here it is only used if already installed,
    otherwise the platform's TC font takes over.
  */
  --font-body: 'GenSenRounded2 TW', 'Manrope', 'PingFang TC', 'Noto Sans TC',
    'Microsoft JhengHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Topic glyph colours — DEFAULT_GROUP_COLORS in groupColors.ts */
  --topic-light: #84c0cb;
  --topic-dark: #4f97a5;

  --header-h: 80px;
}
@media (min-width: 768px) {
  :root { --header-h: 96px; }
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--uua-page);
  color: var(--uua-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--uua-surface-base); color: var(--uua-link);
  padding: 8px 12px; border-radius: var(--uua-radius-control);
  border: 1px solid var(--uua-border);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--uua-link);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header (Header.tsx) ---------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgb(244 251 252 / 0.8);
  border-bottom: 1px solid var(--uua-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--uua-secondary); min-width: 0;
}
.brand img { width: 36px; height: 36px; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand-tag {
  font-size: 13px; font-weight: 500; color: var(--uua-text-muted);
  padding-left: 10px; margin-left: 2px;
  border-left: 1px solid var(--uua-border);
  white-space: nowrap;
}
.header-nav { margin-left: auto; }
.header-nav ul { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.header-nav a {
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--uua-text-secondary); transition: color .15s;
}
.header-nav a:hover { color: var(--uua-link-hover); }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -8px;
  background: none; border: 0; color: var(--uua-text-secondary); cursor: pointer;
  border-radius: var(--uua-radius-control);
}
.menu-toggle:hover { color: var(--uua-link-hover); }
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Shell (Layout.tsx) ---------- */

.shell {
  width: 100%; margin: 0 auto;
  padding: 0 16px;
  max-width: calc(80rem + 20rem); /* 7xl + sidebar track */
}
@media (min-width: 640px) { .shell { padding: 0 24px; } }
@media (min-width: 1024px) { .shell { padding: 0 32px; } }
@media (min-width: 1280px) { .shell { max-width: calc(80rem + 20rem + 16rem); } }

/* clip, not hidden: hidden would break the sticky TOC */
.page { position: relative; overflow-x: clip; }

.hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  pointer-events: none; z-index: -1; opacity: .4; max-width: none;
}

.grid { position: relative; }
@media (min-width: 1024px) {
  .grid { display: grid; grid-template-columns: 20rem minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: 20rem minmax(0, 1fr) 16rem; }
}

.main-col {
  min-width: 0;
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: 32px;
  display: flex; flex-direction: column;
}

/* ---------- Sidebar (Layout.tsx WikiSidebar + SidebarLink) ---------- */

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  width: 16rem; height: 100vh;
  border-right: 1px solid var(--uua-border);
  background: linear-gradient(to bottom, var(--uua-surface-low), var(--uua-surface));
  transform: translateX(-100%);
  transition: transform .2s ease-out;
  overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-inner { padding: calc(var(--header-h) + 16px) 12px 32px; }
body.nav-open .sidebar { transform: none; }

.scrim {
  position: fixed; inset: 0; z-index: 30;
  background: rgb(44 62 80 / .25);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

@media (min-width: 1024px) {
  .sidebar { left: auto; z-index: 10; transform: none; transition: none; }
  /* Extend the gradient to the viewport edge, like the wiki. */
  .sidebar::before {
    content: ''; position: fixed; top: 0; bottom: 0; left: 0; z-index: -1;
    width: 100vw; margin-left: -100vw;
    background: linear-gradient(to bottom, var(--uua-surface-low), var(--uua-surface));
  }
  .scrim, .menu-toggle { display: none; }
}

.nav-group + .nav-group { margin-top: 24px; }
.nav-group-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: var(--uua-text-muted);
  padding: 0 12px; margin: 0 0 6px;
}
.nav-group-title svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: block; padding: 6px 12px;
  border-radius: var(--uua-radius-nav);
  font-size: 15px; font-weight: 500; text-decoration: none;
  color: var(--uua-secondary); transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--uua-link-hover); }
.nav-link[aria-current='page'] {
  color: var(--uua-link); font-weight: 600;
  background: rgb(132 192 203 / .18);
}

/* ---------- Topic title row (TopicTitle.tsx + WikiBreadcrumb) ---------- */

.topic-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 24px;
}
.topic { display: flex; align-items: center; height: 64px; flex-shrink: 0; }
.topic svg { flex-shrink: 0; }
.topic .c-top { fill: var(--topic-light); }
.topic .c-left { fill: var(--uua-surface); }
.topic .c-right { fill: var(--topic-dark); }
.topic-name { margin-left: 16px; font-size: 18px; font-weight: 600; color: var(--topic-dark); }

.breadcrumb ol {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 4px;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-round);
  font-size: 14px; white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before {
  content: '/'; color: var(--uua-border); margin: 0 2px;
}
.breadcrumb a, .breadcrumb span {
  display: block; padding: 2px 12px; border-radius: var(--uua-radius-round);
  text-decoration: none; color: var(--uua-text-secondary);
}
.breadcrumb a:hover { color: var(--uua-link-hover); background: var(--uua-surface-low); }
.breadcrumb [aria-current='page'] {
  color: var(--uua-link); font-weight: 600; background: rgb(132 192 203 / .18);
}

/* ---------- Article + prose (page.module.scss, typography.ts) ---------- */

article { position: relative; }

.prose { color: var(--uua-text-secondary); max-width: 46rem; }
.prose > :first-child { margin-top: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--uua-secondary); }
.prose h1 { font-size: 24px; line-height: 1.35; font-weight: 700; margin: 0 0 8px; }
.prose h2 {
  font-size: 18px; line-height: 1.5; font-weight: 600;
  margin: 48px 0 12px; padding-top: 24px;
  border-top: 1px solid var(--uua-border-soft);
}
.prose h3 { font-size: 16px; line-height: 1.6; font-weight: 600; margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--uua-secondary); font-weight: 600; }

.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose ul > li::marker, .prose ol > li::marker { color: var(--uua-muted); }

.prose a { color: var(--uua-link); text-decoration-color: var(--uua-border); text-underline-offset: 3px; }
.prose a:hover { color: var(--uua-link-hover); text-decoration-color: currentColor; }

.prose hr { border: 0; border-top: 1px solid var(--uua-border-soft); margin: 32px 0; }

.prose blockquote {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 4px solid var(--uua-primary);
  background: var(--uua-surface-low);
  border-radius: var(--uua-radius-control);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--uua-surface-low);
  border: 1px solid var(--uua-border-soft);
  border-radius: 6px; color: var(--uua-secondary);
  padding: 2px 6px;
}

.table-wrap { overflow-x: auto; margin: 0 0 20px; }
.prose table {
  width: 100%; font-size: 15px; line-height: 1.6;
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-control);
  border-collapse: separate; border-spacing: 0; overflow: hidden;
}
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; }
.prose th {
  background: var(--uua-surface-low); color: var(--uua-secondary);
  font-weight: 600; border-bottom: 1px solid var(--uua-border);
  white-space: nowrap;
}
.prose td { border-bottom: 1px solid var(--uua-border-soft); }
.prose tr:last-child td { border-bottom: 0; }

/* Doc meta line under h1 */
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 13px; color: var(--uua-text-muted); margin: 0 0 24px;
}

/* Callouts — blockquote variants for summaries and notes */
.callout {
  margin: 0 0 20px; padding: 14px 18px;
  border: 1px solid var(--uua-border);
  border-left: 4px solid var(--uua-primary);
  background: var(--uua-surface-base);
  border-radius: var(--uua-radius-control);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: block; font-weight: 600; color: var(--uua-secondary); margin-bottom: 4px; }

/* Contact cards on /support */
.cards { display: grid; gap: 12px; margin: 0 0 24px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  display: block; padding: 16px 18px; text-decoration: none;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-dialog);
  transition: border-color .15s, box-shadow .15s;
}
a.card:hover { border-color: var(--uua-primary); box-shadow: 0 12px 28px rgb(132 192 203 / .20); }
.card-label { display: block; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--uua-link); }
.card-title { display: block; font-size: 16px; font-weight: 600; color: var(--uua-secondary); margin-top: 2px; }
.card-text { display: block; font-size: 14px; color: var(--uua-text-secondary); margin-top: 4px; }
.prose a.card { color: inherit; }

/* FAQ — native <details> */
.faq details {
  border: 1px solid var(--uua-border); border-radius: var(--uua-radius-control);
  background: var(--uua-surface-base); margin: 0 0 8px;
}
.faq summary {
  cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--uua-secondary);
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--uua-text-muted); font-weight: 500; }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 16px 4px; }

/* ---------- Contact form (UserContactForm fields, mailto submit) ---------- */

.prose .lead { font-size: 17px; color: var(--uua-text-secondary); margin-bottom: 8px; }

.contact-form {
  display: grid; gap: 16px; margin: 0 0 24px; padding: 20px;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-dialog);
}
.contact-form[hidden] { display: none; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; color: var(--uua-secondary); }
.field .req { color: var(--uua-danger); }
.field .opt { font-weight: 400; color: var(--uua-text-muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--uua-secondary);
  padding: 10px 12px; min-height: 44px;
  background: var(--uua-surface);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-control);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--uua-text-muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--uua-primary);
  box-shadow: 0 0 0 3px rgb(132 192 203 / .25);
}
.field [aria-invalid='true'] { border-color: var(--uua-danger); }
.form-error { margin: 0; color: var(--uua-danger); font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-actions .btn { border: 0; cursor: pointer; font-family: inherit; }
.form-hint { font-size: 13px; color: var(--uua-text-muted); flex: 1; min-width: 14rem; }

/* ---------- Policy parts (網站 / iOS App) ---------- */

.part-switch {
  display: grid; gap: 10px; margin: 20px 0 8px;
}
@media (min-width: 640px) { .part-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose .part-switch a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-dialog);
  transition: border-color .15s, box-shadow .15s;
}
.prose .part-switch a:hover { border-color: var(--uua-primary); box-shadow: var(--uua-primary-shadow); }
.part-switch-label { font-size: 12px; font-weight: 650; letter-spacing: .04em; color: var(--uua-link); }
.part-switch-title { font-size: 16px; font-weight: 600; color: var(--uua-secondary); }
.part-switch-desc { font-size: 13px; line-height: 1.5; color: var(--uua-text-muted); }

.policy-part { margin-top: 48px; }
.part-head {
  margin: 0 0 20px; padding: 18px 20px;
  border-radius: var(--uua-radius-dialog);
  background: linear-gradient(135deg, var(--uua-surface-low), var(--uua-surface-high));
  border: 1px solid var(--uua-border);
}
.part-label { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .04em; color: var(--uua-link); }
.prose h2.part-title {
  margin: 2px 0 0; padding: 0; border: 0;
  font-size: 22px; line-height: 1.4; font-weight: 700;
}
/* Land with the whole part header visible (label + padding sit above the h2). */
.prose h2.part-title { scroll-margin-top: 56px; } /* adds to html scroll-padding-top */
.part-head .doc-meta { margin: 6px 0 0; }

/* ---------- In-page TOC ---------- */

/* xl+: right column (SecondaryNav.tsx) */
.toc-side { display: none; }
@media (min-width: 1280px) {
  .toc-side {
    display: block; position: sticky; top: calc(var(--header-h) + 32px);
    align-self: start; margin: calc(var(--header-h) + 32px) 0 0 24px;
    max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: none;
  }
}
.toc-side nav { border-left: 1px solid var(--uua-border); }
.toc-title {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  color: var(--uua-text-muted); padding: 6px 16px; margin: 0;
}
.toc-list { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.5; }
.toc-list a {
  position: relative; display: block; padding: 6px 16px;
  text-decoration: none; font-weight: 500; color: var(--uua-text-secondary);
  transition: color .15s;
}
.toc-list a:hover { color: var(--uua-link-hover); }
.toc-list a.is-active { color: var(--uua-link); font-weight: 600; }
.toc-list a.lvl-1 { font-weight: 650; color: var(--uua-secondary); margin-top: 8px; }
.toc-list li:first-child a.lvl-1 { margin-top: 0; }
.toc-list a.lvl-2 { padding-left: 28px; }
.toc-list a.lvl-1.is-active { color: var(--uua-link); }
.toc-list a.is-active::before {
  content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px;
  background: var(--uua-primary);
}

/* below xl: collapsible block above the article (replaces MobileSidebar popover) */
.toc-inline {
  margin: 0 0 28px; max-width: 46rem;
  border: 1px solid var(--uua-border); border-radius: var(--uua-radius-control);
  background: var(--uua-surface-base);
}
.toc-inline summary {
  cursor: pointer; padding: 10px 16px; font-size: 14px; font-weight: 600;
  color: var(--uua-text-secondary); list-style: none;
}
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: ' ▾'; color: var(--uua-text-muted); }
.toc-inline .toc-list { padding: 0 0 8px; }
@media (min-width: 1280px) { .toc-inline { display: none; } }

/* ---------- Prev / next (PageNavigation.tsx) ---------- */

.pager {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  padding: 32px 0; margin-top: 48px; max-width: 46rem;
  border-top: 1px solid var(--uua-border-soft);
}
.pager a { text-decoration: none; display: flex; flex-direction: column; }
.pager .next { margin-left: auto; text-align: right; align-items: flex-end; }
.pager-label { font-size: 12px; font-weight: 650; text-transform: uppercase; color: var(--uua-link); margin-bottom: 4px; }
.pager-title { font-weight: 650; color: var(--uua-secondary); transition: color .15s; }
.pager a:hover .pager-title { color: var(--uua-link-hover); }

/* ---------- Footer (Footer.tsx) ---------- */

.site-footer {
  margin-top: auto; padding: 24px 0 40px;
  border-top: 1px solid var(--uua-border);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 14px; color: var(--uua-text-muted);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; color: var(--uua-text-secondary); }
.site-footer a:hover { color: var(--uua-link-hover); }

/* ---------- Home ---------- */

/* Homepage shell: 18rem sidebar track, no TOC column (Layout.tsx isHomepage). */
@media (min-width: 1024px) {
  .grid--home { grid-template-columns: 18rem minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .grid--home { grid-template-columns: 18rem minmax(0, 1fr); }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.home-hero { max-width: 44rem; padding: 8px 0 8px; }
.home-eyebrow {
  margin: 0 0 4px; font-size: 13px; font-weight: 650; letter-spacing: .08em;
  color: var(--uua-link);
}
.home-hero h1 {
  margin: 0; font-size: 32px; line-height: 1.25; font-weight: 700; color: var(--uua-secondary);
}
@media (min-width: 768px) { .home-hero h1 { font-size: 40px; } }
.home-lead { font-size: 17px; max-width: 40rem; color: var(--uua-text-secondary); margin: 12px 0 24px; }

.home-search { position: relative; max-width: 36rem; }
.home-search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 52px;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-dialog);
  box-shadow: var(--uua-primary-shadow);
  transition: border-color .15s;
}
.home-search-box:focus-within { border-color: var(--uua-primary); }
.home-search-box svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--uua-text-muted); }
.home-search-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--uua-secondary);
}
.home-search-box input::placeholder { color: var(--uua-text-muted); }

.home-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px);
  list-style: none; margin: 0; padding: 6px;
  background: var(--uua-surface-base);
  border: 1px solid var(--uua-border);
  border-radius: var(--uua-radius-dialog);
  box-shadow: 0 18px 40px rgb(44 62 80 / .12);
  max-height: 22rem; overflow-y: auto;
}
.home-results a {
  display: block; padding: 8px 12px; border-radius: var(--uua-radius-control);
  text-decoration: none; line-height: 1.45;
}
.home-results a:hover, .home-results a[aria-selected='true'] { background: var(--uua-surface-low); }
.home-results .r-title { display: block; color: var(--uua-secondary); font-weight: 600; font-size: 15px; }
.home-results .r-sub { display: block; color: var(--uua-text-muted); font-size: 12px; }
.home-results mark { background: rgb(132 192 203 / .35); color: inherit; border-radius: 3px; }
.home-results .r-empty { padding: 10px 12px; color: var(--uua-text-muted); font-size: 14px; }

.home-quick { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.home-quick a {
  display: inline-block; padding: 4px 12px; font-size: 13px; font-weight: 500;
  border-radius: var(--uua-radius-round);
  border: 1px solid var(--uua-btn-secondary-border);
  background: var(--uua-btn-secondary-bg);
  color: var(--uua-text-secondary); text-decoration: none; transition: border-color .15s, color .15s;
}
.home-quick a:hover { border-color: var(--uua-primary); color: var(--uua-link-hover); }

.home-section { margin-top: 56px; }
.home-h2 { margin: 0 0 16px; font-size: 18px; font-weight: 600; color: var(--uua-secondary); }
.home-h2-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-h2-row a { font-size: 14px; color: var(--uua-link); text-decoration: none; white-space: nowrap; }
.home-h2-row a:hover { color: var(--uua-link-hover); }

.topic-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.topic-card {
  padding: 20px 22px; background: var(--uua-surface-base);
  border: 1px solid var(--uua-border); border-radius: var(--uua-radius-dialog);
}
.topic-card-head { display: flex; align-items: center; gap: 14px; }
.topic-card .c-top { fill: var(--topic-light); }
.topic-card .c-left { fill: var(--uua-surface); }
.topic-card .c-right { fill: var(--topic-dark); }
.topic-card h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--topic-dark); }
.topic-card p { margin: 10px 0 12px; font-size: 14px; color: var(--uua-text-secondary); }
.topic-card ul {
  list-style: none; margin: 0; padding: 12px 0 0;
  border-top: 1px solid var(--uua-border-soft);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px;
}
.topic-card li a {
  display: block; padding: 4px 0; font-size: 15px; font-weight: 500;
  color: var(--uua-secondary); text-decoration: none; transition: color .15s;
}
.topic-card li a::after { content: ' →'; color: var(--uua-text-muted); opacity: 0; transition: opacity .15s; }
.topic-card li a:hover { color: var(--uua-link-hover); }
.topic-card li a:hover::after { opacity: 1; }

.faq-links {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0 24px;
  border-top: 1px solid var(--uua-border-soft);
}
@media (min-width: 768px) { .faq-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.faq-links li { border-bottom: 1px solid var(--uua-border-soft); }
.faq-links a {
  display: flex; flex-direction: column; padding: 12px 0; text-decoration: none;
}
.faq-links span { color: var(--uua-secondary); font-weight: 500; transition: color .15s; }
.faq-links small { color: var(--uua-text-muted); font-size: 12px; }
.faq-links a:hover span { color: var(--uua-link-hover); }

@media (min-width: 768px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.home-contact {
  margin: 56px 0 40px; padding: 24px 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: var(--uua-radius-dialog);
  background: linear-gradient(135deg, var(--uua-surface-low), var(--uua-surface-high));
  border: 1px solid var(--uua-border);
}
.home-contact h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: var(--uua-secondary); }
.home-contact p { margin: 0; font-size: 14px; color: var(--uua-text-secondary); }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: var(--uua-radius-control);
  background: var(--uua-link); color: #fff; font-weight: 600; font-size: 15px;
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--uua-link-hover); }
.prose a.btn, .prose .btn { color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--uua-surface-base); color: var(--uua-secondary);
  border: 1px solid var(--uua-btn-secondary-border);
}
.btn-secondary:hover { background: var(--uua-surface-low); border-color: var(--uua-primary); }
.home-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 639px) {
  .brand-tag, .header-nav { display: none; }
  .prose h2 { margin-top: 36px; }
}

@media print {
  .site-header, .sidebar, .scrim, .toc-side, .toc-inline, .pager, .hero-glow { display: none !important; }
  .main-col { padding-top: 0; }
  .grid { display: block; }
  body { background: #fff; }
}
