:root {
  --bg: #f6f5f2; --surface: #fff; --text: #1d1c1a; --muted: #6b6862; --line: #e3e0da;
  --accent: #1d1c1a; --accent-text: #fff; --star: #e0a321; --danger: #b42318; --warn-bg: #fff4d6; --warn: #7a5200;
  --radius: 14px; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --surface: #1f1f1d; --text: #f1efea; --muted: #a29f98; --line: #34332f;
    --accent: #f1efea; --accent-text: #151514; --danger: #f97066; --warn-bg: #3a2e10; --warn: #f5cf72; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 64px; }
.narrow main { max-width: 560px; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 40px 0 12px; }
h3 { font-size: 1rem; margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); font-weight: normal; }
.intro { color: var(--muted); margin: 0 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* forms */
.stack { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
input, textarea, select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type="file"] { padding: 8px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; }
.check input { width: auto; margin-top: 4px; }
button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); border-radius: 10px; padding: 10px 18px; }
button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: currentColor; }
button.small { padding: 4px 10px; font-size: 0.85rem; }
button.link { background: none; border: 0; color: var(--muted); padding: 0; text-decoration: underline; }
button:disabled { opacity: 0.6; cursor: progress; }
.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 10px 14px; border-radius: 10px; }
.notice { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* star rating input: DOM order 5..1, shown 1..5 */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; font-weight: normal; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

/* wall */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.chips a { text-decoration: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.9rem; }
.chips a[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.grid { columns: 300px; column-gap: 16px; }
.card { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.card.featured { border-color: var(--star); box-shadow: 0 0 0 1px var(--star); }
.card video { width: 100%; border-radius: 10px; background: #000; max-height: 480px; }
.card .text { margin: 0; white-space: pre-line; }
.card footer { display: flex; gap: 12px; align-items: center; }
.card footer img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.card footer div { display: grid; line-height: 1.3; }
.card footer span { color: var(--muted); font-size: 0.9rem; }
.stars { color: var(--star); letter-spacing: 2px; }
.stars .off { color: var(--line); }

/* admin */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 16px; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; display: grid; gap: 12px; }
.item header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.item .media { display: flex; flex-wrap: wrap; gap: 12px; }
.item .media:empty { display: none; }
.item .thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.item video { width: min(360px, 100%); border-radius: 10px; background: #000; }
.badge { font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .danger { margin-left: auto; }
.list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.list li > div { min-width: 0; }
.list a { color: var(--muted); font-size: 0.9rem; word-break: break-all; }
pre { margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 8px; overflow-x: auto; font-size: 0.8rem; }
.card-form { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; }
.card-form button { justify-self: start; }
