:root {
  --bg: #07101e;
  --bg-soft: #0a1423;
  --panel: #0d1929;
  --panel-2: #101f32;
  --panel-3: #13263c;
  --line: #1d3149;
  --line-strong: #294866;
  --text: #f4f8fc;
  --muted: #8fa4ba;
  --muted-2: #667f98;
  --blue: #58a9ff;
  --cyan: #62d4cb;
  --gold: #d6ad61;
  --green: #48d6a2;
  --red: #ff7a8a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --sidebar: 248px;
  color-scheme: dark;
  font-family: Inter, "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

:root.light {
  --bg: #eef3f8;
  --bg-soft: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #edf3f9;
  --line: #dbe5ee;
  --line-strong: #bfd0df;
  --text: #10243a;
  --muted: #5d7287;
  --muted-2: #8294a5;
  --blue: #1677d2;
  --cyan: #098f87;
  --gold: #a97720;
  --green: #0c9c69;
  --red: #d74a5d;
  --shadow: 0 20px 60px rgba(27, 57, 85, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 72% -10%, rgba(48, 122, 200, .14), transparent 30%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .45; }
bdi, [dir="ltr"] { font-variant-numeric: tabular-nums; }

.demo-ribbon { position: fixed; z-index: 50; inset: 0 0 auto 0; min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 18px; color: #f7e8c6; background: linear-gradient(90deg, #6f4b19, #8b6429 48%, #6f4b19); border-bottom: 1px solid rgba(255,255,255,.14); font-size: 12px; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffd683; box-shadow: 0 0 0 4px rgba(255,214,131,.12); }
.production-ribbon { color: #d9fff0; background: linear-gradient(90deg, #0a4f42, #0f6d5c 48%, #0a4f42); }
.production-ribbon .demo-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(72,214,162,.14); }
.production-ribbon.warning { color: #f7e8c6; background: linear-gradient(90deg, #6f4b19, #8b6429 48%, #6f4b19); }
.production-ribbon.error { color: #ffe5e9; background: linear-gradient(90deg, #6d2030, #8b2d3f 48%, #6d2030); }
.app-shell { min-height: 100vh; padding-top: 34px; }
.sidebar { position: fixed; z-index: 20; top: 34px; right: 0; bottom: 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 26px 16px 18px; background: rgba(8, 18, 32, .94); backdrop-filter: blur(18px); border-left: 1px solid var(--line); }
:root.light .sidebar { background: rgba(255,255,255,.94); }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 24px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(214,173,97,.65); border-radius: 12px; background: linear-gradient(145deg, rgba(214,173,97,.2), rgba(71,137,202,.08)); color: var(--gold); box-shadow: inset 0 0 18px rgba(214,173,97,.08); }
.brand-mark span { font-weight: 850; letter-spacing: -.08em; direction: ltr; transform: translateX(-1px); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .08em; direction: ltr; text-align: right; }
.nav-list { display: grid; gap: 6px; margin-top: 24px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); text-align: right; }
.nav-item span { width: 21px; color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 17px; }
.nav-item b { font-size: 13px; font-weight: 650; }
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: var(--text); border-color: rgba(88,169,255,.24); background: linear-gradient(90deg, rgba(88,169,255,.16), rgba(88,169,255,.05)); box-shadow: inset -2px 0 0 var(--blue); }
.nav-item.active span { color: var(--blue); }
.sidebar-foot { margin-top: auto; }
.data-health { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.health-row { display: flex; align-items: center; gap: 7px; }
.health-row strong { font-size: 12px; }
.status-live, .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(72,214,162,.1); }
.data-health p { margin: 11px 0 4px; font-size: 11px; color: var(--muted); }
.data-health small { color: var(--muted-2); font-size: 10px; }
.independent-note { margin: 11px 7px 0; color: var(--muted-2); font-size: 9px; line-height: 1.6; }

.workspace { min-height: calc(100vh - 34px); margin-right: var(--sidebar); }
.topbar { position: sticky; z-index: 15; top: 34px; height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(7,16,30,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
:root.light .topbar { background: rgba(238,243,248,.88); }
.crumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.crumb b { color: var(--line-strong); }
.crumb strong { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(214,173,97,.45); border-radius: 50%; background: rgba(214,173,97,.12); color: var(--gold); font-size: 11px; font-weight: 800; }
main { max-width: 1680px; margin: 0 auto; padding: 34px 30px 60px; }
.view { display: none; animation: rise .24s ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-row, .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.hero-row h1, .page-head h1 { margin: 4px 0 8px; font-size: clamp(24px, 2.4vw, 39px); line-height: 1.25; letter-spacing: -.03em; }
.hero-row > div:first-child > p:last-child, .page-head > div > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.eyebrow { margin: 0; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dataset-pill { display: flex; align-items: center; gap: 14px; min-width: 430px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow); }
.dataset-pill div { display: grid; }
.dataset-pill strong { font-size: 17px; }
.dataset-pill small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.dataset-pill i { width: 1px; height: 30px; background: var(--line); }

.search-command { display: flex; align-items: stretch; gap: 9px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--panel); box-shadow: 0 16px 40px rgba(0,0,0,.15); }
.command-field { min-width: 240px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: var(--bg-soft); }
.command-field:focus-within { border-color: var(--blue); }
.command-field > span { color: var(--blue); font-size: 21px; }
.command-field input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); text-align: left; }
.command-field kbd { color: var(--muted-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--panel); font-size: 9px; }
.primary-btn, .secondary-btn, .icon-btn, .text-btn, .link-btn { border: 0; border-radius: 9px; transition: .18s ease; }
.primary-btn { padding: 0 18px; background: linear-gradient(135deg, #278fe9, #1474c7); color: white; font-size: 12px; font-weight: 750; box-shadow: 0 8px 22px rgba(39,143,233,.2); }
.primary-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.secondary-btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.secondary-btn:hover, .icon-btn:hover, .text-btn:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-3); }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.text-btn { min-width: 38px; height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 10px; font-weight: 800; }
.link-btn { padding: 3px 0; background: transparent; color: var(--blue); font-size: 10px; }
.active-filters { min-height: 42px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 8px 0; }
.active-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(88,169,255,.24); border-radius: 99px; background: rgba(88,169,255,.08); color: #9fcfff; font-size: 9px; }
.active-chip button { border: 0; background: transparent; color: inherit; padding: 0; }
.filter-mobile-toggle { display: none; width: 100%; margin-bottom: 10px; }

.search-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; align-items: start; }
.filter-panel { grid-column: 2; grid-row: 1; position: sticky; top: 112px; max-height: calc(100vh - 126px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.results-panel { grid-column: 1; grid-row: 1; min-width: 0; }
.panel-heading, .label-row, .card-head, .console-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 18px; }
.filter-group { padding: 15px 0; border-top: 1px solid var(--line); }
.filter-group:first-of-type { margin-top: 14px; }
.filter-group label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-group label small { color: var(--muted-2); font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); }
input, select { min-height: 37px; padding: 0 10px; font-size: 11px; }
select { appearance: auto; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.range-fields, .inline-fields { display: flex; align-items: center; gap: 7px; }
.range-fields input { min-width: 0; }
.range-fields span { color: var(--muted-2); }
.date-fields { margin-top: 7px; }
.inline-fields input { flex: 1.4; }
.inline-fields select { flex: .6; }
.helper { display: block; margin-top: 6px; color: var(--muted-2); font-size: 8.5px; line-height: 1.55; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.tld-chip { min-width: 43px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--muted); direction: ltr; font-size: 10px; }
.tld-chip.active { border-color: rgba(88,169,255,.52); background: rgba(88,169,255,.14); color: #9fd1ff; }
#moreTld { margin-top: 7px; }
.advanced { border-top: 1px solid var(--line); }
.advanced summary { padding: 15px 0 0; color: var(--gold); font-size: 10px; font-weight: 750; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
.segmented button { min-height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-2); font-size: 8px; }
.segmented button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 3px 12px rgba(0,0,0,.12); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { position: relative; overflow: hidden; min-height: 102px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); }
.stat-card::after { content: ""; position: absolute; width: 64px; height: 64px; left: -18px; bottom: -28px; border-radius: 50%; background: radial-gradient(circle, rgba(88,169,255,.12), transparent 70%); }
.stat-card small { display: block; color: var(--muted); font-size: 9px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 20px; direction: ltr; text-align: right; }
.stat-card em { display: block; margin-top: 6px; color: var(--muted-2); font-size: 8px; font-style: normal; }
.insight-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.insight-title { min-width: 190px; }
.insight-title strong { display: block; margin-top: 5px; font-size: 11px; }
.mini-bars { flex: 1; display: flex; align-items: end; justify-content: flex-end; gap: 5px; height: 42px; direction: ltr; }
.mini-bar { width: 11px; min-height: 3px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--blue), rgba(88,169,255,.18)); }

.table-card, .card { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.09); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.table-toolbar h2 { margin: 0 0 4px; font-size: 14px; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: 9px; }
.table-actions, .action-row { display: flex; align-items: center; gap: 7px; }
.table-actions select { width: auto; min-width: 88px; }
.table-actions .secondary-btn { min-height: 37px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: right; font-size: 10px; }
th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--muted); font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(88,169,255,.045); }
tbody tr[data-sale-id] { cursor: pointer; }
.domain-cell { color: var(--text); font-weight: 720; direction: ltr; text-align: left; }
.price-cell { color: var(--cyan); font-weight: 750; direction: ltr; }
.muted-cell { color: var(--muted); }
.source-badge, .category-badge, .truth-badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: 8px; }
.source-badge { color: #9fcfff; border-color: rgba(88,169,255,.23); background: rgba(88,169,255,.07); }
.category-badge { color: #e5c990; border-color: rgba(214,173,97,.23); background: rgba(214,173,97,.07); }
.truth-badge { direction: ltr; color: var(--gold); border-color: rgba(214,173,97,.35); background: rgba(214,173,97,.08); font-weight: 800; letter-spacing: .08em; }
.truth-badge.success { color: var(--green); border-color: rgba(72,214,162,.3); background: rgba(72,214,162,.08); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; }
.pagination span { color: var(--muted); font-size: 10px; }

.page-head { align-items: center; margin-bottom: 28px; }
.bulk-grid { display: grid; grid-template-columns: 1.55fr .75fr; gap: 13px; }
.bulk-grid .card { margin: 0; padding: 20px; }
.bulk-input-card label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
textarea { min-height: 230px; resize: vertical; padding: 14px; line-height: 1.7; font-size: 12px; }
.action-row { margin-top: 10px; }
.action-row .primary-btn { min-height: 40px; }
.action-row span { margin-inline-start: auto; color: var(--muted); font-size: 10px; }
.bulk-guide ul { padding-right: 18px; margin: 18px 0 0; color: var(--muted); direction: ltr; text-align: left; font-size: 11px; line-height: 2.25; }
.bulk-results { margin-top: 13px; }

.trend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.chart-card { margin: 0; min-height: 320px; padding: 18px; }
.chart-card.wide { grid-column: 1 / -1; min-height: 280px; }
.card-head h2 { margin: 4px 0 0; font-size: 15px; }
.timeline-chart, .histogram { min-height: 210px; display: flex; align-items: end; gap: 8px; padding: 28px 8px 0; direction: ltr; }
.timeline-col, .hist-col { flex: 1; min-width: 20px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; height: 180px; }
.timeline-col i, .hist-col i { display: block; width: 68%; min-height: 3px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--cyan), rgba(98,212,203,.14)); }
.timeline-col small, .hist-col small { color: var(--muted-2); font-size: 8px; transform: rotate(-25deg); transform-origin: center; white-space: nowrap; }
.rank-chart { display: grid; gap: 14px; padding-top: 24px; }
.rank-row { display: grid; grid-template-columns: 76px 1fr 38px; align-items: center; gap: 9px; direction: ltr; }
.rank-row b { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; }
.rank-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--bg-soft); }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.rank-row span { color: var(--muted-2); font-size: 8px; text-align: right; }

.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.source-card { margin: 0; padding: 17px; }
.source-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-top h3 { margin: 0 0 5px; font-size: 13px; direction: ltr; text-align: left; }
.source-top p { margin: 0; color: var(--muted-2); font-size: 9px; }
.source-status { padding: 4px 7px; border-radius: 99px; font-size: 7px; font-weight: 850; letter-spacing: .06em; direction: ltr; }
.source-status.active { color: var(--green); background: rgba(72,214,162,.1); }
.source-status.disabled { color: var(--muted); background: var(--panel-3); }
.source-status.planned { color: var(--gold); background: rgba(214,173,97,.1); }
.source-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.source-meta span { display: grid; gap: 4px; color: var(--muted-2); font-size: 8px; }
.source-meta b { color: var(--muted); font-size: 9px; direction: ltr; }
.source-link { display: block; margin-top: 13px; color: var(--blue); font-size: 9px; direction: ltr; text-align: left; text-decoration: none; }

.recon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.recon-card { min-height: 116px; margin: 0; padding: 16px; }
.recon-card small { color: var(--muted); font-size: 9px; }
.recon-card strong { display: block; margin-top: 15px; font-size: 21px; direction: ltr; text-align: right; }
.recon-card em { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; font-style: normal; }
.reconciliation { padding: 20px; }
.reconciliation p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.code-line { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--cyan); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: left; }

.api-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 13px; }
.endpoint-list { display: grid; gap: 8px; align-content: start; }
.endpoint { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; direction: ltr; }
.endpoint:hover { border-color: var(--line-strong); background: var(--panel-2); }
.method { color: var(--green); font: 800 9px ui-monospace, monospace; }
.endpoint code { color: var(--text); font-size: 10px; }
.endpoint small { color: var(--muted-2); font-size: 8px; }
.api-console { position: sticky; top: 116px; margin: 0; min-height: 520px; overflow: hidden; }
.console-head { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; direction: ltr; }
.api-console pre { min-height: 470px; max-height: 600px; overflow: auto; margin: 0; padding: 17px; background: #050c16; color: #b9d9f2; font: 10px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: left; white-space: pre-wrap; }
:root.light .api-console pre { background: #102033; color: #d8ebfb; }

.drawer-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(1,7,14,.62); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: .22s ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-drawer { position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: min(490px, 94vw); overflow: auto; padding: 22px; border-right: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow); transform: translateX(-103%); transition: .25s ease; }
.detail-drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 23px; text-align: left; }
.drawer-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-item { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
.detail-item small, .detail-item strong { display: block; }
.detail-item small { color: var(--muted-2); font-size: 8px; }
.detail-item strong { margin-top: 6px; font-size: 11px; direction: ltr; text-align: left; }
.truth-note { padding: 12px; border: 1px solid rgba(214,173,97,.25); border-radius: 8px; background: rgba(214,173,97,.07); color: #ddc38c; font-size: 9px; line-height: 1.7; }
.toast { position: fixed; z-index: 100; left: 24px; bottom: 24px; max-width: 340px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-3); box-shadow: var(--shadow); color: var(--text); font-size: 10px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: none; }
.mobile-menu { display: none; }

.login-gate { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 0, rgba(48,122,200,.22), transparent 34%), rgba(4,10,19,.94); backdrop-filter: blur(15px); }
.login-gate[hidden] { display: none; }
.login-card { width: min(430px, 100%); padding: 28px; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); box-shadow: 0 32px 100px rgba(0,0,0,.48); }
.brand-lock { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-lock strong, .brand-lock small { display: block; }
.brand-lock small { margin-top: 4px; color: var(--muted); font-size: 10px; direction: ltr; }
.login-card h1 { margin: 7px 0 8px; font-size: 28px; }
.login-card > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-card label { display: block; margin: 13px 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.login-card input { min-height: 44px; }
.login-card .primary-btn { width: 100%; min-height: 44px; margin-top: 18px; }
.login-error { min-height: 20px; margin-top: 12px; color: var(--red); font-size: 10px; text-align: center; }
.loading-cell { padding: 42px !important; text-align: center !important; color: var(--muted) !important; }

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .search-layout { grid-template-columns: minmax(0, 1fr) 268px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 250px; }
  .sidebar { transform: translateX(105%); transition: .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .workspace { margin-right: 0; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { padding: 0 18px; }
  main { padding: 26px 18px 50px; }
  .hero-row, .page-head { align-items: flex-start; flex-direction: column; }
  .dataset-pill { width: 100%; min-width: 0; }
  .search-layout { display: block; }
  .filter-mobile-toggle { display: block; }
  .filter-panel { position: static; display: none; max-height: none; margin-bottom: 12px; }
  .filter-panel.open { display: block; }
  .bulk-grid, .api-layout { grid-template-columns: 1fr; }
  .api-console { position: static; }
}

@media (max-width: 650px) {
  .demo-ribbon span:last-child { display: none; }
  .search-command { flex-wrap: wrap; }
  .command-field { min-width: 100%; }
  .search-command .primary-btn, .search-command .secondary-btn { min-height: 40px; flex: 1; }
  .stats-grid, .trend-grid, .source-grid, .recon-grid { grid-template-columns: 1fr 1fr; }
  .trend-grid .wide { grid-column: 1 / -1; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-actions { width: 100%; overflow: auto; padding-bottom: 3px; }
  .insight-strip { align-items: flex-start; flex-direction: column; }
  .mini-bars { width: 100%; }
  .page-head h1, .hero-row h1 { font-size: 26px; }
  .crumb span, .crumb b { display: none; }
}

@media (max-width: 440px) {
  .stats-grid, .source-grid, .recon-grid { grid-template-columns: 1fr; }
  .trend-grid { grid-template-columns: 1fr; }
  .trend-grid .wide { grid-column: auto; }
  .dataset-pill { flex-wrap: wrap; }
  .dataset-pill i { display: none; }
  .detail-list { grid-template-columns: 1fr; }
}
