:root {
  --bg: #f4f6fb; --panel: #ffffff; --panel-2: #f8fafc; --border: #e3e8f0; --text: #0f172a; --muted: #64748b;
  --primary: #2563eb; --primary-ink: #ffffff; --primary-soft: #e0eaff;
  --ok: #059669; --ok-soft: #d1fae5; --off: #94a3b8; --off-soft: #eef2f7; --danger: #dc2626; --warn: #b45309; --warn-soft: #fef3c7;
  --sidebar: #0b1220; --sidebar-ink: #cbd5e1; --sidebar-active: #1e293b;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --panel: #121a2e; --panel-2: #0f1628; --border: #222d45; --text: #e5eaf5; --muted: #8b98b3;
    --primary-soft: #1b2a4d; --ok-soft: #0f3b2e; --off-soft: #1c2438; --warn-soft: #3b2c0c;
    --sidebar: #070b16; --sidebar-active: #172036; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.error { color: var(--danger); min-height: 1em; margin: 6px 0; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; padding: 4px 10px 18px; }
.brand.big { color: var(--text); font-size: 18px; justify-content: center; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #3b82f6, #22d3ee); display: inline-block; flex-shrink: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--sidebar-ink); padding: 9px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--sidebar-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 16px 10px 6px; }
.user-box { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid #1e293b; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1e3a8a; color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.user-meta b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: #64748b; }
.user-box .icon-btn { color: var(--sidebar-ink); }
.content { padding: 24px 28px 60px; min-width: 0; }
.content.dragging { outline: 3px dashed var(--primary); outline-offset: -12px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 8px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; order: 3; width: 100%; }
  .nav a span, .nav-section { display: none; }
  .user-box { border: 0; padding: 0; margin-left: auto; }
  .user-meta { display: none; }
  .content { padding: 16px; }
}

/* ---------- page ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: table; font-size: 13px; margin-bottom: 6px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card .pad { padding: 16px 16px 0; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 120px; }
.row.inline { align-items: flex-end; margin-top: 8px; }
.row.inline > .field { flex: 0 1 auto; margin: 0; }
.row.tight { gap: 4px; flex-wrap: nowrap; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty p { margin: 0 0 14px; }
.banner { background: var(--primary-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input[type="color"] { padding: 2px; height: 36px; width: 56px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
textarea { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 4px 14px 12px 0; cursor: pointer; }
.search { width: 220px; }
.title-input { font-size: 20px; font-weight: 650; border-color: transparent; background: transparent; padding: 4px 6px; margin-left: -6px; width: 100%; max-width: 560px; }
.title-input:hover { border-color: var(--border); }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 26px; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
.form .btn[type="submit"] { margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 8px; padding: 7px 12px; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); border-color: var(--border); }
.btn.danger.ghost { color: var(--danger); background: transparent; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn.pulse { box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; display: inline-grid; place-items: center; font: inherit; }
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.hover tbody tr { cursor: pointer; }
.table.hover tbody tr:hover { background: var(--panel-2); }
.table tr.disabled td { opacity: .55; }
.card .table { margin: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--off-soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.tiny { font-size: 10px; padding: 0 6px; margin-left: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--off); margin-right: 2px; }
.dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-sub { color: var(--muted); font-size: 12px; }
.steps { margin: 0; padding-left: 20px; line-height: 2; }

/* ---------- media ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 600; background: none; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--panel); border-color: var(--border); color: var(--text); }
.tab .count { margin-left: 6px; font-size: 11px; background: var(--off-soft); padding: 1px 6px; border-radius: 999px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--shadow); }
.media-card:hover { border-color: var(--primary); }
.media-info { padding: 10px 12px; }
.media-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.thumb { position: relative; background: #0f172a; display: grid; place-items: center; color: #94a3b8; overflow: hidden; flex-shrink: 0; }
.thumb.md { aspect-ratio: 16 / 9; width: 100%; }
.thumb.sm { width: 64px; height: 36px; border-radius: 5px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.placeholder.t-html { background: linear-gradient(135deg, #7c2d12, #c2410c); color: #fff; }
.html-preview { aspect-ratio: 16 / 9; height: auto; border: 0; }
.thumb.placeholder.t-web { background: linear-gradient(135deg, #1e3a8a, #0e7490); color: #fff; }
.badge-play { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.uploads:empty { display: none; }
.uploads { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.upload-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.upload-row > span:first-child { flex: 0 0 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { flex: 1; height: 6px; background: var(--off-soft); border-radius: 3px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.upload-row.failed .progress .bar { background: var(--danger); }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.media-detail:has(> form:only-child) { grid-template-columns: 1fr; }
.preview { width: 100%; border-radius: 8px; background: #000; max-height: 60vh; object-fit: contain; }
@media (max-width: 800px) { .media-detail { grid-template-columns: 1fr; } }

/* ---------- playlist editor ---------- */
.editor-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .editor-2 { grid-template-columns: 1fr; } }
.pl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.pl-item.dragging { opacity: .4; }
.pl-item.drop { border-color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }
.grip { color: var(--muted); cursor: grab; display: grid; }
.idx { width: 20px; text-align: center; color: var(--muted); font-weight: 600; font-size: 12px; }
.dur-wrap { display: flex; align-items: center; gap: 4px; }
.dur { width: 72px; }
.item-actions { display: flex; }
.lib-list { display: flex; flex-direction: column; gap: 4px; max-height: 65vh; overflow-y: auto; margin-top: 10px; }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lib-item:hover:not(:disabled) { border-color: var(--border); background: var(--panel-2); }
.lib-item .icon { color: var(--primary); }
.lib-list .search, .card > .search { width: 100%; }

/* ---------- layouts ---------- */
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.layout-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.layout-card > a { display: grid; place-items: center; padding: 14px; background: var(--panel-2); height: 180px; }
.layout-card-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 10px 14px; gap: 8px; }
.layout-mini { position: relative; max-width: 100%; max-height: 150px; height: 150px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.mini-zone { position: absolute; border: 1.5px solid; border-radius: 2px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .editor-layout { grid-template-columns: 1fr; } }
.canvas-wrap { background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; place-items: center; }
.canvas { position: relative; width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); touch-action: none; user-select: none; }
.canvas.portrait { width: auto; height: 70vh; }
.zone-box { position: absolute; border: 2px solid; cursor: move; overflow: hidden; }
.zone-box.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); z-index: 100 !important; }
.zone-label { position: absolute; inset: 0; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); pointer-events: none; overflow: hidden; }
.zone-label .dim { opacity: .75; font-size: 11px; }
.handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--primary); border-radius: 3px; display: none; }
.zone-box.selected .handle { display: block; }
.handle.nw { left: -1px; top: -1px; cursor: nwse-resize; }
.handle.ne { right: -1px; top: -1px; cursor: nesw-resize; }
.handle.sw { left: -1px; bottom: -1px; cursor: nesw-resize; }
.handle.se { right: -1px; bottom: -1px; cursor: nwse-resize; }
.zone-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.zone-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.zone-chip.active { border-color: var(--primary); background: var(--primary-soft); }
.swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- schedules ---------- */
.timeline { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.tl-day { text-align: center; font-weight: 600; font-size: 12px; color: var(--muted); height: 22px; }
.tl-body { position: relative; height: 420px; background: repeating-linear-gradient(to bottom, var(--panel-2) 0, var(--panel-2) calc(100% / 8 - 1px), var(--border) calc(100% / 8 - 1px), var(--border) calc(100% / 8)); border-radius: 6px; }
.tl-hours .tl-body { background: none; }
.tl-hours span { position: absolute; right: 4px; font-size: 10px; color: var(--muted); transform: translateY(-50%); }
.tl-hours span:first-child { transform: none; }
.tl-block { position: absolute; border: 0; border-radius: 5px; color: #fff; font: inherit; font-size: 11px; padding: 3px 5px; text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.tl-block span { opacity: .85; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 12px; }

/* ---------- players ---------- */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.btn.cmd { justify-content: flex-start; }
.screenshot img { width: 100%; border-radius: 8px; background: #000; display: block; }
.screenshot p { margin: 6px 0 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- reports ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 48px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-val { font-size: 11px; color: var(--muted); }
.bar-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- modal & toast ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-body { padding: 8px 18px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--border); margin-top: 8px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 380px; transition: opacity .3s, transform .3s; border-left: 4px solid #10b981; }
.toast.err { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, var(--primary-soft), var(--bg) 60%); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(15, 23, 42, .12); }
.login-card h1 { margin: 6px 0 18px; font-size: 20px; justify-content: center; }

/* ---------- tenants ---------- */
.tenant-box { margin: 0 4px 14px; padding: 8px 10px; border-radius: 8px; background: var(--sidebar-active); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tenant-box small { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.tenant-box b { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-select { background: transparent; color: #fff; border: 0; padding: 0; font-weight: 700; width: 100%; cursor: pointer; }
.tenant-select:focus { outline: 2px solid var(--primary); }
.tenant-select option { color: #0f172a; }
.progress.full .bar { background: var(--danger); }
td .progress { margin-top: 6px; max-width: 140px; }
@media (max-width: 860px) { .tenant-box { margin: 0; order: 2; } }

/* ---------- rotations ---------- */
.rotation-mini { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.rotation-mini .rot-step { width: 64px; display: grid; place-items: center; }
.rotation-mini .rot-step .layout-mini { height: auto; width: 100%; max-height: 90px; }
.rot-arrow, .rot-more { color: var(--muted); font-weight: 700; }
.rotation-mini.empty-rot { flex-direction: column; color: var(--muted); }
.rot-thumb { width: 72px; flex-shrink: 0; }
.rot-thumb .layout-mini { height: auto; width: 100%; }
.rot-steps select { width: 100%; max-width: 320px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- downloads ---------- */
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.download-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.download-card h3 { margin: 0; }
.download-card .btn { align-self: flex-start; }
.download-grid + .card { margin-top: 16px; }
.dl-head { display: flex; gap: 12px; align-items: center; }
.steps.small { line-height: 1.6; margin: 0; }
.copy-wrap { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.copy-code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; word-break: break-all; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.update-card p { margin: 4px 0 0; }
.update-card .check { margin-bottom: 4px; }

/* ---------- plugins ---------- */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plugin-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.plugin-card.disabled { opacity: .6; }
.plugin-card p { margin: 0 0 6px; flex: 1; }
.plugin-head { display: flex; align-items: center; gap: 12px; }
.plugin-head h3 { margin: 0; }
.plugin-head .check { margin: 0; }
.plugin-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.plugin-emoji { line-height: 1; }
.thumb.placeholder.t-plugin { background: linear-gradient(135deg, #312e81, #6d28d9); color: #fff; }
.plugin-pick { display: flex; flex-direction: column; gap: 8px; }
.plugin-option { display: flex; gap: 12px; align-items: center; text-align: left; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.plugin-option:hover { border-color: var(--primary); }
.plugin-dialog { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.plugin-dialog.has-editor { grid-template-columns: 1fr; }
.plugin-dialog .plugin-settings { min-width: 0; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.plugin-editor { width: 100%; height: 52vh; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.plugin-preview { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; display: block; }
.plugin-dialog.has-editor .plugin-side { max-width: 420px; }
@media (max-width: 800px) { .plugin-dialog { grid-template-columns: 1fr; } }
