:root {
  --bg: #f5f6f8; --panel: #fff; --line: #e5e7eb; --line-strong: #d1d5db; --text: #111827; --muted: #6b7280; --faint: #9ca3af;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef2ff; --accent-border: #c7d2fe;
  --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --danger: #dc2626; --danger-soft: #fee2e2;
  --side-bg: #0f1420; --side-text: #cbd2df; --side-muted: #7c8599; --side-line: rgba(255,255,255,.07); --side-active: rgba(99,102,241,.18);
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 20px rgba(16,24,40,.05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -4px; }
.ic.sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic.lg { width: 28px; height: 28px; }
.logo { width: 28px; height: 28px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.app > .sidebar { grid-row: 1 / span 2; }
main { padding: 28px 36px 60px; max-width: 1440px; min-width: 0; }
.banner { grid-column: 2; background: var(--warn-soft); color: #92400e; border-bottom: 1px solid #fde68a; padding: 9px 36px; font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* ---------- sidebar ---------- */
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.01em; padding: 2px 6px 16px; }
.tenant-switch { position: relative; margin-bottom: 14px; }
.tenant-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--side-line); color: #fff; border-radius: 10px; padding: 9px 10px; cursor: pointer; text-align: left; }
.tenant-btn:hover { background: rgba(255,255,255,.08); }
.tenant-btn .avatar { background: var(--accent); }
.tenant-btn .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.tenant-btn .t-sub { display: block; font-weight: 400; font-size: 11.5px; color: var(--side-muted); }
.tenant-btn .ic { color: var(--side-muted); }
.tenant-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #161c2c; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.45); padding: 6px; z-index: 30; }
.tenant-menu a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.tenant-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.tenant-menu a.current { color: #fff; background: var(--side-active); }
.tenant-menu a .ic { color: var(--side-muted); }
.tenant-menu .sep { height: 1px; background: rgba(255,255,255,.08); margin: 6px 4px; }
.avatar { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; flex: 0 0 auto; }
.avatar.round { border-radius: 50%; }
nav#nav { display: flex; flex-direction: column; gap: 14px; }
.nav-title { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px 6px; }
.nav-group a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.nav-group a .ic { color: var(--side-muted); }
.nav-group a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-group a.active { background: var(--side-active); color: #fff; }
.nav-group a.active .ic { color: #a5b4fc; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--side-line); }
.whoami { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.whoami .u-name { flex: 1; min-width: 0; }
.whoami .u-name b { display: block; color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami .u-name span { display: block; font-size: 11.5px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami .icon-btn { flex: 0 0 auto; }
.whoami .icon-btn { color: var(--side-muted); }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.foot-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 0 4px; }
.lang select { background: rgba(255,255,255,.05); color: var(--side-text); border: 1px solid var(--side-line); border-radius: 8px; padding: 4px 8px; font-size: 12px; width: auto; }
.server-info { font-size: 11px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---------- typography & blocks ---------- */
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.sub { color: var(--muted); margin-bottom: 20px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card:has(> table) { overflow-x: auto; }
.mb { margin-bottom: 18px; }
.mt { margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.notice { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start; }
.notice .ic { margin-top: 2px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; font-size: 12.5px; }
pre code { background: none; padding: 0; }
kbd { background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-weight: 500; line-height: 1.3; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: #fca5a5; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.dirty::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; margin-left: 2px; }
input[type=text], input[type=url], input[type=number], input[type=password], input[type=email], input[type=search], input[type=time], input[type=date], input[type=datetime-local], select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-border); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 220px; white-space: pre; tab-size: 2; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row > .fixed { flex: 0 0 auto; }
.field.align-btn { padding-top: 20px; flex: 0 0 auto; }
.w-auto { width: auto !important; }
.w-220 { width: 220px !important; }
.input-code { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: .2em; text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.check label { margin: 0; color: var(--text); font-weight: 400; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
table select { min-width: 130px; }
table input[type=text] { min-width: 150px; }
table.activity td { vertical-align: top; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.badge.ok { background: var(--ok-soft); color: #166534; }
.chip { display: inline-flex; align-items: center; gap: 6px; color: #fff; padding: 1px 8px 1px 2px; border-radius: 99px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; max-width: 180px; vertical-align: middle; }
.chip .avatar { width: 18px; height: 18px; font-size: 9px; border-radius: 50%; background: rgba(0,0,0,.25); }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.who { color: var(--muted); font-size: 11.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.act { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--accent-soft); color: #3730a3; white-space: nowrap; }
.act-delete, .act-remove, .act-disconnect, .act-revoke { background: var(--danger-soft); color: #991b1b; }
.act-create, .act-add, .act-connect, .act-pair, .act-upload, .act-accept, .act-signup { background: var(--ok-soft); color: #166534; }
.act-command, .act-impersonate { background: var(--warn-soft); color: #92400e; }
.scr { display: inline-flex; align-items: center; gap: 4px; background: #f3f4f6; border-radius: 6px; padding: 1px 6px; margin: 1px 2px 1px 0; color: var(--text); }
.changes summary { cursor: pointer; color: var(--accent); }
.changes table td { padding: 2px 6px; vertical-align: top; max-width: 260px; overflow-wrap: anywhere; }

/* ---------- tiles / grids ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--line-strong); }
.tile .thumb { aspect-ratio: 16/9; background: #111 center/cover no-repeat; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.tile .thumb .ic.lg { width: 34px; height: 34px; opacity: .85; }
.tile .body { padding: 10px 12px; }
.tile .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .name .ic { color: var(--muted); }
.tile .meta { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; justify-content: space-between; gap: 8px; }
.tile.disabled { opacity: .55; }
.tile.media-tile .thumb { background-size: contain; background-color: #f3f4f6; color: var(--muted); }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.split.wide { grid-template-columns: minmax(320px, 1fr) 1.3fr; }
.list { display: flex; flex-direction: column; gap: 4px; }
.list a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.list a:hover { background: #f3f4f6; }
.list a.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.items { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.item .n { flex: 1; display: flex; align-items: center; gap: 6px; }
.item input[type=number] { width: 70px; }
.item .icon { display: inline-flex; color: var(--muted); }
.item .grip { cursor: grab; color: var(--faint); display: inline-flex; }
.item.dragging { opacity: .4; }
.item.over { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent); }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.preview { position: sticky; top: 20px; }
.preview .frame { aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.preview iframe { width: 100%; height: 100%; border: 0; }
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.typegrid button { text-align: left; padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.typegrid button:hover { border-color: var(--accent); background: var(--accent-soft); }
.typegrid .t-icon { color: var(--accent); display: inline-flex; }
.typegrid .t-icon .ic { width: 22px; height: 22px; }
.typegrid .t-label { font-weight: 600; margin-top: 6px; }
.typegrid .t-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.drop { border: 2px dashed var(--accent-border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: #fafafe; margin-bottom: 18px; cursor: pointer; }
.drop.over { background: var(--accent-soft); border-color: var(--accent); }
.api-block { margin-bottom: 26px; }
.api-block h3 { margin: 0 0 6px; font-size: 14px; }
.sched summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daychip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 10px; font-size: 12.5px; color: var(--text); cursor: pointer; margin: 0; }
.daychip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.daychip input { width: auto; margin: 0; }
.onboarding { margin-top: 18px; border-color: var(--accent-border); background: #f5f7ff; }
.steps { padding-left: 20px; line-height: 1.7; margin: 8px 0 16px; }
.permgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.permgroup { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.permgroup-title { font-weight: 600; margin-bottom: 6px; }
.permgroup .check { margin: 4px 0; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-s { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.tabs .btn { padding: 5px 10px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 80vh; display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 28px; }
.auth-card .brand { color: var(--text); padding: 0 0 16px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card form .btn { width: 100%; margin-top: 6px; padding: 10px; justify-content: center; }
.auth-alt { margin-top: 14px; text-align: center; }

/* ---------- overlays ---------- */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-card h2 { margin-bottom: 14px; font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }

@media (max-width: 1000px) { .editor, .split, .split.wide { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .app > .sidebar { grid-row: auto; } .banner { grid-column: 1; } }
.mb-sm { margin-bottom: 10px; }
.mt-sm { margin-top: 6px; }
.who-line { margin: -8px 0 12px; }
.thumb-fill { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---------- redesign: shared components ---------- */
.empty-state { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 8px; }
.empty-state h2 { margin: 0; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); max-width: 520px; }
.empty-state .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: inline-block; }
.card > .section-title { display: block; }
.search { position: relative; }
.search .search-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); display: inline-flex; }
.search input { padding-left: 32px; width: 240px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.chip-btn span { color: var(--muted); font-size: 12px; }
.chip-btn .ic { width: 14px; height: 14px; color: var(--muted); }
.chip-btn:hover { border-color: var(--accent-border); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.chip-btn.on .ic, .chip-btn.on span { color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #f3f4f6; color: var(--muted); }
.pill .dot { margin: 0; }
.pill .pill-sub { font-weight: 400; color: var(--faint); }
.pill.live, .pill.online { background: var(--ok-soft); color: #166534; }
.pill.live .pill-sub, .pill.online .pill-sub { color: #4d7c5a; }
.icon-btn.subtle { color: var(--faint); }
.icon-btn.subtle:hover { background: #f3f4f6; color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.grow { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.crumbs a:hover { color: var(--accent); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.title-input { font-size: 17px; font-weight: 600; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #fecaca; background: #fff5f5; border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.person { display: flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 6px; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: #d1d5db; position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch .switch-label { color: var(--text); font-size: 14px; }
.steps.compact { margin: 0 0 14px; line-height: 1.5; color: var(--muted); }
.savebar { position: sticky; bottom: 16px; margin-top: 16px; display: flex; align-items: center; gap: 10px; background: #111827; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.savebar span { flex: 1; font-weight: 500; }
.savebar .btn { border-color: transparent; }
.savebar .btn:not(.primary) { background: rgba(255,255,255,.1); color: #fff; }

/* screens */
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.screen-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.screen-top { display: flex; align-items: center; justify-content: space-between; }
.screen-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.screen-now { font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--text); min-height: 20px; }
.screen-card .field { margin: 4px 0 0; }
.screen-meta { font-size: 12.5px; color: var(--muted); }
.screen-url { display: flex; align-items: center; gap: 4px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 10px; }
.screen-url code { background: none; padding: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.screen-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }

/* playlists */
.editor-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.editor-head .actions { display: flex; gap: 6px; }
.thumb.item-thumb { width: 64px; height: 36px; border-radius: 6px; background: #1f2937 center/cover no-repeat; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.thumb.item-thumb .ic { width: 16px; height: 16px; }
.item .pos { width: 22px; text-align: right; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.item .n { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; }
.item .dur { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 12px; }
.item .dur input { width: 64px; text-align: right; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; padding: 2px; }
.pick { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; }
.pick:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thumb.pick-thumb { aspect-ratio: 16/9; background: #1f2937 center/cover no-repeat; display: grid; place-items: center; color: #fff; }
.pick-body { padding: 8px 10px; display: flex; flex-direction: column; }
.list a b { display: block; }
.list a .scr { margin-top: 4px; }

/* slides */
.tile { position: relative; }
.tile-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 10px; background: rgba(17,24,39,.5); opacity: 0; transition: opacity .15s; }
.tile:hover .tile-hover { opacity: 1; }
.tile-flag { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; background: rgba(17,24,39,.75); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 99px; }
.tile-flag + .tile-flag { left: auto; right: 8px; }
.editor-form .card { padding: 18px 20px; }
.drop { display: flex; align-items: center; gap: 16px; text-align: left; color: var(--text); padding: 20px 24px; }
.drop .ic.lg { color: var(--accent); }
.drop .progress { flex: 1; height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.drop .progress div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.media-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* activity timeline */
.day-group { margin-bottom: 20px; }
.day-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 4px; }
.timeline { padding: 6px 0; }
.tl-row { display: grid; grid-template-columns: 56px 36px 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.tl-row:last-child { border-bottom: 0; }
.tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 5px; }
.tl-ic { width: 32px; height: 32px; border-radius: 10px; background: #f3f4f6; color: var(--muted); display: grid; place-items: center; }
.tl-ic.create, .tl-ic.add, .tl-ic.accept, .tl-ic.pair, .tl-ic.upload, .tl-ic.signup { background: var(--ok-soft); color: #166534; }
.tl-ic.delete, .tl-ic.remove, .tl-ic.revoke { background: var(--danger-soft); color: #991b1b; }
.tl-ic.update, .tl-ic.change { background: var(--accent-soft); color: var(--accent); }
.tl-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tl-body .changes { margin-top: 6px; }
/* auth backdrop */
.auth-wrap { background: radial-gradient(900px 500px at 70% -10%, #e0e7ff 0%, transparent 60%), radial-gradient(700px 400px at 0% 100%, #f5f3ff 0%, transparent 60%); margin: -28px -36px -60px; padding: 28px 36px 60px; min-height: 100vh; }
.auth-card { border-radius: 16px; padding: 32px; }
.auth-card .brand { gap: 10px; }
.auth-card h1 { font-size: 24px; }
.auth-card .field input { padding: 9px 12px; }

/* ---- people directory ---- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.people-table td:first-child { width: 40px; padding-right: 0; }
.people-table .avatar { width: 32px; height: 32px; font-size: 12px; }
.people-table .row-actions { text-align: right; white-space: nowrap; }
.people-table tr.is-off td { opacity: .55; }
.avatar.photo { background-size: cover; background-position: center; }
.icon-btn.danger:hover { color: var(--danger, #b91c1c); }
