:root {
  --bg: #0B0E13;
  --panel: #10141B;
  --field: #121821;
  --raise: #18202B;
  --line: #222A36;
  --line-2: #2E3746;
  --text: #E6EAF0;
  --text-2: #B4BDC9;
  --muted: #9AA4B2;
  --faint: #8B95A3;
  --teal: #3DD6B5;
  --teal-ink: #062019;
  --teal-soft: #0F2A24;
  --teal-text: #5FE3C6;
  --teal-line: #2C6B5D;
  --amber: #F5B84A;
  --amber-soft: #2A2310;
  --amber-line: #5C4718;
  --red: #FF8A8E;
  --red-soft: #2C1416;
  --red-line: #6B2A2E;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--body); }
a { color: var(--teal-text); }
a:hover { color: #9AF0DC; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 220px; max-width: 248px; min-width: 200px; background: var(--panel); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--teal); color: var(--teal-ink); font: 700 15px var(--display); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-text b { font: 700 16px var(--display); letter-spacing: 0.02em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 18px; }
.brand.big .brand-text b { font-size: 22px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; min-height: 44px; }
.nav-item:hover { background: #151B25; color: var(--text); }
.nav-item.active { background: #1A2230; color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--teal); }
.nav-badge { font: 12px var(--mono); color: var(--muted); }
.nav-badge.warn { background: var(--amber-soft); color: var(--amber); padding: 2px 7px; border-radius: 99px; }
.brands ul { list-style: none; margin: 8px 0 0; padding: 0; color: var(--text-2); }
.brands li { padding: 6px 12px; display: flex; gap: 8px; align-items: center; }
.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.me form { margin: 0 0 0 auto; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { font-size: 12px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 99px; background: #5865F2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; object-fit: cover; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--raise); color: var(--text); }

.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px 32px; border-bottom: 1px solid var(--line); }
.page-head .titles { display: flex; flex-direction: column; gap: 4px; }
.page-body { padding: 24px 32px 48px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- controls ---------- */
.btn { height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--raise); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 700; }
.btn.primary:hover { background: #5FE3C6; }
.btn.amber { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); font-weight: 600; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.discord { background: #5865F2; border-color: #5865F2; color: #fff; font-weight: 600; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field.grow { flex: 1 1 200px; }
input[type=text], input[type=url], input[type=password], input[type=datetime-local], input:not([type]), select, textarea {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--field); color: var(--text); width: 100%;
}
textarea { padding: 14px; resize: vertical; line-height: 1.55; font-size: 15px; }
input.headline { font-size: 17px; font-weight: 600; min-height: 48px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ready, .pill.ok, .pill.done, .pill.scheduled { background: var(--teal-soft); color: var(--teal-text); }
.pill.review, .pill.manual, .pill.pending, .pill.sending, .pill.publishing { background: var(--amber-soft); color: var(--amber); }
.pill.blocked, .pill.failed, .pill.partial { background: var(--red-soft); color: var(--red); }
.pill.off, .pill.draft, .pill.later { background: #1A1F28; color: var(--muted); }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin: 0; }
.alert.warn { background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber); }
.alert.error { background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red); }
.alert.info { background: var(--teal-soft); border: 1px solid var(--teal-line); color: var(--teal-text); }
.badge { flex: none; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--display); }
.badge.sm { width: 28px; height: 26px; border-radius: 6px; font-size: 11.5px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 18px; opacity: 0; pointer-events: none; transition: 0.2s; max-width: min(640px, 90vw); z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { border-color: var(--red-line); color: var(--red); }

/* ---------- compose ---------- */
.compose { display: flex; flex-wrap: wrap; gap: 24px; }
.compose .write { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.compose .side { flex: 2 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.editor { border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); overflow: hidden; }
.editor:focus-within { border-color: var(--teal); }
.editor textarea { border: 0; background: transparent; border-radius: 0; min-height: 200px; }
.toolbar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); align-items: center; }
.toolbar button { width: 36px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.toolbar button:hover { background: var(--raise); }
.toolbar .hint { margin-left: auto; font-size: 12px; color: var(--muted); padding-right: 6px; }
.media-row { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb { position: relative; width: 168px; height: 104px; border-radius: 8px; border: 1px solid var(--line-2); overflow: hidden; background: var(--raise); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 6px; border: 0; background: rgba(0,0,0,0.7); color: #fff; cursor: pointer; }
.drop { width: 104px; height: 104px; border-radius: 8px; border: 1px dashed #3A4556; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 8px; }
.drop:hover { border-color: var(--teal); color: var(--text); }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ch { display: flex; gap: 12px; align-items: flex-start; text-align: left; min-height: 72px; padding: 12px; border-radius: 10px; cursor: pointer; background: #0F1318; border: 1px solid var(--line); }
.ch[aria-pressed=true] { background: #121C22; border-color: var(--teal-line); }
.ch[aria-pressed=false] .ch-body { opacity: 0.6; }
.ch:disabled { cursor: not-allowed; opacity: 0.5; }
.ch-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ch-name { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.ch-count { font: 500 11.5px var(--mono); color: var(--muted); }
.ch-count.warn { color: var(--amber); }
.ch-method { font-size: 12px; color: var(--muted); }
.ch-note { font-size: 12px; color: var(--amber); }
.ch-note.error { color: var(--red); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { height: 40px; padding: 0 14px; border-radius: 99px; cursor: pointer; font-weight: 600; background: transparent; color: var(--text-2); border: 1px solid var(--line-2); }
.tab[aria-selected=true] { background: var(--text); color: var(--bg); border-color: var(--text); }
.checklist { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; flex: none; }
.dot.ok { background: var(--teal); } .dot.warn { background: var(--amber); } .dot.error { background: var(--red); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; padding: 24px; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(5, 7, 10, 0.7); }
dialog h2 { margin-bottom: 8px; }
dialog .actions { justify-content: flex-end; margin-top: 18px; }

/* ---------- previews ---------- */
.pv { border-radius: 10px; padding: 16px; display: flex; gap: 12px; }
.pv .pv-av { width: 40px; height: 40px; flex: none; border-radius: 99px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.pv .pv-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.pv .pv-meta { font-size: 12px; opacity: 0.8; }
.pv .pv-title { font-weight: 700; font-size: 15.5px; }
.pv .pv-text { white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 14px; }
.pv .pv-media { border-radius: 8px; overflow: hidden; max-height: 240px; }
.pv .pv-media img, .pv .pv-media video { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.pv-discord { background: #313338; color: #DBDEE1; }
.pv-discord .embed { border-left: 4px solid; background: #2B2D31; border-radius: 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pv-discord .pv-title { color: #00A8FC; }
.pv-discord .app-tag { font-size: 11px; background: #5865F2; color: #fff; padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.pv-x { background: #000; border: 1px solid #2F3336; color: #E7E9EA; }
.pv-bluesky { background: #161E27; border: 1px solid #2E3A48; color: #F1F3F5; }
.pv-facebook { background: #242526; color: #E4E6EB; }
.pv-instagram { background: #000; border: 1px solid #262626; color: #F5F5F5; }
.pv-reddit { background: #0E1113; border: 1px solid #343536; color: #D7DADC; }
.pv-reddit .pv-title { font-size: 18px; color: #F2F4F5; }
.pv-steam { background: #1B2838; color: #ACB2B8; }
.pv-steam .pv-title { color: #fff; }
.pv-steam .pv-text { font-family: var(--mono); font-size: 12.5px; }
.pv-tiktok { background: #121212; color: #E6EAF0; }
.pv-youtube { background: #0F0F0F; color: #F1F1F1; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 20px; }
@media (max-width: 480px) { .pv-grid { grid-template-columns: 1fr; } }
.pv-card { display: flex; flex-direction: column; overflow: hidden; }
.pv-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pv-card > header b { flex: 1; }
.pv-card > .pv { border-radius: 0; flex: 1; }
.pv-card > footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pv-card .issues { padding: 10px 14px 0; display: flex; flex-direction: column; gap: 6px; }
.pv-card .override { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); background: #0D1117; }
.pv-card.off { opacity: 0.6; }

/* ---------- queue ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; min-width: 1100px; }
.week-wrap { overflow-x: auto; }
.day { min-height: 260px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.day.today { border-color: var(--teal); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-head span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.day-head b { font: 600 20px var(--display); }
.day.today .day-head b { color: var(--teal); }
.chip { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 8px; text-decoration: none; border: 1px solid; }
.chip .t { font: 11.5px var(--mono); opacity: 0.85; }
.chip .h { font-weight: 600; font-size: 13px; line-height: 1.3; }
.chip .s { font-size: 11.5px; opacity: 0.85; }
.chip.scheduled, .chip.publishing { background: #122A24; border-color: var(--teal-line); color: #BFF5E7; }
.chip.pending { background: var(--amber-soft); border-color: var(--amber-line); color: #F8D693; }
.chip.done, .chip.draft { background: #151A22; border-color: #2A3240; color: var(--muted); }
.chip.failed, .chip.partial { background: var(--red-soft); border-color: var(--red-line); color: #FFB4B6; }
.table { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--panel); }
.table-inner { min-width: 980px; }
.tr { display: grid; grid-template-columns: 170px minmax(0, 2fr) minmax(0, 2fr) 130px 230px; gap: 16px; padding: 14px 18px; align-items: center; border-bottom: 1px solid #1A212C; }
.tr.th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 18px; }
.tr:last-child { border-bottom: 0; }
.dl { display: flex; flex-wrap: wrap; gap: 5px; }
.dl .badge { cursor: default; }
.d-ok { background: var(--teal-soft); color: var(--teal-text); }
.d-manual, .d-sending, .d-wait { background: var(--amber-soft); color: var(--amber); }
.d-failed { background: var(--red-soft); color: var(--red); }
.manual-box { display: flex; flex-direction: column; gap: 10px; }
.manual-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12.5px/1.5 var(--mono); max-height: 280px; overflow: auto; }

/* ---------- accounts ---------- */
.acct-layout { display: flex; flex-wrap: wrap; gap: 24px; }
.acct-grid { flex: 999 1 640px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-content: start; }
.acct-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.acct { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.acct.none { border-style: dashed; border-color: var(--line-2); }
.acct-head { display: flex; gap: 12px; align-items: center; }
.acct-head .t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.acct-head .t b { font-size: 15px; }
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 10px; font-size: 12.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text-2); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: #D2D8E0; line-height: 1.45; font-size: 13px; }
.hook { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 40px; gap: 8px; align-items: center; }
.hook .masked { font: 12px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.side-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.role-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #122019 0, var(--bg) 55%); }
.login-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.dev-login { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }

@media (max-width: 760px) {
  .sidebar { position: static; height: auto; max-width: none; flex-basis: 100%; gap: 14px; padding: 14px 16px; }
  .sidebar .brands, .sidebar .me { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .page-head, .page-body { padding-left: 16px; padding-right: 16px; }
}

/* ---------- in-game news panel ---------- */
.news-box { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-color: #3A2A2C; }
.news-box legend { padding: 0 6px; font: 600 13px var(--display); color: #FFB4B6; letter-spacing: 0.04em; }
.check-row { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: var(--text-2); }
.check-row input { width: 18px; height: 18px; accent-color: var(--teal); }
