:root {
  --paper: #fff5df;
  --surface: #ffffff;
  --ink: #24231f;
  --muted: #6b665c;
  --line: #e8dcc2;
  --accent: #f5610b;
  --accent-ink: #b5420a;
  --ok: #1f7a4d;
  --warn: #a15c00;
  --bad: #b3261e;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171612;
    --surface: #211f1a;
    --ink: #f4eedf;
    --muted: #a8a194;
    --line: #38342b;
    --accent: #ff7a2b;
    --accent-ink: #ffb27f;
    --ok: #5cc493;
    --warn: #e0a04a;
    --bad: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }
header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; margin: 0; line-height: 1.05; }
h1 { font-size: 34px; text-transform: uppercase; }
h1 b { color: var(--accent); font-weight: 400; }
h2 { font-size: 22px; text-transform: uppercase; margin: 28px 0 10px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-left: 14px; }
nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--accent); }
p.lede { color: var(--muted); margin: 0 0 18px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-top: 16px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
button, .btn {
  appearance: none; border: 0; border-radius: 999px; font: 600 16px/1 var(--body);
  padding: 15px 20px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; min-height: 48px;
}
.primary { background: var(--accent); color: #fff; width: 100%; margin-top: 18px; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.small { padding: 10px 14px; min-height: 40px; font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; margin: 14px 0; }
.drop {
  display: block; border: 2px dashed var(--line); border-radius: 18px; padding: 26px 16px; text-align: center;
  background: var(--surface); cursor: pointer; font-weight: 600;
}
.drop input { display: none; }
.files { list-style: none; padding: 0; margin: 12px 0 0; }
.files li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.files li .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line); color: var(--ink); text-transform: uppercase; letter-spacing: 0.03em; }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.msg { margin-top: 14px; font-weight: 600; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
video { width: 100%; max-height: 72vh; aspect-ratio: 9 / 16; background: #000; border-radius: 12px; display: block; }
.hook { font-family: var(--display); font-size: 22px; text-transform: uppercase; margin: 12px 0 4px; line-height: 1.1; }
.meta { color: var(--muted); font-size: 13px; }
.caption { white-space: pre-wrap; font-size: 15px; background: var(--paper); border-radius: 12px; padding: 12px; margin: 10px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.stats div { background: var(--paper); border-radius: 10px; padding: 8px; text-align: center; }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; }
.stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.posted { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; }
.posted img, .posted .noimg { width: 84px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--line); }
.posted > div { min-width: 0; }
.posted .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.empty { color: var(--muted); text-align: center; padding: 36px 0; }
.tabs { display: flex; gap: 6px; margin: 4px 0 8px; overflow-x: auto; }
.tabs button { min-height: 38px; padding: 9px 14px; font-size: 14px; background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.md h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 18px; margin: 18px 0 6px; }
.md ul { padding-left: 20px; margin: 6px 0; }
.md p { margin: 6px 0; }
dialog { border: 0; border-radius: 18px; padding: 18px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
@media (max-width: 380px) { .stats { grid-template-columns: repeat(2, 1fr); } h1 { font-size: 28px; } }
