/* ============================================================
   Sytua design system
   Night-sky almanac: the ice-blue of the logo for text, the
   blue-black of an observatory plate for ground, and brass
   (the ring around the planet) as the one accent. Newsreader
   for reading, IBM Plex Mono for code and labels. Every surface
   (site, dashboard, admin, repository, hosting, builder) is
   built from the tokens and parts below.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root{
  color-scheme: dark;

  /* surfaces, darkest to lightest (blue-black, never neutral grey) */
  --bg:          #0d1013;
  --bg-elev:     #11151a;
  --bg-card:     #151a20;
  --bg-soft:     #1b2128;
  --bg-input:    #0f1317;
  --line:        #252c34;
  --line-strong: #343c46;

  /* text, tinted towards the logo's ice-blue */
  --text:     #e6ecf1;
  --text-dim: #aab4bd;
  --muted:    #7f8a94;
  --faint:    #535d68;

  /* brand: brass */
  --accent:       #d6ad62;
  --accent-hover: #e2bf7f;
  --accent-ink:   #1f1605;
  --accent-soft:  rgba(214,173,98,.10);
  --accent-line:  rgba(214,173,98,.38);
  --ice:          #b9d3ea;

  /* semantic, pulled into the same night palette */
  --danger: #e8806f; --danger-soft: rgba(232,128,111,.10); --danger-line: rgba(232,128,111,.38);
  --warn:   #e6a35a; --warn-soft:   rgba(230,163,90,.10);  --warn-line:   rgba(230,163,90,.36);
  --violet: #9fb8e4; --violet-soft: rgba(159,184,228,.10); --violet-line: rgba(159,184,228,.36);
  --ok:     #8fc7a0; --ok-soft:     rgba(143,199,160,.10); --ok-line:     rgba(143,199,160,.36);

  /* type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* shape: plates and rules, barely rounded */
  --r-sm:   4px;
  --r:      6px;
  --r-lg:   8px;
  --r-pill: 999px;
  --shadow-lg: 0 18px 40px -16px rgba(2,4,6,.8);
  --ease-out: cubic-bezier(.2,.7,.15,1);

  /* layout */
  --maxw:      1160px;
  --header-h:  68px;
  --sidebar-w: 252px;
}

/* ---------- 2. Base ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
html,body{ margin:0; padding:0; }
body{
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:var(--serif);
  font-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{ font-weight:400; line-height:1.15; letter-spacing:-.01em; margin:0 0 .5em; color:var(--text); }
h1{ font-size:clamp(30px,3.4vw,40px); }
h2{ font-size:26px; }
h3{ font-size:20px; }
h4{ font-size:17px; }
p{ margin:0 0 1em; }
a{ color:inherit; text-decoration:none; }
img,svg,video,canvas{ display:block; max-width:100%; }
svg.icon{ display:inline-block; flex:none; vertical-align:-.18em; }
hr{ border:0; border-top:1px solid var(--line); margin:24px 0; }
strong,b{ font-weight:700; }
small{ font-size:.85em; }
::selection{ background:var(--accent); color:var(--accent-ink); }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
[hidden]{ display:none !important; }
* { scrollbar-width:thin; scrollbar-color:#2c2d31 transparent; }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-thumb{ background:#26272b; border-radius:10px; border:2px solid var(--bg); }
::-webkit-scrollbar-track{ background:transparent; }

code,kbd,pre,samp{ font-family:var(--mono); }
code{ font-size:.84em; padding:.12em .45em; border-radius:6px; background:var(--bg-soft); border:1px solid var(--line); color:var(--text); word-break:break-word; }
kbd{ display:inline-block; font-size:11.5px; line-height:18px; padding:0 6px; border-radius:6px; border:1px solid var(--line-strong); border-bottom-width:2px; color:var(--text-dim); background:var(--bg-elev); }
pre.code{
  margin:0; padding:16px 18px; overflow:auto;
  background:var(--bg-elev); border:1px solid var(--line); border-radius:var(--r-sm);
  font-size:13px; line-height:1.65; color:var(--text-dim); white-space:pre;
}
pre.code.wrap{ white-space:pre-wrap; word-break:break-word; }

.link{ color:var(--accent); }
.link:hover{ text-decoration:underline; text-underline-offset:3px; }
.muted{ color:var(--muted); }
.dim{ color:var(--text-dim); }
.small{ font-size:14px; }
.tiny{ font-size:12.5px; }
.mono{ font-family:var(--mono); font-size:.86em; }
.nowrap{ white-space:nowrap; }
.truncate{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.text-right{ text-align:right; }
.center{ text-align:center; }
.m-0{ margin:0 !important; }
.mt-0{ margin-top:0 !important; }
.mb-0{ margin-bottom:0 !important; }
.ml-auto{ margin-left:auto !important; }
.w-full{ width:100%; }
.sr-only{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }  /* honeypot */

/* ---------- 3. Layout primitives ---------- */
.container{ width:100%; max-width:var(--maxw); margin:0 auto; padding:0 24px; }
.container-narrow{ max-width:760px; }
.container-tight{ max-width:560px; }
.stack{ display:flex; flex-direction:column; gap:var(--gap,16px); }
.stack-sm{ --gap:10px; }
.stack-lg{ --gap:28px; }
.cluster{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--gap,10px); }
.spread{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.grid-auto{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:18px; }

/* ---------- 4. Buttons ---------- */
.btn{
  --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--line-strong);
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:0 20px;
  border-radius:var(--r-sm); border:1px solid var(--btn-bd);
  background:var(--btn-bg); color:var(--btn-fg);
  font-family:var(--serif); font-size:15.5px; line-height:1; letter-spacing:0;
  cursor:pointer; white-space:nowrap; text-decoration:none; user-select:none;
  transition:background-color .18s var(--ease-out), border-color .18s var(--ease-out), color .18s, transform .1s;
}
.btn:hover{ --btn-bd:#4a5360; --btn-bg:rgba(185,211,234,.04); }
.btn:active{ transform:translateY(1px); }
.btn:disabled,.btn[aria-disabled="true"]{ opacity:.5; cursor:not-allowed; transform:none; }
.btn .icon{ width:1.05em; height:1.05em; }
.btn-primary{ --btn-bg:var(--accent); --btn-fg:var(--accent-ink); --btn-bd:var(--accent); font-weight:700; }
.btn-primary:hover{ --btn-bg:var(--accent-hover); --btn-bd:var(--accent-hover); }
.btn-ghost{ }
.btn-subtle{ --btn-bg:var(--bg-soft); --btn-bd:transparent; }
.btn-subtle:hover{ --btn-bg:#222932; --btn-bd:transparent; }
.btn-danger{ --btn-fg:var(--danger); --btn-bd:var(--danger-line); }
.btn-danger:hover{ --btn-bg:var(--danger-soft); --btn-bd:var(--danger); }
.btn-plain{ --btn-bd:transparent; padding:0 10px; color:var(--text-dim); }
.btn-plain:hover{ --btn-bd:transparent; --btn-bg:rgba(185,211,234,.06); color:var(--text); }
.btn-sm{ min-height:32px; padding:0 14px; font-size:14px; gap:6px; }
.btn-xs{ min-height:26px; padding:0 10px; font-size:13px; gap:5px; }
.btn-lg{ min-height:50px; padding:0 28px; font-size:17px; }
.btn-block{ width:100%; }
.btn-icon{ width:40px; padding:0; }
.btn-icon.btn-sm{ width:32px; }
.btn-icon.btn-xs{ width:26px; }
.btn.is-on{ --btn-fg:var(--accent); --btn-bd:var(--accent-line); --btn-bg:var(--accent-soft); }
.btn-google{ --btn-bg:#fff; --btn-fg:#1d1d1f; --btn-bd:#fff; font-weight:700; }
.btn-google:hover{ --btn-bg:#ececec; --btn-bd:#ececec; }

/* ---------- 5. Forms ---------- */
.field{ display:flex; flex-direction:column; gap:7px; margin:0 0 18px; min-width:0; }
.field > label,.label{ display:block; color:var(--text-dim); font-size:14.5px; line-height:1.35; }
.field-grow{ flex:1 1 240px; }
.hint{ font-size:13.5px; color:var(--muted); line-height:1.5; margin:0; }
input[type=text],input[type=email],input[type=password],input[type=number],input[type=search],
input[type=date],input[type=url],input[type=tel],textarea,select,.input{
  width:100%; min-height:42px; padding:9px 14px;
  background:var(--bg-input); color:var(--text);
  border:1px solid var(--line-strong); border-radius:var(--r-sm);
  font-family:var(--serif); font-size:16px; line-height:1.4;
  outline:none; transition:border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover,textarea:hover,select:hover{ border-color:#435061; }
input:focus,textarea:focus,select:focus,.input:focus{ border-color:var(--accent); box-shadow:inset 0 -1px 0 var(--accent); }
input::placeholder,textarea::placeholder{ color:var(--faint); }
input:disabled,textarea:disabled,select:disabled{ opacity:.6; cursor:not-allowed; }
textarea{ min-height:120px; resize:vertical; line-height:1.55; }
textarea.code-input{ font-family:var(--mono); font-size:13.5px; }
select{
  appearance:none; -webkit-appearance:none; padding-right:38px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8a94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; background-size:16px;
}
select option{ background:var(--bg-card); color:var(--text); }
input[type=checkbox],input[type=radio]{ accent-color:var(--accent); width:16px; height:16px; margin:0; cursor:pointer; flex:none; }
input[type=file]{ font-family:var(--serif); color:var(--text-dim); font-size:15px; max-width:100%; }
input[type=file]::file-selector-button{
  margin-right:12px; padding:8px 16px; border-radius:var(--r-sm); cursor:pointer;
  border:1px solid var(--line-strong); background:var(--bg-soft); color:var(--text); font-family:var(--serif); font-size:14px;
}
.check{ display:inline-flex; align-items:center; gap:10px; cursor:pointer; color:var(--text); font-size:15.5px; line-height:1.4; }
.check + .check{ margin-left:0; }
.checks{ display:flex; flex-direction:column; gap:12px; margin:0 0 18px; }
.form-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:16px; margin-bottom:18px; }
.form-grid .field{ margin:0; }
.form-inline{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
.form-inline .field{ margin:0; }
.form-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.input-row{ display:flex; gap:8px; align-items:center; }
.input-row > input,.input-row > select{ flex:1; min-width:0; }

/* ---------- 6. Cards ---------- */
.card{ background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); padding:24px; min-width:0; }
.card-flush{ padding:0; overflow:hidden; }
.card-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:16px 20px; border-bottom:1px solid var(--line); }
.card-head h2,.card-head h3{ font-size:18px; margin:0; display:flex; align-items:center; gap:10px; }
.card-head .icon{ color:var(--muted); }
.card-body{ padding:20px; }
.card-foot{ padding:14px 20px; border-top:1px solid var(--line); background:var(--bg-elev); }
.card-title{ font-size:20px; margin:0 0 6px; display:flex; align-items:center; gap:10px; }
.card-sub{ color:var(--muted); font-size:15px; margin:0 0 18px; }
.card-accent{ border-color:var(--accent-line); box-shadow:inset 3px 0 0 var(--accent); }
.card-danger{ border-color:var(--danger-line); }
.card-danger .card-title{ color:var(--danger); }
a.card,.card-link{ display:block; transition:border-color .15s, background-color .15s; }
a.card:hover,.card-link:hover{ border-color:var(--line-strong); background-color:#182029; }

/* ---------- 7. Badges, counts, dots ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px; height:22px; padding:0 9px;
  border-radius:3px; border:1px solid var(--line-strong); color:var(--text-dim);
  font:500 11px/1 var(--mono); letter-spacing:.03em; text-transform:lowercase;
  white-space:nowrap; vertical-align:middle;
}
.badge .icon{ width:12px; height:12px; }
.badge.ok{ color:var(--ok); border-color:var(--ok-line); background:var(--ok-soft); }
.badge.warn{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-soft); }
.badge.bad{ color:var(--danger); border-color:var(--danger-line); background:var(--danger-soft); }
.badge.violet{ color:var(--violet); border-color:var(--violet-line); background:var(--violet-soft); }
.badge.super{ color:var(--accent-ink); background:var(--accent); border-color:var(--accent); }
.badge.solid-ok{ color:#0d1a12; background:var(--ok); border-color:var(--ok); }
.badge.solid-bad{ color:#2a0c07; background:var(--danger); border-color:var(--danger); }
.badge.solid-violet{ color:#0c1526; background:var(--violet); border-color:var(--violet); }
.count{
  display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px;
  border-radius:var(--r-pill); background:var(--bg-soft); color:var(--text-dim);
  font:600 11px/1 var(--mono);
}
.count.on{ background:var(--accent); color:var(--accent-ink); }
.dot{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--faint); flex:none; vertical-align:middle; }
.dot.ok{ background:var(--ok); }
.dot.live{ background:var(--ok); animation:breathe 3.4s var(--ease-out) infinite; }
.dot.warn{ background:var(--warn); }
.dot.bad{ background:var(--danger); }
.dot.lg{ width:12px; height:12px; }
@keyframes breathe{ 0%,100%{ opacity:1; } 55%{ opacity:.45; } }
.live-hint{ display:inline-flex; align-items:center; gap:10px; color:var(--muted); font-size:14.5px; }

/* ---------- 8. Alerts & announcement bar ---------- */
.alert{
  display:flex; align-items:flex-start; gap:12px; padding:13px 16px;
  border-radius:var(--r-sm); border:1px solid var(--line-strong); background:var(--bg-soft);
  color:var(--text-dim); font-size:15.5px; line-height:1.5;
}
.alert > .icon{ width:18px; height:18px; margin-top:2px; }
.alert-body{ flex:1; min-width:0; }
.alert-success{ background:var(--ok-soft); border-color:var(--ok-line); color:#d3eadb; }
.alert-success > .icon{ color:var(--ok); }
.alert-error{ background:var(--danger-soft); border-color:var(--danger-line); color:#f6d4cd; }
.alert-error > .icon{ color:var(--danger); }
.alert-warn{ background:var(--warn-soft); border-color:var(--warn-line); color:#f3dcbf; }
.alert-warn > .icon{ color:var(--warn); }
.alert-close{ margin:-2px -6px 0 auto; padding:4px; border:0; background:none; color:inherit; opacity:.55; cursor:pointer; border-radius:6px; line-height:0; }
.alert-close:hover{ opacity:1; background:rgba(185,211,234,.07); }
.flash-stack{ display:flex; flex-direction:column; gap:10px; }
.site-flash{ padding-top:18px; }

.announce{
  position:relative; z-index:60; display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;
  padding:9px 16px; font-size:14.5px; line-height:1.4; text-align:center;
  background:var(--accent-soft);
  border-bottom:1px solid var(--accent-line); color:#efe1c4;
}
.announce .icon{ color:var(--accent); }
.announce a{ color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.announce-warn{ background:var(--warn-soft); border-bottom-color:var(--warn-line); color:#f3dcbf; }
.announce-warn .icon,.announce-warn a{ color:var(--warn); }

/* ---------- 9. Tables ---------- */
.table-wrap{ width:100%; overflow-x:auto; }
.table{ width:100%; border-collapse:collapse; font-size:15px; }
.table th{
  text-align:left; padding:11px 16px; white-space:nowrap;
  font:500 11.5px/1.2 var(--mono); letter-spacing:.02em; text-transform:none;
  color:var(--muted); border-bottom:1px solid var(--line-strong); background:transparent;
}
.table td{ padding:13px 16px; border-bottom:1px solid var(--line); vertical-align:middle; color:var(--text); }
.table tbody tr:last-child td{ border-bottom:0; }
.table tbody tr{ transition:background-color .12s; }
.table tbody tr:hover td{ background:rgba(185,211,234,.025); }
.table td.actions,.table th.actions{ text-align:right; white-space:nowrap; }
.table td.actions form{ display:inline-flex; }
.table td.actions .cluster{ justify-content:flex-end; flex-wrap:nowrap; }
.table tr.is-link{ cursor:pointer; }
.table tr.is-link:hover td:first-child{ box-shadow:inset 2px 0 0 var(--accent); }
.table td.empty-cell{ text-align:center; padding:44px 16px; color:var(--muted); }
.table td time,.table td.stamp{ font-family:var(--mono); font-size:12.5px; color:var(--muted); white-space:nowrap; }
.table .sub{ display:block; color:var(--muted); font-size:13px; margin-top:2px; }
.table input,.table select{ min-height:34px; padding:5px 12px; font-size:15px; }
.table select{ padding-right:34px; background-position:right 10px center; }
.table-tight td{ padding:9px 16px; }
.table-kv th{ width:180px; text-transform:none; letter-spacing:0; font:14px var(--serif); color:var(--muted); background:none; vertical-align:top; border-bottom:1px solid var(--line); }
.table-kv td{ white-space:pre-wrap; word-break:break-word; }

/* ---------- 10. List rows ---------- */
.rows{ display:flex; flex-direction:column; }
.row{ display:flex; align-items:center; gap:14px; padding:14px 20px; border-top:1px solid var(--line); min-width:0; color:var(--text); }
.row:first-child{ border-top:0; }
a.row{ transition:background-color .12s; }
a.row:hover{ background:rgba(185,211,234,.03); }
.row-icon{
  width:34px; height:34px; border-radius:var(--r-sm); flex:none; display:grid; place-items:center;
  background:transparent; border:1px solid var(--line); color:var(--text-dim);
}
.row-icon.ok{ color:var(--ok); border-color:var(--ok-line); }
.row-icon.bad{ color:var(--danger); border-color:var(--danger-line); }
.row-icon.violet{ color:var(--violet); border-color:var(--violet-line); }
.row-main{ flex:1; min-width:0; }
.row-title{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:16px; line-height:1.35; color:var(--text); }
a.row-title:hover,.row-title a:hover{ color:var(--accent); }
.row-meta{ color:var(--muted); font-size:13.5px; margin-top:3px; line-height:1.45; overflow-wrap:anywhere; }
.row-meta time{ font-family:var(--mono); font-size:12px; }
.row-actions{ display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; flex:none; }
.row-actions form{ display:inline-flex; }
.row.file{ padding:10px 20px; gap:12px; }
.row.file .icon{ color:var(--muted); }
.row.file.dir .icon{ color:var(--accent); }

/* ---------- 11. Tabs, sub-navigation, segmented control, chips ---------- */
.tabs{ display:flex; gap:2px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tabs a{
  display:inline-flex; align-items:center; gap:8px; padding:11px 14px; margin-bottom:-1px;
  color:var(--text-dim); font-size:15.5px; white-space:nowrap;
  border-bottom:2px solid transparent; transition:color .15s, border-color .15s;
}
.tabs a .icon{ color:var(--muted); }
.tabs a:hover{ color:var(--text); border-bottom-color:var(--line-strong); }
.tabs a.is-active{ color:var(--text); border-bottom-color:var(--accent); }
.tabs a.is-active .icon{ color:var(--accent); }

.subnav{ display:flex; flex-direction:column; gap:2px; position:sticky; top:20px; }
.subnav a{ display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:var(--r-sm); color:var(--text-dim); font-size:15.5px; transition:background-color .12s, color .12s; }
.subnav a .icon{ color:var(--muted); }
.subnav a:hover{ background:rgba(185,211,234,.04); color:var(--text); }
.subnav a.is-active{ background:transparent; color:var(--text); box-shadow:inset 2px 0 0 var(--accent); }
.subnav a.is-active .icon{ color:var(--accent); }

.segmented{ display:inline-flex; flex-wrap:wrap; gap:2px; padding:3px; background:var(--bg-elev); border:1px solid var(--line); border-radius:var(--r); }
.segmented a,.segmented button{
  display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:var(--r-sm);
  color:var(--text-dim); font-size:14.5px; border:0; background:none; cursor:pointer; font-family:var(--serif); line-height:1.3;
}
.segmented a:hover,.segmented button:hover{ color:var(--text); }
.segmented .is-active{ background:var(--bg-soft); color:var(--text); box-shadow:inset 0 0 0 1px var(--line-strong); }

.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 14px;
  border-radius:var(--r-sm); border:1px solid var(--line-strong); background:var(--bg-card);
  color:var(--text-dim); font:14px var(--serif); cursor:pointer; transition:color .15s, border-color .15s, background-color .15s;
}
.chip:hover{ color:var(--text); border-color:#4a5360; }
.chip.on{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.chip .n{ font:12px var(--mono); opacity:.7; }

/* ---------- 12. Dropdown & dialog ---------- */
.dropdown{ position:relative; }
.dropdown-menu{
  position:absolute; right:0; top:calc(100% + 8px); z-index:90; min-width:210px;
  margin:0; padding:6px; list-style:none;
  background:var(--bg-card); border:1px solid var(--line-strong); border-radius:var(--r);
  box-shadow:var(--shadow-lg); display:none;
}
.dropdown.open > .dropdown-menu{ display:block; animation:pop .16s var(--ease-out); }
.dropdown-menu.up{ top:auto; bottom:calc(100% + 8px); }
.dropdown-menu.left{ right:auto; left:0; }
.dropdown-menu a,.dropdown-menu button{
  display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; border-radius:8px;
  color:var(--text-dim); font:15px var(--serif); text-align:left; border:0; background:none; cursor:pointer;
}
.dropdown-menu a:hover,.dropdown-menu button:hover{ background:var(--bg-soft); color:var(--text); }
.dropdown-menu .is-active{ color:var(--accent); }
.dropdown-menu .is-active::after{ content:""; margin-left:auto; width:6px; height:6px; border-radius:50%; background:currentColor; }
.dropdown-sep{ height:1px; margin:6px 4px; background:var(--line); }
@keyframes pop{ from{ opacity:0; transform:translateY(-4px) scale(.98); } to{ opacity:1; transform:none; } }

dialog.dialog{
  width:min(560px,calc(100vw - 32px)); max-height:calc(100vh - 48px); padding:0; overflow:auto;
  background:var(--bg-card); color:var(--text);
  border:1px solid var(--line-strong); border-radius:var(--r-lg);
  box-shadow:0 30px 80px -24px rgba(2,4,6,.9);
}
dialog.dialog[open]{ animation:pop .22s var(--ease-out); }
dialog.dialog::backdrop{ background:rgba(6,9,12,.72); }
.dialog-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:22px 24px 4px; }
.dialog-head h2{ font-size:24px; margin:0; }
.dialog-head p{ margin:6px 0 0; color:var(--muted); font-size:15px; }
.dialog-body{ padding:18px 24px 24px; }

/* ---------- 13. Page header, empty states ---------- */
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:18px 24px; flex-wrap:wrap; }
.page-head > div:first-child{ min-width:0; flex:1 1 360px; }
.page-title{ font-size:clamp(28px,3.2vw,38px); line-height:1.1; margin:0; letter-spacing:-.015em; overflow-wrap:anywhere; }
.page-title .muted{ font-size:.6em; letter-spacing:0; }
.page-lead{ color:var(--text-dim); margin:10px 0 0; max-width:700px; font-size:16.5px; }
.page-actions{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; margin:0 0 12px;
  font:500 12px/1 var(--mono); letter-spacing:.02em; text-transform:none; color:var(--accent);
}
.eyebrow.muted{ color:var(--muted); }
.back{ display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:14.5px; margin-bottom:14px; transition:color .15s; }
.back:hover{ color:var(--text); }
.section-label{ font:500 12px/1 var(--mono); letter-spacing:.02em; color:var(--muted); margin:8px 0 -6px; }

.empty{ text-align:center; padding:48px 24px; }
.empty-icon{
  width:54px; height:54px; margin:0 auto 18px; border-radius:50%; display:grid; place-items:center;
  color:var(--ice); background:transparent; border:1px solid var(--line-strong);
}
.empty-icon .icon{ width:24px; height:24px; }
.empty h3{ font-size:21px; margin:0 0 6px; }
.empty p{ max-width:440px; margin:0 auto; color:var(--muted); font-size:15.5px; }
.empty .btn{ margin-top:20px; }
.empty-sm{ padding:28px 20px; }
.empty-sm .empty-icon{ width:42px; height:42px; margin-bottom:12px; }
.empty-sm .empty-icon .icon{ width:19px; height:19px; }

/* ---------- 14. Stats, meters, bar charts ---------- */
.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:14px; }
.stats-4{ grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr)); }
.stat{ position:relative; background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); padding:18px 20px 20px; min-width:0; overflow:hidden; }
.stat-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.stat-label{ font:500 12px/1.3 var(--mono); letter-spacing:.01em; color:var(--muted); }
.stat-top .icon{ color:var(--faint); }
.stat-value{ display:block; margin-top:14px; font-size:34px; line-height:1.05; letter-spacing:-.02em; color:var(--text); overflow-wrap:anywhere; }
a.stat-value:hover{ color:var(--accent); }
.stat-foot{ margin-top:8px; color:var(--muted); font-size:13.5px; }
.stat-accent{ border-color:var(--accent-line); }
.stat-accent .stat-value{ color:var(--accent); }

.meter{ height:5px; border-radius:1px; background:var(--bg-soft); overflow:hidden; }
.meter > span{ display:block; height:100%; border-radius:inherit; background:var(--ice); }
.meter.warn > span{ background:var(--warn); }
.meter.bad > span{ background:var(--danger); }

.chart-card{ display:flex; flex-direction:column; gap:10px; }
.chart-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.chart-head strong{ font-weight:400; font-size:26px; letter-spacing:-.01em; }
.bars{ display:flex; align-items:flex-end; gap:3px; height:96px; padding-top:6px; border-bottom:1px solid var(--line); }
.bars-tall{ height:170px; }
.bars span{ flex:1; min-width:3px; border-radius:1px 1px 0 0; background:var(--ice); opacity:.7; transition:opacity .15s, background-color .15s; }
.bars span:hover{ opacity:1; background:var(--accent); }
.bars span.zero{ background:var(--line-strong); opacity:.7; }
.chart-axis{ display:flex; justify-content:space-between; font:11px var(--mono); color:var(--faint); }

/* ---------- 15. Code view, diff, markdown ---------- */
.blob,.diff table{ width:100%; border-collapse:collapse; font:12.5px/1.75 var(--mono); }
.blob td,.diff td{ padding:0 14px; white-space:pre-wrap; word-break:break-all; border:0; vertical-align:top; color:var(--text-dim); }
.blob .no,.diff .no{ width:1%; min-width:52px; text-align:right; color:var(--faint); user-select:none; white-space:nowrap; padding-right:14px; }
.blob tr:hover td{ background:rgba(185,211,234,.025); }
.blob tr:hover .no{ color:var(--muted); }
.diff{ background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.diff-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:11px 16px; border-bottom:1px solid var(--line); background:var(--bg-elev); }
.diff-head code{ background:none; border:0; padding:0; font-size:13px; }
.diff-body{ overflow-x:auto; }
.diff tr.add td{ background:rgba(143,199,160,.09); color:#d3eadb; }
.diff tr.del td{ background:rgba(232,128,111,.09); color:#f6d4cd; }
.diff tr.gap td{ background:rgba(159,184,228,.06); color:var(--muted); }
.diff tr.add .no,.diff tr.del .no{ color:var(--muted); }
.fst{ display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 5px; border-radius:6px; border:1px solid var(--line-strong); font:600 11px/1 var(--mono); }
.fst-A{ color:var(--ok); border-color:var(--ok-line); background:var(--ok-soft); }
.fst-D{ color:var(--danger); border-color:var(--danger-line); background:var(--danger-soft); }
.fst-M{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-soft); }
.plus{ color:var(--ok); font-family:var(--mono); font-size:13px; }
.minus{ color:var(--danger); font-family:var(--mono); font-size:13px; }

.md{ padding:24px 28px; font-size:16.5px; line-height:1.72; color:var(--text); overflow-wrap:anywhere; }
.md > :first-child{ margin-top:0; }
.md > :last-child{ margin-bottom:0; }
.md h1,.md h2{ padding-bottom:.3em; border-bottom:1px solid var(--line); margin:1.4em 0 .6em; }
.md h1{ font-size:30px; } .md h2{ font-size:24px; } .md h3{ font-size:20px; margin:1.3em 0 .5em; }
.md a{ color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.md ul,.md ol{ padding-left:1.4em; }
.md li + li{ margin-top:.25em; }
.md pre{ background:var(--bg-elev); border:1px solid var(--line); border-radius:var(--r-sm); padding:14px 16px; overflow:auto; font-size:13px; line-height:1.6; }
.md pre code{ background:none; border:0; padding:0; font-size:inherit; }
.md blockquote{ margin:0 0 1em; padding:2px 1em; color:var(--text-dim); border-left:3px solid var(--accent-line); }
.md img{ border-radius:var(--r-sm); }
.md table{ border-collapse:collapse; margin:0 0 1em; }
.md th,.md td{ border:1px solid var(--line); padding:6px 12px; }
.md hr{ margin:1.5em 0; }

/* ---------- 16. Brand ---------- */
.brand{ display:inline-flex; align-items:center; gap:10px; color:var(--text); flex:none; }
.brand-mark{ width:28px; height:28px; flex:none; }
.brand-logo{ height:28px; width:auto; }
.brand-name{ font-size:23px; line-height:1; letter-spacing:.005em; }

/* ---------- 17. Site shell (public pages) ---------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:var(--bg);
  border-bottom:1px solid var(--line);
}
.header-inner{ display:flex; align-items:center; gap:24px; height:var(--header-h); }
.main-nav{ display:flex; align-items:center; gap:2px; margin-left:8px; }
.main-nav a{ position:relative; padding:8px 12px; color:var(--text-dim); font-size:16.5px; transition:color .15s; }
.main-nav a:hover{ color:var(--text); }
.main-nav a.is-active{ color:var(--text); font-style:italic; }
.main-nav a.is-active::after{ content:""; position:absolute; left:12px; right:12px; bottom:2px; height:1px; background:var(--accent); }
.header-actions{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.nav-toggle{ display:none; }
.lang-toggle .lang-code{ display:none; font-family:var(--mono); font-size:12.5px; letter-spacing:.06em; }
.lang-toggle .icon{ color:var(--muted); }
.mobile-nav{ display:none; border-top:1px solid var(--line); padding:8px 24px 22px; background:var(--bg); }
.mobile-nav a:not(.btn){ display:flex; align-items:center; justify-content:space-between; padding:14px 2px; border-bottom:1px solid var(--line); color:var(--text-dim); font-size:19px; }
.mobile-nav a.is-active:not(.btn){ color:var(--text); }
.mobile-nav a .icon{ color:var(--faint); }
.mobile-nav .btn{ margin-top:18px; width:100%; min-height:48px; font-size:17px; }

.site-main{ min-height:60vh; }
.site-footer{ margin-top:24px; border-top:1px solid var(--line); padding:56px 0 36px; color:var(--text-dim); }
.footer-grid{ display:grid; grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(0,1fr)); gap:40px; }
.footer-brand p{ margin:14px 0 0; max-width:340px; color:var(--muted); font-size:15.5px; }
.footer-col h4{ margin:0 0 14px; font:500 12px/1 var(--mono); letter-spacing:.02em; color:var(--muted); }
.footer-col a{ display:block; padding:5px 0; color:var(--text-dim); font-size:16px; transition:color .15s; }
.footer-col a:hover{ color:var(--accent); }
.footer-bottom{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-top:44px; padding-top:22px; border-top:1px solid var(--line); color:var(--muted); font-size:14.5px; }
.footer-bottom a:hover{ color:var(--text); }
.status-link{ display:inline-flex; align-items:center; gap:8px; }

/* ---------- 18. Landing ---------- */
/* The home page reads like a plate from a star almanac: a big left-set
   title, the logo as the engraving with a brass body on its orbit, and a
   ledger of plain facts underneath. */
.almanac{ position:relative; overflow:hidden; padding:72px 0 0; }
.almanac-grid{ display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); gap:24px; align-items:center; }
.almanac-copy{ position:relative; z-index:1; padding-bottom:24px; }
.almanac-index{ margin:0 0 26px; font:500 12.5px/1.4 var(--mono); color:var(--muted); }
.almanac-index::before{ content:""; display:inline-block; width:28px; height:1px; margin-right:12px; vertical-align:middle; background:var(--accent); }
.almanac-title{
  font-size:clamp(44px,7vw,92px); line-height:.98; letter-spacing:-.028em; font-weight:400;
  margin:0 0 28px; max-width:11ch; text-wrap:balance; font-variation-settings:"opsz" 72;
}
.almanac-sub{ max-width:52ch; margin:0 0 34px; color:var(--text-dim); font-size:clamp(17px,1.5vw,19.5px); line-height:1.6; text-wrap:pretty; }
.almanac-actions{ display:flex; align-items:center; flex-wrap:wrap; gap:14px 28px; }
.text-link{ color:var(--text); font-size:16.5px; border-bottom:1px solid var(--line-strong); padding-bottom:2px; transition:border-color .2s var(--ease-out), color .2s; }
.text-link:hover{ color:var(--accent); border-color:var(--accent); }

.almanac-plate{ position:relative; margin:0 -12% 0 0; aspect-ratio:1; }
.plate-img{
  position:absolute; inset:9%; width:82%; height:82%; object-fit:contain;
  opacity:.92; animation:plate-in 1.4s var(--ease-out) both;
}
.orbit{ position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.orbit-path{ fill:none; stroke:#4a5563; stroke-width:1.2; stroke-dasharray:2 6; }
.orbit-body{ fill:var(--accent); }
@keyframes plate-in{ from{ opacity:0; transform:scale(.96) rotate(-3deg); } to{ opacity:.92; transform:none; } }

.ledger{
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:48px 0 0;
  border-top:1px solid var(--line-strong); border-bottom:1px solid var(--line);
}
.ledger > div{ padding:18px 20px 20px 0; min-width:0; }
.ledger > div + div{ padding-left:20px; border-left:1px solid var(--line); }
.ledger dt{ margin:0 0 6px; font:500 12px/1.3 var(--mono); color:var(--muted); }
.ledger dd{ margin:0; font-size:16px; line-height:1.4; color:var(--text); overflow-wrap:anywhere; }
.ledger .mono{ font-size:13.5px; color:var(--ice); }

.section{ padding:96px 0; border-top:1px solid var(--line); }
.section-flush{ padding-top:64px; border-top:0; }
.section-head{ max-width:700px; margin:0 0 44px; }
.section-head.center{ margin-left:auto; margin-right:auto; text-align:center; }
.section-title{ font-size:clamp(32px,4vw,48px); line-height:1.06; letter-spacing:-.02em; margin:0 0 16px; text-wrap:balance; }
.section-sub{ margin:0; color:var(--text-dim); font-size:18px; max-width:56ch; text-wrap:pretty; }

.split{ display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:72px; align-items:start; }
.split-head{ position:sticky; top:calc(var(--header-h) + 28px); }
.entries{ list-style:none; margin:0; padding:0; border-top:1px solid var(--line-strong); }
.entry{ display:grid; grid-template-columns:72px minmax(0,1fr); gap:8px; padding:30px 0 32px; border-bottom:1px solid var(--line); }
.entry-n{ font-size:30px; line-height:1; font-style:italic; color:var(--accent); padding-top:2px; }
.entry h3{ font-size:25px; margin:0 0 10px; }
.entry p{ margin:0; color:var(--text-dim); font-size:17px; max-width:54ch; }

.section-bench{ background:var(--bg-elev); }
.showcase{ display:grid; grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); gap:64px; align-items:center; }
.showcase .section-sub{ margin-bottom:34px; }
.steps{ list-style:none; margin:0; padding:0; }
.step{ display:grid; grid-template-columns:44px minmax(0,1fr); gap:10px; padding:20px 0; border-top:1px solid var(--line); }
.step-n{ font:500 13px/1 var(--mono); color:var(--accent); padding-top:8px; }
.step h3{ margin:0 0 6px; font-size:22px; }
.step p{ margin:0; color:var(--text-dim); font-size:16.5px; }

.window{ background:var(--bg); border:1px solid var(--line-strong); border-radius:var(--r); overflow:hidden; }
.window-tabs{ display:flex; border-bottom:1px solid var(--line); font:12px var(--mono); color:var(--muted); background:var(--bg-card); overflow-x:auto; }
.window-tabs span{ padding:10px 16px; border-right:1px solid var(--line); white-space:nowrap; }
.window-tabs span.on{ color:var(--text); background:var(--bg); box-shadow:inset 0 2px 0 var(--accent); }
.window-body{ padding:16px 0; margin:0; font:13px/1.8 var(--mono); color:var(--text-dim); overflow-x:auto; counter-reset:ln; }
.window-body span.l{ display:block; padding:0 20px 0 0; white-space:pre; }
.window-body span.l::before{ counter-increment:ln; content:counter(ln); display:inline-block; width:44px; padding-right:16px; text-align:right; color:var(--faint); }
.window-term{ border-top:1px solid var(--line); padding:14px 20px 16px; background:#0a0d10; font:12.5px/1.8 var(--mono); color:var(--text-dim); }
.window-term div{ white-space:pre-wrap; }
.tk-tag{ color:var(--ice); } .tk-attr{ color:var(--violet); } .tk-str{ color:var(--accent); }
.tk-pun{ color:var(--faint); } .tk-txt{ color:var(--text); } .tk-com{ color:var(--faint); font-style:italic; }
.tk-pr{ color:var(--accent); } .tk-ok{ color:var(--ok); } .tk-dim{ color:var(--muted); }
.caret{ display:inline-block; width:7px; height:14px; vertical-align:-2px; background:var(--accent); animation:blink 1.1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity:0; } }

.section-sign{ padding:88px 0 96px; }
.sign{ display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); gap:48px; align-items:end; }
.sign h2{ margin:0; font-size:clamp(34px,4.6vw,58px); line-height:1.02; letter-spacing:-.025em; font-style:italic; text-wrap:balance; }
.sign p{ margin:0 0 24px; color:var(--text-dim); font-size:18px; max-width:42ch; }
.cta-band{ padding:56px 0; border-top:1px solid var(--line-strong); }
.cta-band h2{ font-size:clamp(30px,4vw,46px); margin:0 0 14px; }
.cta-band p{ color:var(--text-dim); font-size:18px; max-width:540px; margin:0 0 26px; }

.plans{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr)); gap:18px; align-items:stretch; }
.plan{ position:relative; display:flex; flex-direction:column; padding:32px 28px 28px; background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r-lg); transition:border-color .2s; }
.plan:hover{ border-color:var(--line-strong); }
.plan.featured{ border-color:var(--accent-line); box-shadow:inset 0 3px 0 var(--accent); }
.plan-badge{ position:absolute; top:-11px; left:26px; }
.plan-name{ font-size:23px; margin:0; }
.plan-desc{ margin:6px 0 0; color:var(--muted); font-size:15px; }
.plan-price{ display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; margin:22px 0 4px; font-size:46px; line-height:1; letter-spacing:-.025em; }
.plan-price .cur{ font-size:20px; color:var(--text-dim); letter-spacing:0; align-self:flex-start; margin-top:6px; }
.plan-price small{ font-size:16px; color:var(--muted); letter-spacing:0; }
.plan-features{ list-style:none; margin:24px 0 30px; padding:22px 0 0; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:11px; }
.plan-features li{ display:flex; gap:11px; color:var(--text-dim); font-size:16px; line-height:1.45; }
.plan-features .icon{ width:15px; height:15px; margin-top:4px; color:var(--muted); }
.plan .btn{ margin-top:auto; }
.pricing-note{ display:flex; align-items:flex-start; gap:10px; margin-top:32px; color:var(--muted); font-size:15px; }

.prose{ font-size:19px; line-height:1.75; color:var(--text-dim); }
.prose p{ margin:0 0 1.2em; }
.prose p:first-of-type::first-letter{ float:left; font-size:3.6em; line-height:.82; padding:.06em .1em 0 0; color:var(--accent); font-style:italic; }
.about-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); gap:72px; align-items:start; }
.about-aside{ position:sticky; top:calc(var(--header-h) + 32px); }
.pillars{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin-top:72px; border-top:1px solid var(--line-strong); }
.pillar{ padding:26px 28px 8px 0; }
.pillar + .pillar{ padding-left:28px; border-left:1px solid var(--line); }
.pillar-n{ display:block; margin-bottom:14px; font-size:26px; font-style:italic; line-height:1; color:var(--accent); }
.pillar h3{ font-size:19px; margin:0 0 6px; }
.pillar p{ margin:0; color:var(--muted); font-size:15.5px; }

.support-grid{ display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); gap:56px; align-items:start; }
.contact-list{ list-style:none; margin:28px 0 0; padding:0; display:flex; flex-direction:column; gap:4px; }
.contact-list li{ display:flex; gap:14px; padding:16px 0; border-top:1px solid var(--line); color:var(--text-dim); font-size:16px; }
.contact-list li:first-child{ border-top:0; }
.contact-list .icon{ color:var(--accent); width:19px; height:19px; margin-top:3px; }
.contact-list a{ color:var(--text); }
.contact-list a:hover{ color:var(--accent); }

.status-hero{ display:flex; align-items:center; gap:16px; padding:22px 24px; border-radius:var(--r-lg); border:1px solid var(--ok-line); box-shadow:inset 3px 0 0 var(--ok); }
.status-hero h2{ margin:0; font-size:25px; }
.status-hero p{ margin:2px 0 0; color:var(--text-dim); font-size:15px; }
.status-hero.bad{ border-color:var(--danger-line); box-shadow:inset 3px 0 0 var(--danger); }
.timeline{ position:relative; margin:0; padding:0 0 0 26px; list-style:none; }
.timeline::before{ content:""; position:absolute; left:5px; top:8px; bottom:8px; width:1px; background:var(--line-strong); }
.tl-item{ position:relative; padding:0 0 26px; }
.tl-item:last-child{ padding-bottom:0; }
.tl-item::before{ content:""; position:absolute; left:-26px; top:7px; width:11px; height:11px; border-radius:50%; background:var(--bg); border:2px solid var(--warn); }
.tl-item.ok::before{ border-color:var(--ok); background:var(--ok); }
.tl-item h3{ font-size:18px; margin:0 0 4px; display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.tl-item p{ margin:6px 0 0; color:var(--text-dim); font-size:15.5px; white-space:pre-line; }

.auth{ display:grid; place-items:center; padding:80px 16px 24px; }
.auth-card{ width:min(460px,100%); padding:40px 34px 32px; text-align:center; }
.auth-card .brand-mark{ width:48px; height:48px; margin:0 auto 22px; }
.auth-card h1{ font-size:34px; margin:0 0 10px; }
.auth-card .lead{ margin:0 0 28px; color:var(--text-dim); }
.auth-foot{ margin:22px 0 0; color:var(--muted); font-size:14px; }
.auth-note{ margin-top:22px; text-align:center; color:var(--muted); font-size:15px; }
.config-hint{ text-align:left; margin-top:16px; }

/* ---------- 19. App shell (dashboard + admin) ---------- */
body.app-body{ font-size:16px; }
.app{ display:grid; grid-template-columns:var(--sidebar-w) minmax(0,1fr); min-height:100vh; }
.sidebar{
  position:sticky; top:0; height:100vh; z-index:80;
  display:flex; flex-direction:column; gap:6px; padding:18px 14px 14px; overflow-y:auto;
  background:var(--bg-elev); border-right:1px solid var(--line);
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:4px 10px 14px; }
.sidebar-brand .badge{ margin-left:auto; }
.side-label{ padding:16px 12px 6px; font:500 11.5px/1 var(--mono); letter-spacing:.02em; color:var(--muted); }
.side-nav{ display:flex; flex-direction:column; gap:1px; }
.side-nav a{
  position:relative; display:flex; align-items:center; gap:12px; padding:9px 12px; border-radius:var(--r-sm);
  color:var(--text-dim); font-size:15.5px; line-height:1.3; transition:background-color .12s, color .12s;
}
.side-nav a .icon{ width:18px; height:18px; color:var(--muted); transition:color .12s; }
.side-nav a:hover{ background:rgba(185,211,234,.04); color:var(--text); }
.side-nav a:hover .icon{ color:var(--text-dim); }
.side-nav a.is-active{ background:rgba(185,211,234,.05); color:var(--text); }
.side-nav a.is-active .icon{ color:var(--accent); }
.side-nav a.is-active::before{ content:""; position:absolute; left:-14px; top:9px; bottom:9px; width:3px; border-radius:0 3px 3px 0; background:var(--accent); }
.side-nav .count{ margin-left:auto; }
.sidebar-foot{ margin-top:auto; padding-top:14px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:8px; }
.context-switch{
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px;
  border:1px dashed var(--line-strong); color:var(--text-dim); font-size:14.5px; transition:all .15s;
}
.context-switch:hover{ border-color:var(--accent-line); color:var(--accent); border-style:solid; }
.context-switch .icon{ color:var(--muted); }
.user-card{ display:flex; align-items:center; gap:10px; padding:6px 4px 2px 6px; min-width:0; }
.who{ flex:1; min-width:0; line-height:1.3; }
.who strong{ display:block; font-weight:400; font-size:15px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.who span{ display:block; font:11.5px var(--mono); color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.avatar{
  width:34px; height:34px; border-radius:50%; flex:none; overflow:hidden; display:grid; place-items:center;
  background:var(--bg-soft); border:1px solid var(--line-strong);
  color:var(--ice); font-size:15px; line-height:1; font-style:italic;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }
.avatar-lg{ width:64px; height:64px; font-size:26px; }
.side-lang{ display:flex; }
.side-lang .btn{ width:100%; justify-content:flex-start; }
.side-lang .dropdown{ width:100%; }

.app-main{ min-width:0; display:flex; flex-direction:column; }
.app-topbar{ display:none; }
.app-scrim{ display:none; }
.app-content{ width:100%; max-width:1180px; margin:0 auto; padding:38px 44px 72px; display:flex; flex-direction:column; gap:24px; }
.app-content > form,.app-content > table{ margin:0; }

/* ---------- 20. App components ---------- */
.projects{ display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr)); gap:16px; }
.project{ display:flex; flex-direction:column; gap:16px; padding:20px; background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); transition:border-color .15s, background-color .15s; min-width:0; }
.project:hover{ border-color:var(--line-strong); }
.project-head{ display:flex; align-items:flex-start; gap:14px; min-width:0; }
.project-icon{
  width:42px; height:42px; flex:none; border-radius:50%; display:grid; place-items:center;
  background:transparent; border:1px solid var(--line-strong); color:var(--ice); font-size:20px; line-height:1; font-style:italic;
}
.project-icon.live{ border-color:var(--ok-line); color:var(--ok); }
.project-name{ display:block; font-size:19px; line-height:1.25; color:var(--text); overflow-wrap:anywhere; }
.project-name:hover{ color:var(--accent); }
.project-desc{ margin:4px 0 0; color:var(--muted); font-size:14.5px; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.project-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.project-meta time{ font-family:var(--mono); font-size:12px; }
.project-foot{ display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; padding-top:16px; border-top:1px solid var(--line); }

.checklist{ list-style:none; margin:0; padding:0; }
.checklist a{ display:flex; align-items:center; gap:14px; padding:13px 0; border-top:1px solid var(--line); color:var(--text); transition:color .15s; }
.checklist li:first-child a{ border-top:0; }
.checklist a:hover{ color:var(--accent); }
.check-dot{ width:22px; height:22px; flex:none; border-radius:50%; display:grid; place-items:center; border:1.5px solid var(--line-strong); color:transparent; }
.check-dot .icon{ width:13px; height:13px; }
.checklist .done .check-dot{ background:var(--ok); border-color:var(--ok); color:#0d1a12; }
.checklist .done .check-label{ color:var(--muted); text-decoration:line-through; text-decoration-color:var(--faint); }
.checklist .go{ margin-left:auto; color:var(--faint); }
.progress-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }

.notif{ display:flex; gap:14px; padding:18px 20px; border-top:1px solid var(--line); }
.notif:first-child{ border-top:0; }
.notif.unread{ background:rgba(214,173,98,.04); box-shadow:inset 2px 0 0 var(--accent); }
.notif-main{ flex:1; min-width:0; }
.notif-main h3{ margin:0; font-size:17px; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.notif-main p{ margin:5px 0 0; color:var(--text-dim); font-size:15.5px; white-space:pre-line; overflow-wrap:anywhere; }
.notif-side{ display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex:none; }
.notif-side time{ font:12px var(--mono); color:var(--muted); white-space:nowrap; }

.monitor-stage{ position:relative; height:340px; background:var(--bg); }
#mon-canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }

.asset-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.search-field{ position:relative; flex:1 1 260px; }
.search-field .icon{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.search-field input{ padding-left:42px; }
.asset-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
.asset-grid > p{ grid-column:1/-1; }
.asset-card{ display:flex; flex-direction:column; align-items:center; gap:12px; padding:14px 14px 16px; background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); text-align:center; transition:border-color .15s; }
.asset-card:hover{ border-color:var(--line-strong); }
.asset-prev{ width:100%; height:96px; display:grid; place-items:center; color:var(--text); background:var(--bg-elev); border:1px solid var(--line); border-radius:var(--r-sm); }
.asset-card:hover .asset-prev{ color:var(--accent); }
.asset-prev svg{ max-width:64px; max-height:64px; }
.asset-name{ font-size:14px; color:var(--text-dim); line-height:1.3; }
.asset-add{ width:100%; }
.asset-add.ok{ --btn-fg:var(--accent); --btn-bd:var(--accent-line); --btn-bg:var(--accent-soft); }

.repo-head{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px 20px; }
.repo-title{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0; font-size:26px; line-height:1.2; min-width:0; }
.repo-title a{ color:var(--text-dim); transition:color .15s; overflow-wrap:anywhere; }
.repo-title a:hover{ color:var(--accent); }
.repo-title a.repo-name{ color:var(--text); }
.repo-title .sep{ color:var(--faint); }
.repo-tabs{ margin-top:-6px; }
.layout-aside{ display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:28px; align-items:start; }
.layout-side{ display:grid; grid-template-columns:210px minmax(0,1fr); gap:28px; align-items:start; }
.layout-main{ display:flex; flex-direction:column; gap:18px; min-width:0; }
.aside{ display:flex; flex-direction:column; gap:22px; }
.aside-block h3{ margin:0 0 10px; font:500 12px/1 var(--mono); letter-spacing:.02em; color:var(--muted); }
.aside-block p{ margin:0 0 8px; color:var(--text-dim); font-size:15.5px; }
.aside-meta{ display:flex; flex-direction:column; gap:8px; color:var(--text-dim); font-size:15px; }
.aside-meta span{ display:flex; align-items:center; gap:10px; }
.aside-meta .icon{ color:var(--muted); }
.toolbar{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.toolbar select{ width:auto; min-width:150px; min-height:36px; padding-top:6px; padding-bottom:6px; font-size:15px; }
.branch-select{ position:relative; display:inline-flex; align-items:center; }
.branch-select .icon{ position:absolute; left:13px; color:var(--muted); pointer-events:none; }
.branch-select select{ padding-left:36px; }
.crumbs{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:15.5px; color:var(--muted); }
.crumbs a{ color:var(--accent); }
.crumbs a:hover{ text-decoration:underline; }
.notice{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:11px 16px; border-radius:var(--r-sm); border:1px solid var(--warn-line); background:var(--warn-soft); color:#f3dcbf; font-size:15px; }
.notice .icon{ color:var(--warn); }
.notice a{ color:var(--warn); text-decoration:underline; text-underline-offset:3px; }
.danger-zone{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; border-color:var(--danger-line); }
.danger-zone h3{ margin:0; font-size:18px; color:var(--danger); }
.danger-zone p{ margin:4px 0 0; color:var(--muted); font-size:14.5px; }
.state-dot{ width:22px; height:22px; flex:none; display:grid; place-items:center; }
.state-open{ color:var(--ok); } .state-closed{ color:var(--danger); } .state-merged{ color:var(--violet); }
.merge-box{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.merge-box.ok{ border-color:var(--ok-line); }
.merge-box.bad{ border-color:var(--danger-line); }
.thread{ display:flex; flex-direction:column; gap:14px; }
.msg{ background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.msg-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:11px 18px; border-bottom:1px solid var(--line); background:var(--bg-elev); font-size:15px; }
.msg-head time{ font:12px var(--mono); color:var(--muted); }
.msg-body{ padding:16px 18px; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text); }
.msg.staff{ border-color:var(--accent-line); }
.msg.staff .msg-head{ background:var(--accent-soft); }
.copy-field{ position:relative; }
.copy-field .btn{ position:absolute; top:10px; right:10px; }
.dns-value{ display:inline-flex; align-items:center; gap:8px; }
.release-tag{ font-family:var(--mono); }
.content-block{ padding:18px 0; border-top:1px solid var(--line); }
.content-block:first-of-type{ border-top:0; padding-top:4px; }
.content-block-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.content-block-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.profile{ display:flex; align-items:center; gap:18px; margin-bottom:22px; }
.profile h2{ margin:0; font-size:24px; }
.profile p{ margin:2px 0 0; color:var(--muted); }
.report-doc{ max-height:70vh; overflow:auto; }

/* ---------- 21. Builder workspace ---------- */
html.ws-html,html.ws-html body{ height:100%; overflow:hidden; }
.ws{ display:flex; flex-direction:column; height:100vh; background:var(--bg); }
.ws-top{ display:flex; align-items:center; gap:14px; height:56px; padding:0 14px 0 10px; flex:none; background:var(--bg-elev); border-bottom:1px solid var(--line); }
.ws-title{ display:flex; align-items:center; gap:10px; min-width:0; font-size:17px; }
.ws-title .truncate{ max-width:38vw; }
.ws-title .sep{ color:var(--faint); }
.ws-dirty{ width:8px; height:8px; border-radius:50%; background:var(--warn); }
.ws-actions{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.ws-actions kbd{ margin-left:2px; }
.ws-body{ flex:1; display:flex; min-height:0; }
.ws-hint{ margin:auto 0 0; padding:14px 10px 6px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; line-height:1.5; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 14px 10px; font:500 12px/1 var(--mono); letter-spacing:.02em; color:var(--muted); }

.bld-palette{ width:216px; flex:none; display:flex; flex-direction:column; gap:4px; padding:0 10px 10px; overflow:auto; background:var(--bg-elev); border-right:1px solid var(--line); }
.bld-add{
  display:flex; align-items:center; gap:12px; width:100%; padding:10px 12px; text-align:left; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r-sm);
  color:var(--text-dim); font:15px var(--serif); transition:color .15s, border-color .15s;
}
.bld-add .icon{ color:var(--muted); }
.bld-add:hover{ color:var(--text); border-color:var(--accent-line); }
.bld-add:hover .icon{ color:var(--accent); }
.bld-add .plus-i{ margin-left:auto; color:var(--faint); }
.bld-canvas{ flex:1; min-width:0; overflow:auto; padding:36px 28px 80px; background-color:var(--bg); }
.bld-list{ list-style:none; margin:0 auto; padding:0; max-width:760px; }
.bld-item{
  position:relative; display:flex; align-items:flex-start; gap:8px; margin:0 0 10px; padding:14px 44px 14px 8px; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line); border-radius:var(--r); transition:border-color .15s, opacity .15s;
}
.bld-item:hover{ border-color:var(--line-strong); }
.bld-item.sel{ border-color:var(--accent); box-shadow:inset 3px 0 0 var(--accent); }
.bld-item.over{ border-color:var(--accent); border-style:dashed; }
.bld-item.drag{ opacity:.35; }
.bld-grip{ display:grid; place-items:center; width:22px; padding-top:3px; color:var(--faint); cursor:grab; user-select:none; }
.bld-grip:active{ cursor:grabbing; }
.bld-item:hover .bld-grip{ color:var(--muted); }
.bld-prev{ flex:1; min-width:0; color:var(--text); overflow-wrap:anywhere; }
.bld-prev h1,.bld-prev h2,.bld-prev h3{ margin:.1em 0; }
.bld-prev p{ margin:.1em 0; color:var(--text-dim); }
.bld-prev img{ border-radius:8px; }
.bld-prev hr{ margin:10px 0; border-top-color:var(--line-strong); }
.bld-btn{ display:inline-block; padding:9px 20px; border-radius:var(--r-sm); background:var(--accent); color:var(--accent-ink); font-size:15px; font-weight:700; }
.bld-ph{ display:flex; align-items:center; justify-content:center; gap:10px; padding:26px; border:1px dashed var(--line-strong); border-radius:10px; color:var(--muted); }
.bld-spacer{ display:flex; align-items:center; justify-content:center; gap:6px; border:1px dashed var(--line-strong); border-radius:8px; color:var(--faint); font:12px var(--mono); }
.bld-del{ position:absolute; top:10px; right:10px; display:grid; place-items:center; width:28px; height:28px; border:0; border-radius:8px; background:none; color:var(--danger); cursor:pointer; opacity:0; transition:opacity .15s, background-color .15s; }
.bld-item:hover .bld-del,.bld-item.sel .bld-del{ opacity:.85; }
.bld-del:hover{ background:var(--danger-soft); opacity:1; }
.bld-empty{ max-width:420px; margin:12vh auto 0; text-align:center; color:var(--muted); }
.bld-empty .empty-icon{ margin-bottom:14px; }
.bld-props{ width:300px; flex:none; display:flex; flex-direction:column; background:var(--bg-elev); border-left:1px solid var(--line); }
.bld-props-body{ flex:1; overflow:auto; padding:2px 14px 14px; }
.bld-props-body > p{ padding:6px 0; color:var(--muted); font-size:15px; }
.bld-f{ display:block; margin:0 0 14px; }
.bld-f > span{ display:block; margin-bottom:6px; color:var(--text-dim); font-size:13.5px; }
.bld-f input,.bld-f select,.bld-f textarea{ font-size:15px; }

.ws-preview{ position:fixed; z-index:40; top:56px; right:0; bottom:0; width:min(46%,760px); display:flex; flex-direction:column; background:#fff; border-left:1px solid var(--line-strong); box-shadow:-30px 0 80px rgba(0,0,0,.5); }
.ws-preview-head{ display:flex; align-items:center; gap:10px; height:44px; padding:0 8px 0 14px; flex:none; background:var(--bg-card); border-bottom:1px solid var(--line); color:var(--text-dim); font-size:14px; }
.ws-preview-url{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:5px 12px; border-radius:var(--r-sm); background:var(--bg-elev); border:1px solid var(--line); font:12px var(--mono); color:var(--muted); }
.ws-preview iframe{ flex:1; width:100%; border:0; background:#fff; }

/* ---------- 22. Error pages ---------- */
.error-page{ position:relative; min-height:100vh; display:grid; align-items:center; padding:96px max(20px,calc(50vw - 520px)) 48px; overflow:hidden; }
.error-page .brand{ position:absolute; top:28px; left:max(20px,calc(50vw - 520px)); }
.error-page > div{ max-width:560px; border-left:1px solid var(--line-strong); padding-left:32px; }
.error-code{ font-size:clamp(96px,18vw,190px); line-height:.86; letter-spacing:-.05em; margin:0 0 22px; font-style:italic; color:var(--accent); }
.error-page h1{ font-size:clamp(26px,3vw,36px); margin:0 0 10px; }
.error-page p{ color:var(--text-dim); max-width:440px; margin:0 0 30px; }

/* ---------- 23. Responsive ---------- */
@media (max-width:1080px){
  .layout-aside{ grid-template-columns:minmax(0,1fr); }
  .aside{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
  .showcase{ grid-template-columns:minmax(0,1fr); gap:48px; }
}
@media (max-width:960px){
  .app{ grid-template-columns:minmax(0,1fr); }
  .sidebar{ position:fixed; inset:0 auto 0 0; width:min(296px,86vw); transform:translateX(-102%); transition:transform .24s cubic-bezier(.2,.8,.2,1); }
  .app.sidebar-open .sidebar{ transform:none; box-shadow:30px 0 80px rgba(2,4,6,.6); }
  .app-scrim{ display:block; position:fixed; inset:0; z-index:70; background:rgba(6,9,12,.66); opacity:0; pointer-events:none; transition:opacity .2s; }
  .app.sidebar-open .app-scrim{ opacity:1; pointer-events:auto; }
  .app-topbar{ position:sticky; top:0; z-index:40; display:flex; align-items:center; gap:12px; height:58px; padding:0 12px; background:var(--bg); border-bottom:1px solid var(--line); }
  .app-topbar .brand-name{ font-size:21px; }
  .app-topbar .avatar{ margin-left:auto; width:30px; height:30px; font-size:13px; }
  .app-content{ padding:26px 18px 56px; gap:20px; }
  .layout-side{ grid-template-columns:minmax(0,1fr); gap:18px; }
  .subnav{ position:static; flex-direction:row; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; }
  .subnav::-webkit-scrollbar{ display:none; }
  .subnav a{ white-space:nowrap; flex:none; }
  .pillars{ grid-template-columns:minmax(0,1fr); }
  .pillar + .pillar{ padding-left:0; border-left:0; border-top:1px solid var(--line); }
  .almanac-grid{ grid-template-columns:minmax(0,1fr); }
  .almanac-plate{ position:absolute; top:-40px; right:-34%; width:76%; margin:0; opacity:.32; pointer-events:none; }
  .ledger{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ledger > div:nth-child(3){ padding-left:0; border-left:0; }
  .ledger > div:nth-child(n+3){ border-top:1px solid var(--line); }
  .split{ grid-template-columns:minmax(0,1fr); gap:36px; }
  .split-head{ position:static; }
  .sign{ grid-template-columns:minmax(0,1fr); gap:24px; }
  .about-grid,.support-grid{ grid-template-columns:minmax(0,1fr); gap:40px; }
  .about-aside{ position:static; }
  .footer-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .footer-brand{ grid-column:1/-1; }
  .bld-palette{ width:170px; }
  .bld-props{ width:240px; }
  .ws-preview{ width:100%; }
}
@media (max-width:860px){
  .main-nav{ display:none; }
  .nav-toggle{ display:inline-flex; }
  body.nav-open .mobile-nav{ display:block; animation:pop .16s ease-out; }
  .header-cta{ display:none; }
  .lang-toggle .lang-full{ display:none; }
  .lang-toggle .lang-code{ display:inline; }
  .grid-2,.grid-3{ grid-template-columns:minmax(0,1fr); }
}
@media (max-width:640px){
  body{ font-size:16.5px; }
  .container{ padding:0 18px; }
  .header-inner{ gap:12px; }
  .almanac{ padding-top:48px; }
  .almanac-plate{ right:-48%; width:96%; opacity:.22; }
  .ledger{ grid-template-columns:minmax(0,1fr); }
  .ledger > div,.ledger > div + div{ padding:14px 0; border-left:0; }
  .ledger > div + div{ border-top:1px solid var(--line); }
  .entry{ grid-template-columns:48px minmax(0,1fr); padding:24px 0; }
  .error-page > div{ padding-left:20px; }
  .section{ padding:72px 0; }
  .section-head{ margin-bottom:32px; }
  .card{ padding:20px; }
  .card-head,.card-body,.card-foot{ padding-left:16px; padding-right:16px; }
  .row{ padding:13px 16px; flex-wrap:wrap; }
  .row-actions{ width:100%; justify-content:flex-start; padding-left:48px; }
  .row.file .row-actions,.row.compact .row-actions{ width:auto; padding-left:0; }
  .md{ padding:18px; }
  .notif{ flex-direction:column; gap:10px; }
  .notif-side{ flex-direction:row; align-items:center; justify-content:space-between; }
  .page-actions{ width:100%; }
  .stats{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stat{ padding:14px 14px 16px; }
  .stat-value{ font-size:26px; margin-top:10px; }
  .stat-value-sm{ font-size:20px; }
  .footer-grid{ gap:28px; }
  .auth-card{ padding:32px 22px 26px; }
  .bld-palette{ width:62px; padding:0 6px 6px; }
  .bld-palette .panel-head,.bld-palette .ws-hint,.bld-add span,.bld-add .plus-i{ display:none; }
  .bld-add{ justify-content:center; padding:10px 0; }
  .bld-props{ position:fixed; z-index:30; left:0; right:0; bottom:0; width:auto; max-height:46vh; border-left:0; border-top:1px solid var(--line-strong); box-shadow:0 -20px 60px rgba(0,0,0,.6); }
  .bld-canvas{ padding:20px 12px 50vh; }
  .ws-actions .btn-label{ display:none; }
  .ws-title .truncate{ max-width:34vw; }
  .table-stack thead{ display:none; }
  .table-stack tr{ display:block; padding:12px 16px; border-bottom:1px solid var(--line); }
  .table-stack tbody tr:last-child{ border-bottom:0; }
  .table-stack td{ display:flex; justify-content:space-between; gap:14px; padding:5px 0; border:0; text-align:right; }
  .table-stack td::before{ content:attr(data-label); color:var(--muted); font:500 12px/1.8 var(--mono); text-align:left; }
  .table-stack td.actions{ justify-content:flex-end; padding-top:10px; }
  .table-stack td.actions::before,.table-stack td.empty-cell::before{ display:none; }
  .table-stack td.empty-cell{ justify-content:center; }
}

/* ---------- 24. Motion preferences ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* ---------- 25. Spacing utilities ---------- */
.mt-1{ margin-top:8px !important; }
.mt-2{ margin-top:14px !important; }
.mt-3{ margin-top:22px !important; }
.mb-2{ margin-bottom:14px !important; }
.auth-card .alert{ text-align:left; }
.auth-wide{ width:min(480px,100%); }
.card-title-lg{ font-size:30px; }

/* ---------- 26. Choice cards & pill options (radio groups) ---------- */
.choices{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:10px; }
.choice,.pill-opt{ position:relative; cursor:pointer; }
.choice input,.pill-opt input{ position:absolute; opacity:0; pointer-events:none; }
.choice-body{ display:flex; flex-direction:column; gap:3px; height:100%; padding:14px 14px 13px; border:1px solid var(--line-strong); border-radius:12px; background:var(--bg-elev); transition:border-color .15s, background-color .15s, box-shadow .15s; }
.choice-body .icon{ color:var(--muted); margin-bottom:8px; }
.choice-body strong{ font-weight:400; font-size:16px; color:var(--text); }
.choice-body small{ color:var(--muted); font-size:13.5px; line-height:1.4; }
.choice:hover .choice-body{ border-color:#45464b; }
.choice input:checked + .choice-body{ border-color:var(--accent); background:var(--accent-soft); box-shadow:0 0 0 3px var(--accent-soft); }
.choice input:checked + .choice-body .icon{ color:var(--accent); }
.pill-opts{ display:flex; flex-wrap:wrap; gap:8px; }
.pill-opt span{ display:inline-flex; align-items:center; height:34px; padding:0 15px; border-radius:var(--r-pill); border:1px solid var(--line-strong); color:var(--text-dim); font-size:14.5px; transition:all .15s; }
.pill-opt:hover span{ color:var(--text); border-color:#45464b; }
.pill-opt input:checked + span{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.choice input:focus-visible + .choice-body,.pill-opt input:focus-visible + span{ outline:2px solid var(--accent); outline-offset:2px; }
.fieldset{ border:0; margin:0 0 18px; padding:0; min-width:0; }
.fieldset > legend{ padding:0; margin-bottom:9px; color:var(--text-dim); font-size:14.5px; }
.stat-value-sm{ font-size:25px; }
.cluster-tight{ --gap:6px; }
.cluster > select,.row-actions select,.toolbar select,.form-inline select.auto{ width:auto; }
.table input[type=number]{ max-width:180px; }
.note-input{ min-width:210px; }
.ctx{ display:block; max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:12px var(--mono); color:var(--muted); }
.cap{ text-transform:capitalize; }
.banner-preview{ border:1px solid var(--accent-line); border-radius:var(--r-sm); }
.banner-preview.announce-warn{ border-color:var(--warn-line); }
.search-field.compact{ flex:0 1 340px; }
.cluster-loose{ --gap:20px; }
.block{ display:block; }

/* ---------- 27. Small touches ---------- */
.sep{ color:var(--faint); margin:0 .15em; }
.brand-mark{ object-fit:contain; }
.brand-name{ font-style:italic; letter-spacing:-.01em; }
.auth-card{ text-align:left; }
.auth-card .brand-mark{ margin:0 0 22px; }
h1,h2,h3{ font-variation-settings:"opsz" 48; }

/* user guide */
.guide-sec{scroll-margin-top:20px}
.guide .mt-3{margin-top:22px}
.guide-steps{list-style:none;counter-reset:gs;margin:14px 0 0;padding:0;display:grid;gap:12px}
.guide-steps>li{counter-increment:gs;position:relative;padding:2px 0 2px 42px;line-height:1.6;color:var(--text-dim)}
.guide-steps>li::before{content:counter(gs);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font:600 13px var(--mono);color:var(--accent-ink);background:var(--accent)}
.guide-list{margin:10px 0 0;padding-left:20px;display:grid;gap:8px;line-height:1.6;color:var(--text-dim)}
.guide-code{margin:10px 0;padding:14px 16px;overflow:auto;border:1px solid var(--line);border-radius:var(--r-sm);background:rgba(0,0,0,.25);font:13px/1.55 var(--mono);color:var(--text)}
.guide-code code{font:inherit;white-space:pre}
.guide .table code,.guide-list code,.guide-steps code{font-size:.9em}
.alert-info{background:var(--soft,rgba(185,211,234,.06));border-color:var(--line-strong,var(--line));color:var(--text)}
.alert-info>.icon{color:var(--accent)}
/* ============================================================
   Chat assistant (dashboard): launcher + panel
   ============================================================ */
.asst{ position:fixed; right:20px; bottom:20px; z-index:95; font-family:inherit; }
.asst-launch{
  display:inline-flex; align-items:center; gap:9px; height:46px; padding:0 18px 0 14px; border-radius:var(--r-pill);
  background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent); font:inherit; font-weight:700; font-size:14px;
  cursor:pointer; box-shadow:0 10px 30px rgba(0,0,0,.45); transition:background .15s, transform .15s;
}
.asst-launch:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
.asst-launch:active{ transform:translateY(1px); }
.asst-launch:focus-visible, .asst-tool:focus-visible, .asst-send:focus-visible, .asst-chip:focus-visible{ outline:2px solid var(--ice); outline-offset:2px; }
.asst.is-open .asst-launch{ display:none; }

.asst-panel{
  display:flex; flex-direction:column; width:min(404px, calc(100vw - 24px)); height:min(660px, calc(100vh - 40px));
  background:var(--bg-card); border:1px solid var(--line-strong); border-radius:var(--r-lg); overflow:hidden;
  box-shadow:0 28px 80px rgba(0,0,0,.6); color:var(--text);
}
.asst-panel[hidden]{ display:none; }
.asst-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:11px 12px 11px 14px; background:var(--bg-elev); border-bottom:1px solid var(--line); }
.asst-title{ display:flex; align-items:center; gap:10px; min-width:0; }
.asst-title strong{ display:block; font-family:var(--serif); font-size:17px; font-weight:500; line-height:1.15; }
.asst-title small{ display:block; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asst-mark{ flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:var(--r); background:var(--accent-soft); border:1px solid var(--accent-line); color:var(--accent); }
.asst-tools{ display:flex; align-items:center; gap:2px; flex:none; }
.asst-tool{ display:grid; place-items:center; width:32px; height:32px; background:none; border:1px solid transparent; border-radius:var(--r); color:var(--text-dim); cursor:pointer; }
.asst-tool:hover{ background:rgba(185,211,234,.07); color:var(--text); }
.asst-lang{ height:30px; max-width:104px; margin-right:4px; padding:0 6px; background:var(--bg-input); color:var(--text-dim); border:1px solid var(--line); border-radius:var(--r); font:inherit; font-size:12px; }

.asst-history{ position:absolute; z-index:2; inset:57px 0 0 0; overflow:auto; padding:10px; background:var(--bg-card); }
.asst-history[hidden]{ display:none; }
.asst-hrow{ display:flex; align-items:stretch; border:1px solid var(--line); border-radius:var(--r); margin-bottom:8px; background:var(--bg-soft); }
.asst-hrow.is-on{ border-color:var(--accent-line); }
.asst-hopen{ flex:1; min-width:0; text-align:left; background:none; border:0; padding:10px 12px; color:var(--text); font:inherit; cursor:pointer; }
.asst-hopen span{ display:block; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asst-hopen small{ color:var(--muted); font-size:12px; }
.asst-hdel{ width:38px; background:none; border:0; border-left:1px solid var(--line); color:var(--muted); font-size:20px; cursor:pointer; }
.asst-hdel:hover{ color:var(--danger); }
.asst-empty{ color:var(--muted); font-size:14px; text-align:center; padding:28px 8px; }

.asst-log{ position:relative; flex:1; overflow-y:auto; overscroll-behavior:contain; padding:16px 14px 6px; display:flex; flex-direction:column; gap:12px; scroll-behavior:smooth; }
.asst-msg{ display:flex; max-width:100%; }
.asst-user{ justify-content:flex-end; }
.asst-bubble{ max-width:92%; padding:10px 13px; border-radius:var(--r-lg); font-size:14.5px; line-height:1.55; overflow-wrap:anywhere; }
.asst-bot .asst-bubble{ background:var(--bg-soft); border:1px solid var(--line); border-top-left-radius:2px; }
.asst-user .asst-bubble{ background:var(--accent-soft); border:1px solid var(--accent-line); border-top-right-radius:2px; white-space:pre-wrap; }
.asst-bubble p{ margin:0 0 .6em; }
.asst-bubble p:last-child, .asst-bubble ul:last-child, .asst-bubble ol:last-child{ margin-bottom:0; }
.asst-bubble ul, .asst-bubble ol{ margin:0 0 .6em; padding-left:1.25em; }
.asst-bubble li{ margin:.2em 0; }
.asst-bubble strong{ color:var(--text); font-weight:700; }
.asst-bubble a{ color:var(--accent); text-decoration:underline; text-underline-offset:2px; }
.asst-bubble code{ font-family:var(--mono); font-size:.86em; padding:1px 5px; border-radius:3px; background:var(--bg-input); border:1px solid var(--line); }
.asst-code{ position:relative; margin:.4em 0 .6em; }
.asst-code pre{ margin:0; padding:10px 12px; overflow:auto; background:var(--bg-input); border:1px solid var(--line); border-radius:var(--r); }
.asst-code pre code{ padding:0; border:0; background:none; font-size:12.5px; white-space:pre; }
.asst-copy{ position:absolute; top:6px; right:6px; z-index:1; height:24px; padding:0 8px; font:inherit; font-size:11px; color:var(--text-dim); background:var(--bg-soft); border:1px solid var(--line-strong); border-radius:var(--r-sm); cursor:pointer; }
.asst-copy:hover{ color:var(--text); }
.asst-typing .asst-bubble{ display:flex; gap:5px; padding:14px 14px; }
.asst-typing span{ width:7px; height:7px; border-radius:50%; background:var(--muted); animation:asst-dot 1s infinite ease-in-out; }
.asst-typing span:nth-child(2){ animation-delay:.15s; }
.asst-typing span:nth-child(3){ animation-delay:.3s; }
@keyframes asst-dot{ 0%,80%,100%{ opacity:.3; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }

.asst-chips{ display:flex; flex-wrap:wrap; gap:7px; padding:6px 14px 4px; }
.asst-chips:empty{ display:none; }
.asst-chip{ max-width:100%; padding:6px 11px; background:transparent; color:var(--text-dim); border:1px solid var(--line-strong); border-radius:var(--r-pill); font:inherit; font-size:13px; line-height:1.3; cursor:pointer; text-align:left; }
.asst-chip:hover{ border-color:var(--accent-line); color:var(--accent); background:var(--accent-soft); }

.asst-form{ display:flex; align-items:flex-end; gap:8px; padding:10px 12px 6px; border-top:1px solid var(--line); background:var(--bg-elev); }
.asst-form textarea{ flex:1; min-height:40px; max-height:132px; padding:9px 12px; resize:none; font:inherit; font-size:14.5px; line-height:1.45; color:var(--text); background:var(--bg-input); border:1px solid var(--line-strong); border-radius:var(--r); }
.asst-form textarea:focus{ outline:none; border-color:var(--accent-line); box-shadow:0 0 0 3px var(--accent-soft); }
.asst-send{ flex:none; display:grid; place-items:center; width:40px; height:40px; background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent); border-radius:var(--r); cursor:pointer; }
.asst-send:hover{ background:var(--accent-hover); }
.asst-foot{ margin:0; padding:2px 14px 9px; background:var(--bg-elev); color:var(--faint); font-size:11.5px; line-height:1.4; }

@media (max-width:640px){
  .asst{ right:14px; bottom:14px; }
  .asst-launch-label{ display:none; }
  .asst-launch{ width:50px; height:50px; padding:0; justify-content:center; }
  .asst.is-open{ right:0; bottom:0; left:0; top:0; }
  .asst-panel{ width:100vw; height:100dvh; border-radius:0; border:0; }
  .asst-history{ inset:57px 0 0 0; }
}
@media (prefers-reduced-motion:reduce){
  .asst-log{ scroll-behavior:auto; }
  .asst-typing span{ animation:none; opacity:.7; }
}
