:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --primary: #111827;
  --primary-text: #ffffff;
  --primary-hover: #1f2937;
  --brand: #f59e0b;
  --brand-soft: #fef3c7;
  --brand-ink: #92400e;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info-soft: #e0e7ff;
  --info-ink: #3730a3;
  --sidebar: #0f1115;
  --sidebar-text: #c7cbd3;
  --sidebar-active: #1c1f26;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 45px -12px rgba(16, 24, 40, .35);
  --radius: 10px;
  --radius-sm: 7px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --surface: #14171c;
    --surface-2: #1b1f26;
    --border: #262b33;
    --border-strong: #353b45;
    --text: #eef0f3;
    --text-2: #b4bac4;
    --text-3: #8a919c;
    --primary: #fbbf24;
    --primary-text: #111827;
    --primary-hover: #fcd34d;
    --brand-soft: #3a2a07;
    --brand-ink: #fcd34d;
    --ok: #34d399;
    --ok-soft: #0b2e22;
    --danger: #f87171;
    --danger-soft: #3b1212;
    --info-soft: #1e1b4b;
    --info-ink: #c7d2fe;
    --sidebar: #08090c;
    --sidebar-active: #161920;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow-lg: 0 20px 45px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; letter-spacing: .01em; }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 16px; height: 16px; stroke: #111; }
.brand .org { display: block; font-size: 11.5px; font-weight: 500; color: #8a919c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--sidebar-text); font-weight: 500; }
.nav a:hover { background: var(--sidebar-active); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav a .badge { margin-left: auto; font-size: 11px; background: #22262e; color: #cbd5e1; padding: 1px 7px; border-radius: 999px; }
.nav .sep { height: 1px; background: #1f232a; margin: 10px 6px; }
.sidebar .me { margin-top: auto; padding: 10px; border-top: 1px solid #1f232a; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2a2f38; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.sidebar .me .who { min-width: 0; flex: 1; }
.sidebar .me .who b { display: block; color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me .who span { font-size: 11.5px; color: #8a919c; }
.sidebar .me button { background: none; border: 0; color: #8a919c; cursor: pointer; padding: 6px; border-radius: 6px; }
.sidebar .me button:hover { color: #fff; background: var(--sidebar-active); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 32px 8px; flex-wrap: wrap; }
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 16px 32px 48px; }
.mobilebar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 30; }
  .mobilebar button { background: none; border: 0; color: #fff; padding: 4px; }
  .topbar { padding: 16px 16px 4px; }
  .content { padding: 12px 16px 40px; }
}

/* ---------- Components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn svg.i { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h2 { font-size: 15px; font-weight: 650; }
.card-b { padding: 18px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg.i { width: 38px; height: 38px; stroke-width: 1.4; color: var(--text-3); margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill.info { background: var(--info-soft); color: var(--info-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Forms */
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--text); }
.field .help { font-size: 12.5px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-transform: uppercase; height: 52px; text-align: center; }
input[type=color].input { padding: 3px; width: 52px; cursor: pointer; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row .input:not([type=color]) { font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--primary); color: var(--primary-text); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-grid; place-items: center; width: 44px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); font-weight: 600; font-size: 12.5px; color: var(--text-2); background: var(--surface); }
.days input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.days input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
.error-text { color: var(--danger); font-size: 13px; font-weight: 500; }

/* Toggle switch */
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: var(--surface-2); }
table.t td.actions { text-align: right; white-space: nowrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 15px; color: var(--text-3); font-weight: 600; }
.stat .s { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 8px; }
.checklist li:hover { background: var(--surface-2); }
.checklist .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-3); flex: none; }
.checklist li.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li.done b { text-decoration: line-through; color: var(--text-3); }
.checklist b { display: block; font-weight: 600; }
.checklist a { font-weight: 600; font-size: 13px; }

/* Screens */
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.screen-card { display: flex; flex-direction: column; overflow: hidden; }
.screen-card .preview { aspect-ratio: 16/9; background: #000; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.screen-card .preview iframe { position: absolute; left: 0; top: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; }
.screen-card .preview .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #6b7280; font-size: 13px; }
.screen-card .preview .status { position: absolute; left: 10px; top: 10px; }
.screen-card .body { padding: 14px 16px; display: grid; gap: 8px; flex: 1; }
.screen-card .body h3 { font-size: 15px; font-weight: 650; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-card .foot { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters .input { width: auto; min-width: 200px; }

/* Media */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--text-3); background: var(--surface); transition: border-color .15s, background .15s; margin-bottom: 18px; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.dropzone b { color: var(--text); }
.uploads { display: grid; gap: 8px; margin-bottom: 18px; }
.upload-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px; align-items: center; padding: 10px 14px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .15s; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { overflow: hidden; cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative; }
.media-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.thumb { aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; position: relative; overflow: hidden; display: grid; place-items: center; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .tag { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; display: flex; gap: 4px; align-items: center; }
.thumb .tag svg.i { width: 12px; height: 12px; }
.media-card .meta { padding: 10px 12px; }
.media-card .meta b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card .meta span { font-size: 12px; color: var(--text-3); }
.media-card.selected { outline: 3px solid var(--brand); outline-offset: -1px; }
.media-card .tick { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #111; display: none; place-items: center; z-index: 2; }
.media-card.selected .tick { display: grid; }

/* Playlists */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pl-card { overflow: hidden; cursor: pointer; transition: box-shadow .12s; display: flex; flex-direction: column; }
.pl-card:hover { box-shadow: var(--shadow-lg); }
.pl-card .cover { aspect-ratio: 16/8; background: linear-gradient(135deg, #1f2937, #111827) center/cover; display: grid; place-items: center; color: #6b7280; position: relative; }
.pl-card .cover svg.i { width: 34px; height: 34px; stroke-width: 1.3; }
.pl-card .body { padding: 14px 16px; flex: 1; }
.pl-card .body h3 { font-size: 15px; font-weight: 650; }
.pl-card .foot { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
@media (max-width: 1200px) { .editor { grid-template-columns: 1fr; } }
.side-sticky { position: sticky; top: 16px; display: grid; gap: 16px; }
.live { aspect-ratio: 16/9; background: #000; border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.live.portrait { aspect-ratio: 9/16; max-height: 70vh; margin: 0 auto; }
.live.square { aspect-ratio: 1/1; max-height: 70vh; margin: 0 auto; }
.live iframe { position: absolute; left: 0; top: 0; width: 300%; height: 300%; border: 0; transform: scale(.3333); transform-origin: 0 0; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 22px 30px 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.item:last-child { border-bottom: 0; }
.item.dragging { opacity: .45; }
.item.drop-before { box-shadow: inset 0 3px 0 var(--brand); }
.item.drop-after { box-shadow: inset 0 -3px 0 var(--brand); }
.item.disabled .thumbs, .item.disabled .info { opacity: .45; }
.item .grip { cursor: grab; color: var(--text-3); display: grid; place-items: center; }
.item .num { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; text-align: center; font-size: 12.5px; }
.item .thumbs { width: 88px; aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.item .thumbs img, .item .thumbs video { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .thumbs.widget { color: #fff; }
.item .thumbs.widget svg.i { width: 26px; height: 26px; }
.item .info { min-width: 0; }
.item .info b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .info .row { gap: 6px; margin-top: 3px; }
.item .ctrls { display: flex; align-items: center; gap: 6px; }
.dur { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 30px; overflow: hidden; background: var(--surface); }
.dur input { width: 52px; border: 0; background: none; text-align: right; padding: 0 4px; outline: none; font-variant-numeric: tabular-nums; }
.dur span { padding: 0 8px 0 2px; color: var(--text-3); font-size: 12px; }
select.mini { height: 30px; padding: 0 6px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; }
@media (max-width: 720px) {
  .item { grid-template-columns: 22px 70px minmax(0, 1fr); }
  .item .num { display: none; }
  .item .thumbs { width: 70px; }
  .item .ctrls { grid-column: 1 / -1; flex-wrap: wrap; }
}
.widget-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .widget-pick { grid-template-columns: repeat(2, 1fr); } }
.widget-pick button { text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; cursor: pointer; display: grid; gap: 8px; transition: border-color .12s, background .12s; }
.widget-pick button:hover { border-color: var(--text-2); background: var(--surface-2); }
.widget-pick .wi { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.widget-pick b { font-weight: 650; }
.widget-pick span { font-size: 12.5px; color: var(--text-3); }

/* Schedules */
.week { display: grid; grid-template-columns: 56px 1fr; font-size: 12px; }
.week .hours { display: grid; grid-template-columns: repeat(24, 1fr); border-bottom: 1px solid var(--border); color: var(--text-3); }
.week .hours span { padding: 6px 0 6px 3px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; overflow: hidden; }
.week .hours span:nth-child(odd) { color: transparent; }
@media (min-width: 1300px) { .week .hours span:nth-child(odd) { color: var(--text-3); } }
.week .dayname { padding: 0 8px; display: flex; align-items: center; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); height: 46px; }
.week .dayname.today { color: var(--brand-ink); }
.week .lane { position: relative; height: 46px; border-bottom: 1px solid var(--border); background-image: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / 24)); }
.week .lane.today { background-color: color-mix(in srgb, var(--brand) 7%, transparent); }
.week .blk { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; padding: 3px 7px; color: #fff; font-size: 11.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; line-height: 1.3; }
.week .blk small { display: block; font-weight: 500; opacity: .85; font-size: 10.5px; }
.week .blk.off { opacity: .35; }
.week .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(8, 10, 14, .55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto; animation: fadein .12s ease; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .16s ease; }
.modal.wide { max-width: 880px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.modal-h h2 { font-size: 17px; font-weight: 700; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 22px; display: grid; gap: 16px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 200; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; gap: 10px; align-items: center; animation: pop .16s ease; max-width: 380px; }
.toast.err { background: #b91c1c; }
.toast svg.i { width: 16px; height: 16px; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--brand) 14%, var(--bg)), var(--bg) 60%); }
.auth .card { width: 100%; max-width: 420px; padding: 30px; }
.auth .brand { color: var(--text); padding: 0 0 22px; font-size: 16px; }
.auth h1 { font-size: 22px; margin-bottom: 4px; }
.auth p.lead { color: var(--text-3); margin: 0 0 22px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 9px 14px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.callout { background: var(--info-soft); color: var(--info-ink); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.callout.warn { background: var(--brand-soft); color: var(--brand-ink); }
.copy { display: flex; gap: 8px; }
.copy .input { font-family: var(--mono); font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; }
details[open] > summary::before { content: '▾ '; }
.item.out-of-window .thumbs, .item.out-of-window .info b { opacity: .5; }
.pill.off .i, .pill.info .i, .pill.brand .i { width: 13px; height: 13px; }
.media-card .exp { position: absolute; right: 8px; top: 8px; z-index: 1; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- Banners (trial / overdue / locked / support view) ---------- */
.banners { display: grid; gap: 0; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 32px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.banner .btn { margin-left: auto; }
.banner a { font-weight: 600; }
.banner.info { background: var(--info-soft); color: var(--info-ink); }
.banner.warn { background: var(--brand-soft); color: var(--brand-ink); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.imp { background: #312e81; color: #e0e7ff; }
.banner.imp .btn { background: #fff; color: #312e81; border-color: #fff; }
@media (max-width: 900px) { .banner { padding: 10px 16px; } }

/* ---------- Sidebar usage meter ---------- */
.usage-mini { margin-top: auto; padding: 12px 10px 4px; display: grid; gap: 10px; font-size: 12px; color: #8a919c; }
.usage-mini + .me { margin-top: 0; }
.usage-mini .um-plan { display: flex; justify-content: space-between; color: #fff; font-weight: 600; font-size: 12.5px; }
.usage-mini .um-plan a { color: #fbbf24; font-weight: 500; text-decoration: none; }
.usage-mini .bar { height: 4px; background: #22262e; margin-top: 5px; }
.usage-mini .bar.hot > i { background: #f87171; }

/* ---------- Plan & usage page ---------- */
.meter-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.meter-row:last-child { border-bottom: 0; }
.meter-row .bar { height: 8px; }
.meter-row .bar.hot > i { background: var(--danger); }
.feat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; }
.feat-list div { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.feat-list .yes { color: var(--ok); }
.feat-list .no { color: var(--text-3); text-decoration: line-through; }
.feat-list .no svg { color: var(--text-3); }
.locked-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); padding: 1px 7px; border-radius: 99px; }

.usage-mini .row span:last-child { white-space: nowrap; }
