/* Snapshot of the LePress admin stylesheet (lepress/admin/assets/admin.css), copied so the license server stays standalone. */
/*
 * LePress admin — calm, low-glare, dense. Warm paper tones, one accent, 1px borders, no gradients.
 *
 * Class reference for module / extension screens (render them with LePress\Admin\AdminView::render):
 *   Page header   <div class="page-header"><div><h1>Title</h1><p class="muted">Intro</p></div>
 *                   <div class="page-header__actions"><a class="btn btn--primary">…</a></div></div>
 *   Buttons       .btn + .btn--primary | .btn--secondary | .btn--ghost | .btn--danger ; sizes .btn--sm, .btn--icon
 *                 .link-btn (.link-btn--danger, .link-btn--success) for inline text actions
 *   Cards         .card > .card__header (h2) + .card__body + .card__footer ; .narrow limits width
 *   Forms         .field > label + .input | .select | .textarea + .help + .field-error
 *                 .form-grid (2 columns; .field--full spans), .checkbox, .radio,
 *                 .switch > input[type=checkbox] + .switch__track ; .input--mono, .input--narrow
 *   Settings rows .setting-row > .setting-row__label (h2 + p.muted) + .setting-row__fields
 *   Tables        .table-wrap > table.table (th/td; .table__num, .table__actions, .table__check)
 *                 .row-actions under the title cell (revealed on hover)
 *   Badges        .badge + .badge--published | --draft | --pending | --scheduled | --private | --trash
 *   Tabs          nav.tabs > a.tabs__tab[aria-current=page] + span.tabs__count
 *   Toolbar       form.toolbar > .toolbar__search (span.input-icon + .input) + .select + .btn
 *   Empty state   .empty > .empty__icon + h2 + p.muted (or AdminView::empty())
 *   Alerts        .alert.alert--success|--error|--warning|--info > svg + p
 *   Layout        .split > .split__aside + .split__main ; .stack (vertical rhythm) ; .btn-row
 *   Utilities     .muted .small .sr-only
 * JS behaviours (admin.js): [data-confirm] on forms/buttons, [data-autosubmit] on selects,
 *   [data-copy="#id"], [data-media-field] image pickers, window.LP.media.open({...}), LP.toast(msg).
 */

/* ------------------------------------------------------------ colour schemes
 * The admin's look is set on <html> by admin/views/layout.php (see LePress\Admin\AdminLook):
 *   data-scheme  soft (default) | dim | dark | contrast | system (soft or dark, from the OS)
 *   data-accent  cobalt (default) | teal | violet | terracotta | forest | graphite
 *   data-motion  reduce (optional)
 * Never hard-code colours in admin CSS: use these tokens. Every text/background pair below is
 * checked for WCAG AA (High contrast: AAA) by tests/AdminLookTest.php, so keep new values in range.
 * --on-solid is the text colour on any solid accent/status fill; --control-line borders inputs (3:1).
 */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;
  --r-sm: 4px; --r: 6px; --r-lg: 8px;
  --sidebar-w: 232px;
  --topbar-h: 52px;

  /* Accent (resolved against the active scheme's --a-* values) and derived tokens. */
  --accent: var(--a-cobalt); --accent-hover: var(--a-cobalt-hover); --accent-soft: var(--a-cobalt-soft);
  --accent-text: var(--on-solid);
  --focus: var(--accent);
  --serp-bg: var(--surface); --serp-text: var(--text); --serp-muted: var(--text-2);
}
:root, .look-preview--soft {
  /* Soft: warm, low-glare paper (the default). */
  --bg: #f3f1ec; --surface: #faf9f6; --surface-2: #ebe8e1; --surface-3: #e2ded5;
  --sidebar: #efede7; --canvas: #fbfaf6;
  --line: #e0dcd3; --line-strong: #ccc7bb; --control-line: #8c867a;
  --text: #2b2925; --text-2: #4a463f; --muted: #686359; --placeholder: #8f8a7f;
  --on-solid: #fbfaf6; --knob: #faf9f6;
  --ok: #22734a; --ok-soft: #e2eae3; --warn: #8f5a0c; --warn-soft: #eee8dc; --bad: #bb3026; --bad-soft: #f3e3df;
  --a-cobalt: #2e61c5; --a-cobalt-hover: #2853a9; --a-cobalt-soft: #e4e8f1;
  --a-teal: #147174; --a-teal-hover: #0f5355; --a-teal-soft: #e1eae8;
  --a-violet: #774fbc; --a-violet-hover: #6640a8; --a-violet-soft: #ece6f0;
  --a-terracotta: #a74927; --a-terracotta-hover: #8a3d20; --a-terracotta-soft: #f1e6df;
  --a-forest: #2f7245; --a-forest-hover: #245936; --a-forest-soft: #e4eae3;
  --a-graphite: #5f6674; --a-graphite-hover: #4f5561; --a-graphite-soft: #e9e9e8;
  --highlight: #f2dc8f; --mark: #f5e9bf; --serp-link: #1a0dab;
  --shadow-rgb: 60 52 38; --overlay: rgba(43, 41, 37, .42);
  --av-fg: 35% 28%; --av-bg: 32% 86%;
  color-scheme: light;
  --pop-shadow: 0 1px 2px rgb(60 52 38 / .08), 0 8px 24px rgb(60 52 38 / .12);
}
:root[data-scheme="dim"], .look-preview--dim {
  /* Dim: a mid-dark grey, like a screen turned down. */
  --bg: #2a2c30; --surface: #313338; --surface-2: #383b40; --surface-3: #41444a;
  --sidebar: #26282c; --canvas: #303237;
  --line: #3f4247; --line-strong: #4f5259; --control-line: #7b7e86;
  --text: #dcd9d2; --text-2: #c2bfb8; --muted: #aba8a1; --placeholder: #868480;
  --on-solid: #1f2124; --knob: #e8e5df;
  --ok: #5cc08e; --ok-soft: #354141; --warn: #dda24a; --warn-soft: #423e3a; --bad: #df9d98; --bad-soft: #423e42;
  --a-cobalt: #96aedc; --a-cobalt-hover: #b1c2e5; --a-cobalt-soft: #3b3f48;
  --a-teal: #37bec3; --a-teal-hover: #50c9ce; --a-teal-soft: #324146;
  --a-violet: #b7a5d5; --a-violet-hover: #cabde0; --a-violet-soft: #3e3e48;
  --a-terracotta: #d8a18d; --a-terracotta-hover: #e1b7a7; --a-terracotta-soft: #423e40;
  --a-forest: #79bc8f; --a-forest-hover: #91c8a3; --a-forest-soft: #384141;
  --a-graphite: #a9aeb6; --a-graphite-hover: #bdc0c6; --a-graphite-soft: #3d3f45;
  --highlight: #6b5a26; --mark: #4e4630; --serp-link: #9fb9ec;
  --shadow-rgb: 0 0 0; --overlay: rgba(10, 11, 12, .55);
  --av-fg: 40% 82%; --av-bg: 18% 30%;
  color-scheme: dark;
  --pop-shadow: 0 1px 2px rgb(0 0 0 / .25), 0 8px 24px rgb(0 0 0 / .35);
}
:root[data-scheme="dark"], .look-preview--dark,
:root[data-scheme="system"][data-theme="dark"],
:root:not([data-scheme])[data-theme="dark"] {
  /* Dark: deep charcoal, never pure black. */
  --bg: #15161a; --surface: #1c1d22; --surface-2: #23252b; --surface-3: #2c2e35;
  --sidebar: #121317; --canvas: #1b1c21;
  --line: #2a2c33; --line-strong: #3a3d45; --control-line: #686b74;
  --text: #e6e4df; --text-2: #c4c2bc; --muted: #9a9892; --placeholder: #6f6e6a;
  --on-solid: #15161a; --knob: #d8d6d0;
  --ok: #40a472; --ok-soft: #202b2a; --warn: #c48525; --warn-soft: #2d2722; --bad: #d47972; --bad-soft: #2e262a;
  --a-cobalt: #7493d0; --a-cobalt-hover: #8ea7d9; --a-cobalt-soft: #252933;
  --a-teal: #2ea1a5; --a-teal-hover: #36bcc1; --a-teal-soft: #1e2a2f;
  --a-violet: #9f88c7; --a-violet-hover: #b2a0d2; --a-violet-soft: #292833;
  --a-terracotta: #cb7f63; --a-terracotta-hover: #d4957e; --a-terracotta-soft: #2e2728;
  --a-forest: #50a26c; --a-forest-hover: #64b27e; --a-forest-soft: #212a29;
  --a-graphite: #8d939e; --a-graphite-hover: #a0a5ae; --a-graphite-soft: #27292e;
  --highlight: #5c4b17; --mark: #3b3422; --serp-link: #8ab0f0;
  --shadow-rgb: 0 0 0; --overlay: rgba(0, 0, 0, .62);
  --av-fg: 45% 80%; --av-bg: 20% 22%;
  color-scheme: dark;
  --pop-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .5);
}
@media (prefers-color-scheme: dark) {
  :root[data-scheme="system"]:not([data-theme="light"]),
  :root:not([data-scheme]):not([data-theme="light"]) {
    /* Follow system, OS in dark mode: same values as Dark above. */
    --bg: #15161a; --surface: #1c1d22; --surface-2: #23252b; --surface-3: #2c2e35;
    --sidebar: #121317; --canvas: #1b1c21;
    --line: #2a2c33; --line-strong: #3a3d45; --control-line: #686b74;
    --text: #e6e4df; --text-2: #c4c2bc; --muted: #9a9892; --placeholder: #6f6e6a;
    --on-solid: #15161a; --knob: #d8d6d0;
    --ok: #40a472; --ok-soft: #202b2a; --warn: #c48525; --warn-soft: #2d2722; --bad: #d47972; --bad-soft: #2e262a;
    --a-cobalt: #7493d0; --a-cobalt-hover: #8ea7d9; --a-cobalt-soft: #252933;
    --a-teal: #2ea1a5; --a-teal-hover: #36bcc1; --a-teal-soft: #1e2a2f;
    --a-violet: #9f88c7; --a-violet-hover: #b2a0d2; --a-violet-soft: #292833;
    --a-terracotta: #cb7f63; --a-terracotta-hover: #d4957e; --a-terracotta-soft: #2e2728;
    --a-forest: #50a26c; --a-forest-hover: #64b27e; --a-forest-soft: #212a29;
    --a-graphite: #8d939e; --a-graphite-hover: #a0a5ae; --a-graphite-soft: #27292e;
    --highlight: #5c4b17; --mark: #3b3422; --serp-link: #8ab0f0;
    --shadow-rgb: 0 0 0; --overlay: rgba(0, 0, 0, .62);
    --av-fg: 45% 80%; --av-bg: 20% 22%;
    color-scheme: dark;
    --pop-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .5);
  }
}
:root[data-scheme="contrast"], .look-preview--contrast {
  /* High contrast: near-black on off-white, strong borders (AAA text). */
  --bg: #f7f7f4; --surface: #fcfcfa; --surface-2: #eeeeea; --surface-3: #e2e2dc;
  --sidebar: #f2f2ee; --canvas: #fcfcfa;
  --line: #8a8a84; --line-strong: #5c5c57; --control-line: #4a4a46;
  --text: #0d0d0c; --text-2: #1f1f1d; --muted: #3d3d39; --placeholder: #5c5c57;
  --on-solid: #fcfcfa; --knob: #fcfcfa;
  --ok: #185436; --ok-soft: #e3eae4; --warn: #694208; --warn-soft: #ece8df; --bad: #8a231c; --bad-soft: #efe4e2;
  --a-cobalt: #224690; --a-cobalt-hover: #1b3873; --a-cobalt-soft: #e4e8ee;
  --a-teal: #0f5255; --a-teal-hover: #0a3536; --a-teal-soft: #e2e9e8;
  --a-violet: #583790; --a-violet-hover: #482d76; --a-violet-soft: #eae6ee;
  --a-terracotta: #7a351d; --a-terracotta-hover: #5d2916; --a-terracotta-soft: #eee6e2;
  --a-forest: #225433; --a-forest-hover: #183b24; --a-forest-soft: #e4eae4;
  --a-graphite: #454a55; --a-graphite-hover: #353941; --a-graphite-soft: #e8e8e8;
  --highlight: #ffd75e; --mark: #fbe7a1; --serp-link: #1a0dab;
  --shadow-rgb: 0 0 0; --overlay: rgba(13, 13, 12, .55);
  --av-fg: 45% 18%; --av-bg: 30% 84%;
  color-scheme: light;
  --pop-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px rgb(0 0 0 / .18);
}
.look-preview { --accent: var(--a-cobalt); background: var(--bg); color: var(--text); }
:root[data-accent="teal"], :root[data-accent="teal"] .look-preview { --accent: var(--a-teal); --accent-hover: var(--a-teal-hover); --accent-soft: var(--a-teal-soft); }
:root[data-accent="violet"], :root[data-accent="violet"] .look-preview { --accent: var(--a-violet); --accent-hover: var(--a-violet-hover); --accent-soft: var(--a-violet-soft); }
:root[data-accent="terracotta"], :root[data-accent="terracotta"] .look-preview { --accent: var(--a-terracotta); --accent-hover: var(--a-terracotta-hover); --accent-soft: var(--a-terracotta-soft); }
:root[data-accent="forest"], :root[data-accent="forest"] .look-preview { --accent: var(--a-forest); --accent-hover: var(--a-forest-hover); --accent-soft: var(--a-forest-soft); }
:root[data-accent="graphite"], :root[data-accent="graphite"] .look-preview { --accent: var(--a-graphite); --accent-hover: var(--a-graphite-hover); --accent-soft: var(--a-graphite-soft); }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -.02em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: var(--r-sm); }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface); font-size: 11px; line-height: 1.6; text-align: center; color: var(--text-2); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

.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; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r); }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.indent { margin-left: 26px; }
.break { word-break: break-all; }
.link { color: var(--accent); cursor: pointer; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 0 10px 12px; }
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 6px; }
.sidebar .sidebar__close, .topbar .topbar__menu { display: none; }
.sidebar__footer { margin-top: auto; padding: 12px 8px 0; font-size: var(--fs-xs); color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; border-radius: 5px; background: var(--text); color: var(--bg); display: grid; place-items: center; font: 700 13px/1 var(--serif); }
.brand__text span { color: var(--muted); font-weight: 500; }
.brand--lg { font-size: 20px; }
.brand--lg .brand__mark { width: 30px; height: 30px; font-size: 17px; border-radius: 7px; }

.nav__heading { margin: 16px 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__link { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); color: var(--text-2); font-weight: 500; }
.nav__link .icon { color: var(--muted); flex: none; }
.nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__link.is-active { background: var(--surface-3); color: var(--text); }
.nav__link.is-active .icon { color: var(--text); }
.nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }

.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: 8px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(6px); }
.topbar__site { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; min-width: 0; }
.topbar__site:hover { text-decoration: none; }
.topbar__site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.topbar__view { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.topbar__site:hover .topbar__view { color: var(--accent); }
.topbar__spacer { flex: 1; }
.cmdk-trigger { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; min-width: 200px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.cmdk-trigger:hover { border-color: var(--line-strong); color: var(--text-2); }
.cmdk-trigger kbd { margin-left: auto; }
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; outline: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 39; }

.usermenu__trigger { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border-radius: var(--r); cursor: pointer; list-style: none; color: var(--text-2); }
.usermenu__trigger::-webkit-details-marker { display: none; }
.usermenu__trigger:hover { background: var(--surface-2); }
.usermenu__name { font-weight: 500; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { width: var(--size, 32px); height: var(--size, 32px); border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
img.avatar { width: auto; }
.avatar--initials { display: inline-grid; place-items: center; font-size: calc(var(--size, 32px) * .38); font-weight: 600; color: hsl(var(--hue) var(--av-fg)); background: hsl(var(--hue) var(--av-bg)); }

/* ---------------------------------------------------------------- dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 200px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--pop-shadow); }
.dropdown--right .dropdown__menu { left: auto; right: 0; }
.dropdown__menu a, .dropdown__menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 7px 9px; border: 0; background: none; border-radius: var(--r-sm); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dropdown__menu a:hover, .dropdown__menu button:hover, .dropdown__menu a:focus-visible, .dropdown__menu button:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
.dropdown__menu .icon { color: var(--muted); }
.dropdown__menu form { margin: 0; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.dropdown__header { display: flex; flex-direction: column; padding: 6px 9px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: var(--fs-sm); }

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r); font: 500 var(--fs-md)/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none; color: var(--text); background: none; transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-text); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--bad); color: var(--on-solid); }
.btn--danger:hover { filter: brightness(.93); }
.btn--sm { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
.btn--icon { width: 32px; padding: 0; }
.btn--block { width: 100%; height: 38px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-btn--danger, a.link-btn--danger { color: var(--bad); }
.link-btn--success { color: var(--ok); }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-weight: 550; font-size: var(--fs-sm); color: var(--text); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
legend.label { margin-bottom: 6px; }
.input, .select, .textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--control-line); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s; }
.textarea { resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-size: 5px 5px; background-repeat: no-repeat; background-position: right 15px center, right 10px center; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.input--sm, .select--sm { min-height: 28px; padding: 3px 8px; font-size: var(--fs-sm); }
.select--sm { padding-right: 26px; width: auto; }
.input--narrow { max-width: 140px; }
.input--mono { font-family: var(--mono); font-size: var(--fs-sm); }
.input--code { font: 600 22px/1 var(--mono); letter-spacing: .25em; text-align: center; max-width: 220px; }
.input--file { padding: 5px; }
.input-group { display: flex; gap: 6px; align-items: center; }
.input-group .input { flex: 1; }
.help { font-size: var(--fs-xs); color: var(--muted); }
.field-error { font-size: var(--fs-sm); color: var(--bad); font-weight: 500; }
.checkbox, .radio { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-md); cursor: pointer; }
.checkbox input, .radio input { margin: 3px 0 0; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.radio code { font-size: var(--fs-xs); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .field--full { grid-column: 1 / -1; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.counter { float: right; font-weight: 400; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.is-good { color: var(--ok); }
.counter.is-warn { color: var(--warn); }
.counter.is-bad { color: var(--bad); }
.hp { position: absolute; left: -9999px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-md); position: relative; }
.switch input { position: absolute; opacity: 0; width: 30px; height: 18px; margin: 0; cursor: pointer; }
.switch__track { width: 30px; height: 18px; border-radius: 9px; background: var(--control-line); position: relative; flex: none; transition: background .15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--knob); transition: transform .15s; box-shadow: 0 1px 1px rgb(var(--shadow-rgb) / .25); }
.switch input:checked + .switch__track::after { background: var(--on-solid); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(12px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--control-line); border-radius: var(--r); background: var(--surface); }

/* ------------------------------------------------------------ page header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header p { margin-top: 4px; max-width: 70ch; }
.page-header__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 2px !important; }
.crumbs a { color: var(--muted); }
.section-title { font-size: var(--fs-md); }

/* ------------------------------------------------------------------ alerts */
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r); background: var(--surface); }
.alert > .icon { margin-top: 1px; flex: none; }
.alert p, .alert > div { flex: 1; }
.alert--success { border-left-color: var(--ok); } .alert--success > .icon { color: var(--ok); }
.alert--error { border-left-color: var(--bad); background: var(--bad-soft); } .alert--error > .icon { color: var(--bad); }
.alert--warning { border-left-color: var(--warn); background: var(--warn-soft); } .alert--warning > .icon { color: var(--warn); }
.alert--info { border-left-color: var(--accent); } .alert--info > .icon { color: var(--accent); }
.alert + .alert, .alert + .card, .alert + form { margin-top: 12px; }
.alert__close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: var(--r-sm); }
.alert__close:hover { color: var(--text); background: var(--surface-2); }

/* -------------------------------------------------------------------- card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card + .card, .card + section, section + .card { margin-top: 16px; }
.card__header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card__header h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
.card__header h2 .icon { color: var(--muted); }
.card__header--form { gap: 16px; }
.card__link { margin-left: auto; font-size: var(--fs-sm); }
.card__body { padding: 16px; }
.card__footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card__footer--sticky { position: sticky; bottom: 0; z-index: 5; }
.narrow { max-width: 720px; }
.settings-stack { display: grid; gap: 16px; max-width: 860px; }
.settings-stack .card + .card { margin-top: 0; }

/* -------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs__tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tabs__tab:hover { color: var(--text); text-decoration: none; }
.tabs__tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.tabs__count { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs__count--alert { color: var(--accent); font-weight: 600; }

/* ----------------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .select { width: auto; }
.toolbar__search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar__search .input { padding-left: 32px; }
.input-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.toolbar__end { margin-left: auto; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.segmented__btn { display: grid; place-items: center; width: 32px; height: 30px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.segmented__btn + .segmented__btn { border-left: 1px solid var(--line-strong); }
.segmented__btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.bulkbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

/* ------------------------------------------------------------------- table */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; font-weight: 550; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr.is-pending { background: var(--warn-soft); }
.table--dense td { padding: 7px 12px; }
.table__check { width: 36px; padding-right: 0 !important; }
.table__check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 2px 0 0; }
.table__num { text-align: right; font-variant-numeric: tabular-nums; width: 70px; }
.table__date { white-space: nowrap; font-size: var(--fs-sm); width: 1%; }
.table__actions { text-align: right; white-space: nowrap; width: 1%; }
.entry-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.entry-title__link { font-weight: 550; color: var(--text); }
a.entry-title__link:hover { color: var(--accent); }
.entry-title__depth { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: var(--fs-sm); opacity: 0; transition: opacity .1s; }
tr:hover .row-actions, tr:focus-within .row-actions, .row-actions--visible { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.term-list { font-size: var(--fs-sm); color: var(--text-2); }
.comment-count { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.comment-count__pending { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 11px; line-height: 16px; text-align: center; }
.comment-author { display: flex; flex-direction: column; gap: 1px; min-width: 160px; }
.comment-body { margin: 4px 0; max-width: 72ch; color: var(--text); }
.comment-meta .badge { vertical-align: 1px; }
.reply-box { margin-top: 10px; display: grid; gap: 8px; max-width: 640px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.user-cell .row-actions { width: 100%; }
.user-cell--lg h1 { font-size: var(--fs-xl); }
.user-cell--lg > div { display: block; }

/* ------------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: var(--r-sm); font-size: 11px; font-weight: 550; color: var(--text-2); background: var(--surface-3); white-space: nowrap; }
.badge--published, .badge--approved { color: var(--ok); background: var(--ok-soft); }
.badge--draft { color: var(--text-2); background: var(--surface-3); }
.badge--pending { color: var(--warn); background: var(--warn-soft); }
.badge--scheduled { color: var(--accent); background: var(--accent-soft); }
.badge--private { color: var(--text-2); background: transparent; border: 1px solid var(--line-strong); }
.badge--trash, .badge--spam { color: var(--bad); background: var(--bad-soft); }

/* -------------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.pagination__info { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- empty */
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty h2 { margin: 10px 0 4px; font-size: var(--fs-lg); }
.empty p + p { margin-top: 14px; }
.empty__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.empty--sm { padding: 24px; }

/* --------------------------------------------------------------- dashboard */
.stats { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.stat { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stat__link { display: flex; gap: 12px; padding: 14px 16px; color: inherit; height: 100%; }
.stat__link:hover { background: var(--surface-2); text-decoration: none; }
.stat__icon { color: var(--muted); padding-top: 2px; }
.stat__body { display: flex; flex-direction: column; padding: 14px 16px 14px 0; }
.stat__link .stat__body { padding: 0; }
.stats--compact .stat__body { padding: 12px 16px; }
.stat__value { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-2); font-size: var(--fs-sm); }
.stat__sub { color: var(--accent); font-size: var(--fs-xs); margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-col { display: grid; gap: 16px; }
.dash-col .card + .card { margin-top: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__title { font-weight: 550; color: var(--text); }
a.list__title:hover { color: var(--accent); }
.list__meta { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.comment-mini__body { color: var(--text-2); font-size: var(--fs-sm); }
.card--feature .card__body { display: grid; gap: 10px; justify-items: start; }
.card--feature p { color: var(--text-2); }
.feature__icon { color: var(--text); }
.onboarding { margin-bottom: 20px; }
.onboarding .card__header h2 { margin-right: auto; }
.onboarding__progress { font-size: var(--fs-sm); }
.meter { width: 120px; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--surface-3); }
.meter::-webkit-progress-value { background: var(--ok); }
.meter::-moz-progress-bar { background: var(--ok); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.checklist__item { display: grid; grid-template-columns: 24px 1fr; gap: 4px 12px; padding: 14px 16px; border-right: 1px solid var(--line); align-content: start; }
.checklist__item:last-child { border-right: 0; }
.checklist__actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }
.checklist__mark { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.checklist__item.is-done .checklist__mark { background: var(--ok); border-color: var(--ok); color: var(--on-solid); }
.checklist__item.is-done strong { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.checklist__text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.checklist__text strong { font-size: var(--fs-md); font-weight: 550; }

/* ------------------------------------------------------------------- split */
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.split__aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.split__aside.card + .split__main { margin-top: 0; }
.split .card + section { margin-top: 0; }

/* ----------------------------------------------------------------- panels */
.panel { border-bottom: 1px solid var(--line); }
.panel.card { border: 1px solid var(--line); }
.panel.card + .panel.card { margin-top: 10px; }
.panel__title { display: flex; align-items: center; gap: 6px; padding: 12px 16px; font-weight: 550; cursor: pointer; list-style: none; user-select: none; }
.panel__title::-webkit-details-marker { display: none; }
.panel__title::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.panel[open] > .panel__title::after { transform: rotate(45deg); }
.panel__title:hover { background: var(--surface-2); }
.panel__body { padding: 2px 16px 16px; }
.panel__count { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.check-list { list-style: none; margin: 8px 0 12px; padding: 0; max-height: 220px; overflow: auto; display: grid; gap: 6px; }

/* ----------------------------------------------------------------- media */
.dropzone { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); padding: 16px; margin-bottom: 16px; color: var(--text-2); transition: border-color .12s, background .12s; }
.dropzone > p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dropzone > p .icon { color: var(--muted); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.uploads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.uploads:not(:empty) { margin-top: 12px; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.upload__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.upload progress::-webkit-progress-bar { background: var(--surface-3); }
.upload progress::-webkit-progress-value { background: var(--accent); }
.upload progress::-moz-progress-bar { background: var(--accent); }
.upload.is-error { color: var(--bad); }
.upload.is-done .upload__state { color: var(--ok); }

.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item__btn { display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.media-item__btn:hover { border-color: var(--line-strong); }
.media-item__btn.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.media-item__thumb { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.media-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-ext { font: 600 13px/1 var(--mono); color: var(--muted); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.media-item__meta { display: flex; flex-direction: column; padding: 8px 10px; gap: 1px; min-width: 0; }
.media-item__name { font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item__info { font-size: var(--fs-xs); }
.media-item__date { display: none; }
.media-item__warn { font-size: var(--fs-xs); color: var(--warn); }
.media-grid.is-list { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.media-grid.is-list .media-item__btn { flex-direction: row; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.media-grid.is-list .media-item:last-child .media-item__btn { border-bottom: 0; }
.media-grid.is-list .media-item__thumb { width: 48px; height: 48px; aspect-ratio: auto; flex: none; margin: 6px 0 6px 10px; border-radius: var(--r-sm); }
.media-grid.is-list .media-item__meta { flex-direction: row; align-items: center; gap: 16px; flex: 1; }
.media-grid.is-list .media-item__name { flex: 1; }
.media-grid.is-list .media-item__date { display: block; }

.media-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 20px; }
.media-detail__preview { background: var(--surface-2); border-radius: var(--r); display: grid; place-items: center; min-height: 260px; padding: 12px; }
.media-detail__preview img, .media-detail__preview video { max-height: 60vh; object-fit: contain; }
.media-detail__side { display: grid; gap: 14px; align-content: start; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: var(--fs-sm); }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; word-break: break-all; }

.media-field__row { display: flex; align-items: center; gap: 12px; }
.media-field__preview { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2) repeating-conic-gradient(var(--surface-3) 0 25%, transparent 0 50%) 0 0 / 12px 12px; display: grid; place-items: center; overflow: hidden; flex: none; }
.media-field__preview img { width: 100%; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------------ modal */
.modal { width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--pop-shadow); }
.modal--wide { width: min(980px, calc(100vw - 32px)); }
.modal--sm { width: min(480px, calc(100vw - 32px)); }
.modal::backdrop { background: var(--overlay); }
.modal[open] { display: flex; flex-direction: column; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.modal__title { font-size: var(--fs-md); }
.modal__body { padding: 16px; overflow: auto; min-height: 0; flex: 1; }
.modal__footer { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }

.picker__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.picker__bar .toolbar__search { max-width: none; }
.picker__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.picker__grid .media-item__meta { padding: 5px 8px; }
.picker__empty { padding: 40px; text-align: center; color: var(--muted); }

/* ----------------------------------------------------------------- themes */
.theme-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.theme-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.theme-card.is-active { border-color: var(--text); }
.theme-card__shot { aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.theme-card__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.theme-card__placeholder { display: grid; place-items: center; height: 100%; font: 600 54px/1 var(--serif); color: var(--line-strong); }
.theme-card__body { padding: 12px 14px; display: grid; gap: 4px; flex: 1; }
.theme-card__name { font-size: var(--fs-md); }
.theme-card__foot { padding: 0 14px 14px; }

/* ------------------------------------------------------------- settings */
.settings-form .card__body { padding: 0; }
.setting-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 20px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row__label h2 { font-size: var(--fs-md); margin-bottom: 4px; }
.sep-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.sep-picker__opt { position: relative; }
.sep-picker__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sep-picker__opt span { display: grid; place-items: center; width: 38px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r); font-size: var(--fs-lg); background: var(--surface); }
.sep-picker__opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sep-picker__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.segmented-radio { display: flex; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ migrate content */
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-cards--links { list-style: none; margin: 0; padding: 0; }
a.choice-card { color: inherit; text-decoration: none; }
a.choice-card:hover { border-color: var(--accent); }
a.choice-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-card[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.choice-cards legend { grid-column: 1 / -1; }
.choice-card { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); cursor: pointer; background: var(--surface); }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-card input { margin-top: 3px; accent-color: var(--accent); }
.choice-card__body { display: flex; flex-direction: column; gap: 2px; }
.log { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-sm); max-height: 260px; overflow: auto; }
.log-box summary { cursor: pointer; font-weight: 500; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------- profile & tokens */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.secret-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.secret { font-size: 16px; letter-spacing: .08em; padding: 6px 10px; }
.token-reveal .input-group { margin-top: 8px; max-width: 560px; }

/* ------------------------------------------------------------------- menus */
.menu-tree, .menu-tree ol { list-style: none; margin: 0; padding: 0; }
.menu-tree ol { margin-left: 28px; }
.menu-tree { display: grid; gap: 0; margin-top: 10px; }
.menu-item { margin-top: 6px; }
.menu-item__row { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.menu-item.is-dragging > .menu-item__row { opacity: .4; }
.menu-item.drop-before > .menu-item__row { box-shadow: 0 -2px 0 var(--accent); }
.menu-item.drop-after > .menu-item__row { box-shadow: 0 2px 0 var(--accent); }
.menu-item.drop-inside > .menu-item__row { box-shadow: inset 0 0 0 2px var(--accent); }
.menu-item__handle { cursor: grab; color: var(--muted); display: flex; padding: 2px; }
.menu-item__label { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item__kind { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.menu-item__tools { display: flex; gap: 2px; }
.menu-item__tools .btn--icon { width: 26px; height: 26px; }
.menu-item__edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); background: var(--surface-2); }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r); background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--pop-shadow); animation: toast-in .16s ease-out; }
.toast--error { background: var(--bad); color: var(--on-solid); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* -------------------------------------------------------- command palette */
.cmdk { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--pop-shadow); }
.cmdk::backdrop { background: var(--overlay); }
.cmdk__input-wrap { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk__input { flex: 1; height: 48px; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: var(--fs-lg); }
.cmdk__list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60vh); overflow: auto; }
.cmdk__group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cmdk__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); cursor: pointer; color: var(--text-2); }
.cmdk__item .icon { color: var(--muted); flex: none; }
.cmdk__item[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.cmdk__item[aria-selected="true"] .icon { color: var(--text); }
.cmdk__hint { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
.cmdk__empty { padding: 24px; text-align: center; color: var(--muted); }
.cmdk__foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* -------------------------------------------------------------------- auth */
.auth-page { background: var(--bg); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 20px; }
.auth__card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.auth__card .alert { margin-bottom: 16px; }
.auth__title { font-size: var(--fs-xl); margin-bottom: 18px; }
.auth__title + .muted { margin: -10px 0 16px; }
.auth__alt { margin-top: 16px; font-size: var(--fs-sm); text-align: center; }
.auth__back { font-size: var(--fs-sm); }
.auth__back a { color: var(--muted); }

/* ------------------------------------------------------------ misc parts */
.repeat { display: grid; gap: 6px; }
.repeat__row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; }
.switch--button { border: 0; background: none; padding: 4px; font: inherit; color: var(--text-2); }
.switch--button[aria-checked="true"] .switch__track { background: var(--accent); }
.switch--button[aria-checked="true"] .switch__track::after { transform: translateX(12px); }
.switch--button:focus-visible { outline: 2px solid var(--focus); border-radius: var(--r); }
.module-icon { width: 34px; height: 34px; border-radius: var(--r); flex: none; }
.widget .card__body > :first-child { margin-top: 0; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .hide-md { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; box-shadow: var(--pop-shadow); }
  .sidebar .sidebar__close, .topbar .topbar__menu { display: inline-flex; }
  .split { grid-template-columns: 1fr; }
  .split__aside { position: static; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; }
  .media-detail { grid-template-columns: 1fr; }
  .cmdk-trigger { min-width: 0; }
  .cmdk-trigger span { display: none; }
  .cmdk-trigger kbd { display: none; }
}
@media (max-width: 640px) {
  .main { padding: 16px 16px 48px; }
  .topbar { padding: 0 10px; gap: 4px; }
  .topbar__view, .usermenu__name, .topbar__site-name { display: none; }
  .hide-sm { display: none; }
  .form-grid, .choice-cards, .menu-item__edit { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; }
  h1 { font-size: var(--fs-xl); }
  .upload { grid-template-columns: 1fr auto; }
  .upload progress { grid-column: 1 / -1; grid-row: 2; }
  .checklist__item { border-right: 0; border-bottom: 1px solid var(--line); }
  .table td, .table th { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------- appearance picker (profile) */
.look-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.look-scheme { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; }
.look-scheme input { position: absolute; opacity: 0; pointer-events: none; }
.look-scheme:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.look-scheme:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.look-scheme__text { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 2px; }
.look-preview { position: relative; display: block; height: 64px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.look-preview i { position: absolute; inset: 0 auto 0 0; width: 24%; background: var(--sidebar); border-right: 1px solid var(--line); }
.look-preview b { position: absolute; left: 32%; right: 10%; top: 12px; bottom: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--text), var(--text)), linear-gradient(var(--muted), var(--muted)); background-size: 30% 4px, 70% 3px, 50% 3px; background-position: 8px 8px, 8px 19px, 8px 27px; background-repeat: no-repeat; }
.look-split { display: grid; grid-template-columns: 1fr 1fr; height: 64px; border-radius: var(--r); overflow: hidden; }
.look-split .look-preview { border-radius: 0; }
.look-split .look-preview + .look-preview { border-left: 0; }
.look-accents { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.look-accent { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: var(--fs-sm); }
.look-accent input { position: absolute; opacity: 0; pointer-events: none; }
.look-accent__dot { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(var(--shadow-rgb) / .15); }
.look-accent:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.look-accent:has(input:checked) .look-accent__dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.look-accent:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
