/* TL Media Agency — Business Hub. Brand tokens taken from tlmediallc.net:
   black #0c0c0c, gold #c9a84c / #d4b96a, ivory #f0ece4, Cormorant Garamond + Outfit. */
:root {
  --bg: #0c0c0c;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --ink: #f0ece4;
  --ink-2: #d9d3c7;
  --muted: #9a9488;
  --line: rgb(201 168 76 / 0.16);
  --line-strong: rgb(201 168 76 / 0.34);
  --accent: #c9a84c;
  --accent-hi: #d4b96a;
  --accent-ink: #0c0c0c;
  --accent-soft: rgb(201 168 76 / 0.12);
  --warn: #e3934a;
  --warn-soft: rgb(227 147 74 / 0.14);
  --danger: #e5675c;
  --danger-soft: rgb(229 103 92 / 0.14);
  --ok: #8cc79c;
  --ok-soft: rgb(140 199 156 / 0.13);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 240px;
  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: 0.01em; }
h2 { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: 0.01em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgb(201 168 76 / .35); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--accent-hi); padding: 4px 8px 20px; letter-spacing: 0.01em; line-height: 1.1; }
.brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand .name { display: block; min-width: 0; }
.brand small { display: block; font-family: var(--font); font-weight: 500; font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; margin-top: 3px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 550; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-hi); box-shadow: inset 2px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 0 7px; font-weight: 650; }
.sidebar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hi); border: 1px solid var(--line-strong); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me .who { min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 10px; }
.topbar h1 { flex: 1; min-width: 0; }
.content { padding: 8px 28px 48px; flex: 1; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px 8px; position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar h1 { font-size: 25px; flex: 1 1 0; }
  .topbar .rel { order: 2; }
  .page-actions:not(:empty) { order: 3; flex-basis: 100%; }
  .page-actions .btn { flex: 0 1 auto; }
  .content { padding: 4px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
}

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px var(--font); padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; min-height: 36px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-radius: 999px; padding-left: 18px; padding-right: 18px; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #0c0c0c; border-color: var(--danger); border-radius: 999px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; font-size: 13px; min-height: 30px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; font: 15px var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { font: 600 13px var(--font); border: 0; background: transparent; padding: 7px 12px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1060px) { .split { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 14px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* Stat strip on the dashboard: one quiet row, not four floating cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.stats > div { padding: 16px 18px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats .v { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.stats .l { font-size: 13px; color: var(--muted); }
.stats a.l { display: block; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div:nth-child(3) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Pipeline bar on dashboard */
.pipebar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin: 6px 0 12px; }
.pipebar span { display: block; height: 100%; }
.legend { display: grid; gap: 6px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-weight: 600; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list a.title:hover { text-decoration: underline; }

table.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table tr.rowlink { cursor: pointer; }
.table tr.rowlink:hover td { background: var(--surface-2); }
@media (max-width: 760px) {
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-top: 1px solid var(--line); padding: 10px 14px; }
  .table.responsive tr:first-child { border-top: 0; }
  .table.responsive td { border: 0; padding: 2px 0; }
  .table.responsive td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .table.responsive td.primary { font-weight: 650; font-size: 16px; }
}

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 170px); scroll-snap-align: start; }
.col-head { padding: 12px 12px 8px; border-top: 4px solid var(--stage, var(--line-strong)); border-radius: var(--radius) var(--radius) 0 0; }
.col-head h3 { display: flex; align-items: center; gap: 8px; }
.col-head h3 .n { color: var(--muted); font-weight: 600; font-size: 13px; }
.col-head .sum { font-size: 13px; color: var(--muted); }
.col-body { padding: 4px 8px 10px; overflow-y: auto; flex: 1; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.col.drop .col-body { background: var(--accent-soft); border-radius: 0 0 var(--radius) var(--radius); }
.lead-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; }
.lead-card:hover { border-color: var(--line-strong); }
.lead-card.dragging { opacity: .45; }
.lead-card .t { font-weight: 650; display: block; color: var(--ink); line-height: 1.3; }
.lead-card .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lead-card .meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.lead-card .meta .val { font-weight: 650; font-size: 13px; margin-right: auto; }
.drop-marker { height: 3px; background: var(--accent); border-radius: 2px; }
@media (max-width: 860px) { .board { grid-auto-columns: 82%; } .col { max-height: none; } }

/* ---------- Content board ---------- */
.lanes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
@media (max-width: 860px) { .lanes { grid-auto-columns: 82%; } }
.lane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lane > header { padding: 12px 12px 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lane > header .n { color: var(--muted); font-size: 13px; font-weight: 600; }
.lane .lane-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.post-card { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--ink); }
.post-card:hover { border-color: var(--line-strong); text-decoration: none; }
.post-card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.post-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 9px 11px 11px; }
.post-card .t { font-weight: 650; line-height: 1.3; display: block; }
.post-card .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* Approval track on the post page: the one bold element of the app */
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 4px 0 16px; counter-reset: step; }
.track .step { position: relative; padding: 12px 10px 10px 0; border-top: 4px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.track .step b { display: block; color: var(--ink-2); font-size: 15px; }
.track .step.done { border-top-color: var(--accent); }
.track .step.done b { color: var(--accent-hi); }
.track .step.now { border-top-color: var(--warn); }
.track .step.now b { color: var(--warn); }
.track .step.bad { border-top-color: var(--danger); }
.track .step.bad b { color: var(--danger); }
@media (max-width: 600px) { .track { grid-template-columns: 1fr 1fr; row-gap: 10px; } }
.next-step { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.next-step.ok { border-left-color: var(--accent); }
.next-step.bad { border-left-color: var(--danger); }
.next-step .grow { flex: 1; min-width: 220px; }
.next-step p { margin: 2px 0 0; color: var(--muted); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-tile { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .file { display: grid; place-items: center; height: 100%; padding: 10px; text-align: center; font-size: 13px; color: var(--muted); word-break: break-all; }
.media-tile .tools { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.media-tile:hover .tools, .media-tile:focus-within .tools { opacity: 1; }
@media (hover: none) { .media-tile .tools { opacity: 1; } }
.media-tile .tools button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20,22,28,.75); color: #fff; cursor: pointer; display: grid; place-items: center; }
.media-tile .tools svg { width: 15px; height: 15px; }
.uploader svg { width: 26px; height: 26px; margin-bottom: 6px; }
.uploader { border: 2px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; text-align: center; padding: 14px; color: var(--muted); font-size: 13px; cursor: pointer; aspect-ratio: 1; }
.uploader:hover, .uploader.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.counts .over { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle { position: relative; }
.chip-toggle input { position: absolute; opacity: 0; }
.chip-toggle span { display: inline-block; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); background: var(--surface); }
.chip-toggle input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .ico { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.timeline .ico svg { width: 14px; height: 14px; }
.timeline .ico.client { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.timeline .body { white-space: pre-wrap; word-break: break-word; }
.timeline .when { font-size: 12.5px; color: var(--muted); }
.composer { display: grid; gap: 8px; margin-bottom: 8px; }
.composer .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.composer .row select { width: auto; }

/* Key/value rows */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- Form builder ---------- */
.fb-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-2); display: grid; gap: 10px; }
.fb-row + .fb-row { margin-top: 10px; }
.fb-row .top { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; }
.fb-row .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 600px) { .fb-row .top { grid-template-columns: 1fr; } .fb-row .opts { grid-template-columns: 1fr; } }
.fb-row .ctl { display: flex; gap: 4px; }
code.block { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12.5px; word-break: break-all; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; }

/* ---------- Modal, toast, menu ---------- */
dialog.modal { border: 1px solid var(--line-strong); padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .7); }
dialog.modal form.inner { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
dialog.modal header { padding: 18px 20px 6px; }
dialog.modal .mbody { padding: 10px 20px; overflow-y: auto; }
dialog.modal footer { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog.modal .err { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }
@media (max-width: 600px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog.modal footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
@media (max-width: 860px) { .toasts { left: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); } }
.toast { background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 550; box-shadow: var(--shadow); max-width: 420px; }
.toast.error { background: var(--danger); color: #0c0c0c; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 50; max-height: 70vh; overflow-y: auto; }
.popover header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.popover .nitem { display: block; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink); }
.popover .nitem:first-of-type { border-top: 0; }
.popover .nitem.unread { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.popover .nitem:hover { background: var(--surface-2); text-decoration: none; }
.popover .nitem b { display: block; font-weight: 650; font-size: 14px; }
.popover .nitem span { font-size: 13px; color: var(--muted); display: block; }
.rel { position: relative; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: min(420px, 100%); }
.auth .mark { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 28px; color: var(--accent-hi); margin-bottom: 22px; text-align: center; }
.auth .mark img { width: 88px; height: 88px; object-fit: contain; }
.auth .card { padding: 24px; box-shadow: var(--shadow); }
.auth h1 { font-size: 28px; margin-bottom: 6px; }
.auth .btn.primary { width: 100%; margin-top: 4px; min-height: 42px; }
.auth .err { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 4px 0 8px; }

/* ---------- Portal ---------- */
.portal-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.portal-top .brand { padding: 0; }
.portal { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.portal h1 { margin-bottom: 4px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
