:root {
  --brand: #f7911c;
  --brand-strong: #cf6d05;
  --brand-soft: #fef4e8;
  --brand-mid: #fddebb;
  --teal: #078f84;
  --blue: #3478d4;
  --green: #2c9b64;
  --red: #d9534f;
  --violet: #6754c6;
  --gold: #d7a21c;
  --ink: #18201e;
  --ink-2: #4b5652;
  --muted: #7a8581;
  --page: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #dde3e0;
  --line-soft: #ebefed;
  --sidebar: #e77c0c;
  --sidebar-deep: #b85c04;
  --shadow: 0 1px 2px rgba(20, 31, 27, .05), 0 8px 24px rgba(20, 31, 27, .06);
  --shadow-hover: 0 14px 34px rgba(20, 31, 27, .13);
  --radius: 8px;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-display: "Sora", sans-serif;
}

html[data-theme="dark"] {
  --ink: #f4f7f6;
  --ink-2: #c3ccc8;
  --muted: #8f9b96;
  --page: #121715;
  --surface: #1a211e;
  --surface-2: #202925;
  --line: #34413b;
  --line-soft: #2a3530;
  --brand-soft: #342517;
  --brand-mid: #5f3c19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 26px rgba(0, 0, 0, .16);
  --shadow-hover: 0 16px 34px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { display: flex; width: 100%; height: 100dvh; overflow: hidden; }
.sidebar {
  position: relative;
  z-index: 70;
  display: flex;
  flex: 0 0 290px;
  flex-direction: column;
  width: 290px;
  min-width: 0;
  height: 100%;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .18), transparent 30%),
    linear-gradient(180deg, #f89c33 0, var(--sidebar) 27%, var(--sidebar-deep) 100%);
  box-shadow: 8px 0 30px rgba(94, 48, 4, .14);
}
.sidebar::after {
  position: absolute;
  right: 0;
  bottom: 64px;
  left: 0;
  height: 150px;
  pointer-events: none;
  content: "";
  opacity: .16;
  background-image:
    linear-gradient(30deg, transparent 45%, #fff 46%, #fff 48%, transparent 49%),
    linear-gradient(150deg, transparent 45%, #fff 46%, #fff 48%, transparent 49%);
  background-size: 26px 44px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.sidebar-brand img { width: 62px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .1)); }
.sidebar-brand div { min-width: 0; }
.sidebar-brand strong { display: block; font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 1.35; }
.sidebar-brand span { display: block; margin-top: 3px; color: rgba(255, 255, 255, .77); font-size: 10.5px; }
.sidebar-close { display: none !important; margin-left: auto; color: #fff !important; background: rgba(255, 255, 255, .12) !important; }

.filter-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 17px 17px 8px; }
.filter-heading h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 20px; }
.eyebrow { color: var(--brand-strong); font-family: var(--font-display); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255, 255, 255, .72); }
.selection-count { display: grid; min-width: 28px; height: 28px; padding: 0 7px; place-items: center; border: 1px solid rgba(255, 255, 255, .35); border-radius: 99px; background: rgba(255, 255, 255, .14); font-size: 11px; font-weight: 700; }
.clear-filters {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: calc(100% - 28px);
  margin: 4px 14px 8px;
  padding: 9px 12px;
  color: var(--brand-strong);
  border: 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(104, 49, 0, .15);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.clear-filters.show { display: flex; }
.clear-filters svg { width: 14px; height: 14px; }
.filter-search { display: flex; align-items: center; gap: 8px; margin: 4px 14px 10px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 6px; background: rgba(255, 255, 255, .12); }
.filter-search:focus-within { border-color: #fff; background: rgba(255, 255, 255, .18); }
.filter-search svg { width: 15px; height: 15px; color: rgba(255, 255, 255, .8); }
.filter-search input { width: 100%; min-width: 0; color: #fff; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-search input::placeholder { color: rgba(255, 255, 255, .62); }
.filter-groups { flex: 1; min-height: 0; padding: 0 11px 18px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .38) transparent; }
.filter-empty { margin: 18px 8px; color: rgba(255, 255, 255, .75); font-size: 11px; line-height: 1.5; }
.filter-group { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.filter-group-header { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 4px; color: #fff; border: 0; background: transparent; text-align: left; cursor: pointer; }
.filter-group-header > svg:first-child { width: 16px; height: 16px; opacity: .8; }
.filter-group-header span { flex: 1; font-size: 12px; font-weight: 700; }
.filter-group-header .filter-active-count { flex: 0 0 auto; min-width: 20px; padding: 1px 6px; color: var(--brand-strong); border-radius: 99px; background: #fff; font-size: 9px; text-align: center; }
.filter-group-header .chevron { width: 14px; height: 14px; transition: transform .2s ease; opacity: .7; }
.filter-group.open .chevron { transform: rotate(180deg); }
.filter-options { display: none; max-height: 245px; padding: 0 1px 11px; overflow-y: auto; }
.filter-group.open .filter-options { display: block; animation: unfold .2s ease both; }
.filter-option { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 6px 5px; color: #fff; border: 0; border-radius: 5px; background: transparent; text-align: left; appearance: none; cursor: pointer; transition: background .15s ease; }
.filter-option:hover { background: rgba(255, 255, 255, .12); }
.filter-option.zero { opacity: .43; }
.filter-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filter-check { display: grid; width: 16px; height: 16px; place-items: center; border: 1px solid rgba(255, 255, 255, .66); border-radius: 4px; }
.filter-check svg { width: 12px; height: 12px; opacity: 0; transform: scale(.5); transition: .15s ease; }
.filter-option.checked .filter-check { color: var(--brand-strong); border-color: #fff; background: #fff; }
.filter-option.checked .filter-check svg { opacity: 1; transform: scale(1); }
.filter-label { overflow: hidden; color: rgba(255, 255, 255, .94); font-size: 11.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.filter-value-count { color: rgba(255, 255, 255, .68); font-size: 10px; font-variant-numeric: tabular-nums; }
.sidebar-foot { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border-top: 1px solid rgba(255, 255, 255, .22); background: rgba(105, 48, 0, .12); }
.sidebar-foot svg { width: 21px; height: 21px; flex: 0 0 21px; }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot span { margin-top: 2px; color: rgba(255, 255, 255, .72); font-size: 9.5px; line-height: 1.45; }

.workspace { display: flex; flex: 1; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.topbar { position: relative; z-index: 45; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 5px 20px rgba(24, 32, 30, .035); backdrop-filter: blur(16px); }
.topbar::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: linear-gradient(90deg, var(--brand), #ffc164 42%, var(--teal)); }
.topbar-mark { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; color: #fff; border-radius: 8px; background: linear-gradient(145deg, #ffad48, var(--brand-strong)); box-shadow: 0 6px 16px rgba(247, 145, 28, .28); }
.topbar-mark svg { width: 26px; height: 26px; }
.title-block { min-width: 220px; }
.title-block h1 { margin: 2px 0 0; font-family: var(--font-display); font-size: 15px; line-height: 1.3; letter-spacing: 0; }
.view-tabs { display: flex; align-items: center; gap: 3px; min-width: 0; padding: 3px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--page); }
.view-tab { display: flex; align-items: center; gap: 6px; padding: 8px 9px; color: var(--muted); border: 0; border-radius: 5px; background: transparent; font-size: 10.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: .18s ease; }
.view-tab svg { width: 15px; height: 15px; }
.view-tab:hover { color: var(--brand-strong); background: var(--brand-soft); }
.view-tab.active { color: #fff; background: var(--brand); box-shadow: 0 3px 9px rgba(247, 145, 28, .24); }
.topbar-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.icon-button { position: relative; display: grid; width: 36px; height: 36px; padding: 0; place-items: center; color: var(--ink-2); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; transition: color .15s ease, transform .15s ease, border-color .15s ease, background .15s ease; }
.icon-button:hover { color: var(--brand-strong); border-color: var(--brand-mid); background: var(--brand-soft); transform: translateY(-1px); }
.icon-button svg { width: 17px; height: 17px; }
.language-button { width: auto; min-width: 58px; grid-auto-flow: column; gap: 6px; padding: 0 9px; }
.language-button span { font-size: 10px; font-weight: 700; }
.icon-button[data-tooltip]::after { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 100; padding: 5px 8px; color: #fff; border-radius: 4px; background: #202725; content: attr(data-tooltip); font-size: 9.5px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, -4px); transition: .15s ease; }
.icon-button[data-tooltip]:hover::after { opacity: 1; transform: translate(-50%, 0); }
.menu-button { display: none; }
.theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: block; }

.active-filter-bar { padding: 7px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.active-filter-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.active-filter-list::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 5px 8px; color: var(--brand-strong); border: 1px solid var(--brand-mid); border-radius: 99px; background: var(--brand-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.filter-chip button { display: grid; width: 14px; height: 14px; padding: 0; place-items: center; color: inherit; border: 0; border-radius: 50%; background: var(--brand-mid); cursor: pointer; }
.filter-chip svg { width: 9px; height: 9px; }

.workspace-scroll { flex: 1; min-height: 0; padding: 18px 20px 28px; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #bcc7c2 transparent; }
.workspace-scroll::-webkit-scrollbar { width: 8px; }
.workspace-scroll::-webkit-scrollbar-thumb { border-radius: 8px; background: #c5cec9; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.page-heading h2 { margin: 4px 0 4px; font-family: var(--font-display); font-size: clamp(20px, 2.1vw, 29px); line-height: 1.2; letter-spacing: 0; }
.page-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.freshness-card { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; min-height: 54px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.freshness-card > div:not(.freshness-divider) { display: grid; gap: 2px; }
.freshness-card small { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.freshness-card strong { font-family: var(--font-display); font-size: 11px; }
.freshness-divider { width: 1px; height: 28px; background: var(--line); }
.live-dot { width: 9px; height: 9px; border: 2px solid color-mix(in srgb, var(--green) 35%, transparent); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 15%, transparent); animation: livePulse 2s ease-in-out infinite; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric-card { --accent: var(--brand); position: relative; display: grid; grid-template-columns: 51px minmax(0, 1fr); align-items: center; gap: 11px; min-height: 112px; padding: 13px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; transform-style: preserve-3d; }
.metric-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: var(--accent); }
.metric-card::after { position: absolute; right: -34px; bottom: -42px; width: 108px; height: 108px; content: ""; border: 16px solid color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 50%; pointer-events: none; }
.metric-card:hover { z-index: 2; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.metric-icon { display: grid; width: 51px; height: 51px; place-items: center; color: #fff; border-radius: 8px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 72%, white), var(--accent)); box-shadow: 0 7px 17px color-mix(in srgb, var(--accent) 24%, transparent); }
.metric-icon svg { width: 27px; height: 27px; }
.metric-content { position: relative; z-index: 1; min-width: 0; }
.metric-value { display: block; overflow: hidden; font-family: var(--font-display); font-size: 23px; font-weight: 700; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-label { display: block; margin-top: 3px; color: var(--ink-2); font-size: 10.5px; font-weight: 700; line-height: 1.25; }
.metric-note { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8.8px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }

.insight-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.insight-item { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-2); }
.insight-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent, var(--brand)); }
.insight-item div { min-width: 0; }
.insight-item strong { display: block; overflow: hidden; font-family: var(--font-display); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.insight-item span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 11px; }
.panel { grid-column: span 4; min-width: 0; padding: 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); animation: riseIn .45s ease both; }
.panel.span-12 { grid-column: span 12; }
.panel.span-8 { grid-column: span 8; }
.panel.span-7 { grid-column: span 7; }
.panel.span-6 { grid-column: span 6; }
.panel.span-5 { grid-column: span 5; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-title { min-width: 0; }
.panel-title h3 { margin: 0; font-family: var(--font-display); font-size: 12px; line-height: 1.3; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.panel-badge { flex: 0 0 auto; padding: 3px 7px; color: var(--brand-strong); border: 1px solid var(--brand-mid); border-radius: 99px; background: var(--brand-soft); font-size: 8.5px; font-weight: 700; }
.chart-wrap { position: relative; width: 100%; height: 255px; min-height: 255px; }
.chart-wrap.tall { height: 310px; min-height: 310px; }
.chart-wrap.short { height: 205px; min-height: 205px; }
.chart-empty { display: grid; height: 100%; place-items: center; color: var(--muted); font-size: 11px; }

.rank-list { display: grid; gap: 9px; }
.rank-row { display: grid; grid-template-columns: minmax(90px, 35%) minmax(100px, 1fr) 58px; align-items: center; gap: 9px; }
.rank-label { overflow: hidden; color: var(--ink-2); font-size: 10.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 12px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.rank-fill { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); animation: barGrow .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.rank-value { color: var(--ink); font-size: 10px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.table-shell { max-height: 385px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 10.5px; }
.data-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; color: var(--brand-strong); border-bottom: 1px solid var(--brand-mid); background: var(--brand-soft); font-size: 9px; font-weight: 700; text-align: left; text-transform: uppercase; }
.data-table td { padding: 8px 10px; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td:first-child { color: var(--ink); font-weight: 700; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-bar { display: inline-flex; align-items: center; gap: 7px; min-width: 86px; }
.table-bar i { display: block; width: 50px; height: 5px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.table-bar i::after { display: block; width: calc(var(--pct) * 1%); height: 100%; content: ""; background: var(--brand); }

.quality-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quality-card { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.quality-ring { --score: 0; display: grid; width: 92px; height: 92px; margin: 0 auto 11px; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--line) 0); }
.quality-ring::before { grid-area: 1 / 1; width: 70px; height: 70px; border-radius: 50%; background: var(--surface); content: ""; }
.quality-ring strong { grid-area: 1 / 1; font-family: var(--font-display); font-size: 19px; }
.quality-card h3 { margin: 0; font-family: var(--font-display); font-size: 11px; text-align: center; }
.quality-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }
.method-list { display: grid; gap: 10px; }
.method-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line-soft); }
.method-row:last-child { padding-bottom: 0; border-bottom: 0; }
.method-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.method-icon svg { width: 18px; height: 18px; }
.method-row strong { display: block; font-size: 10.5px; }
.method-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.method-row > b { font-family: var(--font-display); font-size: 12px; }

.loading-state, .error-state { display: flex; min-height: 100%; align-items: center; justify-content: center; flex-direction: column; color: var(--ink); text-align: center; }
.loading-state h2, .error-state h2 { margin: 18px 0 6px; font-family: var(--font-display); font-size: 20px; }
.loading-state p, .error-state p { max-width: 460px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.loading-orbit, .error-icon { display: grid; width: 84px; height: 84px; place-items: center; color: #fff; border-radius: 50%; background: linear-gradient(145deg, #ffb14e, var(--brand-strong)); box-shadow: 0 0 0 12px var(--brand-soft), 0 16px 30px rgba(247, 145, 28, .22); }
.loading-orbit { animation: float 2s ease-in-out infinite; }
.loading-orbit svg, .error-icon svg { width: 40px; height: 40px; }
.loading-bars { display: flex; gap: 5px; margin-top: 18px; }
.loading-bars span { width: 24px; height: 4px; border-radius: 2px; background: var(--brand-mid); animation: loadBar 1.1s ease-in-out infinite; }
.loading-bars span:nth-child(2) { animation-delay: .14s; }
.loading-bars span:nth-child(3) { animation-delay: .28s; }
.error-state .eyebrow { margin-top: 18px; }
.error-state h2 { margin-top: 5px; }
.primary-button { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; padding: 10px 15px; color: #fff; border: 0; border-radius: 6px; background: var(--brand); box-shadow: 0 7px 18px rgba(247, 145, 28, .24); font-weight: 700; cursor: pointer; }
.primary-button svg { width: 16px; height: 16px; }

.dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 13px 2px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 9.5px; }
.dashboard-footer > div { display: flex; align-items: center; gap: 8px; }
.dashboard-footer img { width: 50px; height: 28px; object-fit: contain; }
.source-note svg { width: 14px; height: 14px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 150; max-width: 340px; padding: 10px 13px; color: #fff; border-radius: 6px; background: #202725; box-shadow: 0 10px 28px rgba(0, 0, 0, .24); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-backdrop { display: none; }

html[dir="rtl"] {
  --font-body: "Noto Kufi Arabic", "IBM Plex Sans", sans-serif;
  --font-display: "Noto Kufi Arabic", "Sora", sans-serif;
}
html[dir="rtl"] body { font-family: var(--font-body); }
html[dir="rtl"] .sidebar-brand, html[dir="rtl"] .filter-heading, html[dir="rtl"] .filter-group-header,
html[dir="rtl"] .filter-option, html[dir="rtl"] .sidebar-foot, html[dir="rtl"] .title-block,
html[dir="rtl"] .page-heading, html[dir="rtl"] .metric-content, html[dir="rtl"] .panel-title,
html[dir="rtl"] .method-row, html[dir="rtl"] .dashboard-footer { text-align: right; }
html[dir="rtl"] .topbar-actions { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .view-tabs { margin-right: 0; }
html[dir="rtl"] .sidebar-close { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .filter-group-header .chevron { transform: scaleX(-1); }
html[dir="rtl"] .filter-group.open .chevron { transform: scaleX(-1) rotate(180deg); }
html[dir="rtl"] .data-table th { text-align: right; }
html[dir="rtl"] .data-table .num, html[dir="rtl"] .rank-value { text-align: left; }
html[dir="rtl"] .toast { right: auto; left: 18px; }
html[dir="rtl"] .metric-card::after { right: auto; left: -34px; }
html[dir="rtl"] .filter-search input, html[dir="rtl"] .data-table { direction: rtl; }
html[dir="rtl"] .filter-search input::placeholder { text-align: right; }
html[dir="rtl"] .filter-option { grid-template-columns: 17px minmax(0, 1fr) auto; }
html[dir="rtl"] .topbar::before { background: linear-gradient(270deg, var(--brand), #ffc164 42%, var(--teal)); }

.reveal-item { animation: riseIn .48s ease both; }
.spin svg { animation: spin360 .8s linear infinite; }

@keyframes unfold { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barGrow { from { width: 0; } }
@keyframes livePulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--green) 4%, transparent); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes loadBar { 0%, 100% { opacity: .3; transform: scaleX(.7); } 50% { opacity: 1; transform: scaleX(1); } }
@keyframes spin360 { to { transform: rotate(360deg); } }

@media (max-width: 1450px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .view-tab span { display: none; }
  .view-tab { padding: 8px 10px; }
  .title-block { min-width: 200px; }
}

@media (max-width: 1080px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(310px, 88vw); transform: translateX(-104%); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid !important; }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 60; display: block; background: rgba(13, 18, 16, .55); opacity: 0; pointer-events: none; transition: opacity .22s ease; backdrop-filter: blur(2px); }
  .mobile-backdrop.show { opacity: 1; pointer-events: auto; }
  .title-block { min-width: 0; }
  .title-block .eyebrow { display: none; }
  .view-tabs { margin-left: auto; }
  .topbar-actions { margin-left: 0; }
  .panel.span-8, .panel.span-7 { grid-column: span 12; }
  .panel.span-5, .panel.span-6, .panel { grid-column: span 6; }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
  html[dir="rtl"] .sidebar { right: 0; left: auto; transform: translateX(104%); }
  html[dir="rtl"] .sidebar.open { transform: translateX(0); }
  html[dir="rtl"] .view-tabs { margin-right: auto; margin-left: 0; }
}

@media (max-width: 760px) {
  .topbar { min-height: 64px; padding: 8px 10px; gap: 7px; backdrop-filter: none; }
  .topbar-mark { display: none; }
  .title-block h1 { max-width: 150px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .view-tabs { order: 5; position: fixed; right: 8px; bottom: 8px; left: 8px; z-index: 50; justify-content: space-around; padding: 5px; box-shadow: 0 9px 30px rgba(0, 0, 0, .22); }
  .view-tab { flex: 1; justify-content: center; padding: 8px 5px; }
  .view-tab span { display: none; }
  #exportButton, #fullscreenButton { display: none; }
  .language-button { min-width: 36px; padding: 0 8px; }
  .language-button span { display: none; }
  .workspace-scroll { padding: 14px 12px 86px; }
  .page-heading { display: grid; }
  .freshness-card { width: 100%; justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { grid-template-columns: 43px minmax(0, 1fr); min-height: 96px; padding: 10px; }
  .metric-icon { width: 43px; height: 43px; }
  .metric-icon svg { width: 23px; height: 23px; }
  .metric-value { font-size: 19px; }
  .metric-note { display: none; }
  .insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel, .panel.span-5, .panel.span-6, .panel.span-7, .panel.span-8, .panel.span-12 { grid-column: span 12; }
  .quality-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 230px; min-height: 230px; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .metric-grid, .insight-strip, .quality-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 88px; }
  .page-heading h2 { font-size: 21px; }
  .freshness-card { justify-content: flex-start; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
