/* ==========================================================================
   Tresario — design tokens
   Palette: paper & ink, with a river-teal accent and a brass gilt CTA —
   a writing desk, not a dashboard.
   ========================================================================== */

/* Fonts are self-hosted in ../fonts/ — no external requests, no third-party
   IP sharing, nothing to break if a CDN is slow, blocked, or down.
   Fraunces, Inter and Source Serif 4 are all SIL Open Font License 1.1;
   full license text is bundled in assets/fonts/licenses/. */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/fraunces-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/fraunces-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/fraunces-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/fraunces-latin-500-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin-400-italic.woff2') format('woff2');
}

:root {
    --paper: #fcfaf5;
    --paper-dim: #f2ede1;
    --paper-line: #e4dcc9;
    --ink: #1c2b39;
    --ink-soft: #4d5f6e;
    --ink-faint: #8393a0;
    --river: #3e7c8c;
    --river-deep: #2c5c68;
    --brass: #b8863f;
    --brass-light: #d9ae6e;
    --moss: #5b7553;
    --danger: #a33b3b;
    --danger-light: #f6e3e0;

    --bg: var(--paper);
    --bg-panel: #ffffff;
    --bg-sunk: var(--paper-dim);
    --line: var(--paper-line);
    --text: var(--ink);
    --text-soft: var(--ink-soft);
    --text-faint: var(--ink-faint);
    --accent: var(--river);
    --accent-deep: var(--river-deep);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-manuscript: 'Source Serif 4', Georgia, 'Times New Roman', serif;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(28,43,57,.06), 0 6px 20px rgba(28,43,57,.06);
    --shadow-lift: 0 4px 10px rgba(28,43,57,.08), 0 14px 34px rgba(28,43,57,.10);
    --header-h: 56px;
}

[data-theme="dark"] {
    --bg: #14191f;
    --bg-panel: #1c232b;
    --bg-sunk: #10151a;
    --line: #2b333c;
    --text: #ece6d8;
    --text-soft: #b7b0a0;
    --text-faint: #7c8896;
    --accent: #6fb3c2;
    --accent-deep: #4a95a6;
    --brass: #d9ae6e;
    --brass-light: #e8c894;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    --shadow-lift: 0 4px 10px rgba(0,0,0,.35), 0 14px 34px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--accent-deep); }
[data-theme="dark"] a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; color: var(--text); }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
    padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; line-height: 1; white-space: nowrap;
    transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-brass { background: var(--brass); color: #221704; }
.btn-brass:hover { background: var(--brass-light); }
.btn-ink { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .btn-ink { background: var(--text); color: var(--bg); }
.btn-ink:hover { opacity: .88; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
    opacity: .45; cursor: not-allowed; pointer-events: none;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=url], .field textarea, .field select {
    width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--bg-panel); color: var(--text); font-family: inherit; font-size: 15px;
}
.field textarea { resize: vertical; min-height: 90px; font-family: var(--font-manuscript); }
.field small { display: block; margin-top: 6px; color: var(--text-faint); font-size: 12.5px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .toggle-label { font-weight: 600; }
.toggle-row .toggle-desc { color: var(--text-soft); font-size: 13px; margin-top: 2px; }
.switch { display: inline-block; position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch .track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--moss); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .4; cursor: not-allowed; }

.card { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px; background: var(--bg-sunk); color: var(--text-soft); }
.pill-live { background: #e4f1e0; color: #3a5f2e; }
[data-theme="dark"] .pill-live { background: #23331f; color: #9fd18e; }
.pill-off { background: var(--bg-sunk); color: var(--text-faint); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-info { background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line); }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
[data-theme="dark"] .alert-error { background: #2e1616; color: #f0a99f; border-color: #5c2a24; }
.alert-success { background: #e4f1e0; color: #3a5f2e; border: 1px solid #b6d9a8; }
[data-theme="dark"] .alert-success { background: #1c2a18; color: #9fd18e; border-color: #33501f; }

/* ---------- Top nav (marketing + app chrome) ---------- */
.topnav {
    height: var(--header-h); display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg-panel);
    position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--text); }
.brand .b1 { font-family: var(--font-display); font-weight: 600; font-size: 20px; font-style: italic; }
.brand .b2 { font-family: var(--font-body); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.topnav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 50%; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text-soft); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* ---------- Landing page ---------- */
.hero { padding: 56px 0 40px; text-align: center; background: var(--paper); }
.hero-eyebrow { font-family: var(--font-body); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--river-deep); margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.08; margin-bottom: 18px; color: var(--ink); }
.hero .blurb { font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 3.4vw, 24px); color: var(--river-deep); max-width: 480px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.hero-art { max-width: 460px; margin: 0 auto; }
.landing-note { text-align: center; font-size: 13px; color: var(--text-faint); margin-top: 10px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin: 40px 0 60px; }
.feature-grid .card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-grid .card p { color: var(--text-soft); font-size: 13.5px; margin: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; text-align: center; font-size: 13px; color: var(--text-faint); }
.site-footer a { color: var(--text-faint); margin: 0 8px; }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-soft); font-size: 14px; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-soft); }

/* ---------- App shell (dashboard, admin) ---------- */
.app-header { display: flex; align-items: center; gap: 14px; margin: 26px 0 22px; flex-wrap: wrap; }
.app-header h1 { margin: 0; font-size: 24px; }
.app-header .spacer { flex: 1; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 40px; }
.project-card { display: block; text-decoration: none; color: var(--text); background: var(--bg-panel); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.project-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.project-card .pt { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin-bottom: 4px; }
.project-card .pm { font-size: 12.5px; color: var(--text-faint); }
.project-card-new { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
    border: 1.5px dashed var(--line); border-radius: var(--radius-lg); min-height: 110px; color: var(--text-soft);
    text-decoration: none; cursor: pointer; background: transparent; font-family: inherit; font-size: 14px; font-weight: 600; }
.project-card-new:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- Project shell: left rail + content ---------- */
.proj-shell { display: flex; min-height: calc(100vh - var(--header-h)); }
.proj-rail {
    width: 250px; flex: none; background: var(--bg-panel); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 16px 0; overflow-y: auto;
}
.proj-rail-title { padding: 0 16px 12px; }
.proj-rail-title .pt-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; display: block; }
.proj-rail-title .pt-meta { font-size: 12px; color: var(--text-faint); }
.rail-back { display: flex; align-items: center; gap: 8px; padding: 10px 16px; margin-bottom: 8px; color: var(--text-soft);
    text-decoration: none; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.rail-back:hover { color: var(--accent-deep); }
.rail-section { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.rail-link { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--text-soft); text-decoration: none; font-size: 14px; }
.rail-link:hover { background: var(--bg-sunk); color: var(--text); }
.rail-link.active { background: var(--bg-sunk); color: var(--accent-deep); font-weight: 600; border-right: 2px solid var(--accent); }
.rail-chapter { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 14px; text-decoration: none; color: var(--text-soft);
    font-size: 13.5px; border-left: 2px solid transparent; }
.rail-chapter .cnum { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 12px; width: 18px; flex: none; }
.rail-chapter:hover { background: var(--bg-sunk); }
.rail-chapter.active { border-left-color: var(--accent); background: var(--bg-sunk); color: var(--text); font-weight: 600; }
.rail-add { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 14px; color: var(--accent-deep); background: transparent;
    border: none; font-size: 13.5px; cursor: pointer; width: 100%; text-align: left; font-family: inherit; }
.rail-add:hover { text-decoration: underline; }

.proj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* mobile rail toggle */
.rail-toggle { display: none; }
@media (max-width: 900px) {
    .proj-rail {
        position: fixed; top: var(--header-h); bottom: 0; left: 0; width: 82%; max-width: 320px;
        transform: translateX(-100%); transition: transform .2s ease; z-index: 50; box-shadow: var(--shadow-lift);
    }
    .proj-rail.open { transform: translateX(0); }
    .rail-toggle {
        display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
        border-radius: 8px; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text); cursor: pointer;
    }
    .rail-scrim { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 45; }
    .rail-scrim.show { display: block; }
}

/* ---------- Editor toolbar + surface ---------- */
.editor-topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
    background: var(--bg-panel); flex-wrap: wrap; position: sticky; top: var(--header-h); z-index: 20; }
.editor-topbar input.chapter-title-input {
    font-family: var(--font-display); font-size: 17px; font-weight: 600; border: none; background: transparent; color: var(--text);
    flex: 1; min-width: 120px; padding: 4px 2px;
}
.editor-topbar input.chapter-title-input:focus { outline: none; border-bottom: 1px solid var(--accent); }
.save-status { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 8px 16px; border-bottom: 1px solid var(--line);
    background: var(--bg-sunk); flex-wrap: wrap; }
.toolbar button {
    width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-soft);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-family: var(--font-body);
}
.toolbar button:hover { background: var(--bg-panel); border-color: var(--line); color: var(--text); }
.toolbar button.is-active { background: var(--bg-panel); border-color: var(--accent); color: var(--accent-deep); }
.toolbar .tsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.toolbar .tool-wide { width: auto; padding: 0 10px; gap: 6px; font-size: 13px; font-weight: 600; }

/* Colour / highlight dropdowns: a trigger button that opens a small swatch
   popover, including an explicit "none/default" option so both text colour
   and highlight can be cleared, not just applied. */
.color-dropdown { position: relative; }
.color-dropdown .color-trigger { font-weight: 700; }
.color-menu {
    display: none; position: absolute; top: 38px; left: 0; z-index: 30;
    background: var(--bg-panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lift);
    padding: 8px; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 132px;
}
.color-menu.open { display: grid; }
.swatch {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.swatch-none { background: var(--bg-sunk); color: var(--text-faint); font-size: 13px; line-height: 1; }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(red, #e8e800, lime, cyan, blue, magenta, red); }
.swatch-custom input[type=color] { position: absolute; inset: -4px; opacity: 0; cursor: pointer; width: calc(100% + 8px); height: calc(100% + 8px); border: none; padding: 0; }

.editor-scroll { flex: 1; overflow-y: auto; background: var(--bg-sunk); }
.page-surface {
    max-width: 720px; margin: 30px auto 120px; background: var(--bg-panel); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 54px 56px; min-height: 70vh;
}
@media (max-width: 780px) {
    .page-surface { margin: 0; border-radius: 0; border-left: none; border-right: none;
        padding: 26px 20px calc(48px + env(safe-area-inset-bottom)); min-height: calc(100vh - 160px); }
}
.manuscript {
    font-family: var(--font-manuscript); font-size: 18px; line-height: 1.75; color: var(--text); outline: none;
    min-height: 50vh;
}
.manuscript p { margin: 0 0 1em; }
.manuscript:empty::before { content: attr(data-placeholder); color: var(--text-faint); font-style: italic; }

.wordcount { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

/* ---------- Panels: chapters, notes, characters, images, front matter ---------- */
.panel-header { display:flex; align-items:center; gap:12px; padding: 20px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-header h2 { margin: 0; font-size: 20px; }
.panel-body { padding: 24px; max-width: 860px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg-panel); margin-bottom: 10px; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 600; }
.list-row .lr-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.chapter-drag { width: 100%; }
.chapter-row { display:flex; align-items:center; gap:10px; padding: 12px 14px; border:1px solid var(--line); border-radius:10px; background: var(--bg-panel); margin-bottom: 8px; cursor: grab; }
.chapter-row .handle { color: var(--text-faint); cursor: grab; }
.chapter-row a.ct { flex:1; color: var(--text); text-decoration: none; font-weight: 600; }
.chapter-row .cw { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gallery-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-panel); }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; }
.gallery-item .cap { font-size: 11.5px; color: var(--text-faint); padding: 6px 8px; }
.gallery-item form { position: absolute; top: 6px; right: 6px; }
.gallery-item .del { background: rgba(20,20,20,.6); color: #fff; border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }

.char-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-panel); margin-bottom: 12px; }
.char-card .avatar { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg-sunk); flex: none; }
.char-card .cbody { flex: 1; min-width: 0; }
.char-card .cname { font-weight: 700; font-family: var(--font-display); font-size: 16px; }
.char-card .crole { font-size: 12px; color: var(--accent-deep); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.char-card .cdesc { font-size: 13.5px; color: var(--text-soft); margin-top: 6px; }

/* ---------- Reading mode ---------- */
.read-shell { max-width: 720px; margin: 0 auto; padding: 40px 22px 120px; }
.read-shell .book-title { text-align: center; margin-bottom: 6px; }
.read-shell .book-author { text-align: center; color: var(--text-soft); margin-bottom: 50px; font-style: italic; }
.read-chapter { margin-bottom: 56px; }
.read-chapter h2 { font-size: 22px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 20px; }
.read-body { font-family: var(--font-manuscript); font-size: 18px; line-height: 1.8; outline: none; }
.read-body p { margin: 0 0 1em; }

/* ---------- Table (admin) ---------- */
table.datatable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.datatable th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint);
    padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.datatable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.datatable tr:last-child td { border-bottom: none; }
.dt-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.settings-section { margin-bottom: 34px; }
.settings-section h2 { font-size: 16px; margin-bottom: 4px; }
.settings-section .sec-desc { color: var(--text-soft); font-size: 13px; margin-bottom: 14px; }

.guide-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.guide-steps li { counter-increment: step; position: relative; padding: 0 0 18px 38px; font-size: 14px; color: var(--text-soft); }
.guide-steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg-sunk); color: var(--text); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.guide-steps code { background: var(--bg-sunk); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-soft); }
.empty-state h3 { color: var(--text); }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg-panel);
    overflow-x: auto; }
.admin-tabs a { display: inline-block; padding: 14px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-faint);
    text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.stat-box { flex: 1; min-width: 130px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-box .n { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.stat-box .l { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
