/* =========================================================
   Internal Knowledgebase: interface styles
   Tokens are overridden at runtime from Settings (brand, accent, fonts, radius, density).
   ========================================================= */

:root {
  --brand: #0E6E7E;
  --accent: #E8A33A;
  --on-brand: #FFFFFF;
  --on-accent: #141A23;

  --ink: #1A2230;
  --ink-2: #48546A;
  --ink-3: #6F7B8F;
  --canvas: #FAFBFC;
  --surface: #FFFFFF;
  --surface-2: #F5F7F9;
  --surface-3: #E8ECF0;
  --line: #D6DCE3;
  --line-soft: #E5E9EE;

  --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --brand-line: color-mix(in srgb, var(--brand) 32%, var(--line));
  --brand-ink: color-mix(in srgb, var(--brand) 80%, #000);
  --link: color-mix(in srgb, var(--brand) 88%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 50%, #3a2a00);

  --danger: #B42318;
  --danger-soft: color-mix(in srgb, var(--danger) 9%, var(--surface));
  --success: #1E7A4C;
  --success-soft: color-mix(in srgb, var(--success) 10%, var(--surface));
  --warning: #9A5B05;
  --warning-soft: color-mix(in srgb, #E8A33A 16%, var(--surface));

  --shadow-1: 0 1px 2px rgba(20, 30, 45, .06);
  --shadow-2: 0 2px 8px rgba(20, 30, 45, .07);
  --shadow-pop: 0 14px 36px rgba(20, 30, 45, .18), 0 2px 6px rgba(20, 30, 45, .08);

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-head: var(--font-ui);
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --pad: 20px;
  --row-y: 11px;
  --sidebar-w: 272px;
  --topbar-h: 60px;
  color-scheme: light;
}
:root[data-radius="sharp"] { --r-xs: 1px; --r-sm: 2px; --r-md: 3px; --r-lg: 4px; }
:root[data-radius="round"] { --r-xs: 6px; --r-sm: 10px; --r-md: 12px; --r-lg: 18px; }
:root[data-density="compact"] { --pad: 14px; --row-y: 7px; --topbar-h: 52px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E4E8EE; --ink-2: #A9B3C2; --ink-3: #7F8A9C;
    --canvas: #0F141A; --surface: #161D26; --surface-2: #1C242F; --surface-3: #243040;
    --line: #2B3543; --line-soft: #222B37;
    --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface));
    --brand-line: color-mix(in srgb, var(--brand) 45%, var(--line));
    --brand-ink: color-mix(in srgb, var(--brand) 45%, #fff);
    --link: color-mix(in srgb, var(--brand) 45%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
    --accent-ink: color-mix(in srgb, var(--accent) 70%, #fff);
    --danger: #F0705F; --success: #4FC48A; --warning: #F0B44C;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 2px 10px rgba(0, 0, 0, .3); --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E4E8EE; --ink-2: #A9B3C2; --ink-3: #7F8A9C;
  --canvas: #0F141A; --surface: #161D26; --surface-2: #1C242F; --surface-3: #243040;
  --line: #2B3543; --line-soft: #222B37;
  --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface));
  --brand-line: color-mix(in srgb, var(--brand) 45%, var(--line));
  --brand-ink: color-mix(in srgb, var(--brand) 45%, #fff);
  --link: color-mix(in srgb, var(--brand) 45%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #fff);
  --danger: #F0705F; --success: #4FC48A; --warning: #F0B44C;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 2px 10px rgba(0, 0, 0, .3); --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font-ui);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); margin: 0; line-height: 1.25; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
code, kbd, pre { font-family: var(--font-mono); }
kbd {
  font-size: 11px; padding: 1px 5px; border-radius: var(--r-xs);
  border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); color: var(--ink-3);
}
.icon { width: 18px; height: 18px; flex: none; }
.muted-text { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.danger-text { color: var(--danger) !important; }
.pad { padding: 16px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--brand); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none !important;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--line) 60%, var(--ink-3)); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn-ghost.on { color: var(--brand-ink); background: var(--brand-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.sm .icon { width: 15px; height: 15px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--link); font-weight: 550; font-size: 13.5px;
}
.link-btn .icon { width: 15px; height: 15px; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; min-width: 0; border: 0; padding: 0; }
.field > span:first-child, .field-label, .field legend { font-weight: 600; font-size: 13.5px; color: var(--ink); padding: 0; }
.field small, .check small { color: var(--ink-3); font-size: 12.5px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.select-sm { min-height: 30px !important; padding: 3px 26px 3px 8px !important; font-size: 13px; width: auto !important; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap > .icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.select-wrap select { padding-left: 32px; min-height: 36px; width: auto; font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; flex: none; }
.check, .radio { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; font-size: 14px; }
.check > input, .radio > input { margin-top: 3px; }
.check > span { display: flex; flex-direction: column; gap: 2px; }
.radio > span { display: block; color: var(--ink-2); }
.radio strong { color: var(--ink); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 14px; }
.hint { color: var(--ink-3); font-size: 13px; margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 34px; height: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 5px 12px; border-radius: calc(var(--r-sm) - 2px); font-size: 13.5px; color: var(--ink-2); font-weight: 550; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.option-card { position: relative; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; }
.option-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); height: 100%; }
.option-body small { color: var(--ink-3); font-size: 12.5px; }
.option-card input:checked + .option-body { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.option-card input:focus-visible + .option-body { outline: 2px solid var(--brand); outline-offset: 2px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { position: relative; cursor: pointer; }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.swatch span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 4px; }
.swatch.custom { overflow: hidden; border-radius: 50%; }
.swatch.custom input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch.custom span { background: var(--surface-2); border: 1px dashed var(--ink-3); box-shadow: none; color: var(--ink-2); }
.swatch.custom .icon { width: 15px; height: 15px; }
.hex { font-size: 12px; color: var(--ink-3); }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.icon-choice { cursor: pointer; }
.icon-choice input { position: absolute; opacity: 0; }
.icon-choice span { display: grid; place-items: center; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); color: var(--ink-2); }
.icon-choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.icon-choice input:focus-visible + span { outline: 2px solid var(--brand); }

/* ---------- chips, badges, tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-xs);
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
a.chip:hover { text-decoration: none; border-color: var(--line); color: var(--ink); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip-muted { color: var(--ink-3); }
.chip-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); }
.chip .icon { width: 13px; height: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; }
.badge-draft { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 650; vertical-align: 2px; margin-left: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-soft); padding: 1px 8px; border-radius: var(--r-xs); }
a.tag:hover { text-decoration: none; color: var(--brand-ink); border-color: var(--brand-line); }
.tag-lg { font-size: 22px; padding: 4px 12px; font-weight: 650; }
.tag-lg .icon { width: 20px; height: 20px; color: var(--ink-3); }

.cat-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); flex: none;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.cat-icon .icon { width: 18px; height: 18px; }
.cat-icon.sm { width: 24px; height: 24px; border-radius: var(--r-sm); }
.cat-icon.sm .icon { width: 14px; height: 14px; }
.cat-icon.lg { width: 52px; height: 52px; border-radius: var(--r-lg); }
.cat-icon.lg .icon { width: 26px; height: 26px; }
:root[data-theme="dark"] .cat-icon { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: color-mix(in srgb, var(--c) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat-icon { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: color-mix(in srgb, var(--c) 55%, #fff); } }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.xl { width: 56px; height: 56px; font-size: 19px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  --sb-bg: var(--surface); --sb-ink: var(--ink); --sb-ink-2: var(--ink-2); --sb-ink-3: var(--ink-3);
  --sb-hover: var(--surface-2); --sb-active: var(--brand-soft); --sb-active-ink: var(--brand-ink); --sb-line: var(--line-soft);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; background: var(--sb-bg); color: var(--sb-ink); border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
:root[data-sidebar="dark"] .sidebar {
  --sb-bg: #121820; --sb-ink: #E6EAF0; --sb-ink-2: #AEB8C6; --sb-ink-3: #7B8698;
  --sb-hover: rgba(255,255,255,.06); --sb-active: rgba(255,255,255,.1); --sb-active-ink: #fff; --sb-line: rgba(255,255,255,.08); border-right-color: #121820;
}
:root[data-sidebar="brand"] .sidebar {
  --sb-bg: var(--brand); --sb-ink: var(--on-brand); --sb-ink-2: color-mix(in srgb, var(--on-brand) 82%, var(--brand)); --sb-ink-3: color-mix(in srgb, var(--on-brand) 62%, var(--brand));
  --sb-hover: color-mix(in srgb, var(--on-brand) 10%, transparent); --sb-active: color-mix(in srgb, var(--on-brand) 17%, transparent); --sb-active-ink: var(--on-brand); --sb-line: color-mix(in srgb, var(--on-brand) 14%, transparent); border-right-color: var(--brand);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; color: var(--sb-ink); text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); background: var(--brand); color: var(--on-brand); flex: none; }
:root[data-sidebar="brand"] .brand-mark { background: var(--on-brand); color: var(--brand); }
.brand-mark .icon { width: 19px; height: 19px; }
.brand-mark.lg { width: 44px; height: 44px; border-radius: var(--r-lg); }
.brand-mark.lg .icon { width: 24px; height: 24px; }
.brand-logo { width: 34px; height: 34px; border-radius: var(--r-md); object-fit: contain; flex: none; }
.brand-logo.lg { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brand-tag { font-size: 12px; color: var(--sb-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { padding: 4px 10px 16px; flex: 1; }
.nav-item, .nav-cat {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--sb-ink-2); font-size: 14px; font-weight: 520; text-decoration: none !important; line-height: 1.3;
}
.nav-item .icon { width: 17px; height: 17px; color: var(--sb-ink-3); }
.nav-item:hover, .nav-cat:hover { background: var(--sb-hover); color: var(--sb-ink); }
.nav-item.active, .nav-cat.active { background: var(--sb-active); color: var(--sb-active-ink); font-weight: 600; }
.nav-item.active .icon { color: var(--sb-active-ink); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--sb-ink-3); font-variant-numeric: tabular-nums; }
.nav-section { margin-top: 18px; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px 10px; font-size: 12.5px; font-weight: 650; color: var(--sb-ink-3); }
.nav-heading .icon-btn { color: var(--sb-ink-3); }
.nav-heading .icon-btn:hover { background: var(--sb-hover); color: var(--sb-ink); }
.nav-tree, .nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-cat { padding-left: calc(10px + var(--depth, 0) * 16px); }
.nav-cat-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; margin: 0 3px; }
.nav-empty { padding: 0 10px; font-size: 13px; color: var(--sb-ink-3); }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid var(--sb-line); }
.sidebar-foot .icon-btn { color: var(--sb-ink-3); }
.sidebar-foot .icon-btn:hover { background: var(--sb-hover); color: var(--sb-ink); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; border-radius: var(--r-sm); color: var(--sb-ink); text-decoration: none !important; }
.me:hover, .me.active { background: var(--sb-hover); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--sb-ink-3); }
:root[data-sidebar="brand"] .sidebar .avatar, :root[data-sidebar="dark"] .sidebar .avatar { background: var(--sb-active); color: var(--sb-ink); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.search-trigger {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 460px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink-3); cursor: text; font-size: 14px;
}
.search-trigger:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink-3)); }
.search-trigger span { flex: 1; text-align: left; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
main#view { flex: 1; outline: none; }
main#view.loading { opacity: .6; transition: opacity .2s .15s; }
.site-foot { padding: 20px 28px 28px; font-size: 12.5px; color: var(--ink-3); }
.mobile-only { display: none !important; }
.scrim { display: none; }

/* ---------- page scaffolding ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 28px 40px; }
.page.narrow { max-width: 720px; }
.page.narrow-wide { max-width: 900px; }
.page-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head-text { flex: 1; min-width: 240px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.up-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 550; color: var(--ink-3); margin-bottom: 4px; }
.up-link .icon { width: 14px; height: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--pad); margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-title { font-size: 16px; font-weight: 650; margin-bottom: 14px; display: flex; align-items: center; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px; flex-wrap: wrap; }
.banner > span { flex: 1; }
.banner-draft { background: var(--warning-soft); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); }
.banner-info { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }
.error-panel { display: flex; gap: 16px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-top: 40px; }
.error-panel > .icon { width: 28px; height: 28px; color: var(--ink-3); }
.error-panel h2 { font-size: 20px; margin-bottom: 6px; }
.error-panel p { color: var(--ink-2); margin-bottom: 16px; }
.error-panel.slim { margin: 0; padding: 16px; border: 0; background: var(--danger-soft); }
.error-panel.slim p { margin: 4px 0 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg); list-style: none; }
.empty-icon { width: 30px !important; height: 30px !important; color: var(--ink-3); margin-bottom: 10px; }
.empty h3 { font-size: 16.5px; margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; font-size: 14px; color: var(--ink-3); }

/* ---------- dashboard ---------- */
.dash { padding-top: 14px; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); margin-bottom: 26px;
  background: var(--brand); color: var(--on-brand);
}
.hero-inner { position: relative; z-index: 1; padding: 38px 40px 32px; max-width: 760px; }
.hero-fibers { position: absolute; right: -40px; top: 0; height: 100%; width: 62%; min-width: 420px; color: var(--on-brand); opacity: .9; pointer-events: none; }
.hero-fibers path { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .17; }
.hero-fibers .pulse { stroke: var(--accent); stroke-width: 2.4; opacity: 1; stroke-linecap: round; stroke-dasharray: 26 1400; stroke-dashoffset: 26; animation: fiber-pulse 2.6s cubic-bezier(.55, .1, .35, 1) .4s 1 forwards; }
.hero-fibers .node { fill: var(--accent); }
@keyframes fiber-pulse { from { stroke-dashoffset: 26; opacity: 1; } 85% { opacity: 1; } to { stroke-dashoffset: -760; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-fibers .pulse { animation: none; opacity: 0; } }
.hero-greet { font-size: 14px; font-weight: 550; opacity: .82; margin-bottom: 8px; }
.hero h1 { color: inherit; font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; max-width: 24ch; text-wrap: balance; }
.hero-sub { margin-top: 10px; font-size: 16px; opacity: .86; max-width: 52ch; }
.hero-search {
  display: flex; align-items: center; gap: 10px; margin-top: 24px; max-width: 620px; height: 54px; padding: 0 7px 0 16px;
  background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(10, 20, 30, .18);
}
.hero-search > .icon { color: var(--ink-3); width: 20px; height: 20px; }
.hero-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 16px; padding: 0 !important; min-height: 0 !important; }
.btn-hero { height: 40px; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-hero:hover { background: color-mix(in srgb, var(--brand) 85%, #000); }
.hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; }
.hero-tags span { opacity: .78; margin-right: 2px; }
.hero-tags a { color: inherit; padding: 3px 10px; border-radius: var(--r-xs); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); }
.hero-tags a:hover { text-decoration: none; background: color-mix(in srgb, currentColor 16%, transparent); }
:root[data-hero="plain"] .hero { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
:root[data-hero="plain"] .hero-fibers { color: var(--brand); }
:root[data-hero="plain"] .hero-fibers path { opacity: .22; }
:root[data-hero="plain"] .hero-search { border: 1px solid var(--line); box-shadow: var(--shadow-2); }

.draft-strip { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 14px; margin: -8px 0 22px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.draft-strip-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--warning); }
.draft-strip-label .icon { width: 15px; height: 15px; }
.draft-strip a:not(.link-btn) { color: var(--ink-2); font-weight: 520; }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 28px; }
.dash-section.span-2 { grid-column: 1 / -1; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.section-empty { color: var(--ink-3); font-size: 14px; padding: 18px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md); }

.featured { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.featured.solo { grid-template-columns: 1fr; }
.feat-lead { position: relative; padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--accent); }
.feat-lead-top { display: flex; gap: 8px; }
.feat-lead h3 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.feat-lead h3 a { color: var(--ink); }
.feat-lead h3 a::after { content: ""; position: absolute; inset: 0; }
.feat-lead:hover h3 a { color: var(--link); text-decoration: none; }
.feat-lead p { color: var(--ink-2); font-size: 15px; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat-lead .chip { position: relative; z-index: 1; }
.meta-row { display: flex; gap: 16px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.meta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-3); }
.meta .icon { width: 14px; height: 14px; }
.feat-list { list-style: none; margin: 0; padding: 6px 0; border-left: 1px solid var(--line-soft); background: var(--surface-2); }
.feat-list a { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--ink); text-decoration: none !important; }
.feat-list a:hover { background: var(--surface-3); }
.feat-list li + li a { border-top: 1px solid var(--line-soft); }
.feat-marker { color: var(--accent); display: grid; }
.feat-marker .icon { width: 15px; height: 15px; fill: currentColor; }
.feat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feat-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.feat-sub { font-size: 12.5px; color: var(--ink-3); }
.feat-time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

.cat-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.cat-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); position: relative; overflow: hidden; }
.cat-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.cat-row-main { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; color: var(--ink); text-decoration: none !important; }
a.cat-row-main:hover .cat-row-name { color: var(--link); }
.cat-row-main.static { padding: 0; }
.cat-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-row-name { font-weight: 650; font-size: 15px; }
.cat-row-desc { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row-count { font-size: 13px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }
.cat-row-subs { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 16px 12px 64px; margin-top: -6px; font-size: 13px; }
.cat-row-subs a { color: var(--ink-2); }

.row-list { list-style: none; margin: 0; padding: 4px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.row-list > li + li { border-top: 1px solid var(--line-soft); }
.row-list a { display: flex; align-items: center; gap: 12px; padding: var(--row-y) 16px; color: var(--ink); text-decoration: none !important; }
.row-list a:hover { background: var(--surface-2); }
.row-list a:hover .row-title { color: var(--link); }
.row-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 580; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-aside { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-aside .icon { width: 14px; height: 14px; }
.row-list.ranked { counter-reset: rank; }
.row-list.ranked a::before { counter-increment: rank; content: counter(rank); width: 18px; font-weight: 700; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-list.ranked .row-dot { display: none; }

/* ---------- list / browse ---------- */
.cat-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.sub-cat { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); font-weight: 550; font-size: 14px; }
.sub-cat:hover { text-decoration: none; border-color: var(--c); }
.sub-cat .nav-count { color: var(--ink-3); }
.inline-search { display: flex; align-items: center; gap: 8px; position: relative; margin-bottom: 18px; }
.inline-search > .icon { position: absolute; left: 12px; color: var(--ink-3); width: 17px; height: 17px; }
.inline-search input { padding-left: 38px !important; height: 40px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.list-count { font-size: 13.5px; color: var(--ink-3); font-weight: 550; }
.list-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.article-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.article-list:has(.empty) { background: none; border: 0; }
.article-row { padding: 16px 20px; }
.article-row + .article-row { border-top: 1px solid var(--line-soft); }
.article-row-link { display: block; color: var(--ink); text-decoration: none !important; }
.article-row-link h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
.article-row-link:hover h3 { color: var(--link); }
.article-row-link p { color: var(--ink-2); font-size: 14px; margin-top: 4px; max-width: 90ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-row mark, .palette mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 2px; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.article-row-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.list-more { text-align: center; margin-top: 16px; }

/* ---------- article page (layout; typography lives in article.css) ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); margin: 4px 0 18px; }
.crumbs a { color: var(--ink-3); font-weight: 520; }
.crumbs a:hover { color: var(--link); }
.crumbs .icon { width: 13px; height: 13px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.has-toc .article-layout { grid-template-columns: minmax(0, 1fr) 220px; }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 40px 52px 32px; min-width: 0; }
.article-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.article-kicker { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.article-head h1 { text-wrap: balance;  font-size: clamp(28px, 3vw, 36px); font-weight: 750; letter-spacing: -.025em; line-height: 1.15; max-width: 26ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.article-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.article-meta .icon { width: 14px; height: 14px; }
.article-meta strong { color: var(--ink-2); font-weight: 600; }
.article-actions { display: flex; align-items: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; margin-left: -10px; }
.article-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 32px; }
.article-tags > .icon { width: 15px; height: 15px; color: var(--ink-3); }
.article-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.feedback { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.feedback-q { font-weight: 600; margin-right: 6px; }
.feedback-count { font-size: 13px; color: var(--ink-3); margin-left: 8px; }
.article-stamp { font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.related { margin-top: 32px; }
.related h2 { font-size: 16px; margin-bottom: 10px; }
.related .row-list { border-radius: var(--r-md); }
.toc { position: relative; }
.toc-inner { position: sticky; top: calc(var(--topbar-h) + 18px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; padding-top: 6px; }
.toc-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13.5px; color: var(--ink-3); line-height: 1.35; }
.toc li.lvl-3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.active { color: var(--brand-ink); border-left-color: var(--brand); font-weight: 600; }
.toc-top { margin-top: 16px; font-size: 13px; color: var(--ink-3); }

/* ---------- editor ---------- */
.editor-page { min-height: calc(100vh - var(--topbar-h)); background: var(--surface); }
.editor-bar {
  position: sticky; top: var(--topbar-h); z-index: 15; display: flex; align-items: center; gap: 10px;
  padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line);
}
.status-pill { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: var(--r-xs); background: var(--warning-soft); color: var(--warning); }
.status-pill.published { background: var(--success-soft); color: var(--success); }
.save-state { font-size: 13px; color: var(--ink-3); }
.save-state.warn, #saveMsg.warn { color: var(--warning); }
.editor-wrap { position: relative; max-width: 940px; margin: 0 auto; padding: 28px 28px 60px; }
.editor-page > .banner { max-width: 804px; margin: 16px auto 0; }
.title-input {
  width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; resize: none; overflow: hidden;
  font-family: var(--font-head); font-size: clamp(28px, 3vw, 36px); font-weight: 750; letter-spacing: -.025em; line-height: 1.2; padding: 0 !important; color: var(--ink);
}
.title-input::placeholder { color: var(--ink-3); opacity: .6; }
.editor-meta { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 16px 0 14px; }
.tag-input { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 36px; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); flex: 1; min-width: 220px; cursor: text; }
.tag-input > .icon { width: 15px; height: 15px; color: var(--ink-3); }
.tag-input input { border: 0 !important; box-shadow: none !important; min-height: 26px !important; padding: 0 2px !important; flex: 1; min-width: 80px; width: auto !important; background: transparent !important; }
#tagChips { display: contents; }
.tag-chip { padding-right: 2px; }
.tag-chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 3px; padding: 0; }
.tag-chip button:hover { background: var(--surface-3); color: var(--ink); }
.tag-chip .icon { width: 12px; height: 12px; }
.summary-box { margin-bottom: 8px; }
.toolbar {
  position: sticky; top: calc(var(--topbar-h) + 57px); z-index: 12; display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 5px; margin: 0 -6px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.tb-btn { display: inline-grid; place-items: center; height: 32px; min-width: 31px; padding: 0 5px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--ink-2); cursor: pointer; }
.tb-btn:hover { background: var(--surface-3); color: var(--ink); }
.tb-btn.on { background: var(--brand-soft); color: var(--brand-ink); }
.tb-btn:disabled { opacity: .35; cursor: default; }
.tb-btn .icon { width: 17px; height: 17px; }
.tb-text { display: inline-flex; gap: 5px; font-size: 13px; font-weight: 600; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.tb-block select { min-height: 32px !important; padding: 4px 28px 4px 10px !important; font-size: 13.5px; border-color: transparent !important; background-color: transparent; font-weight: 550; }
.tb-block select:hover { background-color: var(--surface-3); }
.table-tools { position: absolute; z-index: 11; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); }
.table-tools button { border: 0; background: none; padding: 4px 8px; font-size: 12.5px; border-radius: var(--r-xs); cursor: pointer; color: var(--ink-2); }
.table-tools button:hover { background: var(--surface-3); color: var(--ink); }
.table-tools .danger { color: var(--danger); }
.editor-body { min-height: 420px; padding: 26px 4px 40px; outline: none; }
.editor-body.drop { outline: 2px dashed var(--brand); outline-offset: 4px; border-radius: var(--r-sm); }
.editor-body:empty::before, .editor-body > p:only-child:has(br:only-child)::before, .paste-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; position: absolute; }
.editor-body > p:only-child:has(br:only-child)::before { content: "Start writing, paste from anywhere, or type ## for a heading, - for a list, > for a quote."; }
.source-body { width: 100%; min-height: 480px; margin-top: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.editor-foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-3); }
.editor-foot .hint { margin: 0; }

/* ---------- import ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab .icon { width: 16px; height: 16px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.import-grid:has(.import-side[hidden]) { grid-template-columns: 1fr; }
.import-side { position: sticky; top: calc(var(--topbar-h) + 14px); }
.import-side .panel-title { font-size: 15px; }
.notion-results { min-height: 120px; max-height: 460px; overflow-y: auto; margin: 0 calc(-1 * var(--pad)); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.notion-list { list-style: none; margin: 0; padding: 4px 0; }
.notion-item { display: flex; align-items: center; gap: 12px; padding: 9px var(--pad); cursor: pointer; }
.notion-item:hover { background: var(--surface-2); }
.notion-icon { width: 24px; text-align: center; font-size: 17px; display: grid; place-items: center; color: var(--ink-3); }
.notion-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notion-title { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notion-sub { font-size: 12.5px; color: var(--ink-3); }
.notion-results .load-more { margin: 8px auto; display: flex; }
.notion-results .empty { border: 0; }
.notion-actions { display: flex; align-items: center; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.notion-actions .check { margin: 0; }
.help { margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; font-size: 14px; color: var(--ink-2); }
.help summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--ink); }
.help summary .icon { width: 16px; height: 16px; color: var(--ink-3); }
.help ol { padding-left: 20px; margin: 0 0 10px; }
.help li { margin-bottom: 6px; }
.help p { margin-bottom: 14px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 48px 24px; border: 2px dashed var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone strong { color: var(--ink); font-size: 16px; }
.dropzone span { font-size: 13.5px; max-width: 52ch; }
.drop-ic { width: 30px !important; height: 30px !important; color: var(--brand); margin-bottom: 6px; }
.advanced { margin-bottom: 12px; font-size: 14px; }
.advanced summary { cursor: pointer; color: var(--link); font-weight: 550; margin-bottom: 10px; }
.paste-area { min-height: 260px; max-height: 560px; overflow-y: auto; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); outline: none; position: relative; font-size: 15px !important; }
.paste-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.queue { margin-top: 20px; }
.queue-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.queue-head .panel-title { margin: 0; }
.queue-list { list-style: none; margin: 0 calc(-1 * var(--pad)); padding: 0; border-top: 1px solid var(--line-soft); }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 8px var(--pad); border-bottom: 1px solid var(--line-soft); }
.queue-item:last-child { border-bottom: 0; }
.queue-ic { color: var(--ink-3); display: grid; }
.queue-item.error .queue-ic, .queue-item.error .queue-src { color: var(--danger); }
.queue-item.working .queue-ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.queue-title { flex: 1; min-height: 32px !important; padding: 4px 8px !important; border-color: transparent !important; font-weight: 580; }
.queue-title:hover, .queue-title:focus { border-color: var(--line) !important; }
.queue-title-text { flex: 1; font-weight: 580; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-src { font-size: 12.5px; color: var(--ink-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-list { list-style: none; margin: 0 0 8px; padding: 0; }
.result-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.result-list li > a:first-of-type { flex: 1; font-weight: 580; }
.result-list .ok { color: var(--success); }
.result-list .bad { color: var(--danger); }
.prose-ui h2 { font-size: 18px; margin-bottom: 8px; }
.prose-ui h3 { font-size: 15px; margin: 22px 0 10px; }
.prose-ui p { color: var(--ink-2); margin-bottom: 12px; max-width: 75ch; }
.prose-ui code { font-size: .88em; background: var(--surface-3); padding: 1px 5px; border-radius: var(--r-xs); }
.steps { padding-left: 20px; color: var(--ink-2); margin: 0 0 16px; }
.steps li { margin-bottom: 6px; }

/* ---------- admin ---------- */
.admin-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.admin-list > li { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px calc(16px + var(--depth, 0) * 32px); }
.admin-list > li + li { border-top: 1px solid var(--line-soft); }
.admin-list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-list-title { font-weight: 650; color: var(--ink); }
.admin-list-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.cat-preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface-2); border-radius: var(--r-md); }
.feature-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.feature-list, .pick-list { list-style: none; margin: 0; padding: 0; }
.feature-list li, .pick-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: 6px; background: var(--surface); }
.feature-list li.lead { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.feature-list li.dragging { opacity: .4; }
.feature-list li.drop-target { box-shadow: 0 -2px 0 var(--brand); }
.drag-handle { color: var(--ink-3); cursor: grab; display: grid; }
.feature-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feature-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-sub { font-size: 12.5px; color: var(--ink-3); }
.feature-empty { justify-content: center; color: var(--ink-3); font-size: 14px; border-style: dashed !important; }
.pick-list { max-height: 560px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.inactive td { opacity: .6; }
.person { display: flex; align-items: center; gap: 10px; line-height: 1.35; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 14px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 550; font-size: 14px; }
.settings-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.settings-nav .icon { width: 16px; height: 16px; color: var(--ink-3); }
.settings-form .panel { scroll-margin-top: calc(var(--topbar-h) + 14px); }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-preview { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--surface-2); color: var(--ink-3); overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-row small { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; }
.section-order { list-style: none; margin: 0; padding: 0; }
.section-order li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: 6px; }
.sec-title { max-width: 260px; min-height: 32px !important; padding: 4px 8px !important; }
.sec-kind { font-size: 12.5px; flex: 1; }
.save-bar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); z-index: 5; }
.activity-list { list-style: none; padding: 0 !important; }
.activity-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 14px; }
.activity-list li + li { border-top: 1px solid var(--line-soft); }
.activity-text { flex: 1; min-width: 0; color: var(--ink-2); }
.activity-text strong { color: var(--ink); }
.activity-list time { font-size: 12.5px; white-space: nowrap; }

/* ---------- auth ---------- */
body.bare #app { min-height: 100vh; }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--canvas);
  background-image: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 55%); }
.auth-panel { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-2); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-site { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.auth-tag { font-size: 13px; color: var(--ink-3); }
.auth-form h1 { font-size: 22px; margin-bottom: 18px; letter-spacing: -.01em; }
.auth-form > .muted-text { margin: -10px 0 18px; font-size: 14px; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- dialogs, popovers, palette, toasts ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: calc(100vw - 24px); }
dialog::backdrop { background: rgba(12, 18, 26, .48); backdrop-filter: blur(2px); }
.dialog-inner { width: 520px; max-width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.dialog-wide .dialog-inner { width: 860px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 22px; }
.dialog-head h2 { font-size: 18px; font-weight: 700; }
.dialog-body { padding: 4px 22px 18px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
dialog[open] .dialog-inner { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog[open] .dialog-inner { animation: none; } }

.popover { position: absolute; z-index: 60; min-width: 220px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.popover hr { border: 0; border-top: 1px solid var(--line-soft); margin: 5px 0; }
.popover-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-sm); font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none !important; }
.popover-item:hover, .popover-item:focus-visible { background: var(--surface-3); outline: none; }
.popover-item .icon { width: 16px; height: 16px; color: var(--ink-3); }
.popover-item.danger, .popover-item.danger .icon { color: var(--danger); }

.palette { width: 640px; margin-top: 12vh; }
.palette-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); border: 1px solid var(--line); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input > .icon { color: var(--ink-3); width: 20px; height: 20px; }
.palette-input input { border: 0 !important; box-shadow: none !important; height: 56px; font-size: 17px; padding: 0 !important; background: transparent !important; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { list-style: none; margin: 0; padding: 6px; max-height: min(460px, 56vh); overflow-y: auto; }
.palette-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; }
.palette-item.active { background: var(--brand-soft); }
.palette-ic { display: grid; place-items: center; width: 24px; height: 24px; color: var(--ink-3); }
.palette-item.active .palette-ic { color: var(--brand-ink); }
.palette-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); background: var(--surface-2); }
.palette-foot kbd { margin-right: 3px; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: #1A2230; color: #F2F5F8; font-size: 14px; box-shadow: var(--shadow-pop); pointer-events: auto; animation: toast-in .18s ease-out; max-width: min(560px, calc(100vw - 32px)); }
.toast .icon { width: 17px; height: 17px; color: #6FD3A4; }
.toast-error .icon { color: #FF9B8C; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .22s; }
.toast-action { border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: var(--r-xs); padding: 3px 8px; cursor: pointer; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* history dialog */
.history { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; min-height: 380px; }
.history-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 60vh; border-right: 1px solid var(--line-soft); padding-right: 10px; }
.history-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.history-list button:hover { background: var(--surface-2); }
.history-list button.active { background: var(--brand-soft); }
.history-when { font-weight: 600; font-size: 13.5px; }
.history-who, .history-note { font-size: 12.5px; color: var(--ink-3); }
.history-preview { min-width: 0; overflow-y: auto; max-height: 60vh; }
.history-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .has-toc .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(12, 18, 26, .4); }
  .mobile-only { display: inline-grid !important; }
  .topbar { padding: 0 16px; }
  .page { padding: 16px 16px 32px; }
  .import-grid, .feature-admin, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .import-side { position: static; }
  .editor-bar { padding: 10px 16px; }
  .editor-wrap { padding: 20px 16px 48px; }
  .article { padding: 28px 24px; }
}
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .featured { grid-template-columns: 1fr; }
  .feat-list { border-left: 0; border-top: 1px solid var(--line-soft); }
  .hero-inner { padding: 28px 22px 24px; }
  .hero-fibers { opacity: .5; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .search-trigger kbd, .hide-sm { display: none; }
  .search-trigger { max-width: none; }
  .article { padding: 22px 18px; border-radius: var(--r-md); }
  .history { grid-template-columns: 1fr; }
  .history-list { border-right: 0; max-height: 180px; }
  .queue-src { display: none; }
  .data-table th:nth-child(3), .data-table td:nth-child(3), .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
  .palette { margin-top: 4vh; }
  .toolbar { top: calc(var(--topbar-h) + 53px); }
}

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .site-foot, .article-actions, .article-foot .feedback, .related, .toc, .crumbs, #toasts { display: none !important; }
  .shell { display: block; }
  body, .article { background: #fff; color: #000; }
  .article { border: 0; padding: 0; }
  .page { padding: 0; max-width: none; }
}

/* =========================================================
   Help-center home page (no sidebar)
   ========================================================= */
.home-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.home-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-soft); }
.home-header-inner { max-width: 1120px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.home-brand { padding: 0; }
.home-brand .brand-name { font-size: 16.5px; -webkit-line-clamp: 1; }
.home-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.home-link { color: var(--ink-2); font-weight: 550; font-size: 14px; padding: 6px 8px; border-radius: var(--r-sm); }
.home-link:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--brand-soft); }
.home-shell main#view { flex: 1; }
.home-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1120px; width: 100%; margin: 0 auto; padding: 26px 24px 32px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-3); }

.hc-hero { position: relative; z-index: 5; background: var(--brand); color: var(--on-brand); }
.hc-fibers-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hc-hero .hero-fibers { width: 100%; right: 0; min-width: 0; opacity: .7; }
.hc-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 72px 24px 64px; text-align: center; }
.hc-hero h1 { color: inherit; font-size: clamp(30px, 4vw, 44px); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
.hc-sub { margin: 12px auto 0; font-size: 17px; opacity: .88; max-width: 54ch; }
.hc-search-wrap { position: relative; max-width: 640px; margin: 30px auto 0; text-align: left; }
.hc-search { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 8px 0 18px; background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(10, 20, 30, .22); }
.hc-search > .icon { width: 21px; height: 21px; color: var(--ink-3); }
.hc-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 17px; padding: 0 !important; min-height: 0 !important; }
.hc-search input::-webkit-search-cancel-button { display: none; }
.hc-search .btn-hero { height: 44px; padding: 0 20px; }
.hc-tags { justify-content: center; }
.hc-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); max-height: 440px; overflow-y: auto; }
.hc-suggest a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--ink); text-decoration: none !important; }
.hc-suggest li.active a, .hc-suggest a:hover { background: var(--brand-soft); }
.hc-sug-title { font-weight: 650; font-size: 15px; }
.hc-sug-snippet { grid-column: 1; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-sug-cat { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.hc-suggest mark { background: var(--accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
.hc-sug-empty { padding: 16px 12px; color: var(--ink-3); font-size: 14px; }
.hc-sug-all { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 4px; }
.hc-sug-all a { display: block; font-weight: 600; color: var(--link); font-size: 14px; }

.hc-body { max-width: 1120px; margin: 0 auto; padding: 48px 24px 56px; display: flex; flex-direction: column; gap: 52px; }
.hc-body > .draft-strip { margin: -20px 0 -20px; }
.hc-section h2 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.hc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hc-section > h2 { margin-bottom: 18px; }
.hc-featured { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hc-featured a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none !important; height: 100%; transition: border-color .15s, box-shadow .15s; }
.hc-featured a:hover { border-color: var(--brand-line); box-shadow: var(--shadow-2); }
.hc-featured a:hover .hc-feat-title { color: var(--link); }
.hc-doc { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.hc-doc .icon { width: 19px; height: 19px; }
.hc-feat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hc-feat-title { font-weight: 620; font-size: 15px; line-height: 1.35; }
.hc-feat-sub { font-size: 13px; color: var(--ink-3); }
.hc-chev { width: 16px !important; height: 16px !important; color: var(--ink-3); }
.hc-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hc-cat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, box-shadow .15s, transform .15s; }
.hc-cat:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: var(--shadow-2); }
.hc-cat-link { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px 24px 20px; color: var(--ink); text-decoration: none !important; flex: 1; }
.hc-cat-link .cat-icon { margin-bottom: 8px; }
.hc-cat-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.hc-cat-link:hover .hc-cat-name { color: var(--link); }
.hc-cat-desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.hc-cat-count { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--ink-3); font-weight: 550; }
.hc-cat-subs { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 24px 16px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.hc-cat-subs a { color: var(--ink-2); }
.hc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.hc-row:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.hc-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.hc-links a { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none !important; }
.hc-links a > .icon { width: 15px; height: 15px; color: var(--ink-3); }
.hc-links a:hover .hc-link-title { color: var(--link); }
.hc-link-title { flex: 1; min-width: 0; font-weight: 560; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-link-aside { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.hc-link-aside .icon { width: 14px; height: 14px; }
.hc-contact { text-align: center; padding: 44px 24px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.hc-contact h2 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.hc-contact p { color: var(--ink-2); margin: 8px auto 0; max-width: 56ch; }
.hc-contact-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
:root[data-hero="plain"] .hc-hero { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line-soft); }
:root[data-hero="plain"] .hc-hero .hero-fibers { color: var(--brand); }
:root[data-hero="plain"] .hc-search { border: 1px solid var(--line); box-shadow: var(--shadow-2); }
@media (max-width: 900px) { .hc-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hc-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .hc-cats, .hc-featured { grid-template-columns: minmax(0, 1fr); }
  .hc-hero-inner { padding: 44px 18px 40px; }
  .hc-search { height: 54px; }
  .hc-search .btn-hero { display: none; }
  .home-header-inner { padding: 0 16px; }
  .hc-body { padding: 32px 16px 40px; gap: 40px; }
  .hc-sug-cat { display: none; }
  .hc-cats { gap: 10px; }
  .hc-cat-link { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; }
  .hc-cat-link .cat-icon { grid-row: 1 / span 3; margin: 0; width: 42px; height: 42px; }
  .hc-cat-link .cat-icon .icon { width: 21px; height: 21px; }
  .hc-cat-count { padding-top: 2px; }
  .hc-cat-subs { padding: 10px 16px 12px 72px; }
}

.contact-links { list-style: none; margin: 0 0 8px; padding: 0; }
.contact-links li { display: grid; grid-template-columns: 120px 1fr 1.3fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 720px) { .contact-links li { grid-template-columns: 1fr auto; } }

.fav-btn.on { color: #C2364F; background: color-mix(in srgb, #C2364F 9%, var(--surface)); }
.fav-btn.on .icon { fill: currentColor; }
.email-hint { margin: 0; }

/* ---- help-center header merged into the banner ---- */
.home-header { background: var(--brand); color: var(--on-brand); border-bottom: 0; backdrop-filter: none; }
.home-header-inner { max-width: none; height: 72px; padding: 0 32px; }
.home-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; min-width: 0; }
.home-brand .brand-mark { background: var(--on-brand); color: var(--brand); width: 38px; height: 38px; }
.home-logo { display: inline-flex; align-items: center; height: 44px; flex: none; }
.home-logo img { height: 100%; max-width: 220px; object-fit: contain; display: block; }
.home-logo.plate { background: #fff; padding: 5px 10px; border-radius: var(--r-md); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.home-site { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-header .home-link { color: color-mix(in srgb, var(--on-brand) 85%, var(--brand)); }
.home-header .home-link:hover { color: var(--on-brand); background: color-mix(in srgb, var(--on-brand) 12%, transparent); }
.home-header .icon-btn { color: color-mix(in srgb, var(--on-brand) 85%, var(--brand)); }
.home-header .icon-btn:hover { background: color-mix(in srgb, var(--on-brand) 12%, transparent); color: var(--on-brand); }
.btn-on-brand { background: var(--on-brand); color: var(--brand); border-color: var(--on-brand); }
.btn-on-brand:hover { background: color-mix(in srgb, var(--on-brand) 88%, var(--brand)); border-color: transparent; }
.home-header .avatar { background: color-mix(in srgb, var(--on-brand) 18%, transparent); color: var(--on-brand); }
.home-header .avatar-btn:hover .avatar, .home-header .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--on-brand) 25%, transparent); }
.hc-hero-inner { padding-top: 48px; }
:root[data-hero="plain"] .home-header { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line-soft); }
:root[data-hero="plain"] .home-header .home-link, :root[data-hero="plain"] .home-header .icon-btn { color: var(--ink-2); }
:root[data-hero="plain"] .home-header .btn-on-brand { background: var(--brand); color: var(--on-brand); }
:root[data-hero="plain"] .home-header .avatar { background: var(--brand-soft); color: var(--brand-ink); }
:root[data-hero="plain"] .home-brand .brand-mark { background: var(--brand); color: var(--on-brand); }

/* ---- category picker inside the search box ---- */
.hc-search { padding-left: 6px; }
.hc-cat-select { position: relative; display: flex; align-items: center; flex: none; height: 46px; border-radius: var(--r-md); }
.hc-cat-select:hover, .hc-cat-select:focus-within { background: var(--surface-2); }
.hc-cat-select select { appearance: none; border: 0 !important; box-shadow: none !important; background: transparent !important; min-height: 0 !important; height: 100%; padding: 0 34px 0 14px !important; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; max-width: 210px; text-overflow: ellipsis; width: auto !important; }
.hc-cat-select > .icon { position: absolute; right: 10px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.hc-divider { width: 1px; height: 28px; background: var(--line); flex: none; margin-right: 4px; }
@media (max-width: 600px) {
  .home-header-inner { padding: 0 16px; height: 62px; }
  .home-logo { height: 36px; }
  .home-logo img { max-width: 140px; }
  .home-logo + .home-site { display: none; }
  .hc-cat-select select { max-width: 112px; font-size: 14px; padding: 0 28px 0 10px !important; }
  .hc-cat-select > .icon { right: 6px; }
}

/* ---- access restrictions & teams ---- */
.access-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--warning); background: var(--warning-soft); padding: 3px 9px; border-radius: var(--r-xs); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.access-pill .icon { width: 13px; height: 13px; flex: none; }
.access-pill.open { color: var(--ink-3); background: var(--surface-2); }
.access-field .field-label { display: inline-flex; align-items: center; gap: 6px; }
.access-field .field-label .icon { width: 15px; height: 15px; color: var(--ink-3); }
.access-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 14px; margin: 2px 0 6px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.access-col { min-width: 0; }
.access-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.small-link { font-size: 12px !important; }
.access-col .check { margin-bottom: 8px; font-size: 13.5px; }
.access-filter { min-height: 32px !important; padding: 5px 9px !important; font-size: 13px; margin-bottom: 8px; }
.access-people { max-height: 170px; overflow-y: auto; padding-right: 4px; }
.access-people.tall { max-height: 300px; }
.access-people .check small, .access-col .check small { display: block; }
.access-note { margin: 4px 0 6px; color: var(--warning); }
.muted-text.small { font-size: 13px; }
.teams-panel { margin-top: 20px; }
.teams-intro { font-size: 14px; margin: -6px 0 12px; }
.team-list { list-style: none; margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding: 0; border-top: 1px solid var(--line-soft); }
.team-list li { display: flex; align-items: center; gap: 14px; padding: 12px var(--pad); }
.team-list li + li { border-top: 1px solid var(--line-soft); }
.team-list .admin-list-sub .icon { width: 12px; height: 12px; vertical-align: -1px; }
.team-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.team-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.team-tags .tag { font-size: 11.5px; padding: 0 6px; }
.lock-mark { display: inline-flex; color: var(--ink-3); }
.lock-mark .icon { width: 13px; height: 13px; }
@media (max-width: 720px) { .access-box { grid-template-columns: 1fr; } }

/* ---- core values artwork in the banner ---- */
.home-values { flex: 0 1 auto; min-width: 0; }
.home-values picture { display: block; }
.values-img { display: block; height: 46px; width: auto; max-width: 100%; }
.values-img.custom { height: 52px; object-fit: contain; }
.home-site-mobile { display: none; }
.home-header:has(.home-values) .home-header-inner { height: auto; min-height: 76px; padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 1239px) { .values-img:not(.custom) { height: 68px; } }
@media (max-width: 760px) {
  .home-header:has(.home-values) .home-header-inner { flex-wrap: wrap; row-gap: 10px; }
  .home-values { order: 3; flex-basis: 100%; display: flex; justify-content: center; }
  .home-values .values-img:not(.custom) { height: auto; width: 100%; max-width: 400px; }
  .home-site-mobile { display: block; color: inherit; font-size: 16px; }
}

/* ---- logo (built-in Fibernetics logo has a light-text twin for dark backgrounds) ---- */
.logo-for-dark { display: none !important; }
:root[data-theme="dark"] .logo-for-light { display: none !important; }
:root[data-theme="dark"] .logo-for-dark { display: block !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-for-light { display: none !important; } :root:not([data-theme="light"]) .logo-for-dark { display: block !important; } }
:root[data-sidebar="dark"] .sidebar .logo-for-light, :root[data-sidebar="brand"] .sidebar .logo-for-light { display: none !important; }
:root[data-sidebar="dark"] .sidebar .logo-for-dark, :root[data-sidebar="brand"] .sidebar .logo-for-dark { display: block !important; }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 20px 14px; }
.brand-logo-wrap { display: block; }
.sidebar .brand.has-logo .brand-logo { height: 32px; width: auto; max-width: 200px; border-radius: 0; }
.brand.has-logo .brand-tag { font-size: 12.5px; font-weight: 600; }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.auth-logo img { height: 40px; width: auto; max-width: 260px; display: block; }
.foot-logo img { height: 22px; width: auto; display: block; }
.home-foot { align-items: center; }
.foot-logo { margin-right: auto; }

.values-row { margin-top: 10px; }
.values-preview { display: flex; align-items: center; height: 44px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-2); max-width: 100%; overflow: hidden; }
.values-preview img { height: 100%; width: auto; max-width: 100%; }
.logo-preview { width: auto; min-width: 56px; padding: 6px 10px; }
.logo-preview img { width: auto; max-width: 200px; }

/* =========================================================
   Home header (white, full-colour logo) and core values banner
   ========================================================= */
.home-header { background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--ink); border-bottom: 1px solid var(--line-soft); backdrop-filter: saturate(1.4) blur(10px); }
.home-header-inner { height: 72px; padding: 0 32px; }
.home-header .home-link { color: var(--ink-2); }
.home-header .home-link:hover { color: var(--ink); background: var(--surface-2); }
.home-header .icon-btn { color: var(--ink-2); }
.home-header .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.home-header .avatar { background: var(--brand-soft); color: var(--brand-ink); }
.home-header .avatar-btn:hover .avatar, .home-header .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--brand-soft); }
.home-header .brand-mark { background: var(--brand); color: var(--on-brand); }
.home-logo { height: 42px; }
.home-logo img { height: 100%; width: auto; max-width: 240px; }

.hc-hero-grid { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.hc-hero.with-art .hc-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 40px; padding: 0 24px; }
.hc-hero.with-art .hc-hero-inner { text-align: left; margin: 0; padding: 64px 0; max-width: 620px; }
.hc-hero.with-art .hc-sub { margin-left: 0; }
.hc-hero.with-art .hc-search-wrap { margin-left: 0; }
.hc-hero.with-art .hc-tags { justify-content: flex-start; }
.hc-values { margin: 0; padding: 28px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hc-values img { display: block; width: 100%; max-width: 520px; height: auto; }
.hc-values figcaption { order: -1; font-size: 13px; font-weight: 650; letter-spacing: .01em; opacity: .9; }
@media (max-width: 1020px) {
  .hc-hero.with-art .hc-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 20px; }
  .hc-hero.with-art .hc-hero-inner { text-align: center; margin: 0 auto; padding: 48px 0 8px; }
  .hc-hero.with-art .hc-sub, .hc-hero.with-art .hc-search-wrap { margin-left: auto; margin-right: auto; }
  .hc-hero.with-art .hc-tags { justify-content: center; }
  .hc-values { padding: 20px 0 32px; }
  .hc-values img { max-width: 420px; }
}
@media (max-width: 600px) { .home-logo { height: 34px; } .home-header-inner { padding: 0 16px; } }
.values-preview { height: 96px; background: var(--brand); border-style: solid; border-color: transparent; }

/* =========================================================
   Plain banner: logo inside the banner (top left), centered wide search
   ========================================================= */
.home-shell .hc-hero, :root[data-hero] .home-shell .hc-hero {
  background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line-soft);
}
.home-shell .hc-hero .home-header, :root[data-hero] .home-shell .home-header {
  position: relative; top: auto; background: transparent; border-bottom: 0; backdrop-filter: none; color: var(--ink);
}
.home-shell .hc-hero-grid { max-width: none; }
.home-shell .hc-hero-inner { max-width: 960px; margin: 0 auto; padding: 36px 24px 64px; text-align: center; }
.home-shell .hc-hero h1 { color: var(--ink); }
.home-shell .hc-sub { color: var(--ink-2); opacity: 1; }
.home-shell .hc-search-wrap { max-width: 860px; margin: 32px auto 0; }
.home-shell .hc-search {
  height: 66px; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(20, 30, 45, .10), 0 1px 3px rgba(20, 30, 45, .06);
}
.home-shell .hc-search:focus-within { border-color: var(--brand); box-shadow: 0 10px 30px rgba(20, 30, 45, .10), 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.home-shell .hc-search input { font-size: 18px; }
.home-shell .hc-search .btn-hero { height: 48px; padding: 0 26px; font-size: 15px; }
.home-shell .hc-cat-select { height: 50px; }
.home-shell .hc-tags span { color: var(--ink-3); opacity: 1; }
.home-shell .hc-tags a { color: var(--ink-2); border-color: var(--line); background: var(--surface-2); }
.home-shell .hc-tags a:hover { color: var(--brand-ink); border-color: var(--brand-line); background: var(--brand-soft); }
.home-shell .hc-body { padding-top: 44px; }
@media (max-width: 600px) {
  .home-shell .hc-hero-inner { padding: 24px 16px 40px; }
  .home-shell .hc-search { height: 58px; }
  .home-shell .hc-search input { font-size: 16px; }
}

/* ---- optional banner background image ---- */
:root .home-shell .hc-hero.has-bg, :root[data-hero] .home-shell .hc-hero.has-bg { position: relative; background: var(--surface) var(--banner-img) center / cover no-repeat; border-bottom: 0; }
.home-shell .hc-hero.has-bg::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.home-shell .hc-hero.has-bg > * { position: relative; z-index: 1; }
.home-shell .hc-hero.tint-light::before { background: linear-gradient(color-mix(in srgb, var(--surface) 55%, transparent), color-mix(in srgb, var(--surface) 72%, transparent)); }
.home-shell .hc-hero.tint-dark::before { background: linear-gradient(rgba(8, 16, 26, .42), rgba(8, 16, 26, .6)); }
.home-shell .hc-hero.tint-dark, .home-shell .hc-hero.tint-dark h1, .home-shell .hc-hero.tint-dark .hc-sub { color: #fff; }
.home-shell .hc-hero.tint-dark .hc-sub { opacity: .92; }
.home-shell .hc-hero.tint-dark .home-link, .home-shell .hc-hero.tint-dark .icon-btn { color: rgba(255, 255, 255, .9); }
.home-shell .hc-hero.tint-dark .home-link:hover, .home-shell .hc-hero.tint-dark .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.home-shell .hc-hero.tint-dark .avatar { background: rgba(255, 255, 255, .2); color: #fff; }
.home-shell .hc-hero.tint-dark .hc-tags span { color: rgba(255, 255, 255, .85); }
.home-shell .hc-hero.tint-dark .hc-tags a { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .12); }
.home-shell .hc-hero.tint-dark .hc-tags a:hover { background: rgba(255, 255, 255, .22); }
.home-shell .hc-hero.tint-dark .logo-for-light { display: none !important; }
.home-shell .hc-hero.tint-dark .logo-for-dark { display: block !important; }
.home-shell .hc-hero.tint-none h1, .home-shell .hc-hero.tint-none .hc-sub { text-shadow: 0 1px 2px color-mix(in srgb, var(--surface) 70%, transparent); }
.home-shell .hc-hero.has-bg .hc-search { border-color: transparent; box-shadow: 0 14px 40px rgba(10, 20, 30, .22); }
.home-shell .hc-hero.has-bg .hc-hero-inner { padding-bottom: 76px; }
/* settings preview */
.banner-preview { position: relative; width: 100%; max-width: 520px; aspect-ratio: 32 / 9; border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 13px; }
.banner-preview.filled { border-style: solid; border-color: var(--line); }
.banner-preview .safe-zone { position: absolute; left: 50%; top: 50%; width: 47%; height: 56%; transform: translate(-50%, -50%); border: 1.5px dashed rgba(255, 255, 255, .9); outline: 1.5px dashed rgba(0, 0, 0, .35); border-radius: 4px; }
.banner-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.size-guide { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.size-guide strong { color: var(--ink-2); }

/* ---- very light grey page background, white cards ---- */
.home-shell { background: var(--canvas); }
.home-shell .hc-hero, :root[data-hero] .home-shell .hc-hero { background: var(--canvas); }
.home-shell .hc-hero.has-bg, :root[data-hero] .home-shell .hc-hero.has-bg { background: var(--canvas) var(--banner-img) center / cover no-repeat; }
.hc-contact { background: var(--surface); }
.editor-page { background: var(--canvas); }
.editor-bar { background: var(--surface); }
.editor-page .editor-wrap { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); margin-top: 20px; margin-bottom: 40px; }

/* ---- full-width help band ---- */
.hc-contact.hc-contact-band { border-radius: 0; border: 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--surface); padding: 56px 24px; margin: 0; }
.hc-contact-inner { max-width: 1120px; margin: 0 auto; }
.home-shell .hc-body { padding-bottom: 56px; }
.home-foot { border-top: 0; }

/* ---- category view on the home page ---- */
.hc-cat-view-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hc-cat-view-text { flex: 1; min-width: 220px; }
.hc-cat-view-text h2 { font-size: 24px; }
.hc-cat-view-text p { color: var(--ink-2); margin-top: 4px; }
.hc-cat-view .list-count { margin: 0 0 10px; }
button.sub-cat { cursor: pointer; font: inherit; font-weight: 550; font-size: 14px; }
button.sub-cat:hover { border-color: var(--c); }
.home-shell .hc-cat-select select { max-width: 230px; }
