:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --card: #fafafa;
  --fg-invert: #ffffff;
  --danger: #b00020;
  --radius: 12px;
  --max: 900px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --line: #1f1f1f;
    --card: #0d0d0d;
    --fg-invert: #000000;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 20px 16px 80px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding: 14px 16px; position: sticky; top: 0;
  background: var(--bg); z-index: 5;
}
.brand { font-weight: 700; letter-spacing: -0.3px; }
.brand small { color: var(--muted); font-weight: 500; }
h1 { font-size: 26px; letter-spacing: -0.5px; margin: 4px 0 2px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 16px 0;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, textarea, select, button {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
input[type="range"] { padding: 0; }
input[type="file"] { padding: 8px; }
button {
  cursor: pointer; background: var(--fg); color: var(--fg-invert); border: none;
  font-weight: 600; width: auto; padding: 10px 18px;
}
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); border: none; padding: 4px; width: auto; text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: default; }
button.sm { padding: 6px 12px; font-size: 13px; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat { text-align: center; }
.stat .n { font-size: 20px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.pill.active { color: var(--fg-invert); background: var(--fg); border-color: var(--fg); }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
.ok { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }
.center { max-width: 380px; margin: 8vh auto 0; }
.slider-out { display: flex; justify-content: space-between; font-size: 13px; }
.campaign { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 14px 0; }
.campaign:first-child { border-top: none; }
.campaign .body { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.small { font-size: 13px; }

/* multi-select picker */
.ms { position: relative; }
.ms-drop {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 20;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; }
.ms-opt:hover, .ms-opt.hl { background: var(--card); }
.ms-opt img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; background: var(--line); }
.ms-opt .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 10px;
}
.chip button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 15px; width: auto; }
.ms-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }
