:root {
  --bg: #fafafb; --panel: #fff; --text: #17181c; --muted: #6b7080; --line: #e3e5ec;
  --accent: #3b6df0; --accent-text: #fff; --ok: #1f9d57; --warn: #b7791f; --bad: #c53030;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --panel: #171a21; --text: #e8e9ee; --muted: #9096a8; --line: #272b36;
    --accent: #6c93ff; --accent-text: #0b0d12; --ok: #4cc38a; --warn: #e0a84a; --bad: #f07b7b;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 60px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 16px; height: 54px; }
.brand { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -.02em; }
.nav { display: flex; gap: 14px; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--line); object-fit: cover; flex: none; }
.slots { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.slots.full { color: var(--bad); border-color: var(--bad); }

button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 7px 12px; border-radius: 8px; }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.danger { color: var(--bad); }
button.ghost { padding: 3px 9px; font-size: 13px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }

input[type=text], select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card h2, .card h3 { margin: 0 0 10px; }
.card.ok { border-color: var(--ok); }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.row .lbl { min-width: 110px; font-weight: 600; font-size: 13px; }
.row a.url { word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.banner { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; }
.banner.warn { border-color: var(--warn); color: var(--warn); }
.banner.bad { border-color: var(--bad); color: var(--bad); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 180px; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.expired { color: var(--bad); border-color: var(--bad); }

.stage { position: relative; }
.frame { display: block; width: 100%; height: 70vh; min-height: 200px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chip-wrap { position: sticky; top: 64px; height: 0; z-index: 30; }
.chip-box { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
button.primary.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.pins { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.pins.placing { pointer-events: auto; cursor: crosshair; background: rgba(59,109,240,.06); }
.pin { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-text); border: 2px solid #fff; font-weight: 700; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.35); z-index: 5; }
.pin.on { background: var(--text); color: var(--bg); }
.pop { position: absolute; width: 300px; z-index: 20; pointer-events: auto; margin: 0; box-shadow: 0 8px 28px rgba(0,0,0,.28); max-height: 420px; overflow: auto; }
.comment { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment.reply { margin-left: 24px; }
.comment .body { white-space: pre-wrap; word-break: break-word; }
.comment .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 60; }
.modal { width: min(360px, 92vw); margin: 0; }
.btn.provider { display: block; width: 100%; text-align: center; margin-top: 8px; box-sizing: border-box; }
.gate .btn.provider { max-width: 320px; }
.captcha-slot { min-height: 70px; }

.editor textarea { min-height: 360px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 860px) {
  .pop { width: 240px; }
  .grid2 { grid-template-columns: 1fr; }
  .nav a { font-size: 14px; }
  .who span:not(.slots) { display: none; }
}

.row select { width: auto; min-width: 140px; }
.list select { width: auto; min-width: 140px; }
.live-head { justify-content: space-between; margin: 0 0 4px; }
.live-head h3 { margin: 0; }
.quip { margin: 0 0 6px; }

.dock { width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.25); overflow: hidden; }
.collapsible-trigger { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 0; background: transparent; font-weight: 600; }
.chev { transition: transform .2s; }
.dock.open .chev { transform: rotate(180deg); }
.collapsible-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.dock.open .collapsible-content { grid-template-rows: 1fr; }
.collapsible-inner { overflow: hidden; min-height: 0; }
.dock.open .collapsible-inner { padding: 8px; border-top: 1px solid var(--line); max-height: 50vh; overflow-y: auto; }
.collapsible-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.collapsible-list .item { display: flex; gap: 8px; align-items: center; text-align: left; width: 100%; }
.collapsible-list .item.on { border-color: var(--text); }
.collapsible-list .num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 12px; display: grid; place-items: center; }
.collapsible-list .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
