:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f8fc;
  --ink: #171722;
  --muted: #717285;
  --line: #e7e7ef;
  --primary: #5b3df5;
  --primary-2: #7c61ff;
  --pink: #e72aa4;
  --red: #dd3d55;
  --green: #159b6b;
  --amber: #d88b16;
  --blue: #2786de;
  --sidebar: #15131d;
  --shadow: 0 14px 36px rgba(36, 31, 72, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.1; }
h2 { margin-bottom: 5px; font-size: 17px; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 9px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.block { display: block; margin-top: 3px; color: var(--muted); }
.align-right { text-align: right; }
.full-span { grid-column: 1 / -1; }
.mobile-only { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 248px; flex-direction: column; padding: 22px 16px; color: #f6f4ff; background: radial-gradient(circle at 30% 0%, #292144 0, var(--sidebar) 36%); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: #9893aa; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #ff2daf, #6338ff 72%, #1578ff); box-shadow: 0 9px 22px rgba(124, 61, 245, .32); font-weight: 900; }
.nav-list { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: 11px; color: #a9a5b7; font-weight: 650; transition: .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-link.active { color: white; background: linear-gradient(90deg, rgba(105,70,255,.34), rgba(231,42,164,.12)); box-shadow: inset 3px 0 var(--primary-2); }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; font-size: 12px; font-weight: 900; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user span:last-child { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { overflow: hidden; color: #928da1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.main-column { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; min-height: 66px; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid rgba(231,231,239,.9); background: rgba(255,255,255,.87); backdrop-filter: blur(18px); }
.topbar-status, .live-pill { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #27ba77; box-shadow: 0 0 0 4px rgba(39,186,119,.12); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions form { margin: 0; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 30px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading p:last-child { margin-bottom: 0; }
.heading-actions { display: flex; gap: 10px; }
.live-pill, .count-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.count-pill { color: var(--muted); font-size: 12px; font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-grid.compact { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.metric-card { position: relative; overflow: hidden; min-height: 142px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card::after { position: absolute; right: -18px; bottom: -24px; width: 85px; height: 85px; border-radius: 50%; background: var(--card-accent); content: ""; opacity: .08; }
.metric-label { display: block; min-height: 36px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 4px 0 2px; font-size: clamp(25px, 2.2vw, 34px); letter-spacing: -.05em; }
.metric-card small { color: var(--muted); }
.metric-card small a { color: var(--card-accent); font-weight: 750; }
.accent-violet { --card-accent: var(--primary); border-top: 3px solid var(--primary); }
.accent-blue { --card-accent: var(--blue); border-top: 3px solid var(--blue); }
.accent-amber { --card-accent: var(--amber); border-top: 3px solid var(--amber); }
.accent-red { --card-accent: var(--red); border-top: 3px solid var(--red); }
.accent-green { --card-accent: var(--green); border-top: 3px solid var(--green); }
.accent-pink { --card-accent: var(--pink); border-top: 3px solid var(--pink); }

.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-wide { grid-row: span 2; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 21px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin-bottom: 2px; }
.panel-header p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-header > a { color: var(--primary); font-size: 12px; font-weight: 800; }
.region-bars { display: flex; flex-direction: column; gap: 18px; padding: 24px 21px; }
.region-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) 40px; align-items: center; gap: 15px; }
.region-row div:first-child { display: flex; flex-direction: column; }
.region-row small { color: var(--muted); }
.bar-track, .inline-progress { overflow: hidden; height: 8px; border-radius: 99px; background: #ecebf3; }
.bar-track span, .inline-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--pink)); }
.activity-list { padding: 7px 12px 13px; }
.activity-item { display: flex; align-items: center; gap: 11px; padding: 11px 8px; border-bottom: 1px solid #f0eff5; }
.activity-item:last-child { border-bottom: 0; }
.activity-item > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.activity-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item small { color: var(--muted); font-size: 10px; }
.activity-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; font-weight: 900; }
.activity-icon.danger { color: var(--red); background: #fff0f3; }
.activity-icon.warning { color: var(--amber); background: #fff3d9; }
.activity-icon.insight { color: var(--primary); background: #eeeaff; }
.activity-icon.signal { color: var(--blue); background: #e9f4ff; }
.empty-compact { padding: 24px; color: var(--muted); text-align: center; }

.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) 180px 190px auto auto; gap: 10px; margin-bottom: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.search-field { position: relative; }
.search-field span { position: absolute; top: 8px; left: 12px; color: var(--muted); font-size: 18px; }
.search-field input { width: 100%; padding-left: 38px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #dbdbe5; border-radius: 10px; color: var(--ink); outline: none; background: white; transition: .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(91,61,245,.1); }
label { display: flex; flex-direction: column; gap: 6px; color: #4d4d5e; font-size: 12px; font-weight: 750; }
textarea { resize: vertical; }

.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: linear-gradient(135deg, var(--primary), #744cff); box-shadow: 0 8px 18px rgba(91,61,245,.2); }
.button-secondary { color: var(--primary); border-color: #dcd5ff; background: #f4f1ff; }
.button-ghost { color: #5e5e70; border-color: var(--line); background: var(--surface); }
.button-danger { color: white; background: var(--red); }
.button-danger-soft { color: var(--red); background: #fff0f3; }
.button-success { color: #08784f; background: #e8fbf3; }
.button-small { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 11px; }
.button-wide { width: 100%; }
.icon-button { display: grid; width: 37px; height: 37px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-weight: 900; }
.inline-form { display: inline-flex; margin: 0; }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; color: var(--muted); background: var(--surface-2); font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fcfbff; }
.identity { display: flex; min-width: 180px; align-items: center; gap: 10px; }
.identity > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.identity small { color: var(--muted); font-size: 10px; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #6641fa, #d735ac); font-weight: 900; }
.avatar.small { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; font-size: 11px; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.badge-green { color: #08784f; background: #e6f9f1; }
.badge-red { color: #ba273e; background: #ffebef; }
.badge-amber { color: #a56300; background: #fff3d9; }
.badge-violet { color: #5437d5; background: #eeeaff; }
.badge-gray { color: #656576; background: #efeff4; }
code { padding: 3px 6px; border-radius: 6px; color: #5437d5; background: #f0edff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; }
.content-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.video-thumb { position: relative; display: flex; min-height: 176px; overflow: hidden; align-items: center; justify-content: center; background: linear-gradient(145deg, #272334, #111017); }
.video-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb > span { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; color: white; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.video-thumb > b { position: absolute; display: none; }
.content-card-body { padding: 17px; }
.content-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.content-card-meta small, .content-card-body > small { color: var(--muted); }
.content-card h2 { margin: 14px 0 6px; }
.content-card p { min-height: 38px; margin-bottom: 12px; color: var(--muted); }
.listing-facts { display: flex; gap: 8px; margin-bottom: 13px; }
.listing-facts span { padding: 5px 8px; border-radius: 7px; background: var(--surface-2); font-size: 11px; font-weight: 750; }
.card-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }

.report-list { display: flex; flex-direction: column; gap: 12px; }
.report-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 210px; gap: 16px; padding: 18px; }
.report-card.urgent { border-left: 4px solid var(--amber); }
.report-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--red); background: #ffedf1; font-size: 20px; font-weight: 900; }
.report-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-title > div { display: flex; gap: 6px; }
.report-title time { color: var(--muted); font-size: 11px; }
.report-main h2 { margin: 12px 0 5px; }
.report-main > p { margin-bottom: 13px; color: #565668; }
.report-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; color: var(--muted); font-size: 10px; }
.report-meta b { color: var(--ink); }
.report-actions { display: flex; flex-direction: column; gap: 8px; align-self: center; }

.comment-metrics { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.comment-filter-bar { grid-template-columns: minmax(260px, 1fr) 170px 220px 170px auto auto; }
.comment-list { display: flex; flex-direction: column; gap: 13px; }
.comment-card { overflow: hidden; }
.comment-card-hidden { border-left: 4px solid var(--red); }
.comment-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.comment-card-status { display: flex; align-items: center; gap: 7px; }
.comment-card-body { padding: 18px; }
.comment-card blockquote { margin: 0 0 17px; padding: 14px 16px; border-left: 3px solid var(--primary); border-radius: 0 11px 11px 0; color: #323241; background: #f8f7fc; font-size: 14px; line-height: 1.55; }
.comment-card-hidden blockquote { border-left-color: var(--red); background: #fff8f9; }
.comment-facts { display: grid; grid-template-columns: 1fr minmax(240px, 1.5fr) 1fr 1fr 1fr; gap: 12px; }
.comment-facts > span, .comment-evidence-grid > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.comment-facts small, .comment-evidence-grid small { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.comment-facts strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.comment-facts code { align-self: flex-start; margin-top: 2px; }
.comment-facts em { color: var(--muted); font-size: 10px; font-style: normal; }
.comment-evidence { margin: 0; padding: 12px 18px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: white; }
.comment-evidence summary { color: var(--primary); }
.comment-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; padding: 14px; border-radius: 11px; background: var(--surface-2); }
.comment-evidence-grid code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-report-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.comment-report-links a { padding: 6px 9px; border-radius: 8px; color: #a56300; background: #fff3d9; font-size: 10px; font-weight: 800; }
.comment-retention-note { margin-top: 18px; border-left: 4px solid var(--primary); }
.video-metrics { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.video-filter-bar { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.video-filter-bar .search-field { grid-column: span 2; }
.compact-filter-label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); }
.compact-filter-label input { border: 0; background: transparent; }
.filter-check { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; }
.filter-check input { width: auto; }
.video-status-stack { display: flex; flex-wrap: wrap; gap: 5px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 15px; margin-bottom: 18px; }
.settings-card { display: flex; align-items: center; gap: 16px; padding: 20px; }
.settings-card p { margin-bottom: 9px; color: var(--muted); }
.settings-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 14px; font-weight: 950; }
.settings-icon.firebase { color: #9a5e00; background: #fff1cc; }
.settings-icon.cloudflare { color: #a34800; background: #ffead9; }
.settings-icon.support { color: #5437d5; background: #ede9ff; }
.settings-icon.policy { color: #ba273e; background: #ffebef; }
.checklist { padding-bottom: 15px; }
.checklist ul { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px 20px; margin: 0; padding: 18px 22px 8px; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 9px; color: #555566; }
.checklist li span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: var(--green); background: #e8f9f2; font-weight: 900; }
.info-banner { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 20px; }
.info-banner p { margin: 0; color: var(--muted); }
.info-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 12px; color: var(--primary); background: #eeeaff; font-weight: 900; }
.inline-progress { display: inline-block; width: 120px; margin-right: 8px; vertical-align: middle; }

.business-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.catalog-groups { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.catalog-panel { overflow: hidden; }
.catalog-list { display: flex; flex-direction: column; padding: 7px 12px 13px; }
.catalog-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.catalog-row:last-child { border-bottom: 0; }
.catalog-row > div { display: flex; min-width: 0; flex-direction: column; }
.catalog-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-row small { color: var(--muted); }
.check-row { display: flex; align-items: center; flex-direction: row; gap: 9px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }
details { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
details summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 800; }
details textarea { margin-top: 10px; }
.ledger-panel { margin-top: 18px; }
.access-panel { margin-top: 18px; overflow: hidden; }
.access-list { display: flex; flex-direction: column; padding: 8px 14px 16px; }
.access-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.access-item:last-child { border-bottom: 0; }
.access-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 5px; }
.access-item summary span { color: var(--muted); font-weight: 600; }
.access-item form { padding: 6px 5px 18px; }

.status-dot-paused { background: #aaa8b4; box-shadow: 0 0 0 4px rgba(120,120,140,.12); }
.ai-metrics { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.ai-capability-grid { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ai-capability { display: flex; min-height: 170px; gap: 14px; padding: 19px; }
.ai-capability p { color: var(--muted); font-size: 12px; }
.ai-capability-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; font-size: 11px; font-weight: 950; }
.ai-capability-icon.violet { color: var(--primary); background: #eeeaff; }
.ai-capability-icon.blue { color: var(--blue); background: #e9f4ff; }
.ai-capability-icon.red { color: var(--red); background: #ffebef; }
.ai-capability-icon.green { color: var(--green); background: #e6f9f1; }
.ai-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 18px; margin-bottom: 18px; }
.ai-feed-panel { overflow: hidden; }
.ai-action-list { padding: 7px 12px 13px; }
.ai-action-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 8px; border-bottom: 1px solid var(--line); }
.ai-action-item:last-child { border-bottom: 0; }
.ai-action-copy > div { display: flex; align-items: center; gap: 8px; }
.ai-action-copy p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.ai-action-copy small { color: var(--muted); font-size: 10px; }
.ai-action-buttons { display: flex; gap: 6px; }
.ai-action-buttons form { margin: 0; }
.agent-policy-panel { overflow: hidden; }
.agent-policy-form { padding: 18px; }
.policy-switches { display: flex; flex-direction: column; gap: 3px; }
.policy-switches label { display: flex; min-height: 38px; align-items: center; flex-direction: row; gap: 9px; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); }
.policy-switches input { width: 17px; height: 17px; accent-color: var(--primary); }
.policy-switches .policy-master { margin-top: 6px; color: var(--primary); border: 1px solid #dcd5ff; background: #f4f1ff; }
.ai-secondary-grid { margin-bottom: 18px; }
.ai-safety-banner { display: flex; align-items: center; gap: 15px; padding: 20px; border-left: 4px solid var(--amber); }
.ai-safety-banner h2 { margin-bottom: 3px; }
.ai-safety-banner p { margin: 0; color: var(--muted); }

.modal { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 19px; box-shadow: 0 28px 90px rgba(18,14,40,.28); }
.modal-large { width: min(820px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(17,15,26,.58); backdrop-filter: blur(4px); }
.modal form { padding: 22px; }
.modal header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal header h2 { font-size: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 13px; }
.permission-fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.permission-fieldset legend { padding: 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #33245d 0, #17131f 40%, #0e0d12 100%); }
.auth-body::before { position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 44px 44px; content: ""; mask-image: linear-gradient(to bottom, black, transparent); }
.auth-card { position: relative; z-index: 1; width: min(430px, 100%); padding: 36px; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; color: white; background: rgba(28,24,37,.88); box-shadow: 0 28px 90px rgba(0,0,0,.36); backdrop-filter: blur(20px); }
.auth-card .brand-mark { margin-bottom: 25px; }
.auth-card h1 { font-size: 32px; }
.auth-card .muted, .auth-footnote { color: #aaa6b5; }
.auth-card label { color: #d8d5df; }
.auth-card input { color: white; border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.06); }
.auth-footnote { margin: 20px 0 0; font-size: 10px; text-align: center; }
.alert { margin-bottom: 16px; padding: 11px 13px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.alert-success { color: #08784f; border: 1px solid #bcebd8; background: #e8fbf3; }
.alert-error { color: #b4263e; border: 1px solid #f5c6cf; background: #ffedf1; }
.video-metrics-rich { grid-template-columns: repeat(3, 1fr); }
.video-content-card { display: flex; min-width: 0; flex-direction: column; }
.video-open-button { width: 100%; padding: 0; border: 0; cursor: pointer; font: inherit; }
.video-open-button:focus-visible { outline: 3px solid rgba(103,75,247,.42); outline-offset: -3px; }
.video-content-card .content-card-body { display: flex; flex: 1; flex-direction: column; gap: 7px; }
.video-content-card .content-card-body > small { display: block; overflow-wrap: anywhere; }
.video-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 17px 17px; border-top: 1px solid var(--line); }
.video-card-actions form { display: inline-flex; }
.video-review-modal { width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; }
.video-review-modal .video-review-shell { padding: 22px; }
.video-review-grid { display: grid; grid-template-columns: minmax(340px, 1.25fr) minmax(320px, .9fr); gap: 22px; }
.moderation-player-panel { min-width: 0; }
.moderation-player { position: relative; display: grid; min-height: 560px; overflow: hidden; place-items: center; border-radius: 18px; background: #0d0c12; }
.moderation-player iframe { width: 100%; height: 100%; min-height: 560px; border: 0; }
.player-unavailable { max-width: 330px; padding: 20px; color: #aaa6b5; text-align: center; }
.player-identity { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.player-identity code { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.video-review-details { min-width: 0; }
.video-state-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.video-detail-list { display: grid; margin: 0; border: 1px solid var(--line); border-radius: 14px; }
.video-detail-list > div { display: grid; grid-template-columns: 125px 1fr; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.video-detail-list > div:last-child { border-bottom: 0; }
.video-detail-list dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.video-detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.video-detail-list dd small { display: block; margin-top: 3px; color: var(--muted); }
.modal-action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.moderation-evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.compact-panel { padding: 16px; }
.compact-panel h3 { margin-bottom: 12px; }
.timeline-list { display: grid; max-height: 280px; overflow: auto; gap: 8px; }
.timeline-item { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #faf9fd; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 3px; color: var(--muted); }
.timeline-item p { margin: 7px 0 0; color: var(--ink); }
.danger-modal { border-top: 4px solid #dc3654; }
.danger-modal code { overflow-wrap: anywhere; }
.empty-state { display: flex; min-height: 170px; align-items: center; justify-content: center; flex-direction: column; padding: 25px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.error-page { display: flex; min-height: 430px; align-items: center; justify-content: center; flex-direction: column; padding: 40px; text-align: center; }
.error-page > span { color: #ded9ff; font-size: 100px; font-weight: 950; line-height: 1; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .comment-metrics { grid-template-columns: repeat(2, 1fr); }
  .video-metrics { grid-template-columns: repeat(2, 1fr); }
  .comment-filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .video-filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .comment-filter-bar .search-field { grid-column: 1 / -1; }
  .video-filter-bar .search-field { grid-column: 1 / -1; }
  .comment-facts { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .ai-capability-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .ai-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .mobile-only { display: grid !important; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-row: auto; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .report-card { grid-template-columns: 42px 1fr; }
  .report-actions { grid-column: 2; }
  .comment-evidence-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-workspace { grid-template-columns: 1fr; }
  .business-grid { grid-template-columns: 1fr; }
  .video-review-grid, .moderation-evidence-grid { grid-template-columns: 1fr; }
  .moderation-player, .moderation-player iframe { min-height: 480px; }
}

@media (max-width: 620px) {
  h1 { font-size: 28px; }
  .topbar-status { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid, .metric-grid.compact, .comment-metrics, .video-metrics, .settings-grid, .card-grid, .checklist ul, .ai-capability-grid, .ai-metrics, .catalog-groups { grid-template-columns: 1fr; }
  .metric-card { min-height: 120px; }
  .filter-bar, .form-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .report-card { grid-template-columns: 1fr; }
  .report-icon { display: none; }
  .report-actions { grid-column: auto; }
  .comment-card-header { align-items: flex-start; flex-direction: column; }
  .comment-facts, .comment-evidence-grid { grid-template-columns: 1fr; }
  .region-row { grid-template-columns: 1fr 50px; }
  .region-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .auth-card { padding: 27px 21px; }
  .ai-action-item { grid-template-columns: 34px 1fr; }
  .ai-action-buttons { grid-column: 2; }
  .video-review-modal { width: calc(100vw - 14px); max-height: calc(100vh - 14px); }
  .video-review-modal .video-review-shell { padding: 14px; }
  .moderation-player, .moderation-player iframe { min-height: 420px; }
  .video-detail-list > div { grid-template-columns: 1fr; gap: 4px; }
}
