/* The website admin, drawn like the Alf dashboard (runalf.com/app and its internal pages): a tinted sidebar, a light
   main area with white cards and thin rings, indigo for actions. Tinted green where the internal pages are orange.
   Dark when the system is. */
:root {
  --app: oklch(97.6% .012 160); --side: oklch(95.4% .024 160); --side-line: oklch(88.5% .05 160); --side-hover: oklch(91% .04 160);
  --surface: #fff; --sunk: #f8fafc; --hover: #f8fafc;
  --ink: #0f172a; --ink-2: #334155; --soft: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line-2: #cbd5e1; --line-soft: #f1f5f9;
  --accent: #4f46e5; --accent-hover: #6366f1; --accent-ink: #4338ca; --accent-soft: #eef2ff; --ring: rgb(99 102 241 / .2);
  --green: #059669; --green-ink: #047857; --green-soft: #ecfdf5; --green-line: rgb(5 150 105 / .2);
  --amber-ink: #b45309; --amber-soft: #fffbeb; --amber-line: rgb(217 119 6 / .25);
  --rose: #e11d48; --rose-ink: #be123c; --rose-soft: #fff1f2; --rose-line: rgb(225 29 72 / .2);
  --violet-ink: #6d28d9; --violet-soft: #f5f3ff; --violet-line: rgb(124 58 237 / .2);
  --shadow-xs: 0 1px 2px rgb(15 23 42 / .05); --shadow-sm: 0 1px 2px rgb(15 23 42 / .06), 0 1px 3px rgb(15 23 42 / .04);
  --shadow-lg: 0 20px 40px -12px rgb(15 23 42 / .25);
  --code-bg: #0b1020; --code-ink: #e2e8f0;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --app: oklch(19% .014 160); --side: oklch(16.5% .018 160); --side-line: oklch(30% .035 160); --side-hover: oklch(24% .03 160);
    --surface: oklch(23% .012 160); --sunk: oklch(20.5% .012 160); --hover: oklch(25.5% .014 160);
    --ink: #f1f5f9; --ink-2: #cbd5e1; --soft: #94a3b8; --faint: #64748b;
    --line: rgb(255 255 255 / .09); --line-2: rgb(255 255 255 / .16); --line-soft: rgb(255 255 255 / .06);
    --accent: #6366f1; --accent-hover: #818cf8; --accent-ink: #a5b4fc; --accent-soft: rgb(99 102 241 / .14); --ring: rgb(129 140 248 / .3);
    --green: #34d399; --green-ink: #6ee7b7; --green-soft: rgb(16 185 129 / .12); --green-line: rgb(52 211 153 / .25);
    --amber-ink: #fcd34d; --amber-soft: rgb(245 158 11 / .12); --amber-line: rgb(245 158 11 / .3);
    --rose: #fb7185; --rose-ink: #fda4af; --rose-soft: rgb(244 63 94 / .12); --rose-line: rgb(251 113 133 / .3);
    --violet-ink: #c4b5fd; --violet-soft: rgb(139 92 246 / .14); --violet-line: rgb(167 139 250 / .3);
    --shadow-xs: 0 0 #0000; --shadow-sm: 0 0 #0000; --shadow-lg: 0 24px 48px -12px rgb(0 0 0 / .6);
    --code-bg: oklch(15% .012 160);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--app); color: var(--ink-2); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2 { font-weight: 600; color: var(--ink); letter-spacing: -.015em; margin: 0; }
h1 em, h2 em { font-style: normal; color: var(--soft); font-weight: 500; }
code { font-family: var(--font-mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; border-radius: 6px; }
svg { flex: none; }
.kicker { font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 0; }
.muted { color: var(--soft); }
.small { font-size: 12px; }
.pad { padding: 16px; margin: 0; }
.err { color: var(--rose-ink); margin: 0; }
.hint { font-size: 12px; margin: -4px 0 0; color: var(--soft); }
[hidden] { display: none !important; }

/* ---------- buttons, links, pills ---------- */
.btn-quill, .btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; border: 0; cursor: pointer;
  font-weight: 500; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s;
}
.btn-quill { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px rgb(15 23 42 / .2), inset 0 0 0 1px rgb(0 0 0 / .1); }
.btn-quill:hover { background: var(--accent-hover); }
.btn-line { background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line-2); }
.btn-line:hover { background: var(--hover); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.wide { width: 100%; }
button:disabled, .busy .btn-quill, .busy .btn-line { opacity: .6; pointer-events: none; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--soft); text-decoration: none; font-size: 13px; font-weight: 500; }
.link:hover { color: var(--ink); }
.danger-link { color: var(--rose-ink); } .danger-link:hover { color: var(--rose); }
.danger { background: none; border: 0; color: var(--rose-ink); font-weight: 500; font-size: 13px; cursor: pointer; padding: 6px 0; justify-self: start; }
.danger:hover { text-decoration: underline; text-underline-offset: 3px; }
.paper-card { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.pill.draft { background: var(--sunk); color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.pill.scheduled { background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.pill.live { background: var(--green-soft); color: var(--green-ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.pill.feat { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--ring); vertical-align: 1px; margin-left: 4px; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px; background: var(--rose-soft); color: var(--rose-ink);
  box-shadow: inset 0 0 0 1px var(--rose-line); font-size: 11px; font-weight: 600; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea, .filters input {
  width: 100%; padding: 7px 10px; border-radius: 6px; border: 0; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line-2); transition: box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder, .filters input::placeholder { color: var(--faint); }
.field input:hover, .field select:hover, .field textarea:hover { box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus { outline: none; box-shadow: 0 0 0 3px var(--ring), inset 0 0 0 1px var(--accent); }
.field select { appearance: auto; }
.field textarea { font: 13px/1.5 var(--font-mono); resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--app); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; background: none; box-shadow: none; }
.login-mark { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-bottom: 20px; }
.login-card .kicker { color: var(--accent-ink); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.login-card h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; margin: -10px 0 4px; }
.login-card .btn-quill { height: 40px; border-radius: 9999px; font-weight: 600; margin-top: 4px; }
.login-card .field input { padding: 9px 12px; }
.note { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--amber-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--amber-line); font-size: 13px; }

/* ---------- the shell: sidebar and main ---------- */
.app { display: flex; height: 100dvh; }
.side { display: none; width: 240px; flex: none; flex-direction: column; overflow: hidden; background: var(--side); border-right: 1px solid var(--side-line); }
@media (min-width: 768px) { .side { display: flex; } }
.side-head { display: flex; align-items: center; gap: 8px; height: 56px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--side-line); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.badge { border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--green-soft); color: var(--green-ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; }
.nav-title { margin: 18px 0 4px; padding: 0 8px; font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 6px; font-size: 14px; color: var(--soft); text-decoration: none; transition: background-color .15s, color .15s; }
.nav-item svg { width: 16px; height: 16px; color: var(--faint); }
.nav-item:hover { background: var(--side-hover); color: var(--ink); } .nav-item:hover svg { color: var(--soft); }
.nav-item.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgb(15 23 42 / .06), 0 0 0 1px var(--side-line); }
.nav-item.on svg { color: var(--green); }
.nav-item .count { margin-left: auto; }
.side-foot { margin-top: auto; padding: 24px 8px 0; display: grid; gap: 6px; font-size: 12px; color: var(--soft); }
.side-foot .links { display: flex; gap: 12px; color: var(--faint); }
.side-foot a { text-decoration: none; } .side-foot a:hover { color: var(--ink); }
.side-foot .link { font-size: 12px; justify-self: start; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mob { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; height: 56px; flex: none; padding: 0 12px;
  border-bottom: 1px solid var(--side-line); background: color-mix(in oklch, var(--app) 90%, transparent); backdrop-filter: blur(8px); }
.mob nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mob nav a { flex: none; padding: 6px 10px; border-radius: 6px; color: var(--soft); text-decoration: none; font-size: 14px; }
.mob nav a.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--side-line); }
.mob .link { margin-left: auto; flex: none; }
@media (min-width: 768px) { .mob { display: none; } }
.main { flex: 1; min-height: 0; overflow-y: auto; }
.page { max-width: 72rem; margin: 0 auto; padding: 32px 16px 80px; }
@media (min-width: 640px) { .page { padding: 32px 24px 96px; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head > div:first-child { min-width: 0; max-width: 46rem; }
.page-head h1 { font-size: 24px; line-height: 1.25; }
.page-head .muted { margin: 4px 0 0; font-size: 14px; }

/* ---------- lists ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 16px; }
.filters button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--soft); font-weight: 500; font-size: 13px; }
.filters button:hover { color: var(--ink); background: var(--line-soft); }
.filters button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
.filters input { margin-left: auto; width: 220px; }
.page-head .filters { margin: 0; }
@media (max-width: 640px) { .filters input { margin-left: 0; width: 100%; } }
.list { overflow: hidden; }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line-soft); transition: background-color .15s; }
.row:first-child { border-top: 0; }
a.row:hover, .ov-row:hover { background: var(--hover); }
.thumb { width: 56px; height: 38px; border-radius: 6px; overflow: hidden; background: var(--sunk); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { font-weight: 600; font-size: 15px; color: var(--faint); }
.row-main { min-width: 0; display: grid; gap: 1px; }
.row-title { font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .row { grid-template-columns: 44px 1fr; padding: 12px; gap: 12px; } .thumb { width: 44px; height: 32px; } .row > .pill, .row > .row-end { grid-column: 2; justify-self: start; } }
.row-end { display: inline-flex; align-items: center; gap: 14px; }
.reads { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; font-size: 13px; min-width: 64px; text-align: right; }
.reads small { font-weight: 400; color: var(--soft); font-size: 12px; }
.row.head { padding-top: 8px; padding-bottom: 8px; background: var(--sunk); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--soft); }
.row.head .reads { font-weight: 500; color: var(--soft); font-size: 12px; }
.row.head + .row { border-top: 0; }
.rank { font-weight: 600; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.blank { padding: 40px 24px; display: grid; gap: 10px; justify-items: center; text-align: center; border-radius: 8px; box-shadow: none; background: color-mix(in oklch, var(--sunk) 50%, transparent); outline: 1px dashed var(--line-2); outline-offset: -1px; }
.list > .blank { outline: 0; background: none; }
.blank h2 { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.blank h2 em { display: block; font-weight: 400; margin-top: 2px; }
.blank .kicker { display: none; }

/* ---------- editors ---------- */
.ed-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 56px; margin: -32px -24px 20px; padding: 10px 24px;
  background: color-mix(in oklch, var(--app) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .ed-bar { margin: -32px -16px 16px; padding: 10px 16px; } }
.back { text-decoration: none; font-weight: 500; color: var(--soft); font-size: 13px; }
.back:hover { color: var(--ink); }
.save-state { font-size: 12px; }
.ed-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ed-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .ed-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.ed-main { padding: 28px 0 4px; min-width: 0; }
.title-in, .dek-in { display: block; width: 100%; border: 0; background: none; resize: none; overflow: hidden; padding: 0 28px; outline: none; }
.title-in { font: 600 clamp(1.6rem, 3vw, 2rem)/1.2 var(--font-sans); letter-spacing: -.025em; color: var(--ink); }
.dek-in { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--soft); }
.title-in::placeholder, .dek-in::placeholder { color: var(--faint); }
@media (max-width: 560px) { .title-in, .dek-in { padding: 0 16px; } .ed-main .ql-editor { padding: 20px 16px 40px; } }

/* quill */
.ed-main .toolbar.ql-toolbar.ql-snow { position: sticky; top: 56px; z-index: 4; margin-top: 20px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); padding: 6px 20px; font-family: var(--font-sans); }
.ql-snow .ql-formats { margin-right: 8px !important; }
.ql-snow.ql-toolbar button { width: 28px; height: 28px; padding: 5px; border-radius: 6px; }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active { background: var(--line-soft); }
.ql-snow .ql-stroke { stroke: var(--soft); } .ql-snow .ql-fill { fill: var(--soft); }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--ink); }
.ql-snow.ql-toolbar button:hover .ql-fill { fill: var(--ink); }
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); } .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.ql-divider { color: var(--soft); font-size: 14px; line-height: 1; }
.ql-divider:hover { color: var(--accent); }
.ql-snow .ql-picker { color: var(--ink-2); }
.ql-snow .ql-picker-label:hover, .ql-snow .ql-picker-item:hover, .ql-snow .ql-picker-item.ql-selected { color: var(--ink) !important; }
.ql-snow .ql-picker.ql-header { width: 112px; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before, .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Paragraph"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Heading"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Subheading"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { content: "Label"; }
.ql-snow .ql-picker-options { background: var(--surface) !important; border-radius: 8px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line) !important; border: 0 !important; padding: 6px 10px; }
.ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: transparent !important; }
.ql-snow .ql-tooltip { background: var(--surface); border: 0; border-radius: 8px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); color: var(--ink); z-index: 6; }
.ql-snow .ql-tooltip input[type=text] { border-radius: 6px; border-color: var(--line-2); background: var(--surface); color: var(--ink); }
.ql-snow .ql-tooltip a.ql-action, .ql-snow .ql-tooltip a.ql-remove, .ql-snow .ql-tooltip a.ql-preview { color: var(--accent-ink); }
.ql-container.ql-snow { border: 0; font: inherit; }
.ed-main .ql-editor { min-height: 420px; padding: 24px 28px 48px; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.ed-main .ql-editor.ql-blank::before { left: 28px; right: 28px; color: var(--faint); font-style: normal; }
@media (max-width: 560px) { .ed-main .ql-editor.ql-blank::before { left: 16px; } }
.ql-editor h2 { font: 600 1.5rem/1.25 var(--font-sans); letter-spacing: -.02em; color: var(--ink); margin: 1.2em 0 .4em; }
.ql-editor h3 { font: 600 1.2rem/1.3 var(--font-sans); color: var(--ink); margin: 1.1em 0 .4em; }
.ql-editor h4 { font: 600 .75rem/1.4 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin: 1.2em 0 .4em; }
.ql-editor p, .ql-editor ol, .ql-editor ul, .ql-editor blockquote, .ql-editor pre { margin-bottom: .9em; }
.ql-editor a { color: var(--accent-ink); }
.ql-editor img { border-radius: 8px; margin: .6em 0; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.ql-editor img:hover { outline: 2px solid var(--accent); outline-offset: 3px; }
.ql-snow .ql-editor blockquote { border-left: 3px solid var(--line-2); padding-left: 1em; color: var(--ink); }
.ql-snow .ql-editor code { background: var(--line-soft); color: var(--accent-ink); border-radius: 4px; padding: 1px 4px; }
.ql-snow .ql-editor .ql-code-block-container { background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 12px 16px; font-family: var(--font-mono); }
.ql-editor hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.6em 0; }
.ql-editor li::marker { color: var(--faint); }

/* side panels */
.ed-side { display: grid; gap: 16px; }
@media (min-width: 1000px) { .ed-side { position: sticky; top: 76px; } }
.side-card { padding: 16px; display: grid; gap: 12px; }
.status-line { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.slug-wrap { display: flex; align-items: center; overflow: hidden; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line-2); padding-left: 10px; font-size: 13px; }
.slug-wrap input { box-shadow: none !important; padding-left: 2px !important; font-family: var(--font-mono); font-size: 12px; }
.slug-wrap:focus-within { box-shadow: 0 0 0 3px var(--ring), inset 0 0 0 1px var(--accent); }
.cover-box img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.cover-btns { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.cover-empty { width: 100%; aspect-ratio: 16 / 9; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--sunk); cursor: pointer;
  display: grid; place-content: center; gap: 2px; text-align: center; padding: 12px; color: var(--soft); font-size: 12px; transition: border-color .15s, background-color .15s; }
.cover-empty strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.cover-empty:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- images ---------- */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.gallery .blank { grid-column: 1 / -1; }
.shot { margin: 0; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunk); border-bottom: 1px solid var(--line); }
.shot figcaption { padding: 10px 12px; display: grid; gap: 2px; font-size: 12px; }
.shot .name { color: var(--ink); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-btns { display: flex; gap: 14px; margin-top: 6px; }

/* ---------- dialogs ---------- */
.modal { border: 0; padding: 0; background: none; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink-2); }
.modal.small { width: min(440px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(2 6 23 / .4); backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); border-radius: 12px; padding: 20px; display: grid; gap: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); max-height: calc(100vh - 48px); overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 16px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--soft); padding: 2px 8px; border-radius: 6px; }
.x:hover { background: var(--line-soft); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.drop { display: grid; gap: 2px; place-items: center; text-align: center; padding: 24px 16px; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--sunk); cursor: pointer; font-size: 12px; color: var(--soft); }
.drop strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.busy { opacity: .7; pointer-events: none; }
.lib { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.lib .muted, .lib .err { grid-column: 1 / -1; margin: 0; }
.tile { padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover { outline: 2px solid var(--accent); outline-offset: 2px; }

/* toast */
#toast { position: fixed; right: 16px; bottom: 16px; transform: translateY(12px); opacity: 0; pointer-events: none; z-index: 100; max-width: min(360px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); padding: 10px 14px 10px 32px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: .2s; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
#toast::before { content: ""; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #10b981; }
#toast.show { opacity: 1; transform: none; }
#toast.error::before { background: var(--rose); }

/* ---------- overview ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.tile-n { padding: 14px 16px; text-decoration: none; display: grid; gap: 2px; align-content: start; }
a.tile-n:hover { background: var(--hover); }
.tile-n .kicker { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--soft); }
.tile-n .n { margin: 2px 0 0; font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.trend { font-size: 12px; font-weight: 500; }
.trend.up { color: var(--green-ink); } .trend.down { color: var(--amber-ink); }
.chart-card { padding: 18px 18px 12px; margin-bottom: 16px; }
.chart { width: 100%; height: 160px; display: block; }
.b-views { fill: var(--line); } .b-readers { fill: var(--accent); }
.chart g:hover .b-readers { fill: var(--accent-hover); }
.chart-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--soft); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.k-readers { background: var(--accent); } .k-views { background: var(--line-2); }

/* ---------- changelog ---------- */
.kind { justify-self: start; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 9999px; white-space: nowrap; }
.k-new { background: var(--green-soft); color: var(--green-ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.k-improved { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--ring); }
.k-fixed { background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.k-security { background: var(--rose-soft); color: var(--rose-ink); box-shadow: inset 0 0 0 1px var(--rose-line); }
.k-deprecated { background: var(--sunk); color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- announcement (the preview is runalf.com's dark news bar) ---------- */
.ann { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; border-radius: 9999px; font-size: 13px; color: #e2e8f0; text-align: center;
  background: #0b0e1c; box-shadow: inset 0 0 0 1px rgb(99 102 241 / .35); }
.ann::before { content: "News"; padding: 1px 8px; border-radius: 9999px; background: #6366f1; color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.ann-feature::before { content: "New"; background: #10b981; } .ann-campaign::before { content: "Offer"; background: #a855f7; } .ann-warning::before { content: "Heads-up"; background: #f59e0b; color: #1c1917; }
.ann-link { font-weight: 500; color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(255 255 255 / .4); white-space: nowrap; }
.ann-x { opacity: .5; margin-left: 4px; }
.ann-list { display: grid; gap: 12px; }
.ann-card { padding: 14px; display: grid; gap: 12px; }
.ann-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ann-btns { margin-left: auto; display: inline-flex; gap: 14px; align-items: center; }
.ann-form { margin-bottom: 16px; }
.ann-edit { padding: 20px; display: grid; gap: 14px; }
.ann-live { padding: 14px; border-radius: 8px; background: #05060f; }
.two { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.checks { display: grid; gap: 8px; padding-bottom: 6px; }

/* ---------- inbox ---------- */
.msgs { display: grid; gap: 12px; }
.msg { padding: 16px 18px; display: grid; gap: 10px; }
.msg.unread { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-xs), 0 0 0 1px var(--line); }
.msg header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.msg .who { color: var(--ink); font-weight: 600; }
.msg header a { font-size: 13px; }
.msg .when { margin-left: auto; }
.msg-body { margin: 0; white-space: pre-wrap; color: var(--ink-2); }
.msg footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- overlays ---------- */
.install { padding: 0; margin-bottom: 20px; }
.install summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; color: var(--ink); font-size: 14px; }
.install summary strong { font-weight: 500; }
.install summary::-webkit-details-marker { display: none; }
.install[open] summary { border-bottom: 1px solid var(--line); }
.install > p { margin: 14px 16px 8px; max-width: 60rem; }
.install > .hint { margin: 12px 16px 16px; }
.snippet { display: flex; align-items: center; gap: 10px; margin: 0 16px; padding: 8px 8px 8px 12px; border-radius: 8px; background: var(--code-bg); box-shadow: 0 0 0 1px var(--line); }
.snippet code { flex: 1; min-width: 0; color: var(--code-ink); font: 12px/1.5 var(--font-mono); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.snippet .btn-line { background: rgb(255 255 255 / .08); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); flex: none; }
.snippet .btn-line:hover { background: rgb(255 255 255 / .14); }

/* A little drawing of each kind: where on the page it sits. */
.ov-kind { position: relative; display: block; width: 40px; height: 28px; border-radius: 5px; background: #0b0e1c; box-shadow: inset 0 0 0 1px var(--line-2); flex: none; overflow: hidden; }
.ov-kind i { position: absolute; background: #818cf8; border-radius: 2px; }
.ov-k-modal i { inset: 7px 10px; box-shadow: 0 0 0 30px rgb(2 6 23 / .55); }
.ov-k-slide i { right: 4px; bottom: 4px; width: 14px; height: 10px; }
.ov-k-bar i { left: 4px; right: 4px; bottom: 3px; height: 5px; border-radius: 9px; }
.ov-k-inline i { left: 6px; right: 6px; top: 11px; height: 7px; background: #34d399; }
.ov-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
.ov-row .row-main { text-decoration: none; }
.ov-row .row-title .small { font-weight: 400; color: var(--soft); margin-left: 4px; }
@media (max-width: 760px) { .ov-row { grid-template-columns: 40px 1fr; } .ov-row .row-end { grid-column: 1 / -1; flex-wrap: wrap; } }

.ov-kinds { border: 0; margin: 0; padding: 4px 28px 6px; min-width: 0; }
.ov-kinds legend { padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.ov-kinds-grid { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ov-kind-pick { position: relative; display: grid; gap: 2px; padding: 12px; border-radius: 8px; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s, background .15s; font-size: 13px; }
.ov-kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ov-kind-pick .ov-kind { margin-bottom: 8px; }
.ov-kind-pick strong { color: var(--ink); font-weight: 500; }
.ov-kind-pick:hover { background: var(--hover); }
.ov-kind-pick:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ov-kind-pick:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: 1px; }
.ov-slot { padding: 10px 28px 0; }
.ov-slot .hint { margin: 2px 0 0; }
.ed-main .ov-kinds ~ .title-in { margin-top: 20px; }
.ov-bottom { display: grid; gap: 20px; padding: 20px 28px 24px; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .ov-bottom { grid-template-columns: 1fr 1fr; } }
.ov-image, .ov-cta { display: grid; gap: 12px; align-content: start; }
.ov-stats b { color: var(--ink); font-weight: 600; }
.ov-when.is-inline .field:first-of-type { display: none; }
.ov-slot-demo { min-height: 120px; padding: 24px; border-radius: 8px; background: #05060f; }
.ov-theme { display: inline-flex; padding: 2px; border-radius: 6px; background: var(--line-soft); box-shadow: inset 0 0 0 1px var(--line); }
.ov-theme button { border: 0; background: none; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--soft); cursor: pointer; }
.ov-theme button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
@media (max-width: 560px) { .ov-kinds, .ov-bottom, .ov-slot { padding-left: 16px; padding-right: 16px; } }

/* Reports: the steps someone took before reporting a problem. */
.trail-box summary { cursor: pointer; color: var(--soft); font-size: 13px; }
.trail { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.trail li { display: grid; grid-template-columns: 64px 56px minmax(0, 1fr); gap: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.trail li time, .trail li span:nth-child(2) { color: var(--faint); }
.trail-bad, .trail li.trail-bad span { color: var(--rose-ink); }

/* Authors */
.author-list { display: grid; gap: 12px; }
.author-card { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 20px; }
.author-card h2 { font-size: 16px; margin: 0; }
.author-pic { display: grid; gap: 6px; justify-items: center; align-content: start; }
.author-pic img, .author-blank { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-blank { display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 26px; }
.author-text { display: grid; gap: 10px; min-width: 0; }
.author-text .field textarea { font-family: inherit; }
.author-save { display: flex; justify-content: flex-end; }
@media (max-width: 560px) { .author-card { grid-template-columns: 1fr; } .author-pic { justify-items: start; } }

/* Side notes in the editor */
.ql-editor mark[data-note] { background: #fff0c2; color: inherit; box-shadow: 0 1.5px 0 #b08439; }
.note-in { font-family: inherit !important; }

/* Recommendations */
.rec-section { padding: 0 28px; display: grid; gap: 10px; }
.rec-quote { min-height: 4.5em; display: block; width: 100%; border: 0; background: none; resize: none; overflow: hidden; padding: 0; outline: none;
  font: 500 clamp(1.15rem, 2.2vw, 1.35rem)/1.5 var(--font-sans); letter-spacing: -.01em; color: var(--ink); }
.rec-quote::placeholder { color: var(--faint); }
.rec-meter { margin: -4px 0 8px; }
.rec-meter.warn { color: var(--amber-ink); }
.rec-live { padding: 20px; border-radius: 10px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.rec-card { margin: 0 auto; max-width: 34rem; display: grid; gap: 14px; padding: 20px 22px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
.rec-card blockquote { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.rec-co { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.rec-co img, .rec-co-blank { height: 28px; max-width: 120px; object-fit: contain; }
.rec-co-blank { width: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--line); font-size: 13px; }
.rec-card figcaption { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rec-card figcaption > span:last-child { display: grid; }
.rec-card figcaption strong { color: var(--ink); font-weight: 500; }
.rec-card figcaption img, .rec-card figcaption .author-blank { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; font-size: 14px; }
.rec-case { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.rec-case .title-in { margin-top: 20px; }
.rec-header img { aspect-ratio: 21 / 9; }
.rec-header .cover-empty { aspect-ratio: 21 / 6; }
.rec-pic { display: flex; align-items: center; gap: 12px; }
.rec-pic img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
.rec-pic.round img { object-fit: cover; border-radius: 50%; }
.rec-pic .cover-btns { margin: 0; }
.rec-pic-empty { width: 64px; height: 64px; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--sunk); cursor: pointer; font-size: 11px; color: var(--soft); padding: 4px; line-height: 1.2; }
.rec-pic.round .rec-pic-empty { border-radius: 50%; }
.rec-pic-empty:hover { border-color: var(--accent); background: var(--accent-soft); }
.rec-thumb img { object-fit: contain; background: var(--surface); }
.rec-thumb.round img { object-fit: cover; }
.rec-who-hint { margin: -8px 0 0; text-align: center; }
@media (max-width: 560px) { .rec-section { padding: 0 16px; } }
