:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --card: #16161a;
  --line: #2a2a30;
  --text: #f2efe6;
  --muted: #a39f94;
  --gold: #d4af37;
  --gold-2: #f0d27a;
  --gold-dim: rgba(212, 175, 55, 0.14);
  --danger: #ff7a6b;
  --ok: #8fd19e;
  --radius: 14px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(212, 175, 55, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: 0.005em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.35rem; margin: 0 0 0.6em; }
.shell { max-width: 1100px; margin: 0 auto; padding: 32px 20px 56px; }
.shell.narrow { max-width: 620px; }
.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 24px; }
.muted { color: var(--muted); font-weight: 400; }
.rule { height: 1px; background: linear-gradient(90deg, var(--gold), transparent); border: 0; margin: 28px 0; opacity: 0.6; }
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 0 0 18px;
}
.notice { border-color: rgba(255, 122, 107, 0.4); color: #ffd2cc; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.field > span, legend { font-weight: 600; font-size: 0.95rem; }
legend { padding: 0; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  background: #0d0d10;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}
textarea { resize: vertical; min-height: 130px; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}
.btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1505;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}
.btn:hover { filter: brightness(1.05); color: #1a1505; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--gold-2); }
.btn.ghost:hover { background: var(--gold-dim); color: var(--gold-2); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 0.88rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: rgba(255, 122, 107, 0.12); color: var(--danger); }
.error { color: var(--danger); margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Rating stars: rendered 5→1 and reversed so :checked ~ label fills to the left. */
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.1rem; line-height: 1; color: #3a3a42; cursor: pointer; padding: 2px; transition: color 0.12s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 2px solid var(--gold); border-radius: 6px; }

.thanks { text-align: center; padding: 36px 22px; border-color: rgba(212, 175, 55, 0.5); }
.thanks h2 { color: var(--gold-2); font-size: 1.7rem; }
.disclaimer { color: var(--muted); font-size: 0.88rem; text-align: center; margin: 18px 0 6px; }
.foot { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 28px; }
.foot a { word-break: break-all; }

/* Home */
.hero { padding: 40px 0 10px; }
.hero .mark {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.04em;
  background: var(--gold-dim);
  margin-bottom: 18px;
}
.privacy ul { padding-left: 1.1em; margin: 0.4em 0 0.8em; }
.privacy li { margin: 0.25em 0; }

/* Staff */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: none; }
.tabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button[aria-selected='true'] { color: var(--gold-2); border-bottom-color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .value { font-family: var(--serif); font-size: 1.9rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 0.85rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select { flex: 1 1 200px; width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--bg-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; background: var(--gold-dim); color: var(--gold-2); }
.pill.no { background: #222; color: var(--muted); }
.fb-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--card); }
.fb-item .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; align-items: center; }
.fb-item .msg { white-space: pre-wrap; word-break: break-word; margin: 0 0 10px; }
.fb-item .rating { color: var(--gold); letter-spacing: 2px; }
.export-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.empty { color: var(--muted); text-align: center; padding: 28px; }
dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 22px; max-width: 420px; width: calc(100% - 40px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--gold); border-radius: 999px;
  padding: 10px 18px; font-size: 0.92rem; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
@media (max-width: 640px) {
  .shell { padding: 22px 16px 44px; }
  .card { padding: 18px; }
  .hide-sm { display: none; }
}
