:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #1d1b18;
  --muted: #6d675e;
  --border: #e3dfd7;
  --accent: #e8573f;
  --accent-ink: #ffffff;
  --accent-soft: #fde8e3;
  --vip: #8a5cf6;
  --vip-soft: #efe8ff;
  --ok: #1f8a4c;
  --ok-soft: #e1f4e8;
  --warn: #a06200;
  --warn-soft: #fff1d6;
  --danger: #c0352b;
  --danger-soft: #fde4e1;
  --patreon: #d6303a;
  --patreon-soft: #ffe5e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* statistics charts (validated categorical pair + its tint for bars / heatmap) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-1-soft: #e3eefb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1c19;
    --surface-2: #262420;
    --text: #ece8e1;
    --muted: #a39d93;
    --border: #34312c;
    --accent: #ff6b52;
    --accent-soft: #3a211b;
    --vip: #a98bff;
    --vip-soft: #2a2140;
    --ok: #4ccb7f;
    --ok-soft: #173323;
    --warn: #f0b04a;
    --warn-soft: #3a2c12;
    --danger: #ff7a6e;
    --danger-soft: #3d1c19;
    --patreon: #ff6b73;
    --patreon-soft: #3d1a1d;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-1-soft: #1f2d40;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
picture { display: contents; } /* <picture> only picks the AVIF / WebP file; layout and CSS apply to its <img> */
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; word-break: break-all; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.danger { color: var(--danger) !important; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.gap, .gap { gap: 10px; }
.row.between { justify-content: space-between; gap: 10px; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 200px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: inline; }

/* ---------- topbar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 750; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a { color: var(--text); }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.admin-strip { background: var(--vip-soft); color: var(--vip); text-align: center; font-size: .85rem; padding: 6px 16px; }

.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 999px; padding: .55em 1.15em; font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: .35em .85em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-patreon { background: #ff424d; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: 400 1rem var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .55em .75em; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: .4em; }
textarea { resize: vertical; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }
.row input, .row select { width: auto; flex: 1 1 160px; }
/* …but not fields nested in a column <label> inside a row: there the 160px basis became their height */
.row label > input, .row label > select { flex: 0 0 auto; width: 100%; }
.row .inline-num > input { width: 80px; }

/* ---------- cards & flashes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.empty { text-align: center; padding: 48px 20px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.narrow-left { max-width: 640px; }
.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-vip { background: var(--vip-soft); color: var(--vip); }
.tag-free, .tag-live { background: var(--ok-soft); color: var(--ok); }
.tag-lock { background: var(--surface-2); color: var(--text); }
.tag-pin { background: var(--accent-soft); color: var(--accent); }
.tag-draft { background: var(--danger-soft); color: var(--danger); }
.tag-sched, .tag-scheduled { background: var(--warn-soft); color: var(--warn); }
.tag-src { font-size: .62rem; padding: 1px 7px; margin-left: 2px; vertical-align: .15em; line-height: 1.5; }
.tag-src-patreon { background: var(--patreon-soft); color: var(--patreon); }
.tier-badge {
  --tier: var(--vip);
  display: inline-block; padding: 0 .6em; border-radius: 999px; line-height: 1.55; white-space: nowrap;
  color: color-mix(in srgb, var(--tier) 65%, var(--text));
  background: color-mix(in srgb, var(--tier) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--tier) 60%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tier) 45%, transparent), inset 0 0 6px color-mix(in srgb, var(--tier) 22%, transparent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--tier) 55%, transparent);
}
.badge-colors { display: flex; flex-direction: column; gap: 8px; }
.badge-color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.badge-color:last-child { border-bottom: 0; }
.badge-color [hidden] { display: none; }
.badge-color-preview { flex: 1 1 180px; min-width: 0; font-weight: 700; }
.badge-color input[type=color] { width: 44px; height: 30px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.badge-color input[type=color]:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- home ---------- */
.hero { padding: 24px 0 28px; }
.hero h1 { font-size: 2.3rem; margin-bottom: .2em; }
.hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: .3em; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.post-card:hover { transform: translateY(-2px); }
.post-card-link { display: block; color: inherit; height: 100%; }
.post-card-link:hover { text-decoration: none; }
.post-card .cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.post-card.locked .cover { filter: blur(6px) saturate(.6); transform: scale(1.05); }
.post-card-body { padding: 16px 18px 18px; }
.post-card h2 { font-size: 1.15rem; margin-bottom: .35em; }
.excerpt { color: var(--muted); margin-bottom: .6em; }
.excerpt.lead { font-size: 1.1rem; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 28px; }

/* ---------- post ---------- */
.post { max-width: 720px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 16px; font-size: .9rem; }
.post-cover { width: 100%; border-radius: var(--radius); margin-bottom: 20px; }
.post h1 { font-size: 2.2rem; }
.post .meta { margin-bottom: 20px; }
.post-body { font-size: 1.07rem; line-height: 1.75; overflow-wrap: anywhere; }
.post-body img { border-radius: 8px; }
.post-body blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: .2em 1em; color: var(--muted); }
.post-body pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.schedule { background: var(--vip-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }
.schedule ul { list-style: none; margin: 6px 0 0; padding: 0; }
.schedule li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--muted); }
.schedule li.open { color: var(--text); font-weight: 600; }
.schedule li.ended { text-decoration: line-through; }
.paywall { text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 36px 20px; }
.paywall-icon { font-size: 2rem; margin-bottom: 8px; }
.paywall-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- auth & account ---------- */
.auth-box { max-width: 420px; margin: 40px auto; text-align: center; }
.auth-box .cf-turnstile { display: flex; justify-content: center; }
.account { max-width: 640px; margin: 0 auto; }
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.account-head h1, .account-head h2 { margin: 0; }
.account-head p { margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

/* ---------- messages ---------- */
.thread-card { max-width: 760px; margin: 0 auto; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 8px 2px 16px; margin-bottom: 12px; }
.bubble { max-width: 80%; }
.bubble.me { align-self: flex-end; text-align: right; }
.bubble.them { align-self: flex-start; }
.bubble-body { display: inline-block; text-align: left; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); overflow-wrap: anywhere; }
.bubble.me .bubble-body { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.them .bubble-body { border-bottom-left-radius: 4px; }
.bubble-meta { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.composer { border-top: 1px solid var(--border); padding-top: 14px; }
.char-counter { display: block; align-self: flex-end; margin-top: -4px; font-size: .8rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-counter.is-low { color: var(--warn); }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .85rem; padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--border); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- admin ---------- */
body.admin { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; justify-content: space-between; align-items: center; color: var(--text); padding: 8px 10px; border-radius: 8px; }
.sidebar nav a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.sidebar-foot .linklike { color: var(--muted); text-align: left; }
.admin-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.admin-main-solo { max-width: 520px; margin: 40px auto; }
.page-title { font-size: 1.6rem; margin-bottom: 18px; }
.toolbar { margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs a { padding: 5px 14px; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs a:hover { text-decoration: none; }
.tabs [role=tab] { padding: 5px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 500 .9rem var(--font); cursor: pointer; white-space: nowrap; }
.tabs [role=tab]:hover { color: var(--text); }
.tabs [role=tab][aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-tabs { width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.settings-panel[hidden], .settings-tabs[hidden] { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-n { font-size: 1.8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 4px 0; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done span { color: var(--ok); }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * { margin-left: 10px; display: inline; }
.inbox { list-style: none; margin: -8px 0; padding: 0; }
.inbox li a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.inbox li:last-child a { border-bottom: 0; }
.inbox li a:hover { background: var(--surface-2); text-decoration: none; }
.inbox li.unread strong::before { content: "● "; color: var(--accent); }
.inbox-main { flex: 1; min-width: 0; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.editor .card { margin-bottom: 0; }
.editor-side { position: sticky; top: 16px; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.stage { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.stage [hidden] { display: none !important; }
.stage input, .stage select { padding: .45em .6em; font-size: .9rem; }
.stage-head { display: flex; align-items: center; gap: 8px; }
.stage-head select { flex: 1 1 auto; width: auto; font-weight: 600; }
.stage-remove { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font-size: 1rem; cursor: pointer; }
.stage-remove:hover { background: var(--danger-soft); color: var(--danger); }
.stage-field { display: flex; flex-direction: column; gap: 5px; }
.stage-lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stage-lbl span { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-lbl small { font-size: .75rem; color: var(--muted); }
.stage-inputs { display: flex; align-items: center; gap: 6px; }
.stage-inputs > input, .stage-inputs > select { flex: 1 1 auto; width: auto; }
.stage-or { flex: 0 0 auto; font-size: .78rem; color: var(--muted); }
/* number input with a unit suffix, e.g. [ 3 days ] */
.days-field { flex: 0 0 92px; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding-right: .55em; }
.days-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.days-field input { border: 0; background: none; width: 100%; min-width: 0; text-align: right; padding-right: .35em; -moz-appearance: textfield; appearance: textfield; }
.days-field input:focus { outline: none; }
.days-field input::-webkit-inner-spin-button, .days-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.days-field span { font-size: .8rem; color: var(--muted); }
.days-field-wide { flex: 1 1 auto; }
.days-field-wide input { text-align: left; padding-left: .6em; }
.stage-status { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-invalid { box-shadow: inset 0 0 0 2px var(--danger); }

/* access timeline (post editor) */
.timeline-box { border-top: 1px solid var(--border); padding-top: 14px; }
.timeline-box h4 { margin: 0 0 12px; font-size: .9rem; }
.timeline { --tl: var(--vip); }
.tl-row { position: relative; min-height: 46px; }
.tl-cell { position: absolute; top: 0; bottom: 0; width: 22px; }
.tl-up, .tl-down { position: absolute; left: 10px; width: 2px; background: var(--tl); }
.tl-up { top: 0; height: 11px; }
.tl-down { top: 11px; bottom: 0; }
.tl-dot { position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--tl); border: 2px solid var(--tl); box-shadow: 0 0 0 3px var(--surface); }
.tl-dot.is-end { background: var(--surface); }
.tl-dot.is-note { left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: var(--surface); border-color: var(--muted); }
.tl-label { display: flex; flex-direction: column; padding-bottom: 14px; font-size: .86rem; line-height: 1.35; overflow-wrap: anywhere; }
.tl-label strong { font-weight: 650; }
.tl-end { color: var(--muted); }
.tl-note { font-weight: 500 !important; font-style: italic; color: var(--muted); }
.tl-time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.tl-after { margin: 0; }
.cover-preview { border-radius: 8px; }
.post-cover-thumb { display: block; width: 96px; aspect-ratio: 16 / 9; margin-top: 6px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.post-cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-cover-none { margin-top: 4px; font-style: italic; }
.media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; margin-top: 8px; }
.media-thumb { padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--surface-2); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-item { padding: 0; overflow: hidden; margin: 0; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.media-item figcaption { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.media-item input { padding: 4px 6px; }
/* media library: kinds, tags, bulk */
.upload-card .row input[type=file] { flex: 2 1 260px; }
.media-toolbar { gap: 10px; }
.media-search input { width: 220px; flex: 0 1 220px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .85rem; }
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.chip-sm { padding: 0 8px; font-size: .75rem; }
.media-tags { margin: 0; gap: 4px; }
.bulk-bar select, .bulk-bar input:not([type=checkbox]) { width: auto; flex: 0 1 180px; padding: .35em .6em; font-size: .9rem; }
.media-item { position: relative; }
.media-select { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--surface); border-radius: 6px; padding: 3px 5px; box-shadow: var(--shadow); }
.media-preview { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; }
.media-preview > a, .media-preview video { width: 100%; height: 100%; }
.media-item .media-preview img { aspect-ratio: auto; height: 100%; }
.media-preview video { object-fit: contain; background: #000; display: block; }
.text-preview { display: block; overflow: hidden; padding: 10px 12px; font: .72rem/1.45 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.text-preview:hover { text-decoration: none; color: var(--text); }
.file-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.file-preview:hover { text-decoration: none; }
.file-icon { font-size: 2.6rem; line-height: 1; }
.media-edit summary { cursor: pointer; color: var(--accent); }
.media-edit form { margin-top: 8px; }
.picker-filters { margin-top: 8px; }
.picker-filters select, .picker-filters input { flex: 1 1 140px; padding: .35em .6em; font-size: .9rem; }
.media-thumb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text); }
.media-thumb[hidden] { display: none; }
.thumb-icon { font-size: 1.6rem; line-height: 1; }
.thumb-name { font-size: .65rem; max-width: 100%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* posts: expiry */
.tag-expired { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.post-card.expired { opacity: .7; }
.flash-expired { background: var(--surface-2); color: var(--muted); }

/* post body media + download page */
.post-body video { max-width: 100%; width: 100%; border-radius: 8px; background: #000; }
.post-body .download-link, .post-body .file-link { display: inline-flex; align-items: center; gap: 6px; padding: .5em 1em; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: .95rem; }
.post-body .download-link { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.post-body .download-link:hover, .post-body .file-link:hover { text-decoration: none; filter: brightness(1.05); }
.download-box { margin-top: 40px; }
.download-box .file-icon { font-size: 3rem; margin-bottom: 8px; }
.download-name { font-size: 1.4rem; overflow-wrap: anywhere; }
.download-form { margin: 18px 0 8px; }
.download-form .cf-turnstile { display: flex; justify-content: center; }

.settings { max-width: 760px; }
.settings .stack > .btn { align-self: flex-start; }
.settings .row:has(> label) { align-items: flex-end; }
.steps { margin: 0; padding-left: 1.2em; }
.steps li { margin-bottom: 4px; }
.icon-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 760px) {
  body.admin { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar nav a { padding: 6px 10px; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; }
  .admin-main { padding: 20px 16px 48px; }
  .hero h1 { font-size: 1.8rem; }
  .post h1 { font-size: 1.7rem; }
  .bubble { max-width: 92%; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 8px; }
}

/* member perks (tiers page) */
.perks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
/* fieldsets default to min-inline-size: min-content, which made them spill out of their grid column */
.perk { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-inline-size: 0; }
.perk legend { max-width: 100%; overflow-wrap: anywhere; }
.perk-quota { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; }
.perk-quota .perk-lbl { grid-column: 1 / -1; }
.perk-quota input { width: 76px; }
.perk-quota input[hidden] + select { grid-column: 1 / -1; }
.perk-lbl { font-weight: 600; font-size: .92rem; }
/* default access stages (tiers page) */
.rule-flat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px; background: var(--surface-2); border-radius: 8px; }
.rule-flat input { padding: .4em .5em; font-size: .88rem; }
.rule-flat select { flex: 1 1 200px; width: auto; }
.inline-num { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.inline-num input { width: 80px; }
.rule-flat .rule-remove { margin-left: auto; }

/* custom requests */
.request-info { background: var(--vip-soft); color: var(--text); border-left: 3px solid var(--vip); border-radius: 8px; padding: 12px 14px; overflow-wrap: anywhere;
  font-size: 1rem; line-height: 1.6; }
.request-info > :first-child { margin-top: 0; }
.request-info > :last-child { margin-bottom: 0; }
.request-info .request-info-tier { margin-bottom: .3em; }
.requests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.request { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.request.is-new { border-color: var(--accent); }
.request-body { overflow-wrap: anywhere; }
.request-response { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: .95rem; overflow-wrap: anywhere; }
.request-admin .request-body { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.request-admin a.row { color: var(--text); }
.status-select { width: auto; flex: 0 1 240px; }
.tag-req-open { background: var(--accent-soft); color: var(--accent); }
.tag-req-in_progress { background: var(--warn-soft); color: var(--warn); }
.tag-req-done { background: var(--ok-soft); color: var(--ok); }
.tag-req-declined, .tag-req-cancelled { background: var(--surface-2); color: var(--muted); }
.new-message select { flex: 1 1 240px; max-width: 360px; }

/* ---------- post body: media blocks + lightbox ---------- */
.post-body .block-media { margin: 1.6em 0; }
.post-body .block-media img { display: block; margin-inline: auto; }
.post-body .block-media figcaption { margin-top: .5em; text-align: center; font-size: .88rem; color: var(--muted); }
.post-body .block-media.is-zoomable a { display: block; cursor: zoom-in; border-radius: 8px; }
.post-body .block-media.is-static img { pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.post-body .block-youtube { margin: 1.6em 0; }
.post-body .block-youtube iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
.post-body .block-youtube.is-vertical iframe { aspect-ratio: 9 / 16; max-width: min(100%, 360px); margin-inline: auto; }
.post-body .block-youtube figcaption { margin-top: .5em; text-align: center; font-size: .88rem; color: var(--muted); }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(12 11 10 / .94); color: #fff; overflow: hidden; }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox::backdrop { background: transparent; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
.lb-stage { display: flex; overflow: hidden; min-height: 0; }
.lb-stage img { margin: auto; max-width: calc(100vw - 32px); max-height: calc(100dvh - 72px); object-fit: contain; border-radius: 4px; user-select: none; }
.lightbox.can-zoom .lb-stage img { cursor: zoom-in; }
.lightbox.is-zoomed .lb-stage { overflow: auto; }
.lightbox.is-zoomed .lb-stage img { max-width: none; max-height: none; cursor: zoom-out; border-radius: 0; }
.lb-bar { display: flex; gap: 12px; align-items: baseline; justify-content: center; padding: 8px 64px 14px; min-height: 40px; font-size: .9rem; }
.lb-caption { margin: 0; text-align: center; color: #e8e4dc; }
.lb-count { color: #a9a39a; font-variant-numeric: tabular-nums; }
.lb-btn { position: absolute; display: grid; place-items: center; min-inline-size: 44px; min-block-size: 44px; padding: 0; border: 1px solid rgb(255 255 255 / .2);
  border-radius: 999px; background: rgb(0 0 0 / .45); color: #fff; font: 400 1.6rem/1 var(--font); cursor: pointer; }
.lb-btn[hidden] { display: none; }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) { .lb-btn:hover { background: rgb(0 0 0 / .75); } }
.lb-close { top: 12px; right: 12px; font-size: 1.1rem; z-index: 1; }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lightbox.is-zoomed .lb-prev, .lightbox.is-zoomed .lb-next { display: none; }

/* ---------- post editor: block editor ---------- */
.body-field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: .92rem; }
.field-label small { font-weight: 400; }
.blocks { display: flex; flex-direction: column; gap: 18px; padding-top: 10px; }
.block { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.block:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.block-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0; }
.block-type { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.block-tools { margin-left: auto; display: flex; gap: 2px; }
.icon-btn { display: inline-grid; place-items: center; min-inline-size: 28px; min-block-size: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); font: 600 .9rem/1 var(--font); cursor: pointer; }
.icon-btn:focus-visible, .rt-btn:focus-visible, .insert-btn:focus-visible, .mb-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn[aria-disabled=true] { opacity: .35; cursor: default; }
@media (hover: hover) {
  .icon-btn:not([aria-disabled=true]):hover { background: var(--surface); color: var(--text); border-color: var(--border); }
  .icon-danger:not([aria-disabled=true]):hover { color: var(--danger); }
}
/* "+ Text / + Media" between blocks: shows when hovering the gap above a block (or tabbing to it). */
.block-insert { position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; display: flex; justify-content: center; align-items: center; gap: 6px;
  opacity: 0; z-index: 1; }
.block-insert:hover, .block-insert:focus-within { opacity: 1; }
.insert-btn { padding: 1px 10px; border: 1px solid var(--accent); border-radius: 999px; background: var(--surface); color: var(--accent); font: 600 .74rem var(--font); cursor: pointer; }
@media (hover: none) { .block-insert { display: none; } }
@media (prefers-reduced-motion: no-preference) { .block-insert { transition: opacity .12s; } }

.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--border); }
.rt-toolbar [role=group] { display: flex; gap: 2px; }
.rt-sep { align-self: stretch; width: 0; margin: 4px 5px; border-left: 1px solid var(--border); }
.rt-btn { min-inline-size: 30px; min-block-size: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--text); font: 600 .8rem/1 var(--font); cursor: pointer; white-space: nowrap; }
.rt-b { font-weight: 800; } .rt-i { font-style: italic; font-family: Georgia, serif; } .rt-u { text-decoration: underline; } .rt-s { text-decoration: line-through; }
.rt-btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rt-btn[aria-disabled=true] { opacity: .35; cursor: default; }
@media (hover: hover) { .rt-btn:not([aria-disabled=true]):not([aria-pressed=true]):hover { background: var(--surface-2); } }
@media (pointer: coarse) { .rt-btn, .icon-btn { min-inline-size: 40px; min-block-size: 40px; } }
@media (forced-colors: active) { .rt-btn[aria-pressed=true] { outline: 2px solid Highlight; } }
.rt-area { position: relative; min-height: 5.5em; padding: 10px 14px; border-radius: 0 0 10px 10px; outline: none; font-size: 1rem; }
.rt-area > :first-child { margin-top: 0; }
.rt-area > :last-child { margin-bottom: 0; }
.rt-area.is-empty::before { content: attr(data-placeholder); position: absolute; top: 10px; left: 14px; color: var(--muted); pointer-events: none; }
.rt-area img { max-width: 100%; }
.rt-code { display: block; width: 100%; min-height: 12em; max-height: 70vh; field-sizing: content; margin: 0; border: 0; border-radius: 0 0 10px 10px;
  padding: 10px 14px; font: .84rem/1.55 var(--mono); background: var(--surface); resize: vertical; }
.rt-code:focus { outline: none; }
.rt-code[hidden], .rt-area[hidden] { display: none; }
/* A rich text form field (<textarea data-rich-text>): the toolbar + area without a block around them. */
.rt-field { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.rt-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rt-field .rt-area { min-height: 6.5em; }
.rt-long .rt-area { min-height: 16em; max-height: 70vh; overflow-y: auto; border-radius: 0 0 10px 10px; }
.stack-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.mb { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px; align-items: flex-start; }
.mb-thumb { flex: 0 0 180px; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0;
  overflow: hidden; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.mb-thumb img, .mb-thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mb-thumb:has(img, video) { border-style: solid; }
.mb-thumb.is-static { cursor: pointer; }
.mb-empty { font-weight: 600; font-size: .9rem; color: var(--accent); }
.mb-fields { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mb-fields [hidden] { display: none; }
.mb-fields input[type=text], .mb-fields input[type=url] { padding: .4em .6em; font-size: .9rem; }
.mb-file { flex-wrap: nowrap; }
.mb-name { margin: 0; flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-name.is-missing { color: var(--muted); font-weight: 500; }
.mb-zoom { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 520px) { .mb-thumb { flex-basis: 100%; } }
.block-empty { margin: 4px 0 0; }
.block-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.yt-thumb { cursor: default; aspect-ratio: 16 / 9; }
.yt-thumb img { object-fit: cover; }
.yt-thumb .thumb-icon { font-size: 1.6rem; }
.mb-fields .is-error { color: var(--danger); }

/* media picker dialog */
.picker-dialog { width: min(780px, calc(100vw - 32px)); max-height: min(82dvh, 760px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 12px 48px rgb(0 0 0 / .25); }
.picker-dialog[open] { display: flex; flex-direction: column; }
.picker-dialog::backdrop { background: rgb(0 0 0 / .5); }
.picker-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.picker-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.picker-body { overflow: auto; padding: 14px 18px 18px; }
.picker-body .picker-filters { margin-top: 0; }
.picker-dialog .media-pick { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.media-thumb.is-current { outline: 3px solid var(--accent); outline-offset: 1px; }
.media-thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.media-thumb.is-selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.media-thumb.is-selected::after { content: attr(data-order); position: absolute; top: 5px; right: 5px; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; line-height: 22px; text-align: center;
  box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.picker-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); }
.picker-foot[hidden] { display: none; }
.picker-count { flex: 1 1 180px; }


/* ---------- statistics (admin → Statistics) ---------- */
.stats-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.stats-toolbar .tabs { flex-wrap: wrap; border-radius: 18px; }
.stats-custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stats-custom input[type=date] { width: auto; padding: .3em .5em; font-size: .88rem; }
.stats-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 30px; }
.stats-switches { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .84rem; white-space: nowrap; }
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.on { border-color: var(--series-1); background: var(--series-1-soft); }
.stats-kpis { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 4px; }
.stats-kpis .stat-n { font-size: 1.55rem; }
.delta { display: block; font-size: .78rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stats-compare { margin: 0 0 14px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 2px; vertical-align: 1px; }
.stats-tabs { width: fit-content; margin-bottom: 14px; }
.visitor-card .kv { margin: 0; }
.flag { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nowrap { white-space: nowrap; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }

.chart-card { padding-bottom: 12px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.chart-head h2 { margin: 0; font-size: 1.05rem; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--series-1); }
.chart-key.s2 { background: var(--series-2); }
.chart { position: relative; margin: 10px 0 0; outline-offset: 4px; border-radius: 6px; touch-action: pan-y; overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 560px; height: auto; overflow: visible; } /* scrolls sideways on phones instead of shrinking the text */
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-grid.base { stroke: var(--muted); stroke-opacity: .5; }
.chart-axis { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart-end { fill: var(--muted); font: 600 11px var(--font); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.s1, .chart-point.s1, .chart-dot.s1 { stroke: var(--series-1); }
.chart-line.s2, .chart-point.s2, .chart-dot.s2 { stroke: var(--series-2); }
.chart-point { fill: var(--surface); stroke-width: 2; }
.chart-dot { fill: var(--surface); stroke-width: 2.5; }
.chart-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart [hidden] { display: none; }
.chart-tip { position: absolute; top: 4px; z-index: 5; min-width: 150px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: .82rem; pointer-events: none; }
.chart-tip[hidden] { display: none; }
.chart-tip-float { position: absolute; top: 0; left: 0; min-width: 0; }
.chart-tip-head { color: var(--muted); margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 7px; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip-row span:last-child { color: var(--muted); }
.chart-table { margin-top: 8px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table .table-wrap { max-height: 320px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; align-items: start; }
.stats-grid > *, .bd-card { min-width: 0; }
.stats-grid .card { margin-bottom: 0; }
.bd-wide { grid-column: 1 / -1; }
.bd-card { padding: 16px 18px; }
.bd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.bd-head h2 { font-size: 1rem; margin: 0; }
.bd-cols { display: flex; gap: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bd-cols span, .bd .bd-n { width: 72px; text-align: right; flex: 0 0 auto; }
.bd-wide .bd-cols span:nth-child(3), .bd-wide .bd .bd-n:nth-of-type(4) { width: 110px; }
.bd { list-style: none; margin: 0; padding: 0; }
.bd li { position: relative; display: flex; align-items: center; gap: 0; padding: 5px 8px; margin: 0 -8px 2px; border-radius: 6px; font-size: .9rem; isolation: isolate; }
/* the bar: share of visitors relative to the top row */
.bd li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--series-1-soft); border-radius: 6px; z-index: -1; }
.bd-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-label a { color: var(--text); }
.bd-path { margin-left: 6px; font-size: .78em; color: var(--muted); }
.bd-ext { margin-left: 6px; color: var(--muted) !important; font-size: .85em; }
.bd .bd-n { font-variant-numeric: tabular-nums; }
.bd-more { display: inline-block; margin-top: 6px; }

.heatmap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.hm-row { display: grid; grid-template-columns: 38px repeat(24, minmax(14px, 1fr)); gap: 3px; min-width: 460px; }
.hm-hours span { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-day { font-size: .78rem; color: var(--muted); align-self: center; }
.hm-cell, .hm-scale i { height: 20px; border-radius: 4px; background: color-mix(in oklab, var(--series-1) calc(var(--p) * 100%), var(--surface-2)); }
.hm-cell.zero { background: var(--surface-2); }
.hm-cell:hover, .hm-cell:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-scale { display: flex; align-items: center; gap: 3px; margin-top: 8px; }
.hm-scale i { display: inline-block; width: 18px; height: 12px; }
.hm-scale span:first-child { margin-right: 4px; }
.hm-scale span:last-child { margin-left: 4px; }

.stats-log td { font-size: .86rem; }
.stats-log tr.entry td { border-top: 2px solid var(--border); }
.stats-log .clip-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.stats-foot { margin-top: 16px; }
.stats-reset { display: flex; justify-content: flex-end; gap: 16px; margin-top: 24px; }
@media (max-width: 640px) {
  .stats-switches { margin-left: 0; }
  .bd-cols span, .bd .bd-n { width: 58px; }
  .bd-wide .bd-cols span:nth-child(n+3), .bd-wide .bd .bd-n:nth-of-type(n+4) { display: none; } /* posts: read · teaser and time */
}
