:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #16181d;
  --muted: #5d6472;
  --line: #e3e6ee;
  --accent: #4f46e5;
  --accent-text: #ffffff;
  --ok: #157f3b;
  --warn: #9a5b00;
  --danger: #b42318;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #181b22;
    --text: #eef0f4;
    --muted: #a2a9b7;
    --line: #2a2f3a;
    --accent: #8b85ff;
    --accent-text: #0f1115;
    --ok: #5cd38a;
    --warn: #f2b45a;
    --danger: #ff7b6e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1 1 200px; min-width: 0; }
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card.link { cursor: pointer; transition: border-color .15s; }
.card.link:hover { border-color: var(--accent); }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { font: 13px/1.5 ui-monospace, Consolas, monospace; min-height: 90px; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=color] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--line); }
button.small, .btn.small { padding: 5px 10px; font-size: 0.85rem; }
button:disabled { opacity: .55; cursor: default; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); }
.pill.pending { color: var(--warn); }
.pill.approved { color: var(--ok); }
.pill.hidden { color: var(--muted); }
.pill.flag { color: var(--danger); }
.pill.verified { color: var(--ok); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 96px; height: 96px; }
.thumb img, .thumb a img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.thumb .x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; border-radius: 50%; line-height: 1; background: var(--text); color: var(--bg); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-weight: 500; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; margin: 0; background: var(--bg); }
.chips input:checked + .chip { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.chips input:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 1px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.meta-line { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin: 0 0 10px; }
.reply { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 0 0 12px; background: var(--bg); border-radius: 0 8px 8px 0; }
.ts:empty { display: none; }
.stars { color: #f5a524; letter-spacing: 1px; }

.error { color: var(--danger); font-weight: 600; min-height: 1.5em; margin: 8px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 10;
}

/* review form */
.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 2.2rem; line-height: 1; color: var(--line); cursor: pointer; margin: 0; font-weight: 400; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: #f5a524; }
.rate input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.narrow { max-width: 560px; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
