/* ============================================================================
   DiSky Atlas: application layout. Depends on the design tokens
   (colors_and_type.css) + components (ds-components.css) + theme-bridge.css.
   Ported from the design kit's app.css and extended for the Blazor app.
   ========================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-sans); overflow: hidden; }

a { color: inherit; }

/* ---- Scrollbars: same rounded thumb for every scroller, vertical and horizontal.
   The transparent border + padding-box clip insets the thumb on any background. ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); background-clip: padding-box; border-radius: 10px; border: 3px solid transparent; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--bg-hover) transparent; }
}

/* ---- App shell grid ---- */
.app { display: grid; grid-template-rows: 56px 1fr; height: 100vh; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; text-decoration: none; }
.brand img { width: auto; height: 26px; }
html:not(.dark) .theme-dark-only, html.dark .theme-light-only { display: none; }
.brand .vtag {
  font-family: var(--font-mono); font-size: 11px; padding: 1px 7px;
  border: 1px solid var(--border-strong); border-radius: 999px; color: var(--fg-muted);
  margin-left: 2px;
}
.topbar .spacer { flex: 1; }
.topbar .sidebar-toggle { display: none; }

.search-trigger {
  display: flex; align-items: center; gap: 9px; width: 300px;
  padding: 7px 10px 7px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--bg-raised); cursor: text;
  color: var(--fg-faint); font-size: 13.5px; font-family: var(--font-sans);
  transition: border-color var(--dur) var(--ease);
}
.search-trigger .label-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--fg-faint); }
.search-trigger .kbd { margin-left: auto; display: flex; gap: 3px; }
.search-trigger kbd {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-muted);
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 4px;
  padding: 0 5px; line-height: 1.6;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }

/* ---- Body grid ---- */
.body { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; }

/* ---- Sidebar ---- */
.sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 14px 12px 40px;
  background: var(--bg);
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 10px; border: 3px solid var(--bg); }
.side-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--bg-raised); color: var(--fg-faint);
  font-size: 13px; cursor: text; margin-bottom: 14px; font-family: var(--font-sans);
}
.side-search .kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; }

.group { margin-bottom: 6px; }
.group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-faint); padding: 8px 10px 4px;
}
.tree-row {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  font-size: 13.5px; color: var(--fg-muted);
  padding: 6px 10px; border-radius: var(--radius); cursor: pointer;
  position: relative; background: none; font-family: var(--font-sans);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  text-decoration: none;
}
.tree-row:hover { background: var(--bg-hover); color: var(--fg); }
.tree-row.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--link); font-weight: 500; }
.tree-row.active::before {
  content: ""; position: absolute; left: 3px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 999px; background: var(--primary);
}
.tree-row .leaf-icon { color: var(--fg-faint); flex: none; display: inline-flex; }
.tree-row .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-row .count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); }
/* Sidebar tabs (Atlas | Documentation) */
.side-tabs { margin: 2px 0 6px; }
.side-tabs-list { display: flex; width: 100%; margin-bottom: 6px; }
.side-tab { flex: 1; }

/* Blueprint TreeView shims: the label anchor fills the row (real link,
   middle-click), the empty chevron placeholder on leaves collapses so the
   leaf icon sits in the chevron slot, and BB's chevron picks up DiSky ink. */
.tree-link {
  display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; color: inherit; text-decoration: none;
  margin: -6px -10px -6px 0; padding: 6px 10px 6px 0;
}
/* Clicks on the row padding hit BB's tree handler (select/toggle) instead of the link,
   so the link absorbs the padding; left side only on leaves, to keep the chevron clickable. */
.tree-row:not(:has(> button)) .tree-link { margin-left: -10px; padding-left: 10px; }
.tree-link:hover { text-decoration: none; }
.tree-row > span:empty { display: none; }
.tree-row > button { color: var(--fg-faint); }

/* ---- Content ---- */
.content { overflow-y: auto; overflow-x: hidden; padding: 0; min-width: 0; }
.content::-webkit-scrollbar { width: 12px; }
.content::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 12px; border: 3px solid var(--bg); }
.page { max-width: 820px; margin: 0 auto; padding: 32px 40px 96px; }

/* Rendered by BbBreadcrumb (nav > ol > li); the ol override pins DiSky's
   spacing/size over BB's Tailwind defaults. */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.crumb ol { gap: 8px; font-size: 13px; line-height: var(--lh-body); }
.crumb a { color: var(--fg-muted); cursor: pointer; text-decoration: none; }
.crumb a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.crumb .sep { color: var(--fg-faint); }
.crumb .cur { color: var(--fg); font-weight: 500; }

.page-head { margin-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .head-icon { color: var(--primary); flex: none; }
.page-head h1 { font-family: var(--font-mono); margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.page-lead { color: var(--fg-muted); font-size: 15px; max-width: 64ch; margin: 0 0 6px; }
.page-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.page-jda { font-family: var(--font-mono); font-size: 12px; color: var(--fg-faint); }

.section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  scroll-margin-top: 16px;
}
.section-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.section-head .n { font-family: var(--font-mono); font-size: 12px; color: var(--fg-faint); }
.section-head .to-top-wrap { margin-left: auto; align-self: center; }
/* BB's tooltip trigger nests a plain block span; collapse it so the button
   is the flex item and the head keeps its pre-tooltip height. */
.section-head .to-top-wrap > span { display: contents; }
.section-head .to-top {
  align-self: center; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--fg-faint);
  padding: 4px; border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.section-head .to-top:hover { color: var(--fg); background: var(--bg-hover); }
.section-head .to-top svg { width: 15px; height: 15px; }

/* ---- Syntax record ---- */
.record {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-raised); padding: 16px 18px; margin-bottom: 14px;
  scroll-margin-top: 16px;
}
.record:target { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* Attention glow when a deep link / reference scrolls a card into view (added by atlas.scrollToId). */
.record.atlas-flash { animation: atlas-flash 1.7s var(--ease); }
@keyframes atlas-flash {
  0% {
    box-shadow: 0 0 0 1px var(--primary),
                0 0 22px 4px color-mix(in srgb, var(--primary) 60%, transparent);
  }
  100% {
    box-shadow: 0 0 0 1px transparent, 0 0 0 0 transparent;
  }
}
.record-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; position: relative; }
.record-head .rname { font-family: var(--font-mono); font-size: 15.5px; font-weight: 600; color: var(--fg); }
.record-head .anchor {
  opacity: 0; color: var(--fg-faint); cursor: pointer; display: inline-flex;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease); background: none; border: 0; padding: 0;
  text-decoration: none;
}
.record:hover .record-head .anchor { opacity: 1; }
.record-head .anchor:hover { color: var(--primary); }
.record .desc { color: var(--fg-muted); font-size: 13.5px; margin: 12px 0 0; }
.record .desc + .desc { margin-top: 6px; }
.record .patterns { display: grid; gap: 8px; }
.record-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.cm-label { font-size: 11px; color: var(--fg-faint); font-family: var(--font-mono); margin-right: 2px; }
.ex-toggle {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 12.5px; color: var(--fg-muted); background: none; border: 0; cursor: pointer; font-family: var(--font-sans);
}
.ex-toggle:hover { color: var(--fg); }
.ex-toggle .chev { transition: transform var(--dur) var(--ease); display: inline-flex; }
.ex-toggle .chev.open { transform: rotate(90deg); }
.examples { margin-top: 12px; display: grid; gap: 10px; }

/* ---- Extra chips/badges not in the kit ---- */
.chip-async {
  color: var(--info); border-color: var(--info-bd); background: var(--info-bg);
}
.chip-list { color: var(--fg-muted); }
.intent-chip { color: var(--warning); border-color: var(--warning-bd); background: var(--warning-bg); }
.chip-writeonly {
  color: var(--warning); border-color: var(--warning-bd); background: var(--warning-bg);
  font-weight: 600;
}
.badge-deprecated {
  color: var(--danger); background: var(--destructive-bg); border-color: var(--destructive-bd);
}
.deprecated-note {
  margin-top: 10px; font-size: 13px; color: var(--danger);
  background: var(--destructive-bg); border: 1px solid var(--destructive-bd);
  border-radius: var(--radius); padding: 8px 12px;
}

/* ---- Command palette (Blueprint CommandDialog) ----
   .palette lands on the dialog content: repin BB's centered dialog to the
   classic top-aligned palette and restore the DiSky chrome. */
.palette {
  top: 12vh; translate: -50% 0; transform: none;
  display: flex; flex-direction: column; gap: 0; padding: 0;
  width: min(560px, 92vw); max-width: none; background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
/* BB's command input draws its own focus affordance; the global blurple
   :focus-visible outline would double up inside the dialog. */
.palette input:focus-visible { outline: none; }
.pal-results { max-height: 52vh; overflow-y: auto; overflow-x: hidden; padding: 6px; }
.pal-results::-webkit-scrollbar { width: 10px; }
.pal-results::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 10px; border: 3px solid var(--bg-raised); }
.pal-group { font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-faint); padding: 10px 12px 5px; }
.pal-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius);
  cursor: pointer; font-size: 13.5px;
}
.pal-row .pn { font-family: var(--font-mono); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-row .par { margin-left: auto; color: var(--fg-faint); font-size: 11.5px; font-family: var(--font-mono); white-space: nowrap; }
.pal-row[data-focused="true"] { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.pal-row[data-focused="true"] .par { color: var(--fg-muted); }
.pal-empty { padding: 26px; text-align: center; color: var(--fg-faint); font-size: 13.5px; }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-faint); }
.pal-foot .k { font-family: var(--font-mono); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; margin-right: 4px; }

/* ---- Home / landing ---- */
.home { max-width: 920px; margin: 0 auto; padding: 56px 40px 96px; }
.home-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.home-hero img { width: 64px; height: 64px; }
.home-hero h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.home-hero .vtag {
  font-family: var(--font-mono); font-size: 12px; padding: 2px 8px;
  border: 1px solid var(--border-strong); border-radius: 999px; color: var(--fg-muted); align-self: center;
}
.home-lead { color: var(--fg-muted); font-size: 16px; max-width: 70ch; margin: 6px 0 22px; line-height: 1.6; }
.home-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); padding: 14px 18px; }
.stat .num { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--fg); }
.stat .lbl { font-size: 12px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ecard {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised);
  padding: 16px; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.ecard:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.ecard:active { transform: translateY(0.5px); }
.ecard .ec-head { display: flex; align-items: center; gap: 8px; }
.ecard .ec-icon { color: var(--primary); flex: none; }
.ecard .ec-name { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--fg); }
.ecard .ec-desc { color: var(--fg-muted); font-size: 13px; line-height: 1.5; }
.ecard .ec-count { margin-top: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.home-section-label { margin: 30px 0 12px; }
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-section-head .home-section-label { margin-bottom: 12px; }
.home-section-more {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--fg-muted);
  text-decoration: none; white-space: nowrap;
}
.home-section-more:hover { color: var(--link); text-decoration: none; }
.home-section-more svg { width: 13px; height: 13px; }
.ecard-doc .ec-name { font-family: var(--font-sans); }

/* ---- Empty / not-found states ---- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px; gap: 12px; color: var(--fg-muted);
}
.empty .empty-icon { color: var(--fg-faint); }
.empty :is(h1, h2) { margin: 0; font-size: 20px; color: var(--fg); }
.empty p { margin: 0; max-width: 52ch; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 56px; bottom: 0; left: 0; width: 280px; z-index: 20;
    transform: translateX(-100%); transition: transform var(--dur-slow) var(--ease);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .sidebar-toggle { display: inline-flex; }
  .search-trigger { width: auto; }
  .search-trigger .label-text, .search-trigger .kbd { display: none; }
  .brand .vtag { display: none; }
  .page { padding: 24px 20px 80px; }
  .home { padding: 36px 20px 80px; }
}
.scrim { display: none; }
@media (max-width: 860px) {
  .scrim.show { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,0.5); z-index: 15; }
}

/* ============================================================================
   Icon sizing by context. Blueprint's <LucideIcon> renders a raw <svg>; we size
   it via descendant rules so we don't depend on Tailwind size utilities being
   present in the purged bundle. CSS width/height overrides the svg presentation
   attributes.
   ========================================================================== */
.icon-btn svg { width: 18px; height: 18px; }
.search-trigger > svg { width: 15px; height: 15px; }
.side-search > svg { width: 14px; height: 14px; }
.tree-row .leaf-icon svg { width: 15px; height: 15px; }
.page-head .head-icon svg { width: 26px; height: 26px; }
.crumb svg { width: 13px; height: 13px; }
.ecard .ec-icon svg { width: 18px; height: 18px; }
.code-copy svg { width: 12px; height: 12px; }
.record-head .anchor svg { width: 14px; height: 14px; }
.ex-toggle .chev svg { width: 13px; height: 13px; }
.pal-row svg { width: 14px; height: 14px; }
.empty .empty-icon svg { width: 40px; height: 40px; }
.chip svg, .badge svg, .cm svg { width: 12px; height: 12px; }

/* Keep BlazorBlueprint tooltip/hover-card trigger wrappers inline. */
.tipwrap { display: inline-flex; align-items: center; }

/* ---- Discord account (TopBar) ---- */
.avatar-btn { padding: 0; }
.avatar-btn img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.user-menu-name { display: flex; flex-direction: column; gap: 1px; }
.user-menu-name small { font-weight: 400; color: var(--fg-faint); }
.user-menu-quota { margin-top: 3px; }
.user-menu-item svg { width: 14px; height: 14px; }
.signout-form { display: contents; }
.signout-form button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left;
  border-radius: var(--radius); cursor: pointer;
}
.signout-form button:hover { background: var(--bg-hover); }
.signout-form button svg { width: 14px; height: 14px; }

/* Inline "sign in to ..." card for gated features. */
.login-prompt {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised);
  color: var(--fg); font-size: 13.5px; padding: 10px 12px; margin-bottom: 18px;
}
.login-prompt > svg { width: 15px; height: 15px; flex: none; color: var(--fg-muted); }
.login-prompt-text { flex: 1; min-width: 12ch; }

/* ============================================================================
   Signature accent: replace the hard blurple left border with a clean rounded
   inset bar that doesn't clash with the rounded corners.
   ========================================================================== */
.signature { border-left: 1px solid var(--border); position: relative; padding-left: 1.05rem; padding-right: 4.75rem; }
.signature::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 999px; background: var(--primary); opacity: 0.85;
}

/* Signature hover actions: copy + generator, rendered as one button group. */
.sig-actions {
  position: absolute; top: 0.4rem; right: 0.5rem; display: inline-flex;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.signature:hover .sig-actions, .sig-actions:focus-within { opacity: 1; }
.sig-actions .code-copy { position: relative; top: auto; right: auto; opacity: 1; border-radius: 0; padding: 0.3125rem 0.45rem; }
.sig-actions .code-copy + .code-copy { margin-left: -1px; }
.sig-actions .code-copy:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.sig-actions .code-copy:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sig-actions .code-copy:hover, .sig-actions .code-copy:focus-visible { z-index: 1; }

/* Slightly smaller code in example blocks. */
.code-block pre { font-size: 12.5px; line-height: 1.65; }

/* ============================================================================
   Collapsible syntax records (two-pass display, driven by data-syntax-display)
   ========================================================================== */
.record-head { margin-bottom: 0; }
.rec-toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.rec-toggle .rname { font-family: var(--font-mono); font-size: 15.5px; font-weight: 600; color: var(--fg); }
.rec-toggle:hover .rname { color: var(--link); }
.rec-chev { color: var(--fg-faint); display: inline-flex; transition: transform var(--dur) var(--ease); flex: none; }
.rec-chev svg { width: 14px; height: 14px; }
.rec-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.rec-meta .b-since { margin-left: auto; }
@media (max-width: 860px) { .rec-meta { flex-basis: 100%; } }
.rec-meta .b-return.unreadable .chip-return {
  color: var(--fg-faint);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.record-details { margin-top: 12px; }

/* compact: collapsed unless toggled open */
html[data-syntax-display="compact"] .record:not(.toggled) .record-details,
html[data-syntax-display="compact"] .record:not(.toggled) .rec-meta { display: none; }
html[data-syntax-display="compact"] .record:not(.toggled) { padding-top: 11px; padding-bottom: 11px; }
html[data-syntax-display="compact"] .record.toggled .rec-chev { transform: rotate(90deg); }

/* expanded: open unless toggled closed */
html[data-syntax-display="expanded"] .rec-chev { transform: rotate(90deg); }
html[data-syntax-display="expanded"] .record.toggled .record-details,
html[data-syntax-display="expanded"] .record.toggled .rec-meta { display: none; }
html[data-syntax-display="expanded"] .record.toggled .rec-chev { transform: none; }
html[data-syntax-display="expanded"] .record.toggled { padding-top: 11px; padding-bottom: 11px; }

/* always: no collapsing, no chevron */
html[data-syntax-display="always"] .rec-chev { display: none; }
html[data-syntax-display="always"] .rec-toggle { cursor: default; }

/* a deep-linked record is always shown in full, whatever the mode */
.record:target .record-details,
.record.force-open .record-details { display: block !important; }
.record:target .rec-meta,
.record.force-open .rec-meta { display: flex !important; }
.record:target .rec-chev,
.record.force-open .rec-chev { transform: rotate(90deg) !important; }

/* ---- Per-badge visibility (data-badge-* attributes) ---- */
html[data-badge-kind="off"] .b-kind,
html[data-badge-return="off"] .b-return,
html[data-badge-async="off"] .b-async,
html[data-badge-shared="off"] .b-shared,
html[data-badge-since="off"] .b-since,
html[data-badge-change="off"] .b-change,
html[data-badge-intents="off"] .b-intents { display: none !important; }

/* ---- Clickable chip (subtypes) ---- */
.chip-button { cursor: pointer; font-family: var(--font-mono); gap: 0.35em; }
.chip-button:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--fg); }

/* Popover/hover-card trigger that should look like its child chip, not a button. */
.chip-trigger { all: unset; display: inline-flex; align-items: center; cursor: pointer; }
.chip-trigger:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- JDA class link (advanced mode only) ---- */
.jda-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--fg-faint); }
.jda-link:hover { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.jda-link svg { width: 11px; height: 11px; }
html:not([data-advanced="on"]) .page-jda { display: none; }

/* ---- Entity-page filter bar ---- */
.kind-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.kind-jump-btn { cursor: pointer; }
.kind-jump-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.kind-jump-btn .kj-n { color: var(--fg-faint); margin-left: 0.15em; }
.jump-section { scroll-margin-top: 16px; }

/* ---- Page rail (sticky section list, wide screens only) ---- */
.page { position: relative; }
.page-rail { display: none; }
/* The page stays centered; the rail sits in the free gutter to its left, ending 24px before the
   text (inside the page's 40px padding). Shown only once that gutter fits it (1440px+). */
@media (min-width: 1440px) {
  .page-rail { display: block; position: absolute; top: 32px; bottom: 96px; right: calc(100% - 16px); width: 180px; margin: 0; }
}
.page-rail-inner {
  position: sticky; top: 24px; max-height: calc(100vh - 56px - 48px); overflow-y: auto;
  border-left: 1px solid var(--border); padding: 2px 0 2px 2px;
}
.page-rail-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-faint); padding: 0 12px 8px;
}
.page-rail ul { list-style: none; margin: 0; padding: 0; }
.page-rail li.sub .page-rail-link { padding-left: 24px; font-size: 12.5px; }
.page-rail-link {
  display: flex; align-items: center; gap: 7px; width: 100%; margin-left: -3px;
  padding: 4px 10px 4px 12px; border: 0; border-left: 2px solid transparent; background: none;
  color: var(--fg-muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.page-rail-link:hover { color: var(--fg); }
.page-rail-link.active { color: var(--fg); border-left-color: var(--primary); }
.page-rail-link .pr-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.page-rail-link .pr-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-rail-link .pr-n { color: var(--fg-faint); font-size: 12px; font-variant-numeric: tabular-nums; }

.filter-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-raised);
}
.filter-bar .filter-icon { color: var(--fg-faint); display: inline-flex; flex: none; }
.filter-bar .filter-icon svg { width: 15px; height: 15px; }
.filter-input { all: unset; flex: 1; min-width: 0; font-size: 13.5px; color: var(--fg); font-family: var(--font-mono); }
.filter-input::placeholder { color: var(--fg-faint); font-family: var(--font-sans); }
.filter-clear {
  display: inline-flex; background: none; border: 0; color: var(--fg-faint);
  cursor: pointer; padding: 2px; border-radius: var(--radius-sm); flex: none;
}
.filter-clear:hover { color: var(--fg); background: var(--bg-hover); }
.filter-clear svg { width: 14px; height: 14px; }
.filter-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-faint); flex: none; }

.settings-sub { color: var(--fg-faint); font-size: 12px; }

/* ============================================================================
   Event records: cancellable badge + "Event values" / "Event expressions"
   ========================================================================== */
.chip-cancellable { color: var(--warning); border-color: var(--warning-bd); background: var(--warning-bg); }

.event-section { margin-top: 14px; }
.event-section-head { margin-bottom: 8px; }
.ev-list { display: flex; flex-direction: column; gap: 6px; }
.ev-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-inset);
}
.ev-row > code.ev-name,
.ev-row > code.ev-pattern {
  font-family: var(--font-mono); font-size: var(--fs-code);
  background: none; border: 0; padding: 0;
}
.ev-name { color: var(--syn-var); }   /* event-x reads like a variable */
.ev-pattern { color: var(--fg); }
.ev-time {
  margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-micro);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-faint);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 7px;
}

/* Home: wide events call-to-action card */
.ecard-wide { margin-bottom: 8px; }

/* Kind colours: PROPERTY (new, dominant) reuses the calm sky; EXPRESSION (rare,
   non-property) gets a distinct teal so the two read apart. */
.kind-property { color: var(--sky-300); }
html:not(.dark) .kind-property { color: var(--sky-600); }
.kind-expression { color: #2dd4bf; }
html:not(.dark) .kind-expression { color: #0d9488; }

/* ---- "Returned by" section on entity pages ---- */
.returns-lead { color: var(--fg-muted); font-size: 13px; margin: 0 0 12px; }
.returns-list { display: flex; flex-direction: column; gap: 6px; }
.ret-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ret-row:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.signature-inline {
  font-family: var(--font-mono); font-size: var(--fs-code); color: var(--fg);
  background: none; border: 0; padding: 0; min-width: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ret-src { margin-left: auto; font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; }

/* ============================================================================
   Hover cards (shared property / subtypes)
   ========================================================================== */
.hovercard { padding: 10px; min-width: 220px; max-width: 300px; }
.hc-title { font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 2px; }
.hc-sub { font-size: 11.5px; color: var(--fg-faint); margin-bottom: 8px; }
.hc-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.hc-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius);
  font-size: 13px; color: var(--fg-muted); text-decoration: none;
}
.hc-item:hover { background: var(--bg-hover); color: var(--fg); }
.hc-item svg { width: 14px; height: 14px; color: var(--fg-faint); flex: none; }

/* ============================================================================
   Pattern generator dialog
   ========================================================================== */
.pgen-dialog { width: min(960px, 96vw); max-width: none; }
.pgen-patterns { display: flex; flex-direction: column; gap: 4px; }
.pgen-pattern, .pgen-single {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-inset);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pgen-single { cursor: default; }
.pgen-pattern:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.pgen-pattern.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pgen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pgen-head .settings-label { margin-bottom: 0; }
.pgen-trunc { margin-left: 8px; color: var(--fg-muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.pgen-copy {
  display: inline-flex; align-items: center; gap: 0.35em; flex: none;
  font-family: var(--font-sans); font-size: var(--fs-micro); font-weight: 500; color: var(--fg-muted);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.pgen-copy svg { width: 12px; height: 12px; }
.pgen-line:hover .pgen-copy, .pgen-line:focus-visible .pgen-copy, .pgen-line.copied .pgen-copy { opacity: 1; }
.pgen-line.copied { background: var(--success-bg, rgba(87,242,135,0.08)); }
.pgen-line.copied .pgen-copy { color: var(--success); }
.pgen-output {
  margin-top: 10px; max-height: 45vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-inset);
}
.pgen-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 5px 10px; border: 0; border-top: 1px solid var(--border); background: none; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.pgen-line:hover { background: var(--bg-hover); }
.pgen-line:first-child { border-top: 0; }

/* ============================================================================
   Settings dialog
   ========================================================================== */
.settings-dialog { width: min(440px, 92vw); }
.settings-section { margin-top: 20px; }
.settings-section:first-of-type { margin-top: 10px; }
.settings-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 10px;
}
.settings-hint { font-size: 12.5px; color: var(--fg-muted); margin-top: 8px; }
.settings-switches { display: flex; flex-direction: column; }
.settings-switch {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px; font-size: 14px; color: var(--fg); border-bottom: 1px solid var(--border);
}
.settings-switch:last-child { border-bottom: 0; }

/* ============================================================================
   Welcome dialog (first visit)
   ========================================================================== */
.welcome-dialog { width: min(480px, 92vw); }
.welcome-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.welcome-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--fg-muted); line-height: 1.5; }
.welcome-list li > svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--primary); }
.welcome-list strong { color: var(--fg); }
.welcome-list a { color: var(--link); }
.welcome-check {
  display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 13.5px; color: var(--fg-muted); cursor: pointer;
}
.welcome-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }

/* ============================================================================
   Subtype hierarchy dialog
   ========================================================================== */
.hierarchy-dialog { width: min(560px, 94vw); }
.hierarchy { margin-top: 14px; max-height: 60vh; overflow-y: auto; padding-right: 6px; }
.hx-children { margin-left: 13px; padding-left: 12px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.hx-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  padding: 6px 8px; margin: 1px 0; cursor: pointer; color: var(--fg-muted);
  font-family: var(--font-sans); font-size: 13.5px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.hx-row:hover { background: var(--bg-hover); color: var(--fg); }
.hx-current { color: var(--link); font-weight: 600; border-color: var(--border); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.hx-icon { display: inline-flex; color: var(--fg-faint); flex: none; }
.hx-icon svg { width: 15px; height: 15px; }
.hx-name { font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); flex: none; }

/* ============================================================================
   Documentation: hand-written markdown pages (/docs). Rendered as components
   by Components/Docs/*; these styles only use the existing design tokens.
   ========================================================================== */

/* ---- Doc identity (badge hue, tags, title) ---- */
.kind-doc { color: var(--blurple-300); }
html:not(.dark) .kind-doc { color: var(--blurple-600); }
.page-head .doc-title { font-family: var(--font-sans); }
.chip-tag { color: var(--fg-muted); font-family: var(--font-sans); }

/* ---- Prose ---- */
.prose { font-size: var(--fs-body); line-height: var(--lh-body); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 14px; color: var(--fg-muted); }
.prose h2 { font-size: 20px; margin: 32px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border); scroll-margin-top: 16px; }
.prose h3 { margin: 26px 0 10px; scroll-margin-top: 16px; }
.prose h4 { font-size: 15px; margin: 20px 0 8px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; color: var(--fg-muted); }
.prose li { margin: 4px 0; }
.prose li > p { margin-bottom: 6px; }
.prose input.task-box { margin-right: 7px; accent-color: var(--primary); }
.prose li:has(> .task-box) { list-style: none; margin-left: -18px; }
.prose blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 3px solid var(--border-strong); color: var(--fg-muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.prose img { max-width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.prose dt { font-weight: 600; color: var(--fg); margin-top: 10px; }
.prose dd { margin: 4px 0 10px 18px; color: var(--fg-muted); }
.prose .code-block { margin: 0 0 14px; }
.prose mark { background: rgba(252, 211, 77, 0.28); color: inherit; border-radius: 2px; padding: 0 2px; }

/* Inline code copies itself on click (atlas.js). Inside a link the click
   navigates instead, so the affordance is dropped there. */
.prose code.copyable {
  cursor: pointer; position: relative;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.prose code.copyable:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.prose a code.copyable { cursor: inherit; }
.prose a code.copyable:hover { border-color: var(--border); background: var(--bg-inset); }
.prose code.copyable.code-copied { border-color: var(--success-bd); }
.prose code.copyable.code-copied::after {
  content: "Copied";
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-family: var(--font-sans); font-size: var(--fs-micro); font-weight: 600;
  color: var(--success); background: var(--success-bg);
  border: 1px solid var(--success-bd); border-radius: var(--radius-sm);
  padding: 1px 6px; pointer-events: none;
}

/* Heading hover copy-link (same affordance as syntax records) */
.doc-h .anchor {
  opacity: 0; margin-left: 8px; color: var(--fg-faint); display: inline-flex;
  vertical-align: middle; transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.doc-h:hover .anchor { opacity: 1; }
.doc-h .anchor:hover { color: var(--primary); }
.doc-h .anchor svg { width: 14px; height: 14px; }

/* ---- Tables ---- */
.doc-table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { text-align: left; font-weight: 600; color: var(--fg); background: var(--bg-inset); }
.doc-table th, .doc-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td { color: var(--fg-muted); }
.doc-table p { margin: 0; }

/* ---- Admonitions (!!! kind "Title" / ??? collapsed / ???+ open) ---- */
.admonition {
  --adm-fg: var(--fg-muted); --adm-bg: var(--bg-inset); --adm-bd: var(--border-strong);
  border: 1px solid var(--adm-bd); border-left: 3px solid var(--adm-fg);
  border-radius: var(--radius-lg); background: var(--bg-raised);
  margin: 0 0 16px; overflow: hidden;
}
.adm-title {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-weight: 600; font-size: 13.5px; color: var(--adm-fg); background: var(--adm-bg);
}
.adm-icon { display: inline-flex; flex: none; }
.adm-icon svg { width: 15px; height: 15px; }
.adm-body { padding: 12px 14px; }
.adm-body > :last-child { margin-bottom: 0; }
details.admonition > summary { cursor: pointer; list-style: none; user-select: none; }
details.admonition > summary::-webkit-details-marker { display: none; }
.adm-chev { margin-left: auto; display: inline-flex; color: var(--fg-faint); transition: transform var(--dur) var(--ease); }
details[open] > summary .adm-chev { transform: rotate(180deg); }
.adm-chev svg { width: 15px; height: 15px; }

/* Semantic kinds ride the theme-aware --success/--info/--warning/--danger
   aliases (mapped onto Blueprint's --alert-* tokens), so no per-theme
   duplication; note/example use brand hues with no alert equivalent. */
.adm-note { --adm-fg: var(--blurple-300); --adm-bg: rgba(88, 101, 242, 0.08); --adm-bd: rgba(88, 101, 242, 0.28); }
.adm-tip, .adm-hint,
.adm-success, .adm-check, .adm-done { --adm-fg: var(--success); --adm-bg: var(--success-bg); --adm-bd: var(--success-bd); }
.adm-info, .adm-abstract, .adm-summary,
.adm-question, .adm-faq, .adm-help { --adm-fg: var(--info); --adm-bg: var(--info-bg); --adm-bd: var(--info-bd); }
.adm-warning, .adm-caution, .adm-attention { --adm-fg: var(--warning); --adm-bg: var(--warning-bg); --adm-bd: var(--warning-bd); }
.adm-danger, .adm-error, .adm-failure, .adm-bug { --adm-fg: var(--danger); --adm-bg: var(--destructive-bg); --adm-bd: var(--destructive-bd); }
.adm-example { --adm-fg: #c4b5fd; --adm-bg: rgba(124, 58, 237, 0.10); --adm-bd: rgba(124, 58, 237, 0.30); }
html:not(.dark) .adm-note { --adm-fg: var(--blurple-600); }
html:not(.dark) .adm-example { --adm-fg: #7c3aed; }

/* ---- Content tabs (=== "Title") ---- */
/* Rendered by Blueprint tabs (DocTabs.razor); the height/radius/shadow resets
   neutralize BB's own trigger chrome, the active state keys off data-state. */
.doc-tabs { margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); overflow: hidden; }
.doc-tabs-list { display: flex; gap: 2px; border-bottom: 1px solid var(--border); background: var(--bg-inset); padding: 6px 8px 0; overflow-x: auto; height: auto; border-radius: 0; }
.doc-tab {
  border: 0; border-radius: 0; box-shadow: none; background: none; color: var(--fg-muted); cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.doc-tab:hover { color: var(--fg); }
.doc-tab[data-state="active"] { color: var(--link); border-bottom-color: var(--primary); font-weight: 600; background: none; box-shadow: none; }
.doc-tabs-panel { padding: 14px; }
.doc-tabs-panel > :last-child { margin-bottom: 0; }

/* ---- Numbered steps (::: steps) ---- */
.doc-steps { display: flex; flex-direction: column; margin: 0 0 16px; }
.doc-step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.doc-step:last-child { padding-bottom: 0; }
.doc-step::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--border); }
.doc-step:last-child::before { display: none; }
.doc-step-num {
  flex: none; width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: color-mix(in srgb, var(--primary) 15%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  color: var(--link); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; z-index: 1;
}
.doc-step-body { flex: 1; min-width: 0; padding-top: 3px; }
.doc-step-body > :last-child { margin-bottom: 0; }

/* ---- Page toggles + conditional blocks (toggle: / ::: when) ---- */
.doc-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 14px 0;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-raised); font-size: 13px; color: var(--fg);
}
.doc-toggle-label { user-select: none; }

/* ---- Degraded boxes (unknown component / broken ref) ---- */
.doc-unknown {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px dashed var(--warning-bd); background: var(--warning-bg); color: var(--warning);
  border-radius: var(--radius); font-size: 13px;
}
.doc-unknown svg { width: 15px; height: 15px; flex: none; }
.doc-unknown code { color: inherit; }
.doc-broken-link { color: var(--warning); border-bottom: 1px dashed var(--warning); cursor: help; }

/* ---- Syntax / entity / doc reference cards (syntax: guild#ban) ---- */
.sref {
  display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; padding: 12px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg); background: var(--bg-raised); text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
a.sref:hover { background: var(--bg-hover); border-color: var(--border-strong); border-left-color: var(--primary); text-decoration: none; }
.sref-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sref-name { font-family: var(--font-mono); font-weight: 600; font-size: 14.5px; color: var(--fg); }
.sref-src { margin-left: auto; font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; }
.sref-pattern { min-width: 0; overflow-x: auto; }
.sref-desc {
  color: var(--fg-muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sref-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.sref-icon { display: inline-flex; color: var(--primary); flex: none; }
.sref-icon svg { width: 17px; height: 17px; }
.sref-missing {
  flex-direction: row; align-items: center; gap: 10px; font-size: 13px;
  color: var(--warning); background: var(--warning-bg);
  border-color: var(--warning-bd); border-left-color: var(--warning);
}
.sref-missing-icon { display: inline-flex; flex: none; }
.sref-missing-icon svg { width: 16px; height: 16px; }
.sref-missing code { color: inherit; }

/* Card detail level: the Documentation settings tab sets data-doc-card on <html>;
   a per-card `syntax: … compact|standard|full` flag (data-detail) wins over it. */
html[data-doc-card="compact"] .sref:not([data-detail]) .sref-pattern,
html[data-doc-card="compact"] .sref:not([data-detail]) .sref-desc,
html[data-doc-card="compact"] .sref:not([data-detail]) .sref-meta,
html[data-doc-card="standard"] .sref:not([data-detail]) .sref-meta { display: none; }
.sref[data-detail="compact"] .sref-pattern,
.sref[data-detail="compact"] .sref-desc,
.sref[data-detail="compact"] .sref-meta,
.sref[data-detail="standard"] .sref-meta { display: none; }

/* Inline atlas links ([text](syntax:…)); hover shows the element's reference card. */
.prose a.doc-ref-link { color: var(--link); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.prose a.doc-ref-link:hover { text-decoration-style: solid; }
.doc-hover { width: min(440px, calc(100vw - 24px)); animation: doc-hover-in 120ms var(--ease) both; }
.doc-hover .sref { margin: 0; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.25)); cursor: pointer; }
.doc-hover .sref-desc { -webkit-line-clamp: 3; }
@keyframes doc-hover-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---- On-page ToC ---- */
.doc-toc { margin-bottom: 18px; }
html[data-doc-toc="off"] .doc-toc { display: none; }

/* ---- Related syntaxes ---- */
.doc-related { margin-top: 10px; }

/* ---- Prev / next footer nav ---- */
.doc-pn { display: flex; gap: 12px; margin-top: 36px; }
.doc-pn-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised);
  text-decoration: none; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.doc-pn-link:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; }
.doc-pn-next { justify-content: flex-end; text-align: right; margin-left: auto; }
.doc-pn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-pn-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-faint); }
.doc-pn-title { font-size: 13.5px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-pn-link svg { width: 16px; height: 16px; color: var(--fg-faint); flex: none; }
@media (max-width: 860px) { .doc-pn { flex-direction: column; } }

/* ---- Dev-only lint banner (/docs) ---- */
.doc-lint {
  margin: 0 0 20px; padding: 12px 16px; font-size: 13px; color: var(--fg-muted);
  border: 1px solid var(--warning-bd); background: var(--warning-bg); border-radius: var(--radius-lg);
}
.doc-lint-head { display: flex; align-items: center; gap: 8px; color: var(--warning); font-weight: 600; margin-bottom: 6px; }
.doc-lint-head svg { width: 15px; height: 15px; }
.doc-lint ul { margin: 0; padding-left: 20px; }
.doc-lint li { margin: 2px 0; }

/* ---- Atlas-side backlinks: guide strip + "mentioned in" chips on records ---- */
.doc-guide {
  display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-radius: var(--radius); font-size: 13px; color: var(--fg-muted); text-decoration: none;
  transition: background var(--dur) var(--ease);
}
a.doc-guide:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); text-decoration: none; }
.doc-guide svg { width: 15px; height: 15px; color: var(--link); flex: none; }
.doc-guide .dg-title { color: var(--link); font-weight: 600; }
.chip-doc { color: var(--blurple-300); font-family: var(--font-sans); text-decoration: none; }
.chip-doc:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; }
html:not(.dark) .chip-doc { color: var(--blurple-600); }

/* "Documentation" rows on entity pages (Documented in) */
.ret-doc-icon { display: inline-flex; color: var(--link); flex: none; }
.ret-doc-icon svg { width: 15px; height: 15px; }
.ret-doc-title { font-size: 13.5px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.ret-doc-desc { font-size: 12.5px; color: var(--fg-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }

/* Settings dialog tabs: the Blueprint tablist is inline-flex; centre it in the dialog. */
.settings-tabs { margin-top: 12px; }
.settings-tabs-list { display: flex; width: fit-content; margin: 0 auto; }
.settings-tabs .settings-section:first-of-type { margin-top: 16px; }

/* Blueprint's CSS reset strips list markers; restore them inside prose. */
.prose ul { list-style: disc; }
.prose ul ul { list-style: circle; }
.prose ol { list-style: decimal; }

/* Markdown links (site.css resets `a` to inherit; classless prose links get the link color). */
.prose a:not([class]) { color: var(--link); }
.prose a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }

/* Markdown buttons (`{ .md-button }`): several in one paragraph need breathing room, and
   they must stay aligned with surrounding text when they wrap. */
.prose .btn { margin: 0 8px 6px 0; vertical-align: middle; }
.prose .btn:last-child { margin-right: 0; }

/* ---- Invisible UX: keyboard & assistive-tech plumbing -------------------- */

/* Skip link: first tab stop, visually hidden until keyboard-focused. */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--fg);
  border: 1px solid var(--border-strong);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* The skip link and FocusOnNavigate target the main region programmatically;
   no visible ring on a non-interactive container. */
#main-content:focus { outline: none; }

/* Screen-reader-only utility (aria-live announcers, hidden labels). */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Respect the OS "reduce motion" preference: collapse decorative animations
   and transitions. JS-driven smooth scrolling checks the same media query in
   atlas.js. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================================
   Cross-entity kind pages (/effects): a toolbar pairing the filter with a sort
   segmented control, sources as section heads, and an owner chip on the flat
   sorts (where the section head no longer names the entity).
   ========================================================================== */
.list-toolbar { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.list-toolbar .filter-bar { flex: 1 1 300px; margin: 0; }

/* Height comes from the filter bar it sits beside (.list-toolbar stretches its
   items), so the two boxes match whatever the filter bar's padding is. */
.sort-seg {
  display: inline-flex; align-items: stretch; gap: 2px; flex: none;
  padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-raised);
}
.sort-seg .sort-label {
  display: inline-flex; align-items: center;
  font-size: 11px; color: var(--fg-faint); font-family: var(--font-mono);
  padding: 0 6px 0 4px;
}
.sort-opt {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--fg-muted);
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 0 9px; cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.sort-opt svg { width: 13px; height: 13px; }
.sort-opt:hover { color: var(--fg); background: var(--bg-hover); }
.sort-opt.active { color: var(--link); background: color-mix(in srgb, var(--primary) 12%, transparent); font-weight: 500; }
.sort-opt:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

/* Section head extras: an entity icon and a title that links to that entity's page. */
.section-head .sh-icon { color: var(--fg-faint); display: inline-flex; align-self: center; flex: none; }
.section-head .sh-icon svg { width: 16px; height: 16px; }
.section-head .sh-link { color: inherit; text-decoration: none; }
.section-head .sh-link:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* Owner chip in a record head (aggregate pages only). */
.record-head .chip-owner {
  color: var(--fg-muted); font-size: var(--fs-micro); text-decoration: none; flex: none;
}
.record-head .chip-owner svg { width: 11px; height: 11px; color: var(--fg-faint); }
.record-head .chip-owner:hover { color: var(--fg); border-color: var(--border-strong); background: var(--bg-hover); }

@media (max-width: 700px) {
  .sort-seg { width: 100%; justify-content: space-between; }
}

/* ============================================================================
   Ask AI (/ask): the glowing sidebar entry and the ask page — question box,
   live tool timeline, rendered answer. The glow animation is neutralized by
   the prefers-reduced-motion block above.
   ========================================================================== */
.side-ask {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 8%, var(--bg-raised));
  color: var(--link); font-size: 13px; font-family: var(--font-sans);
  text-decoration: none;
  box-shadow: 0 0 12px 1px color-mix(in srgb, var(--primary) 25%, transparent);
  animation: ask-glow 3s var(--ease) infinite alternate;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
@keyframes ask-glow {
  from { box-shadow: 0 0 8px 0 color-mix(in srgb, var(--primary) 20%, transparent); }
  to   { box-shadow: 0 0 18px 3px color-mix(in srgb, var(--primary) 40%, transparent); }
}
.side-ask:hover, .side-ask.active {
  border-color: color-mix(in srgb, var(--primary) 70%, transparent);
  background: color-mix(in srgb, var(--primary) 14%, var(--bg-raised));
}
.side-ask > svg { width: 14px; height: 14px; }

/* Question box. */
.ask-form {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-raised); padding: 10px 12px; margin-bottom: 18px;
}
.ask-form:focus-within { border-color: var(--ring); }
.ask-input {
  width: 100%; border: 0; background: none; resize: vertical;
  color: var(--fg); font-family: var(--font-sans); font-size: 14px; line-height: 1.5;
  min-height: 60px; outline: none;
}
.ask-input::placeholder { color: var(--fg-faint); }
.ask-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.ask-btn-idle, .ask-btn-busy { display: inline-flex; align-items: center; gap: 6px; }
.ask-btn-idle svg { width: 14px; height: 14px; }

/* Alerts (disabled / quota / error states). */
.ask-alert {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid color-mix(in srgb, var(--amber-500, #f59e0b) 40%, transparent);
  border-radius: var(--radius); background: color-mix(in srgb, var(--amber-500, #f59e0b) 8%, var(--bg-raised));
  color: var(--fg); font-size: 13.5px; padding: 10px 12px; margin-bottom: 18px;
}
.ask-alert svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--amber-500, #f59e0b); }

/* Example questions shown on the empty page. */
.ask-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ask-suggestion {
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-raised); color: var(--fg-muted);
  font-family: var(--font-sans); font-size: 12.5px; padding: 6px 12px; cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ask-suggestion:hover { color: var(--link); border-color: color-mix(in srgb, var(--primary) 50%, transparent); }

/* Live tool timeline: one row per lookup, spinner on the running step. */
.ask-steps {
  border: 1px solid var(--border); border-left: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: var(--radius); background: var(--bg-raised);
  padding: 8px 12px; margin-bottom: 18px;
}
.ask-steps ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ask-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-muted); }
.ask-step.running { color: var(--fg); }
.ask-step.done { color: var(--fg-faint); }
.ask-step-icon { display: inline-flex; width: 15px; justify-content: center; flex: none; }
.ask-step-icon svg { width: 13px; height: 13px; }
.ask-step.done .ask-step-icon svg { color: var(--emerald-500, #10b981); }
.ask-step-label { font-family: var(--font-sans); }
.ask-steps-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; color: var(--fg-faint); cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; padding: 2px 0;
}
.ask-steps-toggle:hover { color: var(--fg); }
.ask-steps-toggle svg { width: 13px; height: 13px; }
.ask-steps.done { padding: 6px 12px; }

.ask-spinner {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-top-color: var(--primary);
  animation: ask-spin 0.7s linear infinite;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }

/* Answer + footer. */
.ask-answer { margin-bottom: 10px; }
.ask-foot { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-faint); margin-bottom: 40px; }

/* Quota line under the question box: remaining daily questions + reset countdown. */
.ask-quota {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-faint);
  margin: -8px 0 18px 2px;
}
.ask-quota svg { width: 12px; height: 12px; flex: none; }

/* Shared "Recent answers": the last distinct questions anyone asked, expandable. */
.ask-recent { margin-top: 28px; }
.ask-recent-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 8px;
}
.ask-recent-head svg { width: 13px; height: 13px; }
.ask-recent-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); margin-bottom: 6px; overflow: hidden;
}
.ask-recent-item.open { border-color: var(--border-strong); }
.ask-recent-q {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer;
  color: var(--fg-muted); font-family: var(--font-sans); font-size: 13px;
  padding: 9px 11px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.ask-recent-q:hover { color: var(--fg); background: var(--bg-hover); }
.ask-recent-q svg { width: 13px; height: 13px; flex: none; color: var(--fg-faint); }
.ask-recent-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-recent-meta { flex: none; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); }
.ask-recent-a { padding: 4px 14px 10px; border-top: 1px solid var(--border); }
.ask-recent-a .ask-foot { margin-bottom: 2px; }
.ask-recent-head .ask-recent-all { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ask-recent-score { flex: none; font-family: var(--font-mono); font-size: 10.5px; padding: 0 5px; border-radius: 999px; }
.ask-recent-score.pos { color: var(--emerald-500, #10b981); background: color-mix(in srgb, var(--emerald-500, #10b981) 12%, transparent); }
.ask-recent-score.neg { color: var(--red-500, #ef4444); background: color-mix(in srgb, var(--red-500, #ef4444) 12%, transparent); }
.ask-all { margin-top: 8px; }

/* Answer footer: stats on the left, vote pair on the right. */
.ask-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.ask-foot-row .ask-foot { margin-bottom: 0; }
.ask-recent-a .ask-foot-row { margin-bottom: 2px; }
.vote-bar { display: inline-flex; align-items: center; gap: 4px; }
.vote-label { font-size: 12px; color: var(--fg-muted); margin-right: 6px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 999px; background: none; cursor: pointer;
  color: var(--fg-faint); font-family: var(--font-mono); font-size: 11px; padding: 3px 9px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.vote-btn svg { width: 12px; height: 12px; }
.vote-btn:not(:disabled):hover { color: var(--fg); border-color: var(--border-strong); background: var(--bg-hover); }
.vote-btn.up.on { color: var(--emerald-500, #10b981); border-color: color-mix(in srgb, var(--emerald-500, #10b981) 50%, transparent); background: color-mix(in srgb, var(--emerald-500, #10b981) 10%, transparent); }
.vote-btn.down.on { color: var(--red-500, #ef4444); border-color: color-mix(in srgb, var(--red-500, #ef4444) 50%, transparent); background: color-mix(in srgb, var(--red-500, #ef4444) 10%, transparent); }
.vote-btn:disabled { cursor: not-allowed; opacity: 0.55; }

/* Report flag + dialog (doc pages and syntax cards). */
.report-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; padding: 2px; cursor: pointer; color: var(--fg-faint);
  transition: color var(--dur) var(--ease);
}
.report-btn svg { width: 13px; height: 13px; }
.report-btn:hover { color: var(--red-500, #ef4444); }
.record-head .report-btn { opacity: 0; transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease); }
.record:hover .record-head .report-btn { opacity: 1; }
.record-foot.b-votes { justify-content: flex-end; }
.record-foot.b-votes .vote-label { font-size: 11px; color: var(--fg-faint); font-family: var(--font-mono); }
.report-dialog { width: min(440px, 92vw); }
.report-target { font-family: var(--font-mono); color: var(--fg); }
.report-form { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 18px; }
.report-field { display: flex; flex-direction: column; gap: 6px; }
.report-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fg-faint); }
.report-select, .report-details {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-raised); color: var(--fg); font-family: var(--font-sans); font-size: 13.5px;
  padding: 7px 10px; outline: none;
}
.report-select:focus, .report-details:focus { border-color: var(--ring); }
.report-details { resize: vertical; min-height: 80px; line-height: 1.5; }
.report-details::placeholder { color: var(--fg-faint); }
.report-field .ask-count { align-self: flex-end; }
.report-state { font-size: 13.5px; color: var(--fg-muted); margin: 14px 0 18px; }
.report-state.ok { color: var(--emerald-500, #10b981); }
.report-state.warn { color: var(--amber-500, #f59e0b); }

/* End-of-doc feedback strip. */
.page-feedback {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised);
  padding: 10px 14px; margin-top: 28px;
}
.page-feedback .vote-label { font-size: 13px; color: var(--fg); }

/* Post-answer code check: analyser verdict, expandable to its findings. */
.ask-lint {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised);
  margin: 4px 0 12px; overflow: hidden; --lint: var(--emerald-500, #10b981);
}
.ask-lint.warn { --lint: var(--amber-500, #f59e0b); }
.ask-lint.bad { --lint: var(--red-500, #ef4444); }
.ask-lint { border-color: color-mix(in srgb, var(--lint) 35%, transparent); background: color-mix(in srgb, var(--lint) 6%, var(--bg-raised)); }
.ask-lint-head {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; padding: 8px 11px;
  color: var(--fg-muted); font-family: var(--font-sans); font-size: 13px;
}
.ask-lint-head:disabled { cursor: default; }
.ask-lint-head svg { width: 14px; height: 14px; flex: none; color: var(--lint); }
.ask-lint-head svg:last-child:not(:first-child) { color: var(--fg-faint); width: 13px; height: 13px; }
.ask-lint-text { flex: 1; }
.ask-lint-list { list-style: none; margin: 0; padding: 2px 11px 9px 33px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ask-lint-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; color: var(--fg); }
.ask-lint-where { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); flex: none; }
.ask-lint-list li.warning .ask-lint-where { color: var(--amber-500, #f59e0b); }
.ask-lint-list li.error .ask-lint-where { color: var(--red-500, #ef4444); }
.ask-lint-msg { flex: 1 1 300px; min-width: 0; }
.ask-lint-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); }

/* Beta notice: dismissed once per browser (cookie, so prerender already knows). */
.ask-beta {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 7%, var(--bg-raised));
  color: var(--fg-muted); font-size: 13px; line-height: 1.5; padding: 10px 12px; margin: 10px 0 18px;
}
.ask-beta > svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--primary); }
.ask-beta strong { color: var(--fg); }
.ask-beta-close {
  flex: none; display: inline-flex; border: 0; background: none; cursor: pointer;
  color: var(--fg-faint); padding: 2px; margin: -2px -4px 0 0; border-radius: var(--radius);
}
.ask-beta-close:hover { color: var(--fg); background: var(--bg-hover); }
.ask-beta-close svg { width: 14px; height: 14px; }

/* ============================================================================
   Admin (/admin): stats strip + report queue
   ============================================================================ */
.admin-stats { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-bottom: 22px; }
.admin-stats .stat { min-width: 120px; }
.admin-downvoted { flex: 1 1 280px; min-width: 0; }
.admin-downvoted .lbl { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.admin-downvoted .lbl svg { width: 12px; height: 12px; }
.admin-downvoted ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-downvoted li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.admin-downvoted li a { color: var(--fg-muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-downvoted li a:hover { color: var(--link); }
.admin-downvoted-empty { font-size: 13px; color: var(--fg-faint); }

.admin-tabs { margin-bottom: 14px; }
.admin-tabs .sort-opt { padding: 5px 10px; text-transform: capitalize; }
.admin-tab-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); }
.sort-opt.active .admin-tab-count { color: inherit; }

.admin-reports { display: flex; flex-direction: column; gap: 6px; }
.admin-report {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); padding: 9px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.admin-report.open { border-color: var(--border-strong); }
.admin-report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.admin-report-target {
  display: inline-flex; align-items: center; gap: 4px; color: var(--fg); font-weight: 500;
  text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-report-target:hover { color: var(--link); }
.admin-report-target svg { width: 12px; height: 12px; color: var(--fg-faint); flex: none; }
.admin-report-reason {
  font-size: 12px; color: var(--fg-muted); padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-inset);
}
.admin-report-meta { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); white-space: nowrap; }
.admin-report-details { margin: 0; font-size: 13.5px; color: var(--fg-muted); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-more {
  border: 0; background: none; cursor: pointer; padding: 0 4px; margin-left: 4px;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--link);
}
.admin-more:hover { text-decoration: underline; }
.admin-report-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-report-actions svg { width: 13px; height: 13px; margin-right: 4px; }
.admin-report-resolve { display: flex; flex-direction: column; gap: 6px; }
.admin-report-resolve .report-details { min-height: 52px; }
.admin-report-outcome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-faint); }
.admin-report-outcome > svg { width: 13px; height: 13px; flex: none; }
.admin-report-note { color: var(--fg-muted); font-style: italic; overflow-wrap: anywhere; }

/* Admin: wide pages, section nav, panels, tables, charts.
   Type colours are the validated categorical slots 1-3 (generation / reused / translated)
   plus the critical status red for failures; dark steps by default, light under html:not(.dark). */
.page.page-wide { max-width: 1240px; }
.admin-nav { margin: 0 0 18px; flex-wrap: wrap; }
.admin-nav .sort-opt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; text-decoration: none; }
.admin-muted { color: var(--fg-faint); font-size: 12.5px; }
.admin-section { margin-top: 26px; }
.admin-section a { font-size: 12px; font-weight: 400; margin-left: 8px; }
.admin .pos { color: var(--success); }
.admin .neg { color: var(--danger); }
.admin .mono { font-family: var(--font-mono); }
.admin .nowrap { white-space: nowrap; }

.admin-panel {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised);
  padding: 14px 16px; min-width: 0;
}
.admin-panel h3 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; font-weight: 600;
}
.admin-panel h3 svg { width: 13px; height: 13px; color: var(--fg-faint); }
.admin-panel h3 a { margin-left: auto; font-size: 12px; font-weight: 400; }
.admin-status { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.admin-status-row { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-muted);
}
.admin-pill svg { width: 12px; height: 12px; }
.admin-pill.ok { border-color: var(--success-bd); background: var(--success-bg); color: var(--success); }
.admin-pill.bad { border-color: var(--destructive-bd); background: var(--destructive-bg); color: var(--danger); }
.admin-pill.off { color: var(--fg-faint); }

.admin-budget-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-muted); margin-bottom: 6px; }
.admin-meter { height: 8px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.admin-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--admin-gen); }
.admin-meter.warn > span { background: var(--warning); }
.admin-meter.bad > span { background: var(--danger); }

.admin-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; margin: 0; }
.admin-facts > div { min-width: 0; }
.admin-facts dt { font-size: 11px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-facts dd { margin: 2px 0 0; font-size: 12.5px; color: var(--fg); overflow-wrap: anywhere; }
.admin-facts-wide { margin-bottom: 18px; }
.admin-roles { font-size: 11px; color: var(--fg-muted); }

.admin-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.admin-kpi { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); padding: 12px 14px; min-width: 0; }
.admin-kpi .lbl { font-size: 11px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-kpi .num { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--fg); text-decoration: none; margin: 2px 0; }
.admin-kpi a.num:hover { color: var(--link); }
.admin-kpi .sub { font-size: 12px; color: var(--fg-muted); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 18px; }
.admin-rank, .admin-hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.admin-rank li, .admin-hbars li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.admin-rank li > a, .admin-rank li > span.mono:first-child {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); text-decoration: none;
}
.admin-rank li > a:hover { color: var(--link); }
.admin-rank img { border-radius: 50%; flex: none; }
.admin-rank-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); white-space: nowrap; }
.admin-rank-val { font-family: var(--font-mono); font-size: 12px; color: var(--fg); white-space: nowrap; margin-left: auto; }
.admin-hbars li > .mono { flex: 0 0 120px; font-size: 12px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; }
.admin-hbar { flex: 1 1 auto; height: 8px; }
.admin-hbar > span { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--admin-gen); }

.admin-note {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--fg-muted); line-height: 1.5; margin: 10px 0 0;
}
.admin-note > svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--success); }

/* Type badges and colours */
:root {
  --admin-gen: #3987e5; --admin-reused: #d95926; --admin-translated: #199e70; --admin-failed: #d03b3b;
}
html:not(.dark) {
  --admin-gen: #2a78d6; --admin-reused: #eb6834; --admin-translated: #1baf7a; --admin-failed: #d03b3b;
}
.admin-type {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted);
}
.admin-type::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--admin-c); flex: none; }
.admin-type-gen { --admin-c: var(--admin-gen); color: var(--fg); }
.admin-type-reused { --admin-c: var(--admin-reused); }
.admin-type-translated { --admin-c: var(--admin-translated); }
.admin-type-failed { --admin-c: var(--admin-failed); color: var(--danger); }
.admin-split span { display: inline-flex; align-items: center; gap: 3px; }
.admin-split span::before { content: ""; width: 6px; height: 6px; border-radius: 2px; }
.admin-type-gen-fg::before { background: var(--admin-gen); }
.admin-type-reused-fg::before { background: var(--admin-reused); }
.admin-type-translated-fg::before { background: var(--admin-translated); }
.admin-type-failed-fg::before { background: var(--admin-failed); }
.admin-lint { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.admin-lint.ok { color: var(--success); }
.admin-lint.warn { color: var(--warning); }
.admin-lint.bad { color: var(--danger); }

/* Tables */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.admin-toolbar .admin-tabs { margin-bottom: 0; }
.admin-select { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-faint); }
.admin-select select {
  font: inherit; font-size: 12.5px; color: var(--fg); background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 4px 8px;
}
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-raised); text-align: left; font-weight: 500;
  font-size: 11px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--fg-muted); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 500; color: var(--fg); }
.admin-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .strong { color: var(--fg); font-weight: 600; }
.admin-table a { color: var(--fg); text-decoration: none; }
.admin-table a:hover { color: var(--link); text-decoration: underline; }
.admin-row { cursor: pointer; }
.admin-row:hover td, .admin-row.open td { background: var(--bg-hover); }
.admin-th {
  display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
.admin-th:hover, .admin-th.active { color: var(--fg); }
.admin-th svg { width: 11px; height: 11px; }
.admin-q { display: flex; align-items: center; gap: 4px; max-width: 360px; }
.admin-q svg { width: 12px; height: 12px; flex: none; color: var(--fg-faint); }
.admin-q span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.admin-user-cell { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.admin-user-cell img { border-radius: 50%; flex: none; }
.admin-row-detail > td { background: var(--bg); padding: 14px 16px 18px; cursor: default; }
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--fg-faint); }
.admin-pager svg { width: 13px; height: 13px; }
.admin-compare { max-width: 760px; }
.admin-table-wrap:has(.admin-compare) { max-width: 760px; }

/* One conversation */
.admin-chat { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.admin-chat-q { margin: 0; font-size: 14px; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-answer { border-left: 2px solid var(--border-strong); padding-left: 14px; font-size: 14px; }
.admin-tools summary { cursor: pointer; font-size: 12.5px; color: var(--fg-muted); }
.admin-tools ol { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.admin-tools code { font-size: 11.5px; color: var(--fg-muted); overflow-wrap: anywhere; }
.admin-tool-name { color: var(--fg); margin-right: 4px; }
.admin-open { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; align-self: flex-start; }
.admin-open svg { width: 12px; height: 12px; }
.admin-question-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-question-sub { font-size: 12.5px; color: var(--fg-muted); margin: 0 0 16px; }
.admin-user-name { font-family: var(--font-mono); margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); padding: 8px 12px;
}
.admin-list-main { flex: 1 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); text-decoration: none; }
.admin-list-main:hover { color: var(--link); }
.admin-list-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.admin-chip-row { margin-bottom: 10px; }
.admin-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-raised); font-size: 12.5px;
}
.admin-chip svg { width: 12px; height: 12px; }
.admin-chip a { display: inline-flex; color: var(--fg-faint); }
.admin-chip a:hover { color: var(--fg); }

/* Daily charts */
.admin-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.admin-chart { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); padding: 12px 14px 10px; min-width: 0; }
.admin-chart-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.admin-chart-title { font-size: 13px; font-weight: 600; color: var(--fg); }
.admin-chart-max { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.admin-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; padding: 0; font-size: 11.5px; color: var(--fg-muted); }
.admin-legend li { display: inline-flex; align-items: center; gap: 5px; }
.admin .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.admin-sw-gen { background: var(--admin-gen); }
.admin-sw-reused { background: var(--admin-reused); }
.admin-sw-translated { background: var(--admin-translated); }
.admin-sw-failed { background: var(--admin-failed); }
.admin-sw-cost { background: var(--admin-gen); }
.admin-bars {
  display: flex; align-items: stretch; gap: 2px; height: 130px;
  border-bottom: 1px solid var(--border-strong);
}
.admin-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; outline: none; }
.admin-col:hover, .admin-col:focus-visible { background: var(--bg-hover); }
.admin-stack { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; overflow: hidden; }
.admin-seg { width: 100%; flex: none; min-height: 2px; }
.admin-stack > .admin-seg:first-child { border-radius: 4px 4px 0 0; }
.admin-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  flex-direction: column; gap: 2px; padding: 7px 9px; min-width: 140px;
  background: var(--popover); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-md); font-size: 11.5px; white-space: nowrap; pointer-events: none;
}
.admin-tip span { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-muted); font-family: var(--font-mono); }
.admin-col:hover .admin-tip, .admin-col:focus-visible .admin-tip { display: flex; }
.admin-col:first-child .admin-tip, .admin-col:nth-child(2) .admin-tip, .admin-col:nth-child(3) .admin-tip { left: 0; transform: none; }
.admin-col:last-child .admin-tip, .admin-col:nth-last-child(2) .admin-tip, .admin-col:nth-last-child(3) .admin-tip { left: auto; right: 0; transform: none; }
.admin-axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint); margin-top: 4px; }

@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-charts { grid-template-columns: 1fr; }
  .admin-hbars li > .mono { flex-basis: 90px; }
}

.side-admin {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; margin-bottom: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-raised); color: var(--fg-muted); font-size: 13px; font-family: var(--font-sans);
  text-decoration: none;
}
.side-admin:hover, .side-admin.active { color: var(--fg); background: var(--bg-hover); }
.side-admin > svg { width: 14px; height: 14px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.profile-identity h1 { font-family: var(--font-mono); margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.profile-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-handle { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-faint); }
.profile-note { color: var(--fg-muted); font-size: 13px; margin: -8px 0 24px; }
.profile-section { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.profile-status.ok > svg { color: var(--emerald-500, #10b981); }
.profile-status.off > svg { color: var(--fg-faint); }
.profile-status.wait > svg { color: var(--amber-500, #f59e0b); }

/* Docs language: top bar menu, per-page i18n banner, index language list. */
.lang-menu-btn { width: auto; gap: 5px; padding: 0 8px; }
.lang-menu-btn > svg { width: 16px; height: 16px; flex: none; }
.lang-menu-code { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; }
.lang-menu-item { display: flex; align-items: center; gap: 8px; }
.lang-menu-check { display: inline-flex; width: 14px; flex: none; color: var(--primary); }
.lang-menu-check > svg { width: 14px; height: 14px; }
.lang-menu-name { flex: 1 1 auto; min-width: 0; }
.lang-menu-percent { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.lang-menu-ai {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; line-height: 1.5; padding: 0 6px; border-radius: 999px;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.lang-menu-outdated { font-size: 11px; color: var(--warning); }

.doc-i18n {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; margin: 0 0 18px; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--fg-faint); border-radius: var(--radius);
  background: var(--bg-inset); color: var(--fg-muted); font-size: 13px; line-height: 1.5;
}
.doc-i18n > svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.doc-i18n > div { flex: 1 1 260px; min-width: 0; }
.doc-i18n p { margin: 0; }
.doc-i18n p + p { margin-top: 4px; }
.doc-i18n-ai { border-left-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--bg-raised)); }
.doc-i18n-ai > svg { color: var(--primary); }
.doc-i18n-outdated { border-left-color: var(--warning); border-color: var(--warning-bd); background: var(--warning-bg); }
.doc-i18n-outdated > svg { color: var(--warning); }
.doc-i18n-toggle {
  margin-left: auto; flex: none; font: inherit; font-size: 12.5px; color: var(--fg); cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 3px 9px;
}
.doc-i18n-toggle:hover { background: var(--bg-hover); }

.doc-lang-list { display: flex; flex-direction: column; gap: 8px; }
.doc-lang-row {
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); color: var(--fg);
}
.doc-lang-row:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.doc-lang-row.is-current { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.doc-lang-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.doc-lang-name { font-weight: 600; font-size: 14px; }
.doc-lang-en { font-size: 12.5px; color: var(--fg-faint); }
.doc-lang-meter { display: flex; align-items: center; gap: 10px; }
.doc-lang-track { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.doc-lang-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.doc-lang-meter .lang-menu-percent { min-width: 3.2em; text-align: right; }

/* MCP: profile access section, admin kill switch, OAuth consent page. */
.profile-mcp-intro { color: var(--fg-muted); font-size: 13.5px; margin: 0 0 10px; max-width: 70ch; }
.profile-mcp-url {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 6px 6px 10px; max-width: 640px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-inset);
}
.profile-mcp-url code { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; }
.profile-mcp-url .code-copy { position: static; flex: none; }
.profile-mcp-url + .admin-stats { margin-top: 14px; }
.profile-mcp-grants { margin-bottom: 24px; }
.profile-mcp-grants li > svg { width: 14px; height: 14px; flex: none; color: var(--fg-faint); }
.admin-mcp-toggle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 22px; }
.oauth-consent { max-width: 520px; margin: 48px auto; text-align: center; }
.oauth-consent h1 { font-size: 22px; margin: 12px 0 10px; }
.oauth-consent p { color: var(--fg-muted); font-size: 14px; line-height: 1.55; }
.oauth-consent strong { color: var(--fg); }
.oauth-redirect code { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg); }
.oauth-actions { display: flex; justify-content: center; gap: 10px; margin: 20px 0 14px; }
