/* ACE Platform — gold/black identity, themeable via [data-theme] on <html> */

/* ───────────── THEME TOKENS ───────────── */
:root, html[data-theme="dark"] {
  /* gold/black identity + semantic status color (red=action, amber=review, green=resolved) */
  --bg: #0e0e10; --surface: #171719; --surface-2: #1f1f22; --surface-3: #29292d;
  --text: #f4f4f2; --muted: #8c8a86;
  --gold: #d4af37; --gold-bright: #ecc659; --gold-dim: #8c7320;
  --gold-glow: rgba(212,175,55,0.09); --gold-border: rgba(212,175,55,0.16);
  --red: #e05252; --red-dim: rgba(224,82,82,0.13);
  --amber: #e0a23c; --amber-dim: rgba(224,162,60,0.13);
  --green: #4caf7a; --green-dim: rgba(76,175,122,0.13);
  --btn-fg: #0a0a0a;
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
  --card-shadow: 0 1px 2px rgba(0,0,0,0.45);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, monospace;
}
html[data-theme="light"] {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #f6f5f1; --surface-3: #ebe9e2;
  --text: #14140f; --muted: #6b6960;
  --gold: #b8901f; --gold-bright: #9a7715; --gold-dim: #b6a76c;
  --gold-glow: rgba(184,144,31,0.08); --gold-border: rgba(184,144,31,0.22);
  --red: #cf3f3f; --red-dim: rgba(207,63,63,0.08);
  --amber: #c0851a; --amber-dim: rgba(192,133,26,0.10);
  --green: #2e8b57; --green-dim: rgba(46,139,87,0.10);
  --btn-fg: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ───────────── AUTH ───────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--gold-border); border-radius: 14px; padding: 34px 30px; box-shadow: var(--shadow); }
.brand { text-align: center; margin-bottom: 24px; }
.brand-mark { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: 0.08em; color: var(--gold-bright); }
.brand-sub { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-dim); margin-top: 4px; }
.auth-heading { font-size: 19px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.auth-tagline { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.field input { width: 100%; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; color: var(--text); font: inherit; outline: none; }
.field input:focus { border-color: var(--gold); }
.hint { font-size: 11px; color: var(--muted); }
.auth-error { background: var(--red-dim); color: var(--red); font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid rgba(224,82,82,0.25); }
.auth-notice { background: rgba(108,92,231,0.12); color: #b9aef9; font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid rgba(108,92,231,0.3); }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.link-btn { background: none; border: 0; color: var(--gold); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ───────────── BUTTONS ───────────── */
.btn { padding: 9px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 600; font-family: var(--font-sans); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold, .btn-primary { background: var(--gold); color: var(--btn-fg); }
.btn-gold:hover, .btn-primary:hover { background: var(--gold-bright); }
.btn-outline { background: transparent; border-color: var(--gold-border); color: var(--gold); }
.btn-outline:hover { background: var(--gold-glow); border-color: var(--gold); }
.btn-ghost { background: transparent; border-color: var(--gold-border); color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-red, .btn-danger { background: var(--red); color: var(--btn-fg); }
.btn-red:hover, .btn-danger:hover { opacity: 0.88; }
.btn-block { width: 100%; padding: 12px; }
.icon-btn { background: transparent; border: 1px solid var(--gold-border); color: var(--text); width: 36px; height: 36px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); }

/* ───────────── APP LAYOUT ───────────── */
.app { min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: var(--surface); border-right: 1px solid var(--gold-border); display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s; }
.logo { padding: 26px 24px 22px; border-bottom: 1px solid var(--gold-border); }
.logo-mark { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--gold-bright); letter-spacing: 0.08em; line-height: 1; }
.logo-sub { font-size: 9px; color: var(--gold-dim); letter-spacing: 0.15em; text-transform: uppercase; margin-top: 4px; }
.nav { padding: 18px 0; flex: 1; overflow-y: auto; }
.nav-section { padding: 0 16px; margin-bottom: 18px; }
.nav-label { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dim); padding: 0 8px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; margin-bottom: 2px; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--gold-bright); background: var(--gold-glow); border-color: var(--gold-border); }
.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; font-family: var(--font-mono); }
.nav-badge.amber { background: var(--amber); }
.sidebar-foot { padding: 16px; border-top: 1px solid var(--gold-border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s; border: 1px solid transparent; outline: none; }
.user-chip:hover { background: var(--surface-2); }
.user-chip:focus-visible { border-color: var(--gold-border); }
.user-chip.active { background: var(--gold-glow); border-color: var(--gold-border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-glow); border: 1px solid var(--gold-border); display: grid; place-items: center; font-size: 12px; color: var(--gold); font-weight: 700; flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-org { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { margin-left: 220px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { border-bottom: 1px solid var(--gold-border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
.topbar-inner { width: 100%; max-width: 1180px; margin-inline: auto; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.alert-banner { display: flex; align-items: center; gap: 8px; background: var(--red-dim); border: 1px solid rgba(224,82,82,0.3); border-radius: 6px; padding: 7px 14px; font-size: 12px; color: var(--red); cursor: pointer; }
.alert-banner:hover { filter: brightness(1.15); }
.alert-dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; animation: blink 2s infinite; }
.content { padding: 26px 32px; flex: 1; width: 100%; max-width: 1180px; margin-inline: auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }

/* ───────────── BANNERS ───────────── */
.threat-banner { background: linear-gradient(135deg, var(--red-dim), transparent); border: 1px solid rgba(224,82,82,0.25); border-left: 3px solid var(--red); border-radius: 8px; padding: 16px 20px; margin-bottom: 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.threat-left { display: flex; align-items: center; gap: 14px; }
.threat-icon { font-size: 22px; }
.threat-title { font-size: 14px; font-weight: 600; color: var(--red); }
.threat-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.threat-tag { font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 4px; background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,82,82,0.2); white-space: nowrap; }
.allclear-banner { background: linear-gradient(135deg, var(--green-dim), transparent); border: 1px solid rgba(76,175,122,0.25); border-left: 3px solid var(--green); border-radius: 8px; padding: 18px 22px; margin-bottom: 26px; display: flex; align-items: center; gap: 16px; }
.allclear-icon { font-size: 26px; color: var(--green); }
.allclear-title { font-size: 15px; font-weight: 700; color: var(--green); }
.allclear-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ───────────── STATS ───────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); box-shadow: var(--card-shadow); border-radius: 10px; padding: 18px 20px; position: relative; overflow: hidden; }
.stat-label { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.stat-value.red { color: var(--red); }
.stat-value.green { color: var(--green); }
.stat-change { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ───────────── GRID + PANELS ───────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel { background: var(--surface); box-shadow: var(--card-shadow); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.panel-header { padding: 15px 20px; border-bottom: 1px solid var(--gold-border); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-size: 13px; font-weight: 600; }
.panel-tag { font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 4px; background: var(--gold-glow); color: var(--gold); }
.panel-tag.live { animation: blink 2s infinite; }
.panel-body { padding: 16px 20px; }
.panel-body.flush { padding: 0; }

/* ───────────── ALERTS ───────────── */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 8px; border: 1px solid transparent; transition: all 0.15s; }
.alert-item.critical { background: rgba(224,82,82,0.05); border-color: rgba(224,82,82,0.2); }
.alert-item.warning { background: var(--amber-dim); border-color: rgba(224,154,58,0.2); }
.alert-severity { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.alert-severity.critical { background: var(--red); }
.alert-severity.warning { background: var(--amber); }
.alert-body { flex: 1; min-width: 0; }
.alert-headline { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.alert-meta { font-size: 11px; color: var(--muted); }
.alert-artist { color: var(--gold); }
.row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ───────────── EMPTY STATE ───────────── */
.empty-state { text-align: center; padding: 36px 20px; }
.empty-icon { font-size: 32px; margin-bottom: 12px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 6px; }
.empty-desc { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 42ch; margin: 0 auto; }

/* ───────────── ROSTER ───────────── */
.roster-list { display: flex; flex-direction: column; gap: 8px; }
.roster-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; transition: all 0.15s; }
.roster-item:hover { background: var(--surface-2); border-color: var(--gold-border); }
.roster-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; border: 1px solid var(--gold-border); background: var(--gold-glow); color: var(--gold); }
.roster-info { flex: 1; min-width: 0; }
.roster-name { font-size: 13px; font-weight: 600; }
.roster-genre { font-size: 11px; color: var(--muted); margin-top: 1px; }
.status-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; font-family: var(--font-mono); }
.status-badge.protected { background: var(--green-dim); color: var(--green); }
.status-badge.alert { background: var(--red-dim); color: var(--red); }
.status-badge.monitoring { background: var(--gold-glow); color: var(--gold); }

/* ───────────── SCAN TIMELINE ───────────── */
.scan-timeline { display: flex; flex-direction: column; }
.scan-entry { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--gold-glow); font-size: 12px; }
.scan-entry:last-child { border-bottom: none; }
.scan-time { font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; width: 64px; flex-shrink: 0; padding-top: 1px; }
.scan-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.scan-dot.flagged { background: var(--red); }
.scan-dot.review { background: var(--amber); }
.scan-dot.clear { background: var(--green); }
.scan-text { flex: 1; color: var(--muted); line-height: 1.4; }
.scan-text strong { color: var(--text); font-weight: 600; }
.scan-text .platform { color: var(--gold-dim); font-family: var(--font-mono); font-size: 10px; }

/* ───────────── FINGERPRINT ───────────── */
.score-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.score-item { background: var(--surface-2); border-radius: 8px; padding: 12px; text-align: center; }
.score-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.score-num.zero { color: var(--muted); }
.score-name { font-size: 11px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-label { font-size: 11px; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.05em; text-transform: uppercase; }

/* ───────────── DETECT ───────────── */
.detect-drop { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
input[type="file"] { color: var(--muted); font: inherit; font-size: 12px; }
input[type="file"]::file-selector-button { background: var(--surface-2); border: 1px solid var(--gold-border); color: var(--gold); border-radius: 6px; padding: 7px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; margin-right: 10px; }
.result-card { border-radius: 10px; padding: 18px 20px; margin-top: 16px; background: var(--surface-2); }
.result-card.match { border-color: rgba(224,82,82,0.4); }
.result-card.review { border-color: rgba(224,154,58,0.4); }
.result-card.ignore { border-color: rgba(76,175,122,0.35); }
.result-verdict { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.result-card.match .result-verdict { color: var(--red); }
.result-card.review .result-verdict { color: var(--amber); }
.result-card.ignore .result-verdict { color: var(--green); }
.result-rec { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* confidence meter */
.meter { position: relative; height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width .4s ease; }
.meter-fill.match { background: var(--red); }
.meter-fill.review { background: var(--amber); }
.meter-fill.ignore { background: var(--green); }
.meter-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--gold-dim); opacity: .7; }
.meter-cap { font-size: 10px; color: var(--muted); margin-top: 6px; }

/* uploaded-clip waveform */
.wf-wrap { margin-top: 16px; }
.wf-canvas { width: 100%; height: 64px; display: block; background: var(--surface-2); border-radius: 8px; }
.wf-caption { font-size: 11px; color: var(--muted); margin-top: 6px; font-family: var(--font-mono); }

/* detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-top: 16px; font-size: 12px; }
.detail-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--gold-glow); }
.detail-grid .k { color: var(--muted); }
.detail-grid .v { font-family: var(--font-mono); color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* ───────────── TABLES ───────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--gold-border); font-weight: 600; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--gold-glow); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.pill { font-size: 10px; font-family: var(--font-mono); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.pill.match { background: var(--red-dim); color: var(--red); }
.pill.review { background: var(--amber-dim); color: var(--amber); }
.pill.ignore { background: var(--surface-3); color: var(--muted); }
.pill.ok, .pill.licensed { background: var(--green-dim); color: var(--green); }
.pill.dismissed { background: var(--surface-3); color: var(--muted); }

/* ───────────── MODAL ───────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(8,8,10,0.45); backdrop-filter: blur(18px) saturate(125%); -webkit-backdrop-filter: blur(18px) saturate(125%); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: ovIn .18s ease; }
.modal { background: var(--surface); border: 1px solid var(--gold-border); border-radius: 16px; width: 480px; max-width: 95vw; max-height: 86vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.5); animation: modIn .26s cubic-bezier(.2,.8,.2,1); }
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--gold-border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.enroll-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.select { width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; color: var(--text); font: inherit; outline: none; }
.select:focus { border-color: var(--gold); }

/* ── search bar ── */
.searchbar { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 10px; padding: 0 13px; margin-bottom: 14px; }
.searchbar:focus-within { border-color: var(--gold); }
.searchbar .search-ico { color: var(--muted); flex-shrink: 0; }
.searchbar input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 13.5px; padding: 11px 0; }
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Reusable bounded scroll area for dashboard lists (scan activity, etc.) — scrollbar hidden */
.scroll-y { max-height: 360px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.scroll-y::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ── roster table (4 columns, scrollable, sticky header, clickable rows) ── */
.roster-table-wrap { max-height: 62vh; overflow-y: auto; border: 1px solid var(--gold-border); border-radius: 10px; }
.roster-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.roster-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; padding: 11px 16px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--gold-border); font-weight: 600; }
.roster-table td { padding: 11px 16px; border-bottom: 1px solid var(--gold-glow); vertical-align: middle; }
.roster-table tbody tr { cursor: pointer; transition: background .12s; }
.roster-table tbody tr:hover td { background: var(--surface-2); }
.roster-table tbody tr:last-child td { border-bottom: none; }
.roster-cell { display: flex; align-items: center; gap: 11px; }
.roster-avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.r-chevron { color: var(--muted); }

/* ── artist profile modal ── */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 700; background: var(--gold-glow); border: 1px solid var(--gold-border); color: var(--gold); flex-shrink: 0; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 16px 0; }
.profile-stat { background: var(--surface-2); border-radius: 9px; padding: 12px 14px; }
.profile-stat .v { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.profile-stat .k { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── city autocomplete ── */
.autocomplete { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--gold-border); border-radius: 8px; max-height: 220px; overflow-y: auto; box-shadow: var(--shadow); }
.ac-item { padding: 9px 12px; font-size: 13px; cursor: pointer; }
.ac-item:hover, .ac-item.active { background: var(--surface-2); }

/* ── CSV import notice ── */
.csv-note { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); line-height: 1.65; margin: 4px 0 14px; }
.csv-note code { font-family: var(--font-mono); color: var(--text); }

/* ── collapsible sidebar (desktop push in/out) ── */
.main { transition: margin-left .25s ease; }
.hamburger { display: flex; }
.app.nav-collapsed .sidebar { transform: translateX(-100%); }
.app.nav-collapsed .main { margin-left: 0; }

/* ── avatar picker ── */
.user-chip .avatar img, .profile-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.avatar-row { display: flex; align-items: center; gap: 14px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 1px solid var(--gold-border); background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.avatar-lg img { width: 100%; height: 100%; display: block; }
.avatar-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.avatar-opt { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface-2); padding: 0; }
.avatar-opt.active { border-color: var(--gold); }
.avatar-opt img { width: 100%; height: 100%; display: block; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 140px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; color: var(--text); font: inherit; outline: none; }
.row-form input:focus { border-color: var(--gold); }

/* ───────────── RELEASES (direct-to-fan) ───────────── */
.release-card { border: 1px solid var(--gold-border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.release-top { display: flex; align-items: center; gap: 12px; }
.release-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--muted); }
.release-stats span { white-space: nowrap; }
.fan-panel { border-top: 1px solid var(--gold-glow); padding-top: 8px; }
.fan-list-title { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 6px; }
.fan-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--gold-glow); }
.fan-row:last-child { border-bottom: none; }

/* ───────────── SETTINGS ───────────── */
.set-form { display: flex; flex-direction: column; gap: 14px; }
.set-field { display: flex; flex-direction: column; gap: 6px; }
.set-field label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.set-field input { width: 100%; max-width: 420px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; color: var(--text); font: inherit; outline: none; }
.set-field input:focus { border-color: var(--gold); }
.set-field input:disabled { opacity: 0.55; cursor: not-allowed; }
.set-hint { font-size: 11px; color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--gold-glow); }
.set-row:first-of-type { border-top: 0; padding-top: 2px; }
.set-row-title { font-size: 13px; font-weight: 600; }
.set-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 54ch; }
.set-row-flat { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.set-foot { font-size: 12px; margin-top: 12px; }
.list.compact { display: flex; flex-direction: column; }
.list.compact .list-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--gold-glow); font-size: 12px; }
.list.compact .list-row:first-child { border-top: 0; }
.sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mt10 { margin-top: 10px; }
.disclosure { background: var(--surface); border: 1px solid var(--gold-border); border-radius: 10px; padding: 4px 20px; margin-bottom: 20px; }
.disclosure summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 13px; list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure-body { padding: 0 0 16px; font-size: 13px; line-height: 1.6; }
.disclosure.bare { border: 0; padding: 0; margin: 0 0 6px; background: transparent; }
.disclosure.bare > summary { padding: 6px 0; color: var(--gold); }
.bare-details { margin-top: 14px; border: 0; padding: 0; background: transparent; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented .seg { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 12.5px; padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.segmented .seg:hover { color: var(--text); }
.segmented .seg.active { background: var(--gold-glow); color: var(--gold-bright); box-shadow: inset 0 0 0 1px var(--gold-border); }
.policy-explain { font-size: 13px; margin-top: 10px; }

/* detection-policy threshold bands */
.policy-bands { margin: 18px 0 4px; }
.band-track { position: relative; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--gold-border); }
.band { height: 100%; }
.band.ignore { background: var(--surface-3); }
.band.review { background: var(--amber); }
.band.match { background: var(--red); }
.band-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.band-legend .bl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.band-legend .bl b { color: var(--text); font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.bdot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bdot.ignore { background: var(--surface-3); border: 1px solid var(--gold-border); }
.bdot.review { background: var(--amber); }
.bdot.match { background: var(--red); }

/* detection detail modal */
.data-table tbody tr[data-event] { cursor: pointer; }
.scan-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scan-detail-head .result-verdict { font-size: 16px; font-weight: 700; }
.scan-how { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--gold-glow); padding-top: 12px; }
.card.danger { border-color: rgba(224,82,82,0.35); }
.card.danger .panel-title, .card.danger h2 { color: var(--red); }
.delete-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gold-glow); display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.delete-panel input { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--gold-border); border-radius: 8px; color: var(--text); font: inherit; outline: none; }
.delete-panel input:focus { border-color: var(--red); }
.view-header { margin-bottom: 22px; }
.view-header h2 { font-size: 22px; font-weight: 700; }
.view-header p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ───────────── TOAST ───────────── */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--surface); border: 1px solid var(--gold-border); border-left: 3px solid var(--gold); border-radius: 8px; padding: 13px 18px; font-size: 13px; color: var(--text); z-index: 500; box-shadow: var(--shadow); max-width: 340px; }

/* ───────────── MISC ───────────── */
.hamburger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; border-radius: 6px; border: 1px solid var(--gold-border); background: transparent; }
.hamburger span { width: 18px; height: 2px; background: var(--gold); border-radius: 1px; display: block; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.45} }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ───────────── RESPONSIVE ───────────── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-220px); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3-2 { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 600px) {
  .score-grid { grid-template-columns: 1fr 1fr; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .threat-banner { flex-direction: column; align-items: flex-start; }
}

/* ───────────── LEGAL PAGES (terms / privacy) ───────────── */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.legal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--gold-border); }
.legal-title { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.legal-meta { font-size: 12px; color: var(--muted); margin-bottom: 28px; }
.legal-body h2 { font-size: 15px; font-weight: 700; margin: 26px 0 8px; color: var(--text); }
.legal-body p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 6px; }
.legal-body a { color: var(--gold); }
.legal-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--gold-border); font-size: 13px; color: var(--muted); }
.legal-foot a { color: var(--gold); }
.auth-legal { text-align: center; font-size: 11px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.auth-legal a { color: var(--gold); text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; }

/* ───────────── GLOBAL ACTIVITY INDICATOR ───────────── */
.activity-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; overflow: hidden; background: var(--gold-glow); }
.activity-bar.active { opacity: 1; }
.activity-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: -45%; width: 45%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold), var(--gold-bright), var(--gold), transparent); box-shadow: 0 0 8px var(--gold-glow); animation: activitySlide 1.9s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@keyframes activitySlide { 0% { left: -45%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .activity-bar::before { animation-duration: 2.2s; } }

/* ───────────── RELEASE CARD DETAILS ───────────── */
.release-kind { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); background: var(--gold-glow); padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.release-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 12px; }
.metric { background: var(--surface-2); border-radius: 9px; padding: 11px 13px; }
.metric-val { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.1; }
.metric-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.track-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; margin-bottom: 14px; }
.track-chip.ready { color: var(--green); background: var(--green-dim); }
.track-chip.missing { color: var(--muted); background: var(--surface-2); }
@media (max-width: 640px) { .release-metrics { grid-template-columns: repeat(2, 1fr); } }
