/* Fortress CMS — administration
   Swiss: soft gray ground, white modules, hairlines, one blue.

   Typography rule — the mono face is deliberately scarce:
     1. engraved titles and section eyebrows (page titles, nav headings, stat
        labels, table headers, alert titles, code-block titles);
     2. machine values (code, keys, model ids, slugs, recovery codes, timers,
        file glyphs);
     3. glyphs and marks.
   Everything that is prose, a form label, a link, a button, a tab, a chip or a
   navigation item uses the text face: monospace paragraphs are hard to read and
   must never carry body copy. */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f4f6f8;
    --surface-3: #eef1f5;
    --ink: #0b0d10;
    --ink-2: #454c58;
    --dim: #6e7683;
    /* Surfaces painted with --ink need their own text colour: without it,
       `color: var(--on-ink)` is invalid and inherits dark-on-dark. */
    --on-ink: #ffffff;
    --ink-hover: #1b2027;
    --line: #e3e6ea;
    --line-2: #cfd4db;
    --line-soft: #f0f2f5;
    --line-strong: #0b0d10;
    --accent: #0a66ff;
    --accent-dark: #0043c8;
    --accent-soft: #e9f0ff;
    --ok: #0f7a53;
    --warn: #9a5b00;
    --danger: #b42318;
    --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 2px;
    --sidebar-w: 244px;
    /* Height shared by the sidebar brand and the top bar: one continuous rule. */
    --header-h: 54px;
    --pad-x: clamp(16px, 2.4vw, 36px);
    color-scheme: light;
}

/* Same tints as the public site, so the back office matches the theme. */
body.tint-azure { --accent: #0a66ff; --accent-dark: #0043c8; --accent-soft: #e9f0ff; --accent-line: #bcd3ff; }
body.tint-ink { --accent: #0b0d10; --accent-dark: #000000; --accent-soft: #f1f2f4; --accent-line: #d5d8dd; }
body.tint-emerald { --accent: #00a06b; --accent-dark: #00714c; --accent-soft: #e4f7f0; --accent-line: #a9e5cf; }
body.tint-violet { --accent: #6a3cff; --accent-dark: #4720d6; --accent-soft: #efeaff; --accent-line: #cfc2ff; }

*, *::before, *::after { box-sizing: border-box; }

/* The [hidden] attribute must always win over display rules. */
[hidden] { display: none !important; }

/* ------------------------------------------------------------ scrollbars */

html { scrollbar-width: thin; scrollbar-color: #c6ccd5 transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #ccd2db;
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #a9b1bd; background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img, svg, video { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -.025em;
    line-height: 1.16;
    margin: 0 0 .5em;
}
h1 { font-size: 1.26rem; }
h2 { font-size: 1.04rem; }
h3 { font-size: .95rem; }
h4 { font-size: .88rem; }
p { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }
strong, b { color: var(--ink); font-weight: 600; }

.small, small { font-size: .8rem; }
.muted { color: var(--dim); }
.nowrap { white-space: nowrap; }
.hint { color: var(--dim); font-size: .78rem; line-height: 1.5; margin: .2rem 0 0; }
.hint.is-error { color: var(--danger); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--ink); color: #fff; padding: .6rem 1rem;
    font-size: .8rem;
}
.skip-link:focus { left: 0; color: #fff; }
.eyebrow {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 .6rem;
}
.link-small { font-size: .78rem; color: var(--accent); }
.small-code, .small-value, .code-inline {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: .1em .35em;
}

/* -------------------------------------------------------------- buttons */

.btn {
    --btn-bg: #fff;
    --btn-fg: var(--ink);
    --btn-bd: #cfd4db;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem .9rem;
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--sans);
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.15;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { color: var(--btn-fg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); font-weight: 600; }
.btn-primary:hover { --btn-bg: #1b2027; --btn-bd: #1b2027; color: #fff; }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); font-weight: 600; }
.btn-accent:hover { --btn-bg: var(--accent-dark); --btn-bd: var(--accent-dark); color: #fff; }
.btn-secondary { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #cfd4db; }
.btn-secondary:hover { --btn-bd: var(--ink); color: var(--ink); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: transparent; }
.btn-ghost:hover { --btn-bd: var(--line); --btn-fg: var(--ink); background: #fff; }
.btn-danger { --btn-bg: var(--ink); --btn-fg: var(--on-ink); --btn-bd: var(--ink); }
.btn-danger:hover { --btn-bg: var(--ink-hover); --btn-fg: var(--on-ink); --btn-bd: var(--ink-hover); }
.btn-sm { padding: .34rem .62rem; font-size: .76rem; }
.btn-lg { padding: .78rem 1.3rem; font-size: .92rem; }
.btn-block { display: flex; width: 100%; }

/* --------------------------------------------------------------- badges */

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .15rem .45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: .66rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dim);
    white-space: nowrap;
}
.badge-success { border-color: #bfe3d2; background: #eef8f3; color: var(--ok); }
.badge-warning { border-color: #f0dcbd; background: #fdf6ec; color: var(--warn); }
.badge-error { border-color: #f0c4c0; background: #fdf3f2; color: var(--danger); }
.badge-ai { border-color: #c9defa; background: var(--accent-soft); color: var(--accent-dark); }
.badge-lang { color: var(--dim); }

.status-pill {
    display: inline-flex; align-items: center;
    font-family: var(--mono); font-size: .64rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--dim); white-space: nowrap;
}
.status-pill.is-ready { color: var(--ok); }
.status-pill.is-warn { color: var(--warn); }
.status-dot { width: 6px; height: 6px; background: currentColor; display: inline-block; margin-right: .4rem; flex: none; }
.dot { width: 5px; height: 5px; background: var(--accent); display: inline-block; }
.avatar {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); border: 1px solid #c9defa;
    border-radius: 50%;
    font-family: var(--mono); font-size: .7rem; color: var(--accent-dark);
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- shell */

.admin-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ------------------------------------------------------------- panel demo
   A public, read-only instance of this panel. The bar sits above the shell and
   the sidebar/topbar stick below it; forms that would write are visibly
   disabled, because a POST to the demo is refused with 405. */
.demo-bar {
    position: sticky; top: 0; z-index: 45;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 44px;
    padding: .5rem max(1rem, var(--pad-x));
    background: var(--ink);
    color: var(--on-ink);
    font-size: .82rem;
    flex-wrap: wrap;
}
.demo-bar-text { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.demo-bar-text strong {
    font-family: var(--mono); font-size: .64rem; font-weight: 400;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--on-ink);
    border: 1px solid color-mix(in srgb, var(--on-ink) 32%, transparent);
    padding: .12rem .38rem; border-radius: 2px;
}
.demo-bar-text span { color: color-mix(in srgb, var(--on-ink) 72%, transparent); }
.demo-bar-link { color: var(--on-ink); font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; white-space: nowrap; }
.demo-bar-link:hover { color: var(--on-ink); text-decoration: underline; text-underline-offset: .2em; }
/* Shown only when a visitor tries to save something in the demo. */
.demo-bar-refusal {
    margin: 0 0 0 auto;
    font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
    padding: .16rem .5rem; border-radius: 2px;
    border: 1px solid color-mix(in srgb, var(--on-ink) 42%, transparent);
    color: var(--on-ink);
}
.demo-bar-refusal[hidden] { display: none; }

.demo-admin { --demo-bar: 44px; }
.demo-admin .admin-shell { min-height: calc(100vh - var(--demo-bar)); }
.demo-admin .admin-sidebar { top: var(--demo-bar); height: calc(100vh - var(--demo-bar)); }
.demo-admin .admin-topbar { top: var(--demo-bar); }
/* The panel demo is read-only: the server refuses every POST and admin.js shows
   a notice. Controls stay legible and clickable — dimming a whole form reads as
   broken, and `pointer-events: none` would be inherited by every child button. */
.demo-admin form[method="post"] button[type="submit"]:not(:disabled),
.demo-admin form[method="post"] input[type="submit"]:not(:disabled) { opacity: .82; }

.admin-sidebar {
    position: sticky; top: 0;
    height: 100vh;
    display: flex; flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--line);
    z-index: 30;
}
.admin-brand {
    display: flex; align-items: center; gap: .6rem;
    /* Same height as the top bar, border included: the two hairlines meet in a
       single line across the whole panel instead of stopping 2 px apart. */
    height: var(--header-h);
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.admin-brand:hover { color: var(--ink); }
.admin-brand .brand-mark svg { width: 20px; height: 20px; }
.admin-brand .brand-text { font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: -.02em; }

.admin-nav { flex: 1; overflow-y: auto; padding: .4rem 0 1rem; }
.admin-nav-heading {
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dim);
    padding: .9rem 1.1rem .35rem;
    margin: 0;
    font-weight: 400;
}
.admin-nav-link {
    display: flex; align-items: center; gap: .55rem;
    padding: .42rem 1.1rem;
    font-size: .845rem;
    color: var(--ink-2);
    border-left: 2px solid transparent;
}
.admin-nav-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-left-color: var(--accent);
    font-weight: 500;
}
.admin-nav-icon {
    width: 1rem; flex: none;
    font-family: var(--mono); font-size: .8rem;
    color: var(--dim); text-align: center;
}
.admin-nav-link.is-active .admin-nav-icon { color: var(--accent); }
.admin-nav-plugin { display: block; font-size: .72rem; color: var(--dim); }

.admin-sidebar-footer {
    border-top: 1px solid var(--line);
    padding: .5rem 0 .7rem;
}
.admin-sidebar-footer .admin-nav-link { border-left-width: 2px; }

.admin-main-wrap { display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .9rem;
    height: var(--header-h);
    padding: 0 var(--pad-x);
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid var(--line);
}
.admin-page-title {
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0;
}
.admin-topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.admin-user { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--ink-2); }
.admin-user-name { font-size: .82rem; }
.admin-logout { border: 0; background: none; color: var(--dim); cursor: pointer; padding: .3rem; font-size: .95rem; line-height: 1; }
.admin-logout:hover { color: var(--ink); }
.admin-menu-btn {
    display: none;
    border: 0; background: none;
    color: var(--ink); padding: .35rem .3rem; cursor: pointer;
}

.admin-content { padding: clamp(18px, 2.4vw, 32px) var(--pad-x) 48px; width: 100%; max-width: 1240px; margin: 0 auto; }

.admin-footer {
    margin-top: auto;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem;
    padding: .8rem var(--pad-x);
    border-top: 1px solid var(--line);
    font-size: .64rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dim);
}

/* ------------------------------------------------------------ page head */

.page-head {
    display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
    gap: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 1.5rem;
}
.page-head h2 { margin: 0 0 .25rem; font-size: clamp(1.12rem, 1.8vw, 1.42rem); letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--dim); }
.page-head .eyebrow { margin-bottom: .55rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.page-hero {
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 1.2rem;
}
.page-hero h2 { margin-bottom: .3rem; }
.page-hero p { color: var(--dim); margin: 0; }

/* ---------------------------------------------------------------- cards */

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.2rem;
    margin-bottom: 1rem;
    min-width: 0;
}
.card-flush { padding: 0; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-bottom: .7rem;
    margin-bottom: .9rem;
    border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: .95rem; }
.card-head-pad { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); margin: -.1rem 0 1rem; }
.card-title { font-size: .95rem; margin: 0 0 .7rem; }
.card-body { padding: .9rem 1.2rem 1.1rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.card-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid > .card { border: 0; border-radius: 0; margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }

/* ---------------------------------------------------------------- stats */

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
    background: #fff;
    padding: .95rem 1rem;
    display: grid; gap: .3rem;
    color: var(--ink);
    border-top: 2px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}
a.stat-card:hover { background: #fbfcfd; border-top-color: var(--accent); color: var(--ink); }
.stat-label {
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--dim);
}
.stat-value {
    font-family: var(--display);
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    font-weight: 500;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.stat-key { font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.stat-inline {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    margin-top: .9rem;
}
.stat-inline > div { background: #fff; padding: .7rem .85rem; display: grid; gap: .18rem; }
.stat-inline .stat-value { font-size: 1.1rem; letter-spacing: -.02em; }
.stat-inline .stat-value.small { font-family: var(--sans); font-size: .76rem; letter-spacing: 0; }
.stat-inline .stat-label { font-size: .62rem; letter-spacing: .08em; }

/* Module ledger (dashboard) */
.module-list { list-style: none; margin: 0; padding: 0; }
.module-list li {
    display: grid;
    grid-template-columns: 180px 138px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .9rem;
    padding: .75rem 1.2rem;
    border-bottom: 1px solid var(--line-soft);
}
.module-list li:last-child { border-bottom: 0; }
.module-list li:hover { background: #fbfcfd; }
.module-name { font-size: .88rem; font-weight: 500; color: var(--ink); }
.module-meta { font-size: .79rem; color: var(--dim); min-width: 0; }
.module-facts { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .74rem; color: var(--dim); }
.module-facts b { color: var(--ink); font-weight: 500; }
.module-facts a { color: var(--accent); }

/* ---------------------------------------------------------------- lists */

.simple-list { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .5rem; }
.simple-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; }
.simple-list li > strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.simple-list li > a { margin-left: auto; font-size: .8rem; }

/* Plugin ledger on the dashboard: status, name, version. Three fixed columns so
   the names line up whatever the badge says, and the version stays right. */
.plugin-status { list-style: none; margin: 0; padding: .75rem 1.2rem .95rem; display: grid; gap: 0; }
.plugin-status li {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .6rem;
    padding: .32rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .84rem;
}
.plugin-status li:last-child { border-bottom: 0; }
.plugin-status .badge { justify-self: start; }
.plugin-status .plugin-name { display: flex; align-items: center; gap: .4rem; min-width: 0; font-weight: 500; color: var(--ink); }
.plugin-status .plugin-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plugin-status .plugin-version { color: var(--dim); font-size: .76rem; font-variant-numeric: tabular-nums; }

.queue-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.queue-list li {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .5rem .65rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: .84rem;
}
.queue-list li:last-child { border-bottom: 0; }

.mode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mode-list li { background: #fff; padding: .7rem .8rem; font-size: .84rem; }
.mode-list li.is-active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); font-size: .83rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: .55rem; flex: none; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checklist li { display: flex; align-items: center; gap: .6rem; background: #fff; padding: .6rem .75rem; font-size: .84rem; }
.checklist-body { display: grid; gap: .05rem; min-width: 0; }
.checklist-mark {
    width: 18px; height: 18px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #cfd4db; border-radius: 50%;
    font-family: var(--mono); font-size: .66rem; color: var(--dim);
}
.checklist li.is-ok .checklist-mark { border-color: #bfe3d2; background: #eef8f3; color: var(--ok); }
.checklist li.is-todo .checklist-mark { border-color: #f0dcbd; background: #fdf6ec; color: var(--warn); }

.details-list { margin: 0; display: grid; gap: .05rem; }
.details-list > div {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .84rem;
}
.details-list dt { color: var(--dim); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.details-list dd { margin: 0; color: var(--ink); }

/* ---------------------------------------------------------------- forms */

.form, .settings-form { display: grid; gap: .95rem; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field-group { display: grid; gap: .95rem; }
.field-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
label, .label {
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-2);
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="search"], input[type="datetime-local"], input[type="date"],
input[type="tel"], select, textarea {
    width: 100%;
    padding: .52rem .62rem;
    background: #fff;
    border: 1px solid #cfd4db;
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--sans);
    font-size: .88rem;
    line-height: 1.45;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #9aa1ac; }
input:hover, select:hover, textarea:hover { border-color: #b6bcc5; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 102, 255, .18);
}
textarea { min-height: 6.5rem; resize: vertical; font-family: var(--sans); font-size: .9rem; line-height: 1.7; }
.editor-textarea { min-height: 25rem; font-size: .95rem; line-height: 1.75; }
select {
    appearance: none;
    padding-right: 1.8rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
    background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); cursor: pointer; }
/* A checkbox row is a two-column grid: the box owns the first column, the
   label the second, so a wrapped label keeps its text block aligned with the
   box instead of drifting under it. */
.check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0 .5rem;
    padding: .22rem 0;
    cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] { margin-top: 2px; }
.check.is-muted { opacity: .45; }
.check span { font-family: var(--sans); font-size: .84rem; line-height: 1.45; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.check span .muted { font-size: .76rem; }
.check:hover span { color: var(--ink); }
.check:has(input:disabled) { cursor: default; }
.check:has(input:disabled):hover span { color: var(--ink-2); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .05rem 1.1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding-top: .25rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.inline-form select, .inline-form input { width: auto; min-width: 8rem; }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.filters-actions { display: flex; gap: .45rem; align-items: end; margin-left: auto; }
.input-with-action { display: flex; }
.input-with-action input { border-right: 0; }
.input-action {
    border: 1px solid #cfd4db; background: var(--surface-2); color: var(--ink-2);
    padding: 0 .7rem; font-size: .72rem; letter-spacing: .01em;
    text-transform: none; cursor: pointer;
}
.input-action:hover { color: var(--ink); border-color: var(--ink); }
.strength { display: block; height: 3px; background: var(--surface-3); margin-top: .35rem; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s ease, background .2s ease; }
.code-block { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin: 0 0 .9rem; }
.code-block pre, pre.code-block { margin: 0; padding: .8rem; overflow-x: auto; font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--ink-2); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .45rem .65rem; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.code-title { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--ink-2); }
.copy-row { display: flex; gap: .45rem; align-items: center; }
.copy-source { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table-wrap-flush { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--dim);
    font-weight: 400;
    padding: .55rem .75rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: .65rem .75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfd; }
.table-sub { display: block; color: var(--dim); font-size: .72rem; margin-top: .1rem; }
.table-title { color: var(--ink); font-weight: 500; }
.td-actions, .th-actions { text-align: right; white-space: nowrap; }
.td-actions .btn { margin-left: .2rem; }
/* Row actions are icons, not words: the column stays narrow and scannable.
   The accessible name comes from aria-label, the mouse hint from title. */
.td-actions .icon-btn { margin-left: .2rem; vertical-align: middle; }
.td-actions form { display: inline-block; margin: 0; }
/* A language badge carries a dot: solid when the translation has text, hollow
   when the row exists but says nothing. */
.badge-lang { gap: .32rem; }
.badge-lang::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    border: 1px solid currentColor;
    flex: none;
}
.badge-lang.is-filled { border-color: var(--line-2); color: var(--ink); }
.badge-lang.is-filled::before { background: var(--ink); border-color: var(--ink); }
.badge-lang.is-empty { border-style: dashed; color: var(--dim); }
.badge-lang.is-empty::before { background: transparent; border-color: var(--line-2); }
.compact .table td, .compact .table th { padding: .45rem .55rem; }

/* ---------------------------------------------------------------- alerts
   Sober: hairlines and ink only, never a coloured bubble. */

.alert {
    position: relative;
    border: 1px solid var(--line);
    border-left: 2px solid var(--ink);
    border-radius: var(--radius);
    background: #fff;
    padding: 1rem 1.1rem;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--ink-2);
    margin: 0 0 1.5rem;
}
.alert:last-child { margin-bottom: 0; }
.alert > strong:first-child,
.alert > .alert-label {
    display: block;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: .4rem;
    font-weight: 500;
}
.alert-info, .alert-success, .alert-warning, .alert-error, .alert-danger {
    border-left-color: var(--ink);
    background: #fff;
}
.alert strong { display: block; margin-bottom: .3rem; color: var(--ink); }
.alert-list { margin: .3rem 0 0; padding-left: 1.1rem; }
.alert-list li { margin-bottom: .2rem; }
.alert code { font-family: var(--mono); font-size: .82em; background: var(--surface-2); padding: .08em .35em; border-radius: 2px; color: var(--ink); }

/* Tables and panels get their own designed scrollbars too. */
.table-wrap, .editor-side, .tab-panel, .admin-nav, .day-list, .provider-grid {
    scrollbar-width: thin;
    scrollbar-color: #ccd2db transparent;
}
.table-wrap::-webkit-scrollbar, .admin-nav::-webkit-scrollbar,
.editor-side::-webkit-scrollbar, .provider-grid::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb, .admin-nav::-webkit-scrollbar-thumb,
.editor-side::-webkit-scrollbar-thumb, .provider-grid::-webkit-scrollbar-thumb {
    background: #ccd2db; border: 3px solid transparent; background-clip: padding-box; border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb:hover, .admin-nav::-webkit-scrollbar-thumb:hover,
.editor-side::-webkit-scrollbar-thumb:hover, .provider-grid::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }

/* -------------------------------------------------------------- AI panel */

.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.provider-card { background: #fff; padding: .95rem; display: grid; gap: .5rem; }
.provider-card.is-configured { box-shadow: inset 3px 0 0 var(--accent); }
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.provider-name { font-family: var(--display); font-size: .92rem; font-weight: 600; color: var(--ink); }
.provider-model { font-family: var(--mono); font-size: .68rem; color: var(--dim); }
.provider-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.provider-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .8rem; }
.provider-chip, .chip {
    display: inline-flex; align-items: center;
    padding: .22rem .5rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff;
    font-size: .72rem; font-weight: 500; letter-spacing: .01em;
    color: var(--ink-2);
}
.provider-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .9rem; }

.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.1rem; align-items: start; }
.ai-side { display: grid; gap: .9rem; position: sticky; top: calc(var(--header-h) + 16px); }
.ai-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.ai-result { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.2rem; margin-bottom: 1rem; }
.ai-result[hidden] { display: none; }
.ai-disclaimer { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; font-size: .76rem; color: var(--dim); }
.ai-editor-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0; }
.title-suggestions { list-style: none; margin: .55rem 0 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.title-suggestions li { background: #fff; padding: .45rem .55rem; font-size: .82rem; }
.title-suggestions button { background: none; border: 0; color: var(--ink-2); text-align: left; cursor: pointer; font: inherit; padding: 0; width: 100%; }
.title-suggestions button:hover { color: var(--accent); }

/* --------------------------------------------------------------- editor */

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.1rem; align-items: start; }
.editor-main { min-width: 0; }
.editor-side { display: grid; gap: .9rem; position: sticky; top: calc(var(--header-h) + 16px); }

/* Language selector: code, native name, and the state of the translation.
   The state is the point — a language can exist and say nothing. */
.locale-bar { display: grid; gap: .4rem; margin-bottom: .9rem; }
.locale-tabs {
    display: flex; flex-wrap: wrap; gap: .35rem;
    background: none; border: 0; border-radius: 0; overflow: visible;
}
.locale-tab {
    display: inline-flex; align-items: center;
    gap: .4rem;
    padding: .42rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--dim);
    font-size: .78rem; letter-spacing: .01em;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.locale-tab:hover { border-color: var(--ink-2); background: var(--surface); }
.locale-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.locale-tab.is-active {
    background: var(--surface);
    border-color: var(--ink);
    color: var(--ink);
    font-weight: 500;
}
.locale-tab-code {
    font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
    color: var(--dim);
}
.locale-tab.is-active .locale-tab-code { color: var(--ink); }
.locale-tab-name { color: inherit; }
.locale-tab-default {
    font-family: var(--mono); font-size: .58rem; letter-spacing: .1em;
    text-transform: uppercase; color: var(--dim);
    border: 1px solid var(--line-2); border-radius: 2px; padding: 0 .22rem;
}
/* Filled = solid ink disc · partial = half disc · empty = hollow ring. */
.locale-state {
    width: 8px; height: 8px; border-radius: 50%;
    border: 1px solid var(--ink-2);
    background: transparent;
    flex: none;
}
.locale-filled .locale-state { background: var(--ink); border-color: var(--ink); }
.locale-partial .locale-state {
    background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%);
    border-color: var(--ink);
}
.locale-empty .locale-state { border-color: var(--line-2); }
.locale-legend {
    display: flex; flex-wrap: wrap; gap: .9rem;
    margin: 0 0 0 .1rem;
    font-family: var(--mono); font-size: .62rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--dim);
}
.locale-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.locale-legend .locale-state { width: 7px; height: 7px; }
.locale-panel { display: grid; gap: .9rem; }
.locale-panel[hidden] { display: none; }

/* ------------------------------------------------------- document head */

/* Title and permalink behave like a document header: the title is the biggest
   thing on the page, the URL is a line under it, not a form row. */
.doc-head { display: grid; gap: .55rem; padding-bottom: 1rem; }
.doc-title-wrap { display: flex; }
input.doc-title {
    width: 100%;
    padding: .1rem 0 .35rem;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: none;
    font-family: var(--display);
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.025em;
    color: var(--ink);
}
input.doc-title::placeholder { color: #aab0ba; font-weight: 500; }
input.doc-title:hover { border-bottom-color: var(--line-2); background: none; }
input.doc-title:focus {
    outline: none;
    border-bottom-color: var(--ink);
    box-shadow: none;
    background: none;
}
.doc-permalink { display: grid; gap: .3rem; }
.doc-permalink-field {
    display: inline-flex; align-items: center; flex-wrap: wrap;
    font-family: var(--mono); font-size: .8rem;
    color: var(--dim);
    max-width: 100%;
}
.doc-permalink-base { color: var(--ink-2); white-space: pre; }
input.doc-slug {
    width: auto;
    min-width: 12ch;
    flex: 1 1 auto;
    max-width: 46ch;
    padding: .12rem .25rem;
    border: 0;
    border-bottom: 1px dashed var(--line-2);
    border-radius: 0;
    background: none;
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--ink);
}
input.doc-slug:hover { border-bottom-color: var(--ink-2); background: none; }
input.doc-slug:focus {
    outline: none;
    border-bottom: 1px solid var(--ink);
    box-shadow: none;
    background: none;
}
.doc-permalink-note {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem;
    margin: 0;
    font-size: .74rem; line-height: 1.5;
    color: var(--dim);
}
.doc-permalink-open {
    font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
    color: var(--ink-2);
    text-decoration: underline; text-underline-offset: 2px;
}
.doc-permalink-open:hover { color: var(--ink); }
.doc-permalink-open[hidden] { display: none; }

/* ------------------------------------------------------- markdown editor */

.editor-card { padding-bottom: 1rem; }
.editor-shell {
    border: 1px solid #cfd4db;
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}
.editor-shell:focus-within { border-color: var(--ink); }
.editor-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: .3rem .35rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.editor-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 .42rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: none;
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: .82rem;
    line-height: 1;
    cursor: pointer;
}
.editor-btn:hover { background: #fff; border-color: var(--line-2); color: var(--ink); }
.editor-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.editor-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.editor-btn strong { font-weight: 700; }
.editor-sep { width: 1px; height: 18px; margin: 0 .25rem; background: var(--line-2); }
.editor-toolbar-spacer { flex: 1 1 auto; }
.editor-count {
    font-family: var(--mono); font-size: .66rem; letter-spacing: .04em;
    color: var(--dim); white-space: nowrap; margin-right: .4rem;
}
/* Mode switch: two segments, both readable, the current one in ink. There is
   no ambiguous "pressed" look — you read your position, you click the other
   label to move. */
.editor-switch {
    display: inline-flex; align-items: stretch;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    flex: none;
}
.editor-switch-btn {
    display: inline-flex; align-items: center; gap: .32rem;
    height: 28px; padding: 0 .6rem;
    border: 0;
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: .74rem;
    line-height: 1;
    cursor: pointer;
}
.editor-switch-btn + .editor-switch-btn { border-left: 1px solid var(--line-2); }
.editor-switch-btn:hover { background: var(--surface-2); color: var(--ink); }
.editor-switch-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.editor-switch-btn.is-active {
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 500;
}
.editor-switch-btn.is-active:hover { background: var(--ink-hover); color: var(--on-ink); }
.editor-shell .editor-textarea {
    display: block;
    width: 100%;
    min-height: 26rem;
    padding: .9rem 1rem;
    border: 0;
    border-radius: 0;
    background: none;
    font-family: var(--mono);
    font-size: .84rem;
    line-height: 1.8;
    color: var(--ink);
    resize: vertical;
}
.editor-shell .editor-textarea:focus { outline: none; box-shadow: none; border: 0; }
.editor-shell .editor-textarea[hidden] { display: none; }

/* Link bar: appears inside the shell, so it never floats over the page. */
.editor-linkbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    padding: .45rem .5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.editor-linkbar[hidden] { display: none; }
.editor-link-input { flex: 1 1 12rem; min-width: 0; font-size: .8rem; padding: .35rem .5rem; }
.editor-link-input[data-link-text] { flex: 0 1 12rem; }

/* The document itself: the published rendering, made editable. Articles are
   read at a comfortable measure, so the editor uses prose styles — what you
   see while typing is the page you are going to publish. */
.editor-rich {
    min-height: 26rem;
    padding: 1rem 1.1rem 1.4rem;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--ink);
    outline: none;
    overflow-wrap: break-word;
}
.editor-rich[hidden] { display: none; }
.editor-rich:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.editor-rich:empty::before {
    content: var(--placeholder, '');
    color: var(--dim);
    pointer-events: none;
}
.editor-rich > :first-child { margin-top: 0; }
.editor-rich h1 { font-size: 1.45rem; margin: 1.5em 0 .5em; letter-spacing: -.025em; }
.editor-rich h2 { font-size: 1.2rem; margin: 1.4em 0 .5em; letter-spacing: -.02em; }
.editor-rich h3 { font-size: 1.02rem; margin: 1.3em 0 .4em; }
.editor-rich h4, .editor-rich h5, .editor-rich h6 { font-size: .95rem; margin: 1.2em 0 .3em; }
.editor-rich p { margin: .75em 0; color: var(--ink-2); }
.editor-rich ul, .editor-rich ol { margin: .75em 0; padding-left: 1.35em; color: var(--ink-2); }
.editor-rich li { margin: .28em 0; }
.editor-rich li::marker { color: var(--dim); }
.editor-rich a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.editor-rich a:hover { text-decoration-color: var(--ink); }
.editor-rich strong { color: var(--ink); font-weight: 600; }
.editor-rich hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.4em 0; }
.editor-rich blockquote {
    margin: .9em 0; padding: .1rem 0 .1rem .9rem;
    border-left: 2px solid var(--ink);
    color: var(--ink-2);
}
.editor-rich blockquote p { margin: .35em 0; }
.editor-rich code {
    font-family: var(--mono); font-size: .82em;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 2px; padding: .08em .3em;
}
.editor-rich pre {
    background: #0b0d10; border-radius: var(--radius);
    padding: .8rem; overflow-x: auto;
}
.editor-rich pre code { background: none; border: 0; padding: 0; color: #e8eaed; }
.editor-rich img { max-width: 100%; height: auto; }
.editor-rich table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: 1em 0; }
.editor-rich th, .editor-rich td { border: 1px solid var(--line); padding: .4rem .55rem; text-align: left; vertical-align: top; }
.editor-rich th { background: var(--bg-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .02em; color: var(--dim); }

.field-group-tight { margin-top: .9rem; }

.side-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-tabs .tab {
    padding: .5rem .25rem;
    background: var(--surface);
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--dim);
    font-size: .68rem; letter-spacing: .03em; text-transform: uppercase;
    cursor: pointer;
}
.side-tabs .tab:hover { color: var(--ink); background: var(--surface-2); }
/* Ink, not the accent: the panel speaks one colour for "you are here". */
.side-tabs .tab.is-active { color: var(--ink); border-bottom-color: var(--ink); background: var(--surface); }
.tab-panel[hidden] { display: none; }

.tabs { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.1rem; }
.tabs a, .tabs button {
    flex: 1 1 auto;
    padding: .45rem .7rem;
    background: #fff;
    border: 0; border-bottom: 2px solid transparent;
    color: var(--dim);
    font-size: .7rem; letter-spacing: .03em; text-transform: uppercase;
    cursor: pointer; text-align: center;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs .is-active { color: var(--accent-dark); border-bottom-color: var(--accent); background: var(--accent-soft); }

/* -------------------------------------------------------------- studio */

.studio-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.1rem; align-items: start; }
.studio-stage, .studio-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b0d10;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.studio-preview { width: 100%; object-fit: cover; }
.studio-placeholder { display: grid; gap: .35rem; justify-items: center; color: #6f7783; text-align: center; padding: 1rem; }
.studio-icon { font-family: var(--mono); font-size: 1.5rem; }
.studio-controls { display: grid; gap: .7rem; }
.studio-buttons { display: flex; flex-wrap: wrap; gap: .45rem; }
.studio-timer { font-family: var(--mono); font-size: 1.45rem; letter-spacing: .04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.studio-meter { height: 3px; background: var(--surface-3); overflow: hidden; }
.studio-meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.is-recording .studio-timer { color: var(--danger); }

/* ---------------------------------------------------------------- misc */

/* ------------------------------------------------------------ media library */

.upload-card { display: grid; gap: .8rem; }
.upload-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }

/* The native file input is hidden behind a label, so the browser's unstyled
   "Choose File" button never appears in the panel. */
.upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.file-picker {
    display: inline-flex; align-items: center; gap: .6rem;
    flex: 1 1 320px; min-width: 0;
    padding: .34rem .34rem .34rem .4rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.file-picker:hover { border-color: var(--ink); background: var(--hover); }
.file-picker:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.file-picker input[type="file"] {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-picker-button {
    flex: none;
    display: inline-flex; align-items: center;
    height: 30px; padding: 0 .75rem;
    border: 1px solid var(--ink); border-radius: var(--radius);
    background: var(--ink); color: var(--on-ink);
    font-size: .78rem; font-weight: 500; line-height: 1;
}
.file-picker-name {
    min-width: 0; flex: 1 1 auto;
    font-family: var(--mono); font-size: .74rem; color: var(--dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-picker.is-selected .file-picker-name { color: var(--ink); }
.file-picker.is-invalid { border-color: var(--ink); background: var(--surface-2); }
.upload-notes { display: grid; gap: .35rem; }
.upload-notes .hint { margin: 0; }
.hint-strong { color: var(--ink); font-weight: 500; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.media-card { background: #fff; display: flex; flex-direction: column; min-width: 0; }
.media-preview {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.media-preview img,
.media-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-file {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background:
        repeating-linear-gradient(135deg, rgba(11, 13, 16, .035) 0 1px, transparent 1px 9px),
        var(--surface-2);
}
.media-ext {
    font-family: var(--mono); font-size: .78rem; letter-spacing: .14em;
    color: var(--ink);
    border: 1px solid var(--line-2); border-radius: 2px;
    background: #fff; padding: .3rem .5rem;
}
.media-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(11, 13, 16, .62); color: #fff;
    pointer-events: none;
}
.media-kind {
    position: absolute; left: 0; bottom: 0;
    font-family: var(--mono); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase;
    background: rgba(11, 13, 16, .78); color: #fff;
    padding: .16rem .42rem;
}
.media-meta { padding: .6rem .7rem 0; display: grid; gap: .12rem; }
.media-name { font-size: .8rem; word-break: break-word; color: var(--ink); line-height: 1.35; }
.media-facts { font-family: var(--mono); font-size: .64rem; letter-spacing: .02em; color: var(--dim); }

.media-alt { padding: .5rem .7rem 0; display: grid; gap: .25rem; }
.media-alt-label {
    font-family: var(--mono); font-size: .56rem; letter-spacing: .12em;
    text-transform: uppercase; color: var(--dim);
}
.media-alt-row { display: flex; gap: .3rem; }
.media-alt-row input {
    flex: 1 1 auto; min-width: 0;
    height: 30px; padding: 0 .45rem;
    font-size: .78rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink);
}
.media-alt-row input::placeholder { color: var(--dim); }
.media-alt-row input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }

.media-actions {
    margin-top: auto;
    padding: .55rem .7rem .7rem;
    display: flex; align-items: center; gap: .25rem;
}
.media-delete { margin: 0 0 0 auto; }
.icon-btn {
    appearance: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink-2);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn-danger:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-card {
    position: relative;
    background: #fff; padding: 1rem; display: grid; gap: .6rem;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease;
}
.theme-card:hover { background: #fbfcfd; }
.theme-card:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-card.is-selected { background: #fbfcfd; box-shadow: inset 0 2px 0 var(--accent); }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview {
    position: relative;
    height: 92px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}
/* Miniature wireframes: each theme shows its own layout rhythm. */
.theme-preview::before,
.theme-preview::after { content: ""; position: absolute; background: var(--line); }
.theme-preview-aurora::before { left: 8px; right: 8px; top: 12px; height: 6px; background: var(--ink); opacity: .85; }
.theme-preview-aurora::after {
    left: 8px; right: 8px; top: 26px; height: 54px;
    background:
        linear-gradient(90deg, #eceff3 1px, transparent 1px) 0 0 / 25% 100%,
        linear-gradient(180deg, #f4f6f8 1px, transparent 1px) 0 0 / 100% 18px;
    border-top: 1px solid var(--line);
}
.theme-preview-editorial::before {
    left: 50%; transform: translateX(-50%);
    top: 12px; width: 46%; height: 44px;
    background: linear-gradient(180deg, var(--ink) 0 4px, transparent 4px),
                repeating-linear-gradient(180deg, #eceff3 0 3px, transparent 3px 8px);
    opacity: .9; border-bottom: 2px solid var(--ink);
}
.theme-preview-editorial::after { left: 50%; transform: translateX(-50%); top: 62px; width: 46%; height: 22px; background: repeating-linear-gradient(180deg, #eceff3 0 3px, transparent 3px 8px); }
.theme-preview-studio::before {
    left: 8px; top: 12px; width: 46%; height: 34px; background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.theme-preview-studio::after {
    right: 8px; top: 12px; width: calc(54% - 12px); height: 68px;
    background: repeating-linear-gradient(180deg, #eceff3 0 4px, transparent 4px 10px);
}
.theme-meta { display: grid; gap: .1rem; }
.theme-name { font-family: var(--display); font-size: .95rem; font-weight: 600; color: var(--ink); letter-spacing: -.015em; }

/* Dark-first themes: the wireframe is drawn on the ink ground they ship, and the
   card says so, because "looks dark in the screenshot" is not a specification. */
.theme-preview-photo,
.theme-preview-slate { background: #0b0d10; border-color: #232830; }
.theme-preview-photo::before {
    left: 8px; right: 8px; top: 12px; height: 46px;
    background: linear-gradient(135deg, #39424f 0%, #1c222a 55%, #10141a 100%);
    border: 1px solid #2c333d;
}
.theme-preview-photo::after {
    left: 8px; right: 8px; top: 64px; height: 18px;
    background:
        linear-gradient(#22272f, #22272f) 0 0 / calc(50% - 3px) 100% no-repeat,
        linear-gradient(#22272f, #22272f) 100% 0 / calc(50% - 3px) 100% no-repeat;
}
.theme-preview-slate::before {
    left: 8px; right: 8px; top: 16px; height: 60px;
    background: repeating-linear-gradient(180deg, #2c333d 0 3px, transparent 3px 15px);
    border-top: 1px solid #232830;
}
.theme-preview-slate::after { left: 8px; top: 22px; width: 58%; height: 3px; background: #f3f5f8; opacity: .8; }
.theme-preview-fortress::before {
    left: 50%; transform: translateX(-50%);
    top: 12px; width: 62%; height: 5px; background: var(--ink);
}
.theme-preview-fortress::after {
    left: 8px; right: 8px; top: 24px; height: 58px;
    background:
        linear-gradient(180deg, var(--ink) 0 2px, transparent 2px) 0 0 / 100% 22px,
        repeating-linear-gradient(180deg, #eceff3 0 3px, transparent 3px 12px);
    border-bottom: 1px solid var(--line);
}
.theme-flag {
    font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-2); border: 1px solid var(--line); border-radius: 2px;
    padding: .05rem .3rem; margin-left: .35rem; vertical-align: .08em;
}

.tint-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.tint-option { position: relative; display: inline-flex; }
.tint-option input { position: absolute; opacity: 0; pointer-events: none; }
.tint-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .4rem .65rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; cursor: pointer;
    font-size: .72rem; letter-spacing: .01em; color: var(--ink-2);
    transition: border-color .15s ease, color .15s ease;
}
.tint-chip:hover { border-color: #b6bcc5; color: var(--ink); }
.tint-chip i {
    width: 12px; height: 12px; border-radius: 50%; display: block;
    box-shadow: inset 0 0 0 1px rgba(11, 13, 16, .12);
}
.tint-option input:checked + .tint-chip { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tint-option input:focus-visible + .tint-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.tint-azure i { background: #0a66ff; }
.tint-ink i { background: #0b0d10; }
.tint-emerald i { background: #00a06b; }
.tint-violet i { background: #6a3cff; }

.theme-stage { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.theme-shot { background: #fff; padding: 0; display: grid; grid-template-rows: auto 1fr; }
.theme-shot-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.theme-shot-head strong { font-family: var(--display); font-size: .9rem; font-weight: 600; color: var(--ink); }
.theme-shot-head span { font-size: .64rem; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.theme-shot-body { padding: .9rem; display: grid; gap: .45rem; }
.theme-shot-body .bar { height: 5px; border-radius: 1px; background: var(--surface-3); }
.theme-shot-body .bar.dark { background: var(--ink); }
.theme-shot-body .bar.blue { background: var(--accent); }
.theme-shot-body .bar.w40 { width: 40%; }
.theme-shot-body .bar.w60 { width: 60%; }
.theme-shot-body .bar.w80 { width: 80%; }
.theme-shot-body .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: .2rem; }
.theme-shot-body .cols span { height: 34px; border: 1px solid var(--line); background: #fbfcfd; }

.plugin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plugin-card { background: #fff; padding: 1.05rem; display: grid; gap: .55rem; }
.plugin-head { display: flex; align-items: start; justify-content: space-between; gap: .7rem; }
.plugin-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
/* Active state is read before you read a single word: an accent rule along the
   bottom edge and a filled accent badge. Inactive cards keep the plain
   hairline, so the two states never depend on a side accent. */
.plugin-card { position: relative; }
.plugin-card.is-enabled { padding-bottom: calc(1.05rem + 3px); }
.plugin-card.is-enabled::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 3px; background: var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
}
.badge-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.badge-active .badge-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #fff; flex: none;
}
.plugin-card .badge:not(.badge-active) .badge-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--line-2); flex: none;
}
.plugin-install { display: grid; gap: .6rem; }
.plugin-install-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.plugin-install-notes { display: grid; gap: .3rem; }
.plugin-page { display: grid; gap: .9rem; }

.new-key-card {
    border: 1px solid #c9defa;
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 1rem;
    display: grid; gap: .55rem;
    margin-bottom: .9rem;
}
.api-key-value {
    font-family: var(--mono);
    font-size: .82rem;
    word-break: break-all;
    background: #fff;
    border: 1px solid #c9defa;
    border-radius: var(--radius);
    padding: .55rem .65rem;
    color: var(--ink);
}
.recovery-codes {
    font-family: var(--mono); font-size: .82rem;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft);
    padding: .8rem; margin: 0; list-style: none;
}
.danger-zone { border: 1px solid var(--line-2); border-left: 3px solid var(--ink); border-radius: var(--radius); background: var(--bg-soft); padding: 1rem; }
.danger-zone h3 { color: var(--ink); }

.empty-state { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 2.2rem 1.1rem; text-align: center; }
.empty-icon { display: block; font-family: var(--mono); font-size: 1.2rem; color: var(--dim); margin-bottom: .6rem; }
.error-card { border: 1px solid var(--line); border-top: 3px solid var(--danger); border-radius: var(--radius); background: #fff; padding: 1.5rem; max-width: 540px; }

.doc-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.2rem; margin-bottom: .9rem; }
.doc-section .prose { font-size: .88rem; color: var(--ink-2); }
.doc-section .prose h2, .doc-section .prose h3 { margin-top: 1.3em; }
.doc-section .prose code { font-family: var(--mono); font-size: .82em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; padding: .08em .3em; color: var(--ink); overflow-wrap: anywhere; }
.doc-section .prose pre { background: #0b0d10; border-radius: var(--radius); padding: .8rem; overflow-x: auto; }
.doc-section .prose pre code { background: none; border: 0; padding: 0; color: #e8eaed; }
.doc-section .prose table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: 1em 0; }
.doc-section .prose th, .doc-section .prose td { border: 1px solid var(--line); padding: .4rem .55rem; text-align: left; }
.doc-section .prose th { background: var(--bg-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; color: var(--dim); }

.pagination { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: 1.1rem; align-items: center; }
.pagination a, .pagination span {
    padding: .32rem .55rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; font-size: .76rem; color: var(--ink-2);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination-pad { margin-top: .9rem; }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.lang-switch a { padding: .2rem .4rem; font-size: .68rem; letter-spacing: .01em; color: var(--dim); }
.lang-switch a:hover { color: var(--ink); background: var(--surface-2); }
.lang-switch a.is-active { background: var(--accent); color: #fff; }

/* Topbar language: a compact dropdown, not four permanent links. */
.admin-lang { position: relative; }
.admin-lang > summary {
    list-style: none;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .28rem .5rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; cursor: pointer;
    font-size: .7rem; letter-spacing: .01em;
    color: var(--ink-2);
    transition: border-color .15s ease, color .15s ease;
}
.admin-lang > summary::-webkit-details-marker { display: none; }
.admin-lang > summary:hover { border-color: #b6bcc5; color: var(--ink); }
.admin-lang > summary::after { content: "▾"; font-size: .58rem; color: var(--dim); }
.admin-lang[open] > summary { border-color: var(--ink); color: var(--ink); }
.admin-lang ul {
    position: absolute; right: 0; top: calc(100% + 7px); z-index: 60;
    list-style: none; margin: 0; padding: .25rem;
    min-width: 11.5rem;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 16px 34px rgba(11, 13, 16, .1);
}
.admin-lang ul a {
    display: flex; align-items: baseline; justify-content: space-between; gap: .8rem;
    padding: .4rem .5rem; border-radius: 2px;
    font-size: .84rem; color: var(--ink-2);
}
.admin-lang ul a:hover { background: var(--surface-2); color: var(--ink); }
.admin-lang ul a span { font-size: .68rem; letter-spacing: 0; color: var(--dim); }
.admin-lang ul a.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.admin-lang ul a.is-active span { color: var(--accent); }

/* Burger: no box, no border, just the three rules. */
.admin-menu-btn {
    border: 0; background: none; padding: .35rem .3rem;
    color: var(--ink); cursor: pointer;
    display: none; align-items: center; justify-content: center;
}
.admin-menu-btn:hover { color: var(--accent); }
.admin-menu-btn svg { width: 22px; height: 22px; display: block; }
.admin-menu-btn rect { transition: transform .2s ease, opacity .2s ease; transform-origin: center; }
.admin-menu-btn[aria-expanded="true"] rect:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.admin-menu-btn[aria-expanded="true"] rect:nth-child(2) { opacity: 0; }
.admin-menu-btn[aria-expanded="true"] rect:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand-mark { display: inline-flex; color: var(--ink); }
.brand-text { font-family: var(--display); font-weight: 600; }

/* ------------------------------------------------------------ auth pages */

.auth-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(18px, 5vw, 48px) 1rem;
    background:
        linear-gradient(90deg, #eef1f5 1px, transparent 1px) 0 0 / 25% 100%,
        var(--bg);
}
.auth-shell { width: 100%; max-width: 400px; }
.auth-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: clamp(1.3rem, 4vw, 2rem); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding-bottom: 1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }

/* Sign-in language: one dropdown in the card header, not four inline links.
   The chip shows the current language; the list opens under it. */
.auth-tools { flex: none; }
.lang-menu { position: relative; }
.lang-menu summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: .35rem;
    height: 30px; padding: 0 .5rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--ink-2);
    font-size: .74rem;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: "▾"; font-size: .56rem; color: var(--dim); }
.lang-menu summary:hover,
.lang-menu[open] summary { border-color: var(--ink); color: var(--ink); }
.lang-menu .lang-code { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; }
.lang-menu .lang-name { max-width: 8ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-menu ul {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
    min-width: 190px; margin: 0; padding: .3rem; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 14px 30px rgba(11, 13, 16, .12);
}
.lang-menu ul a {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .42rem .55rem; border-radius: var(--radius);
    font-size: .84rem; color: var(--ink-2);
}
.lang-menu ul a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu ul a span { font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; color: var(--dim); }
.lang-menu ul a.is-active { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.lang-menu ul a.is-active span { color: var(--ink); }
.auth-title { font-size: 1.3rem; letter-spacing: -.03em; margin: 0 0 .3rem; }
.auth-subtitle { color: var(--dim); font-size: .86rem; margin: 0 0 1.2rem; }
.auth-foot {
    margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line);
    font-size: .64rem; letter-spacing: .03em;
    text-transform: uppercase; color: var(--dim);
    display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
}
.auth-security { margin-top: .9rem; font-size: .76rem; color: var(--dim); }
.auth-security strong { color: var(--ink-2); font-weight: 500; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 1100px) {
    .ai-layout, .editor-layout, .studio-grid { grid-template-columns: 1fr; }
    .ai-side, .editor-side { position: static; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-inline { grid-template-columns: 1fr 1fr; }
    .card-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed; inset: 0 auto 0 0;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 0 1px var(--line);
    }
    .admin-sidebar.is-open { transform: none; box-shadow: 24px 0 48px rgba(11, 13, 16, .12); }
    .admin-menu-btn { display: inline-flex; }
    .admin-content { padding-left: 1rem; padding-right: 1rem; }
    .module-list li { grid-template-columns: 1fr; gap: .35rem; }
    .stat-grid, .stat-grid-4, .card-grid, .card-grid-4, .grid-2, .grid-3, .split, .provider-grid, .plugin-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: start; }
    .admin-user-name { display: none; }
}

@media (max-width: 560px) {
    /* The toolbar has to stay usable in a 380 px column: the counter is the
       first thing to go, then the switch keeps its labels and full height. */
    .editor-count { display: none; }
    .editor-toolbar { gap: 2px; }
    .editor-switch-btn { padding: 0 .5rem; font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
