/* Wiki viewer. Basecoat (vendored, vendor/basecoat/) provides the components: it is imported by
   brand.css into the lowest cascade layer "basecoat". Colours come from brand.css (--bg --surface
   --text --primary --primary-foreground --brand-accent --link --logo-filter plus the shadcn
   variables Basecoat reads: --background --foreground --muted --muted-foreground --accent --border
   --ring ...); everything else is derived here. customer.css loads last and may override.
   brand.css and viewer.css sit in cascade layers (basecoat, brand, viewer); customer.css is
   unlayered, so it wins over all of them whatever the selector specificity. Because viewer is
   above basecoat, a rule here beats Basecoat's components and its Tailwind preflight. */
@layer basecoat, brand, viewer;

@font-face {
  font-family: "TASA Orbiter";
  src: url("/brand/fonts/TASAOrbiter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "TASA Orbiter";
  src: url("/brand/fonts/TASAOrbiter-Medium.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

@layer viewer {
:root {
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 24%, var(--bg));
  --code-bg: color-mix(in srgb, var(--text) 6%, var(--surface));
  --radius-field: 8px;
  --radius-card: 12px;
  --topbar-h: 52px;
  --sidebar-width: 17rem;
  --font: "TASA Orbiter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: var(--font);
  --font-mono: var(--mono);
  --i-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 400 16px/1.65 var(--font);
}
/* Tailwind's preflight makes links inherit; plain links are styled only in content areas (zero
   specificity), so Basecoat's own anchors (.btn, .badge, sidebar, menus) keep their colours */
:where(.main, .rail) a:where(:not(.btn, .badge)) { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:where(.main, .rail) a:where(:not(.btn, .badge)):hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
/* Basecoat components draw their own focus ring */
:is(.btn, .input, .badge, .sidebar a, .sidebar summary, .breadcrumb a, .accordion summary, .command, .command-dialog, .dropdown-menu):focus-visible,
.dropdown-menu *:focus-visible, .command *:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted-foreground); }
.error { color: var(--destructive); }
.icon { flex: none; }

/* ---- top bar ---- */
.topbar form { margin: 0; display: contents; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { filter: var(--logo-filter, none); height: 22px; width: auto; max-width: 140px; display: block; }
.topbar .search { display: block; position: relative; flex: 0 1 280px; margin-left: auto; }
.search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.search input:focus ~ .kbd, .search input:not(:placeholder-shown) ~ .kbd { display: none; }
.topbar .search input { padding-right: 48px; }
@media (min-width: 768px) { #nav-toggle { display: none; } }
/* the right rail can be hidden where it is a column; pages without panels have nothing to hide */
body:not(:has(.rail .panel)) #rail-toggle { display: none; }
@media (max-width: 1000px) { #rail-toggle { display: none; } }
.dropdown-menu { flex: none; }
.dropdown-menu > [data-popover] { max-width: calc(100vw - 16px); }
.dropdown-menu [role="menuitem"] kbd { font-family: var(--font); }
.menu-user { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.dropdown-menu form { margin: 0; }
.dropdown-menu button[role="menuitem"] { background: none; text-align: left; }

/* ---- layout: Basecoat's sidebar is fixed below the top bar and pushes its next sibling ---- */
.sidebar > nav { top: var(--topbar-h); bottom: 0; font-family: var(--font); }
@media (max-width: 767px) { .sidebar { top: var(--topbar-h); } }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  min-height: calc(100vh - var(--topbar-h));
}
.rail {
  position: sticky; top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h)); overflow: auto;
  padding: 16px; font-size: 14px;
  border-left: 1px solid var(--border);
}
.rail:not(:has(.panel)) { border-left: 0; }
.main { min-width: 0; padding: 32px clamp(16px, 4vw, 48px) 64px; }
.note { max-width: 72ch; margin: 0 auto; }
.note > p { margin: .8em 0; }
.crumbs { margin: 0 0 8px; font-size: 13px; }
.crumbs ol { gap: 4px 6px; }
.crumbs a { color: var(--muted-foreground); text-decoration: none; }
.crumbs a:hover { color: var(--foreground); text-decoration: underline; }
.crumbs .reg { min-width: 0; margin-right: 4px; font-size: 11px; }
.crumbs .icon { width: 14px; height: 14px; }
.note-head { display: flex; align-items: flex-start; gap: 16px; margin: 0 0 .4em; }
.note-head .note-title { flex: 1 1 auto; min-width: 0; margin: 0; }
/* 32px button centred on the 38px first title line */
.note-head .share { flex: none; margin-top: 3px; }
.share [role="menu"] a { color: inherit; text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.avatar + .icon { display: none; }
.copy-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; padding: 8px 14px; border-radius: var(--radius); background: var(--foreground); color: var(--background); font-size: 14px; box-shadow: 0 4px 12px rgb(0 0 0 / .15); }
.note-title { font-size: 2rem; line-height: 1.2; margin: 0 0 .4em; font-weight: 500; letter-spacing: -.01em; }
.note-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.note-footer a { color: var(--muted-foreground); }
.note-footer .path { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

.panel { margin-bottom: 24px; }
/* section labels: sentence case, no tracking */
.panel h2 { font-size: 13px; letter-spacing: normal; text-transform: none; color: var(--muted-foreground); font-weight: 500; }
.panel h2 { margin: 0 0 8px; }
.panel h3 { font-size: 12px; color: var(--muted-foreground); font-weight: 500; margin: 8px 0 4px; }
.panel p { margin: 0; }
.outline, .linklist, .listing { list-style: none; margin: 0; padding: 0; }
.outline li { padding: 1px 0; }
.outline .lvl-2 { padding-left: 10px; } .outline .lvl-3 { padding-left: 20px; }
.outline .lvl-4 { padding-left: 30px; } .outline .lvl-5, .outline .lvl-6 { padding-left: 40px; }
.outline a, .linklist a { text-decoration: none; color: var(--foreground); }
.outline a:hover, .linklist a:hover { color: var(--link); text-decoration: underline; }
.linklist li { padding: 2px 0; overflow-wrap: anywhere; }
.outline a { display: block; padding: 3px 8px; border-radius: var(--radius-field); }
@media (max-width: 1000px) { .outline a { padding: 6px 8px; min-height: 28px; } }
.outline a.is-active { background: var(--brand-accent-soft); font-weight: 500; box-shadow: inset 2px 0 var(--brand-accent); }

/* ---- explorer (Basecoat sidebar) ---- */
.sidebar > nav > section { padding-bottom: 16px; }
/* deep trees: Basecoat pads every folder level on both sides (14px in ::details-content, 10px
   on the ul); indent only on the start side, so a level costs 14px instead of 48px */
.sidebar > nav ul details::details-content { padding-inline: 8px 0; }
.sidebar > nav ul ul { padding-inline: 6px 0; }
/* drag handle on the explorer's right edge (width in --sidebar-width, set by viewer.js) */
.sidebar-resizer { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; z-index: 1; cursor: col-resize; touch-action: none; }
.sidebar-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background-color .15s; }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .is-resizing .sidebar-resizer::after { background: var(--ring); }
.sidebar-resizer:focus-visible { outline: none; }
.is-resizing, .is-resizing * { cursor: col-resize !important; user-select: none; }
.is-resizing .sidebar > nav, .is-resizing .sidebar + * { transition: none; }
@media (max-width: 767px) { .sidebar-resizer { display: none; } }
.tree { list-style: none; }
.tree summary > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: inherit; text-decoration: none; }
.tree-note > a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- markdown ---- */
.markdown-body { overflow-wrap: break-word; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { line-height: 1.25; font-weight: 500; margin: 1.8em 0 .5em; }
.markdown-body h1, .markdown-body h2 { font-weight: 600; }
.markdown-body h3 { font-weight: 600; }
.markdown-body h2 { border-bottom: 1px solid var(--border); padding-bottom: .25em; }
.markdown-body h1 { font-size: 1.7rem; } .markdown-body h2 { font-size: 1.4rem; }
.markdown-body h3 { font-size: 1.2rem; } .markdown-body h4 { font-size: 1.05rem; }
.markdown-body h5, .markdown-body h6 { font-size: 1rem; color: var(--muted-foreground); }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body p { margin: .8em 0; }
.markdown-body ul { list-style: disc; } .markdown-body ol { list-style: decimal; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin: .8em 0; }
.markdown-body li > ul, .markdown-body li > ol { margin: .2em 0; }
.markdown-body li { margin: .2em 0; }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.markdown-body img { display: inline; max-width: 100%; height: auto; border-radius: var(--radius-field); }
.markdown-body blockquote { margin: 1em 0; padding: .1em 1em; border-left: 3px solid var(--border); color: var(--muted-foreground); }
/* tables are Basecoat's .table (render.py adds the classes); Markdown cells may wrap */
.markdown-body .table-container { margin: 1em 0; }
.markdown-body .table th, .markdown-body .table td, .properties th, .properties td { white-space: normal; }
.markdown-body .table th { text-align: start; }
.markdown-body code { font: .88em var(--mono); background: var(--code-bg); padding: .15em .35em; border-radius: 4px; }
.markdown-body pre { margin: 1em 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-field); padding: 12px 16px; overflow-x: auto; line-height: 1.5; }
.markdown-body pre code { background: none; padding: 0; font-size: 13px; }
.markdown-body pre.highlight { background: var(--code-bg); }
.markdown-body mark, .snippet mark { background: color-mix(in srgb, var(--brand-accent) 45%, transparent); color: inherit; padding: 0 2px; border-radius: 4px; }
.markdown-body .math.inline, .markdown-body .math.block { font-family: var(--mono); font-size: .92em; }
.markdown-body .math.block { display: block; margin: 1em 0; overflow-x: auto; }
.task-list-item { list-style: none; margin-left: -1.3em; }
.task-list-item-checkbox { margin-right: .5em; accent-color: var(--primary); }
.footnotes { font-size: .88em; color: var(--muted-foreground); border-top: 1px solid var(--border); margin-top: 2em; }
.footnote-ref, .footnote-backref { text-decoration: none; }

.internal-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--link) 50%, transparent); }
.internal-link:hover { text-decoration-color: var(--link); }
.internal-link.is-unresolved { color: var(--muted-foreground); text-decoration-style: dashed; text-decoration-color: var(--muted-foreground); cursor: default; }
.external-link::after { content: "\2197"; content: "\2197" / ""; font-size: .75em; margin-left: 2px; opacity: .6; }

.tag .count { opacity: .7; }
.note-tags, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: .4em 0 1em; }

.properties th, .properties td { text-align: left; vertical-align: top; padding: 8px 16px; }
.properties { width: 100%; padding: 0; font-size: 14px; }
.properties th { width: 9em; color: var(--muted-foreground); font-weight: 400; height: auto; }
.properties td { overflow-wrap: anywhere; }
.properties .chip { display: inline-block; margin: 0 .4em .2em 0; }
.props { margin: 0 0 1.5em; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); }
.props > details > summary { align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; font-weight: 400; color: var(--muted-foreground); border-radius: var(--radius-card); }
.props > details > summary .count { font-variant-numeric: tabular-nums; }
.props > details > summary > svg:last-child { margin-inline-start: auto; }
.props > details[open] > summary { border-bottom: 1px solid var(--border); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.props > details > .properties { margin: 0; padding: 0; }
.props .properties tr:last-child { border-bottom: 0; }

.embed { margin: 1em 0; padding: .1em 1em; border-left: 3px solid var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 8%, var(--bg)); border-radius: 0 var(--radius-field) var(--radius-field) 0; }
.embed-title { font-size: .85em; font-weight: 500; margin-top: .6em; }
.embed-title a { text-decoration: none; }
.embed-file { display: inline-block; margin: 0; padding: 0 .6em; border: 1px solid var(--border); border-radius: var(--radius-field); background: var(--surface); text-decoration: none; }

/* ---- callouts ---- */
.callout { --c: #3b82f6; margin: 1em 0; border-radius: var(--radius-card); background: color-mix(in srgb, var(--c) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--c) 28%, var(--bg)); border-left: 4px solid var(--c); overflow: hidden; }
.callout-title { display: block; padding: 8px 16px; font-weight: 500; color: color-mix(in srgb, var(--c) 60%, var(--foreground)); list-style: none; }
details.callout > summary { cursor: pointer; }
details.callout > summary::-webkit-details-marker { display: none; }
details.callout > summary::after {
  content: ""; display: block; width: 16px; height: 16px; float: right; margin-top: 5px; transition: transform .15s;
  background-color: currentColor;
  -webkit-mask: var(--i-chev) center / 16px 16px no-repeat; mask: var(--i-chev) center / 16px 16px no-repeat;
}
details.callout[open] > summary::after { transform: rotate(90deg); }
.callout-content { padding: 0 16px 8px; }
.callout-content > :first-child { margin-top: .2em; }
.callout-content > :last-child { margin-bottom: .2em; }
.callout[data-callout="note"], .callout[data-callout="info"], .callout[data-callout="todo"] { --c: #3b82f6; }
.callout[data-callout="abstract"], .callout[data-callout="summary"], .callout[data-callout="tldr"],
.callout[data-callout="tip"], .callout[data-callout="hint"], .callout[data-callout="important"] { --c: #06b6d4; }
.callout[data-callout="success"], .callout[data-callout="check"], .callout[data-callout="done"] { --c: #22a559; }
.callout[data-callout="question"], .callout[data-callout="help"], .callout[data-callout="faq"],
.callout[data-callout="warning"], .callout[data-callout="caution"], .callout[data-callout="attention"] { --c: #e08a00; }
.callout[data-callout="failure"], .callout[data-callout="fail"], .callout[data-callout="missing"],
.callout[data-callout="danger"], .callout[data-callout="error"], .callout[data-callout="bug"] { --c: #e0364a; }
.callout[data-callout="example"] { --c: #8b5cf6; }
.callout[data-callout="quote"], .callout[data-callout="cite"] { --c: #8a8a93; }

/* ---- listings, search ---- */
.listing li { padding: 4px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.listing li > .icon, .listing a > .icon { color: var(--muted-foreground); }
.listing a { text-decoration: none; }
/* register numeral of a "30_Name" folder */
.reg { display: inline-block; min-width: 3ch; margin-right: 8px; font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.search-big { display: flex; gap: 8px; margin: 1em 0 .5em; }
.search-big .input { flex: 1; }
.results { list-style: none; padding: 0; margin: 1em 0; }
.results > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.result-title { font-weight: 500; font-size: 1.05rem; text-decoration: none; }
.result-path { color: var(--muted-foreground); font-size: 13px; margin-left: 8px; }
.snippet { margin: 8px 0 0; padding: 8px 12px; font: 14px/1.5 var(--font); white-space: pre-wrap; background: var(--code-bg); border-radius: var(--radius-field); overflow-wrap: anywhere; }

/* ---- hover preview ---- */
.hover-preview { position: fixed; z-index: 60; width: min(420px, calc(100vw - 24px)); max-height: 320px; overflow: hidden; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 10px 30px rgb(0 0 0 / .18); padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.hover-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(transparent, var(--popover)); pointer-events: none; }
.hover-preview .preview-title { font-weight: 500; margin-bottom: 8px; }
.hover-preview .markdown-body > * { margin-top: .4em; margin-bottom: .4em; }
.hover-preview .markdown-body h1, .hover-preview .markdown-body h2, .hover-preview .markdown-body h3 { font-size: 1.05rem; margin: .6em 0 .3em; }
.preview-empty { color: var(--muted-foreground); }

/* ---- quick switcher (Basecoat command in a dialog) ---- */
.command-dialog > .command { top: 14vh; max-width: min(36rem, calc(100% - 2rem)); font-family: var(--font); }
.command-dialog [role="menuitem"] { gap: 8px; }
.command-dialog [role="menuitem"] > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-dialog [role="menuitem"] > small { margin-left: auto; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted-foreground); max-width: 55%; }
.command-dialog [role="menuitem"] { text-decoration: none; color: inherit; }

/* ---- dashboard ---- */
.dashboard { max-width: 1100px; margin: 0 auto; }
/* the dashboard has no right panel: give its column to the main area */
.layout:has(.dashboard) { grid-template-columns: minmax(0, 1fr); }
.layout:has(.dashboard) .rail { display: none; }
.hero { padding: 8px 0 24px; }
.hero-logo { filter: var(--logo-filter, none); display: block; margin: 0 0 16px; height: 64px; width: auto; max-width: min(320px, 80%); }
.hero-title { font-size: 1.5rem; line-height: 1.25; font-weight: 500; margin: 0 0 24px; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.stat { gap: 4px; }
.stat > header > p { margin: 0; }
.stat-value { margin: 0; font-size: 1.8rem; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 32px; align-items: start; }
.card { min-width: 0; }
.bars, .recent { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3.5em; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { width: 100%; height: 8px; display: block; background: var(--border); border-radius: 2px; }
/* neutral on purpose: the heatmap is the only accent on the dashboard */
.bar-fill { fill: color-mix(in srgb, var(--text) 40%, var(--bg)); }
.bar-count { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.recent li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.recent li:last-child { border-bottom: 0; }
.recent a { text-decoration: none; font-weight: 500; }
.recent a:hover { text-decoration: underline; }
.recent-folder { font-size: 12px; overflow-wrap: anywhere; }
.recent-meta { font-size: 12px; margin-left: auto; white-space: nowrap; }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat { display: block; width: 100%; height: auto; min-width: 640px; }
.heat-label { font-size: 12px; fill: var(--muted-foreground); }
/* --link, not --primary: brand.css guarantees it is readable on either scheme's background */
.heat rect, .heat-legend rect { fill: var(--link); }
.heat rect.lvl-0, .heat-legend rect.lvl-0 { fill: var(--border); }
.heat rect.lvl-1, .heat-legend rect.lvl-1 { fill-opacity: .3; }
.heat rect.lvl-2, .heat-legend rect.lvl-2 { fill-opacity: .55; }
.heat rect.lvl-3, .heat-legend rect.lvl-3 { fill-opacity: .8; }
.heat rect[data-tip]:hover { stroke: var(--foreground); stroke-opacity: .6; stroke-width: 1; }
.heat-tip { position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: var(--radius); background: var(--foreground); color: var(--background); font-size: 12px; line-height: 1.4; white-space: nowrap; box-shadow: 0 4px 12px rgb(0 0 0 / .15); }
.heat-tip strong { display: block; font-weight: 600; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; margin-top: 8px; }
.heat-note { font-size: 12px; margin: 8px 0 0; }
.area-bars { column-gap: 32px; }
.area-bars li { display: block; padding: 0; }
.area-bars a { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr) 3.5em; align-items: center; gap: 12px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius); color: inherit; text-decoration: none; }
.area-bars a:hover { background: var(--accent); }
.area-bars a:hover .bar-fill { fill: var(--link); }
.areas-files { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (min-width: 1200px) { .area-bars { columns: 2; } .area-bars li { break-inside: avoid; } }
@media (min-width: 1200px) {
  .cards { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .card-wide { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .bars li { grid-template-columns: minmax(0, 8em) minmax(0, 1fr) 3em; }
  .share-label { display: none; }
  .area-bars a { grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 3em; }
  .recent-meta { margin-left: 0; flex-basis: 100%; }
}

/* ---- a11y / navigation feedback ---- */
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: var(--radius); background: var(--background); color: var(--foreground); border: 1px solid var(--border); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
#main:focus { outline: none; }
.copy-toast:empty { opacity: 0; pointer-events: none; }
.topbar::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--ring, var(--link)); transform-origin: left; transform: scaleX(0); opacity: 0; pointer-events: none; }
[data-busy] .topbar::after { opacity: 1; animation: nav-busy 1.2s ease-in-out infinite; }
@keyframes nav-busy { 0% { transform: scaleX(0); } 70% { transform: scaleX(.9); } 100% { transform: scaleX(.9); opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  [data-busy] .topbar::after { animation: none; transform: none; }
}

/* ---- responsive ---- */
@media (min-width: 1001px) {
  [data-rail-closed] .layout { grid-template-columns: minmax(0, 1fr); }
  [data-rail-closed] .rail { display: none; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--border); padding: 24px clamp(16px, 4vw, 48px); }
  .search { flex-basis: 180px; }
}
@media (max-width: 767px) {
  .search .kbd { display: none; }
  .search { flex: 1 1 0; min-width: 0; }
  .brand img { max-width: 96px; }
  .topbar { gap: 4px; padding: 0 8px; }
  .main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .topbar, .sidebar, .rail, .hover-preview, .command-dialog { display: none !important; }
  .sidebar + .layout { margin: 0; }
  .layout { display: block; }
  .main { padding: 0; }
  .note { max-width: none; }
  a { color: inherit; }
}
}

/* ---- login page ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 24rem; padding: 32px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo { height: 36px; width: auto; max-width: 200px; filter: var(--logo-filter, none); }
.login-logo[src=""] { display: none; }
.login-title { font-size: 1.4rem; line-height: 1.25; font-weight: 500; margin: 8px 0 0; }
.login-card p { margin: 0 0 8px; }
.login-btn { gap: 10px; }
.google-g { flex: none; }
