:root {
    color-scheme: light;
    --ink: #0b1220;
    --ink-2: #344054;
    --muted: #667085;
    --quiet: #8a94a6;
    --line: #e7ebf1;
    --line-strong: #d7dde7;
    --canvas: #f8fafc;
    --paper: #ffffff;
    --soft: #f2f5f8;
    --blue: #245bff;
    --blue-strong: #1748d8;
    --blue-soft: #eef3ff;
    --green: #12a66a;
    --green-soft: #ecf9f3;
    --amber: #e88b19;
    --amber-soft: #fff7e8;
    --red: #e5484d;
    --red-soft: #fff1f2;
    --rail-w: 76px;
    --top-h: 64px;
    --page-x: clamp(28px, 3.2vw, 56px);
    --content-max: 1680px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { width: 100%; height: 100%; background: var(--canvas); }
body { width: 100%; height: 100%; min-width: 320px; margin: 0; overflow: hidden; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { color: inherit; font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
img { display: block; max-width: 100%; }
dl, dd { margin: 0; }
:focus-visible { outline: 2px solid rgba(36, 91, 255, .35); outline-offset: 3px; }
::selection { background: #dbe5ff; color: var(--ink); }

.shell { display: grid; width: 100%; height: 100dvh; min-height: 0; grid-template-columns: var(--rail-w) minmax(0, 1fr); overflow: hidden; }
.nav-rail { position: relative; z-index: 60; display: flex; min-height: 0; flex-direction: column; align-items: center; padding: 12px 8px 14px; border-right: 1px solid var(--line); background: var(--paper); }
.rail-brand { display: flex; width: 60px; min-height: 58px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border-radius: 14px; text-decoration: none; }
.brand-symbol, .boot-symbol { display: flex; align-items: flex-end; justify-content: center; gap: 3px; background: var(--ink); color: #fff; }
.brand-symbol { width: 36px; height: 36px; padding: 9px; border-radius: 12px; }
.brand-symbol i, .boot-symbol i { display: block; width: 3px; border-radius: 2px; background: currentColor; }
.brand-symbol i:first-child { height: 8px; }
.brand-symbol i:nth-child(2) { height: 17px; }
.brand-symbol i:last-child { height: 12px; }
.rail-brand strong { font-size: 12px; font-weight: 700; }
.rail-routes { display: flex; width: 100%; align-items: center; flex-direction: column; gap: 6px; margin-top: 34px; }
.rail-routes a { display: flex; width: 60px; min-height: 58px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border-radius: 14px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; transition: background 160ms ease, color 160ms ease, transform 160ms ease; }
.rail-routes a svg { width: 20px; height: 20px; }
.rail-routes a:hover { background: var(--soft); color: var(--ink); }
.rail-routes a.is-active { background: var(--blue-soft); color: var(--blue); }
.rail-live { display: flex; align-items: center; flex-direction: column; gap: 5px; margin-top: auto; color: var(--muted); font-size: 11px; }
.rail-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(18, 166, 106, .08); }

.workspace { display: grid; min-width: 0; min-height: 0; grid-template-rows: var(--top-h) auto minmax(0, 1fr); overflow: hidden; }
.topbar { position: relative; z-index: 50; display: grid; height: var(--top-h); grid-template-columns: minmax(190px, 1fr) auto auto; align-items: center; gap: 24px; padding: 0 22px 0 var(--page-x); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); }
.mobile-brand { display: none; align-items: center; gap: 9px; text-decoration: none; }
.mobile-brand strong { font-size: 14px; }
.topbar-context strong, .topbar-context span { display: block; }
.topbar-context strong { font-size: 14px; font-weight: 700; }
.topbar-context span { margin-top: 1px; color: var(--quiet); font-size: 11px; }
.source-strip { display: flex; align-items: center; gap: 3px; }
.source-state { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 0 9px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.source-state:first-child { border-left: 0; }
.source-state i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--quiet); }
.source-state b, .source-state > span { font-weight: 600; white-space: nowrap; }
.source-state small { color: var(--quiet); font-size: 11px; white-space: nowrap; }
.source-state.is-loading i, .source-state[data-state="loading"] i { background: var(--quiet); animation: source-pulse 1.2s ease-in-out infinite; }
.source-state.is-online i, .source-state.is-ready i, .source-state[data-state="online"] i, .source-state[data-state="ready"] i { background: var(--green); }
.source-state.is-degraded i, .source-state[data-state="degraded"] i { background: var(--amber); }
.source-state.is-error i, .source-state.is-offline i, .source-state[data-state="error"] i, .source-state[data-state="offline"] i { background: var(--red); }
.source-state.is-stale small { color: var(--amber); }
.topbar-status { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.connection { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 10px; border-radius: 10px; background: var(--green-soft); color: #087a50; font-size: 12px; font-weight: 650; }
.connection span, .icon-button { white-space: nowrap; }
.connection i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.connection.is-degraded { background: var(--amber-soft); color: #a35c06; }
.connection.is-offline { background: var(--red-soft); color: var(--red); }
.connection.is-loading i { animation: source-pulse 1.2s ease-in-out infinite; }
.business-day, .updated-at { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.updated-at { color: var(--quiet); }
.icon-button { display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 12px; font-weight: 650; transition: border-color 160ms ease, color 160ms ease, background 160ms ease; }
.icon-button:hover { border-color: #a9baf3; color: var(--blue); background: var(--blue-soft); }
.icon-button svg { width: 17px; height: 17px; }
.refresh.is-loading svg { animation: spin .75s linear infinite; }

.service-alert { position: relative; z-index: 45; display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 16px; padding: 7px var(--page-x); border-bottom: 1px solid #f5d28f; background: var(--amber-soft); color: #7f4a08; font-size: 12px; }
.service-alert button { min-height: 32px; padding: 0 11px; border: 1px solid #e6bb69; border-radius: 9px; background: #fff; color: inherit; font-size: 12px; font-weight: 650; }
.workspace-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 var(--page-x) 88px; scrollbar-color: #cbd3df transparent; scrollbar-width: thin; }
.screen { display: none; width: min(100%, var(--content-max)); min-height: 100%; margin: 0 auto; }
.screen.is-active { display: block; animation: screen-in 240ms var(--ease) both; }

.page-heading { display: flex; min-height: 116px; align-items: center; justify-content: space-between; gap: 28px; padding: 24px 0 20px; }
.page-heading > div:first-child { min-width: 0; }
.page-kicker, .page-heading h1, .page-heading p { display: block; margin: 0; }
.page-kicker { color: var(--blue); font-size: 12px; font-weight: 700; }
.page-heading h1 { margin-top: 5px; font-size: clamp(28px, 2.2vw, 38px); font-weight: 720; letter-spacing: -.04em; line-height: 1.12; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.page-live { display: inline-flex; min-height: 36px; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.page-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live-pulse 1.8s ease-out infinite; }
.panel-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading span, .panel-heading h2, .panel-heading p, .section-heading span, .section-heading h2 { display: block; margin: 0; }
.panel-heading span, .section-heading span { color: var(--blue); font-size: 12px; font-weight: 680; }
.panel-heading h2, .section-heading h2 { margin-top: 3px; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.panel-heading small, .section-heading small { color: var(--quiet); font-size: 12px; }
.section-heading { min-height: 68px; align-items: center; }
.section-heading a { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; color: var(--blue); font-size: 12px; font-weight: 650; text-decoration: none; }

.segmented, .section-tabs, .view-toggle { display: inline-flex; min-height: 46px; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--soft); }
.segmented button, .section-tabs button, .view-toggle button { display: inline-flex; min-width: 60px; height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.segmented button.is-active, .section-tabs button.is-active, .view-toggle button.is-active { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(16, 24, 40, .08); }
.view-toggle button { min-width: 76px; }
.view-toggle svg { width: 16px; height: 16px; }

/* Overview: one continuous white operating surface. */
.overview-stage { display: grid; min-height: 534px; grid-template-areas: "sales trend" "metrics metrics"; grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.8fr); grid-template-rows: minmax(430px, 1fr) auto; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--paper); }
.sales-focus { display: flex; min-width: 0; grid-area: sales; flex-direction: column; padding: 34px 32px 30px 2px; border-right: 1px solid var(--line); }
.focus-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.focus-meta span { color: var(--muted); font-size: 13px; }
.focus-meta small { color: var(--quiet); font-size: 11px; }
.sales-value { display: block; margin-top: 22px; color: var(--ink); font-size: clamp(48px, 4.2vw, 68px); font-variant-numeric: tabular-nums; font-weight: 720; letter-spacing: -.065em; line-height: .98; white-space: nowrap; }
.sales-change { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.sales-change b { color: var(--blue); font-size: 14px; font-variant-numeric: tabular-nums; }
.sales-change b.is-down { color: var(--ink-2); }
.hero-difference { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 9px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.hero-difference strong { color: var(--blue); font-size: 16px; font-variant-numeric: tabular-nums; }
.hero-difference small { padding-left: 8px; border-left: 1px solid var(--line); color: var(--ink-2); font-size: 11px; }
.sales-support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.sales-support > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.sales-support dt { color: var(--muted); font-size: 12px; }
.sales-support dd { margin-top: 6px; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 680; }
.trend-panel { display: flex; min-width: 0; min-height: 0; grid-area: trend; flex-direction: column; padding: 28px 2px 20px 32px; }
.trend-heading { min-height: 64px; flex: 0 0 auto; }
.trend-controls { display: flex; align-items: center; gap: 8px; }
.trend-chart, .contribution-chart { position: relative; min-width: 0; }
.trend-chart { min-height: 255px; flex: 1; }
.trend-chart::after, .contribution-chart::after { position: absolute; inset: 0; display: none; place-items: center; color: var(--quiet); content: attr(data-empty); font-size: 13px; pointer-events: none; }
.trend-chart[data-empty]::after, .contribution-chart[data-empty]::after { display: grid; }
.trend-readout { display: grid; min-height: 68px; flex: 0 0 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.trend-readout > div { position: relative; min-width: 0; padding: 12px 14px 0; }
.trend-readout > div:first-child { padding-left: 0; }
.trend-readout > div + div::before { position: absolute; top: 13px; bottom: 2px; left: 0; width: 1px; background: var(--line); content: ""; }
.trend-readout dt, .trend-readout dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-readout dt { color: var(--muted); font-size: 11px; }
.trend-readout dd { margin-top: 5px; font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 680; }
.trend-readout > div:first-child dd { color: var(--blue); }
.metric-line, .summary-line { display: grid; overflow: hidden; background: var(--paper); }
.metric-line { grid-area: metrics; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.metric-line > div, .summary-line > div { position: relative; display: flex; min-width: 0; justify-content: center; flex-direction: column; }
.metric-line > div { min-height: 104px; padding: 18px 24px; }
.metric-line > div + div::before, .summary-line > div + div::before { position: absolute; top: 20px; bottom: 20px; left: 0; width: 1px; background: var(--line); content: ""; }
.metric-line dt, .summary-line dt { color: var(--muted); font-size: 12px; }
.metric-line dd, .summary-line dd { margin-top: 5px; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.025em; }
.metric-line small { margin-top: 3px; color: var(--quiet); font-size: 11px; }
.metric-line small.is-up, .metric-line small.is-down { color: var(--ink-2); }
.fact-section { margin-top: 36px; }
.fact-strip { display: grid; min-height: 124px; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.fact-item { position: relative; display: flex; min-width: 0; justify-content: center; flex-direction: column; padding: 20px 42px 20px 24px; border: 0; background: transparent; color: inherit; text-align: left; transition: background 150ms ease; }
.fact-item + .fact-item { border-left: 1px solid var(--line); }
.fact-item:hover { background: #f7f9ff; }
.fact-item span, .fact-item strong, .fact-item p, .fact-item small { display: block; margin: 0; }
.fact-item span { color: var(--muted); font-size: 11px; }
.fact-item strong { margin-top: 8px; font-size: 17px; font-weight: 680; }
.fact-item p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.fact-item small { margin-top: auto; padding-top: 8px; color: var(--quiet); font-size: 11px; }
.fact-item > i { position: absolute; top: 20px; right: 18px; color: var(--blue); font-size: 14px; font-style: normal; }
.overview-secondary { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: clamp(32px, 4vw, 64px); margin-top: 42px; }
.top-products, .distribution-list { min-height: 290px; }
.top-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.top-product-card, .top-product { min-width: 0; cursor: pointer; }
.top-product-media, .top-product-image { position: relative; overflow: hidden; aspect-ratio: 1 / .82; border-radius: 16px; background: #f1f3f6; }
.top-product-media img, .top-product-image img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 180ms ease, transform 320ms var(--ease); }
.top-product-media.has-image img, .top-product-image.has-image img { opacity: 1; }
.top-product-card:hover img, .top-product:hover img { transform: scale(1.015); }
.top-product-card h3, .top-product-copy h3 { display: -webkit-box; overflow: hidden; margin: 12px 0 0; font-size: 14px; font-weight: 650; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.top-product-copy > span { display: block; margin-top: 11px; color: var(--quiet); font-size: 11px; }
.top-product-copy h3 { margin-top: 4px; }
.top-product-copy p { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 0; }
.top-product-copy p strong { color: var(--blue); font-size: 19px; font-variant-numeric: tabular-nums; }
.top-product-copy p small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.top-product-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 7px; }
.top-product-meta strong { color: var(--blue); font-size: 19px; font-variant-numeric: tabular-nums; }
.top-product-meta span { color: var(--muted); font-size: 11px; }
.distribution-list { padding: 6px 0 10px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.distribution-row { display: grid; min-height: 58px; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.distribution-row:last-child { border-bottom: 0; }
.distribution-index { color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; }
.distribution-row > div { min-width: 0; }
.distribution-row p { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; }
.distribution-row p strong, .distribution-row p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.distribution-row p strong { font-size: 12px; }
.distribution-row p span { color: var(--muted); font-size: 11px; }
.distribution-row > div > i { position: relative; display: block; width: 100%; height: 6px; overflow: hidden; margin-top: 7px; border-radius: 4px; background: var(--soft); }
.distribution-row > div > i::after { display: block; width: var(--bar, 0%); height: 100%; border-radius: inherit; background: var(--blue); content: ""; }
.distribution-track { height: 6px; overflow: hidden; background: var(--soft); border-radius: 4px; }
.distribution-track i { display: block; width: var(--share, 0%); height: 100%; border-radius: inherit; background: var(--blue); }
.distribution-row strong { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.distribution-note { margin: 12px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.6; }

/* Team comparison is a ranked list and an inspector, not a judgement scatterplot. */
.page-heading-with-tabs { align-items: center; }
.section-tabs { flex: 0 0 auto; }
.summary-line { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.summary-line > div { min-height: 92px; padding: 16px 24px; }
.team-workbench { display: grid; min-height: 430px; grid-template-columns: minmax(520px, 1.35fr) minmax(320px, .65fr); margin-top: 32px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.team-ranking-panel { min-width: 0; padding: 24px 28px 24px 0; border-right: 1px solid var(--line); }
.team-ranking-panel > .panel-heading { min-height: 62px; }
.team-ranking { min-height: 320px; }
.team-rank-item { display: grid; min-height: 62px; grid-template-columns: 38px minmax(110px, .8fr) minmax(160px, 1.5fr) auto; align-items: center; gap: 14px; padding: 8px 10px; border-top: 1px solid var(--line); cursor: pointer; transition: background 150ms ease, color 150ms ease; }
.team-rank-item:hover, .team-rank-item.is-selected { background: var(--blue-soft); }
.team-rank-row { width: 100%; grid-template-columns: 34px minmax(130px, .9fr) minmax(160px, 1.35fr) 68px 68px 96px; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: inherit; text-align: left; }
.team-rank-number { color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.team-person { display: flex; min-width: 0; align-items: center; gap: 9px; }
.team-person > i { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-style: normal; font-weight: 700; }
.team-person strong, .team-person small, .team-sales strong, .team-ratio small, .team-ratio strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-person strong { font-size: 13px; }
.team-person small { color: var(--quiet); font-size: 11px; }
.team-sales { min-width: 0; }
.team-sales strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.team-sales > i { position: relative; display: block; width: 100%; height: 5px; overflow: hidden; margin-top: 5px; border-radius: 3px; background: var(--soft); }
.team-sales > i::after { display: block; width: var(--bar, 0%); height: 100%; border-radius: inherit; background: var(--blue); content: ""; }
.team-ratio small { color: var(--quiet); font-size: 11px; }
.team-ratio strong { margin-top: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.change { display: inline-flex; min-height: 27px; align-items: center; justify-content: center; gap: 3px; padding: 0 7px; border-radius: 8px; background: var(--soft); color: var(--ink-2); font-size: 11px; font-weight: 650; white-space: nowrap; }
.change i { color: var(--quiet); font-style: normal; }
.team-rank-person strong, .team-rank-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-rank-person strong { font-size: 13px; }
.team-rank-person small { margin-top: 2px; color: var(--quiet); font-size: 11px; }
.team-rank-track { position: relative; height: 8px; overflow: hidden; background: var(--soft); border-radius: 4px; }
.team-rank-track i { display: block; width: var(--rank-width, 0%); height: 100%; border-radius: inherit; background: var(--blue); }
.team-rank-value { min-width: 98px; text-align: right; }
.team-rank-value strong, .team-rank-value small { display: block; }
.team-rank-value strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.team-rank-value small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.inspector { min-width: 0; padding: 26px 0 26px 30px; background: #fbfcfe; }
.inspector-empty { display: flex; min-height: 100%; align-items: flex-start; justify-content: center; flex-direction: column; padding: 28px; border-left: 2px solid var(--line); }
.inspector-empty span { color: var(--blue); font-size: 12px; font-weight: 650; }
.inspector-empty strong { margin-top: 10px; font-size: 21px; }
.inspector-empty p { max-width: 280px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.inspector-person > span { color: var(--blue); font-size: 12px; font-weight: 650; }
.inspector-person h2 { margin: 7px 0 0; font-size: 26px; }
.inspector-hero { margin-top: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.inspector-hero span, .inspector-hero strong, .inspector-hero small { display: block; }
.inspector-hero span { color: var(--muted); font-size: 12px; }
.inspector-hero strong { margin-top: 6px; color: var(--blue); font-size: 30px; font-variant-numeric: tabular-nums; }
.inspector-hero small { margin-top: 4px; color: var(--quiet); font-size: 11px; }
.inspector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 18px; background: var(--line); }
.inspector-grid > div { min-height: 66px; padding: 12px; background: #fbfcfe; }
.inspector-grid span, .inspector-grid strong { display: block; }
.inspector-grid span { color: var(--muted); font-size: 11px; }
.inspector-grid strong { margin-top: 5px; font-size: 13px; }
.team-inspector > header > span { color: var(--blue); font-size: 11px; font-weight: 650; }
.team-inspector .inspector-person { display: flex; align-items: center; gap: 11px; margin-top: 9px; }
.team-inspector .inspector-person > i { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-style: normal; font-weight: 700; }
.team-inspector .inspector-person h2 { margin: 0; font-size: 22px; }
.team-inspector .inspector-person p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.inspector-primary { margin-top: 24px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.inspector-primary > span, .inspector-primary > strong { display: block; }
.inspector-primary > span { color: var(--muted); font-size: 11px; }
.inspector-primary > strong { margin-top: 5px; color: var(--blue); font-size: 29px; font-variant-numeric: tabular-nums; }
.inspector-primary .change { margin-top: 8px; }
.inspector-extension { margin-top: 22px; }
.inspector-extension h3 { margin: 0 0 9px; font-size: 13px; }
.inspector-extension > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-field { min-height: 62px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-field span, .detail-field strong { display: block; }
.detail-field span { color: var(--muted); font-size: 11px; }
.detail-field strong { margin-top: 4px; font-size: 12px; line-height: 1.45; word-break: break-word; }
.inspector-extension > p { margin: 9px 0 0; color: var(--quiet); font-size: 11px; line-height: 1.55; }
.inspector-action, .drawer-action { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 0 13px; border: 1px solid #bdccff; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 12px; text-align: left; }
.inspector-action strong, .drawer-action strong { font-size: 12px; }

.data-section { margin-top: 46px; background: var(--paper); }
.data-section > .section-heading { border-bottom: 1px solid var(--line-strong); }
.filter-bar { display: flex; min-height: 66px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); }
.search-field, .select-field { display: flex; height: 46px; min-width: 0; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; }
.search-field:focus-within, .select-field:focus-within { border-color: #9eb1ef; box-shadow: 0 0 0 3px var(--blue-soft); }
.search-field { width: min(440px, 40%); padding: 0 14px; }
.search-field svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--quiet); }
.search-field input { width: 100%; height: 100%; min-width: 0; padding: 0 0 0 9px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-field input::placeholder { color: var(--quiet); }
.select-field { min-width: 180px; padding-left: 12px; }
.select-field > span { color: var(--quiet); font-size: 11px; white-space: nowrap; }
.select-field select { height: 100%; min-width: 0; flex: 1; padding: 0 30px 0 8px; border: 0; outline: 0; background: transparent; font-size: 12px; cursor: pointer; }
.desktop-table { overflow: auto; scrollbar-color: #cbd3df transparent; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; }
thead th { position: sticky; z-index: 4; top: 0; height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; }
tbody td { height: 62px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
tbody tr { cursor: pointer; transition: background 140ms ease; }
tbody tr:hover, tbody tr.is-selected { background: #f4f7ff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { display: inline-flex; min-width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.rank.is-top { background: var(--blue-soft); color: var(--blue); }
.person { display: inline-flex; min-width: 120px; align-items: center; gap: 9px; }
.person i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-style: normal; font-weight: 700; }
.person strong, .person small { display: block; }
.person strong { color: var(--ink); font-size: 13px; }
.person small { margin-top: 1px; color: var(--quiet); font-size: 11px; }
.money { color: var(--blue); font-weight: 680; }
.delta { display: inline-flex; min-height: 26px; align-items: center; padding: 0 7px; border-radius: 8px; background: var(--soft); color: var(--ink-2); font-size: 11px; font-weight: 650; }
.row-arrow { color: var(--quiet); font-size: 18px; }
.stream { display: flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; color: var(--quiet); font-size: 12px; }
.stream::before { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%; content: ""; animation: spin .8s linear infinite; }
.stream.is-complete::before { width: 9px; height: 6px; border: 0; border-bottom: 1.5px solid var(--green); border-left: 1.5px solid var(--green); border-radius: 0; animation: none; transform: rotate(-45deg); }
.empty-state { display: grid; min-height: 160px; place-items: center; color: var(--quiet); font-size: 13px; }

/* TOP50 products: images are the primary analytical object. */
.product-heading { min-height: 104px; }
.product-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.product-summary > div { min-height: 86px; padding: 14px 18px; }
.product-summary .coverage-item dd { color: var(--blue); }
.product-toolbar { position: sticky; z-index: 22; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 8px 0; border-bottom: 1px solid var(--line); background: rgba(248, 250, 252, .96); backdrop-filter: blur(14px); }
.product-toolbar .filter-bar { min-width: 0; flex: 1; padding: 0; border: 0; background: transparent; }
.product-toolbar .search-field { width: min(460px, 48%); }
.product-view-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.product-contribution { margin-top: 22px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.contribution-layout { display: grid; min-height: 420px; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr); }
.contribution-chart { min-height: 390px; border-right: 1px solid var(--line); }
.contribution-copy { display: flex; justify-content: center; flex-direction: column; padding: 30px; }
.contribution-copy > span { color: var(--blue); font-size: 12px; font-weight: 650; }
.contribution-copy > strong { margin-top: 8px; font-size: 28px; font-variant-numeric: tabular-nums; }
.contribution-copy > p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.contribution-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 22px; background: var(--line); }
.contribution-facts > div { padding: 13px; background: #fff; }
.contribution-facts span, .contribution-facts strong { display: block; }
.contribution-facts span { color: var(--muted); font-size: 11px; }
.contribution-facts strong { margin-top: 4px; font-size: 15px; }
.product-gallery-section { margin-top: 28px; }
.product-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 20px; }
.product-card { position: relative; min-width: 0; cursor: pointer; animation: product-in 260ms var(--ease) both; animation-delay: var(--delay, 0ms); }
.product-visual, .product-media { position: relative; overflow: hidden; }
.product-visual { aspect-ratio: 1 / .86; border-radius: 16px; background: #f1f3f6; }
.product-media { width: 100%; height: 100%; }
.product-visual img, .product-media img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 180ms ease, transform 340ms var(--ease); }
.product-visual.has-image img, .product-media.has-image img, .has-image > img { opacity: 1; }
.product-card:hover .product-visual img { transform: scale(1.015); }
.image-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #aeb7c5; background: linear-gradient(135deg, #f3f5f8, #edf0f4); }
.image-placeholder svg { width: 32px; height: 32px; }
.has-image .image-placeholder { opacity: 0; }
.image-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; background: linear-gradient(135deg, #f4f6f9, #eceff4); color: #9aa5b5; }
.image-fallback b { font-size: 28px; font-weight: 650; }
.image-fallback small { max-width: 80%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.has-image .image-fallback { opacity: 0; }
.product-rank, .product-segment { position: absolute; z-index: 3; top: 10px; display: inline-flex; min-height: 28px; align-items: center; padding: 0 8px; border: 1px solid rgba(215, 221, 231, .82); border-radius: 9px; background: rgba(255, 255, 255, .92); color: var(--ink-2); font-size: 11px; font-weight: 680; backdrop-filter: blur(8px); }
.product-rank { left: 10px; }
.product-rank.is-top { border-color: #b9c8f9; color: var(--blue); }
.product-segment { right: 10px; color: var(--muted); }
.product-card-body { padding: 13px 2px 0; }
.product-content > .product-owner { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-content > h3 { display: -webkit-box; min-height: 42px; overflow: hidden; margin: 5px 0 0; font-size: 14px; font-weight: 650; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-content > .product-id { overflow: hidden; margin: 4px 0 0; color: var(--quiet); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-main { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.product-main span, .product-main strong { display: block; }
.product-main span { color: var(--muted); font-size: 11px; }
.product-main strong { margin-top: 3px; color: var(--blue); font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.025em; }
.product-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.product-metrics > span { color: var(--quiet); font-size: 11px; }
.product-metrics strong { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.product-card-head > div { min-width: 0; }
.product-card-head h3 { display: -webkit-box; min-height: 42px; overflow: hidden; margin: 0; font-size: 14px; font-weight: 650; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card-head p { overflow: hidden; margin: 5px 0 0; color: var(--quiet); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.owner-pill { display: inline-flex; max-width: 92px; min-height: 28px; flex: 0 0 auto; align-items: center; gap: 5px; overflow: hidden; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.owner-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.product-number { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.product-number span, .product-number strong, .product-number small { display: block; }
.product-number span { color: var(--muted); font-size: 11px; }
.product-number strong { margin-top: 3px; color: var(--blue); font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.025em; }
.product-number > div:last-child, .product-card-facts { display: flex; gap: 13px; text-align: right; }
.product-number small, .product-card-facts span { color: var(--quiet); font-size: 11px; }
.product-number small b, .product-card-facts strong { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12px; }
.product-number small b.is-profit, .product-card-facts strong.is-profit { color: var(--green); }
.product-number small b.is-loss, .product-card-facts strong.is-loss { color: var(--red); }
.product-stream { grid-column: 1 / -1; margin-top: 12px; }

/* Read-only violation and penalty records. */
.risk-summary { display: grid; grid-template-columns: .7fr 1.1fr 1.25fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.risk-summary-group { min-width: 0; padding: 18px 24px; }
.risk-summary-group + .risk-summary-group { border-left: 1px solid var(--line); }
.risk-summary-group > span { display: block; color: var(--blue); font-size: 12px; font-weight: 650; }
.risk-summary-group dl { display: grid; margin-top: 10px; }
.risk-summary-group dl > div { min-width: 0; }
.risk-summary-group dt { color: var(--muted); font-size: 11px; }
.risk-summary-group dd { margin-top: 4px; font-size: 21px; font-variant-numeric: tabular-nums; font-weight: 700; }
.risk-summary-group small { display: block; margin-top: 1px; color: var(--quiet); font-size: 11px; }
.risk-status-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.risk-status-facts > div { display: inline-flex; align-items: baseline; gap: 5px; }
.risk-status-facts span { color: var(--muted); font-size: 11px; }
.risk-status-facts strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.task-summary dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fine-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-summary dl > div + div, .fine-summary dl > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.risk-ledger { margin-top: 36px; }
.risk-mobile-list { display: none; }
.violation-type, .status { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 650; white-space: normal; }
.violation-type { background: var(--blue-soft); color: var(--blue); }
.status { background: var(--soft); color: var(--muted); }
.record-type, .record-status { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 650; white-space: normal; }
.record-type { background: var(--blue-soft); color: var(--blue); }
.record-status { background: var(--soft); color: var(--ink-2); }
.status.is-done { background: var(--green-soft); color: #087a50; }
.status.is-pending { background: var(--amber-soft); color: #a35c06; }
.risk-row.is-pending td:first-child { box-shadow: inset 2px 0 var(--amber); }
.risk-row.is-done td:first-child { box-shadow: inset 2px 0 var(--green); }
.risk-record-item { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.risk-record-item + .risk-record-item { margin-top: 10px; }
.record-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record-card > header > strong { color: var(--blue); font-size: 16px; }
.record-card h3 { display: -webkit-box; overflow: hidden; margin: 13px 0 0; font-size: 14px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.record-card > p { display: -webkit-box; overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.record-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 11px; }
.risk-record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.risk-record-head strong { font-size: 14px; line-height: 1.45; }
.risk-record-object { display: -webkit-box; overflow: hidden; margin: 12px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.risk-record-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* Detail, loading and feedback. */
.drawer { position: fixed; z-index: 120; inset: 0; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(11, 18, 32, .24); backdrop-filter: blur(2px); animation: fade-in 160ms ease both; }
.drawer-sheet { position: absolute; top: 8px; right: 8px; bottom: 8px; display: flex; width: min(480px, calc(100vw - 24px)); overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 24px 64px rgba(16, 24, 40, .16); animation: sheet-in 260ms var(--ease) both; }
.drawer.is-closing .drawer-backdrop { animation: fade-out 160ms ease both; }
.drawer.is-closing .drawer-sheet { animation: sheet-out 190ms ease-in both; }
.drawer-sheet > header { display: flex; min-height: 72px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-sheet header span, .drawer-sheet header h2 { display: block; margin: 0; }
.drawer-sheet header span { color: var(--blue); font-size: 11px; font-weight: 650; }
.drawer-sheet header h2 { overflow: hidden; margin-top: 3px; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-sheet header > div { min-width: 0; }
.drawer-close { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--muted); font-size: 22px; }
.drawer-body { min-height: 0; flex: 1; overflow-y: auto; padding: 20px 20px 30px; }
.detail-hero { padding: 22px; border: 1px solid #dbe5ff; border-radius: 16px; background: var(--blue-soft); color: var(--ink); }
.detail-hero span, .detail-hero strong, .detail-hero small { display: block; }
.detail-hero span { color: var(--muted); font-size: 11px; }
.detail-hero strong { margin-top: 6px; color: var(--blue); font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.detail-hero small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.detail-product { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 16px; }
.detail-product-media { position: relative; width: 96px; height: 96px; overflow: hidden; border-radius: 14px; background: #fff; }
.detail-product-media img { width: 100%; height: 100%; object-fit: contain; }
.drawer-product { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.drawer-product-image { position: relative; width: 104px; height: 104px; overflow: hidden; border-radius: 13px; background: var(--soft); }
.drawer-product-image img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 180ms ease; }
.drawer-product-image.has-image img { opacity: 1; }
.drawer-product > div > span, .drawer-product > div > strong, .drawer-product > div > small { display: block; }
.drawer-product > div > span { color: var(--muted); font-size: 11px; }
.drawer-product > div > strong { margin-top: 5px; color: var(--blue); font-size: 25px; font-variant-numeric: tabular-nums; }
.drawer-product > div > small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.drawer-record-hero { padding: 22px; border: 1px solid #dbe5ff; border-radius: 16px; background: var(--blue-soft); }
.drawer-record-hero span, .drawer-record-hero strong, .drawer-record-hero small { display: block; }
.drawer-record-hero span { color: var(--muted); font-size: 11px; }
.drawer-record-hero strong { margin-top: 6px; color: var(--blue); font-size: 25px; }
.drawer-record-hero small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.drawer-fields { margin-top: 24px; }
.drawer-fields h3 { margin: 0 0 10px; font-size: 14px; }
.drawer-fields > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-grid > div { min-height: 70px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--muted); font-size: 11px; }
.detail-grid strong { margin-top: 5px; color: var(--ink-2); font-size: 12px; font-weight: 650; line-height: 1.5; word-break: break-word; }
.detail-action { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 0 15px; border: 1px solid #bdccff; border-radius: 12px; background: var(--blue-soft); color: var(--blue); text-align: left; transition: background 160ms ease, transform 160ms ease; }
.detail-action:hover { background: #e2eaff; transform: translateY(-1px); }
.detail-action span, .detail-action b { font-size: 12px; }
.detail-action i { margin-left: 4px; font-style: normal; }
.toasts { position: fixed; z-index: 140; top: 78px; right: 18px; display: flex; width: min(340px, calc(100vw - 28px)); flex-direction: column; gap: 8px; }
.toast { display: flex; min-height: 46px; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-2); box-shadow: 0 12px 34px rgba(16, 24, 40, .1); font-size: 12px; animation: toast-in 200ms ease both; }
.toast i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.toast.is-success i { background: var(--green); }
.toast.is-warning i { background: var(--amber); }
.toast.is-error i { background: var(--red); }
.toast.is-leaving { opacity: 0; transform: translateY(-4px); transition: 180ms ease; }
.boot { position: fixed; z-index: 200; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #fff; color: var(--ink); transition: opacity 260ms ease, visibility 260ms ease; }
.boot.is-hidden { opacity: 0; visibility: hidden; }
.boot-symbol { width: 52px; height: 52px; padding: 14px; border-radius: 16px; }
.boot-symbol i:first-child { height: 9px; animation: boot-bars .65s ease-in-out infinite alternate; }
.boot-symbol i:nth-child(2) { height: 21px; animation: boot-bars .65s .1s ease-in-out infinite alternate; }
.boot-symbol i:last-child { height: 14px; animation: boot-bars .65s .2s ease-in-out infinite alternate; }
.boot strong { margin-top: 16px; font-size: 14px; }
.boot small { margin-top: 4px; color: var(--quiet); font-size: 11px; }
.noscript { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; background: #fff; }
.mobile-routes { display: none; }

@media (min-width: 1600px) {
    .product-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .top-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1179px) {
    :root { --rail-w: 64px; --page-x: 28px; }
    .nav-rail { padding-inline: 6px; }
    .rail-brand, .rail-routes a { width: 50px; }
    .rail-brand strong, .rail-routes a span, .rail-live span { display: none; }
    .rail-brand { min-height: 50px; }
    .rail-routes a { min-height: 50px; }
    .source-state b, .source-state > span, .source-state small { display: none; }
    .source-state { width: 24px; justify-content: center; padding: 0; border: 0; }
    .updated-at { display: none; }
    .topbar { grid-template-columns: minmax(160px, 1fr) auto auto; gap: 14px; }
    .overview-stage { grid-template-columns: minmax(270px, .7fr) minmax(430px, 1.5fr); }
    .sales-focus { padding-right: 24px; }
    .trend-panel { padding-left: 24px; }
    .overview-secondary { grid-template-columns: 1fr; }
    .distribution-list { min-height: 250px; }
    .team-workbench { grid-template-columns: minmax(430px, 1.2fr) minmax(280px, .8fr); }
    .product-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-summary > div:nth-child(4)::before { display: none; }
    .product-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .product-toolbar { align-items: flex-end; }
    .product-toolbar .filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(155px, .5fr)); }
    .product-toolbar .search-field { width: 100%; }
}

@media (min-width: 1180px) and (max-width: 1450px) {
    .source-state small { display: none; }
    .source-state { padding-inline: 8px; }
    .topbar { gap: 16px; }
}

@media (max-width: 980px) and (min-width: 768px) {
    .topbar-context span, .business-day, .refresh span { display: none; }
    .overview-stage { grid-template-areas: "sales" "metrics" "trend"; grid-template-columns: 1fr; grid-template-rows: auto; }
    .sales-focus { min-height: 300px; padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .sales-support { max-width: 520px; }
    .trend-panel { min-height: 410px; padding: 26px 0 18px; }
    .metric-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-line > div:nth-child(4)::before { display: none; }
    .metric-line > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fact-item:nth-child(3) { border-left: 0; }
    .fact-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .team-workbench { grid-template-columns: 1fr; }
    .team-ranking-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .inspector { padding-left: 0; }
    .product-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-toolbar { display: block; }
    .view-toggle { margin-top: 10px; }
    .risk-summary { grid-template-columns: 1fr 1.5fr; }
    .fine-summary { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0 !important; }
}

@media (max-width: 767px) {
    :root { --top-h: 56px; --page-x: 14px; }
    html, body { min-height: 100%; }
    .shell { display: block; height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .nav-rail { display: none; }
    .workspace { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); grid-template-rows: var(--top-h) auto minmax(0, 1fr); }
    .topbar { height: var(--top-h); grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 10px 0 12px; }
    .mobile-brand { display: inline-flex; }
    .mobile-brand .brand-symbol { width: 34px; height: 34px; padding: 8px; border-radius: 11px; }
    .topbar-context, .connection, .business-day, .updated-at, .refresh span { display: none; }
    .source-strip { justify-self: end; gap: 1px; }
    .source-state { width: 18px; min-height: 30px; }
    .source-state i { width: 6px; height: 6px; flex-basis: 6px; }
    .topbar-status { gap: 0; }
    .icon-button { width: 44px; padding: 0; }
    .service-alert { min-height: 44px; justify-content: space-between; gap: 10px; padding-inline: 12px; font-size: 11px; }
    .workspace-scroll { padding-bottom: 52px; }
    .screen { min-height: 0; }
    .page-heading { min-height: 82px; align-items: flex-start; padding: 14px 0 12px; }
    .page-kicker { font-size: 11px; }
    .page-heading h1 { margin-top: 3px; font-size: 27px; }
    .page-heading p { max-width: 330px; margin-top: 5px; font-size: 12px; }
    .page-live { display: none; }
    .page-heading-with-tabs { display: block; }
    .page-heading-with-tabs .section-tabs { margin-top: 15px; }
    .panel-heading h2, .section-heading h2 { font-size: 18px; }
    .panel-heading span, .section-heading span { font-size: 11px; }
    .panel-heading small, .section-heading small { display: none; }
    .section-heading { min-height: 60px; }
    .segmented, .section-tabs, .view-toggle { min-height: 46px; }
    .segmented button, .section-tabs button, .view-toggle button { min-width: 58px; height: 40px; padding-inline: 10px; font-size: 12px; }

    .overview-stage { min-height: 0; grid-template-areas: "sales" "metrics" "trend"; grid-template-columns: 1fr; grid-template-rows: auto; }
    .sales-focus { min-height: 190px; padding: 16px 0 14px; border-right: 0; border-bottom: 0; }
    .focus-meta span { font-size: 12px; }
    .sales-value { margin-top: 12px; font-size: 48px; }
    .sales-change { margin-top: 10px; }
    .sales-support { margin-top: 10px; padding-top: 9px; }
    .sales-support > div { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
    .sales-support > div + div { padding-left: 12px; }
    .sales-support dt { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .sales-support dd { overflow: hidden; margin-top: 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
    .trend-panel { min-height: 310px; padding: 15px 0 10px; border-top: 1px solid var(--line-strong); }
    .trend-heading { min-height: 84px; flex-direction: column; gap: 8px; }
    .trend-controls { width: 100%; justify-content: space-between; gap: 6px; }
    .trend-controls .segmented { min-width: 0; }
    .trend-chart { min-height: 150px; height: 150px; order: 3; flex: none; }
    .trend-readout { min-height: 52px; order: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .trend-readout > div { min-height: 52px; padding: 7px 8px; border-top: 1px solid var(--line); }
    .trend-readout > div:first-child { padding-left: 10px; }
    .trend-readout > div:nth-child(3)::before { display: block; }
    .trend-readout > div:nth-child(4) { display: none; }
    .trend-readout dd { font-size: 13px; }
    .metric-line { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .metric-line > div { min-height: 62px; grid-column: span 2; padding: 8px 10px; }
    .metric-line > div:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
    .metric-line > div:nth-child(4)::before { display: none; }
    .metric-line dd { margin-top: 2px; font-size: 16px; }
    .metric-line dt, .metric-line small { overflow: hidden; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
    .fact-section { margin-top: 26px; }
    .fact-strip { display: block; min-height: 0; }
    .fact-item { min-height: 112px; padding: 17px 2px; }
    .fact-item + .fact-item { border-top: 1px solid var(--line); border-left: 0; }
    .fact-item strong { font-size: 16px; }
    .overview-secondary { display: block; margin-top: 30px; }
    .top-products { min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
    .top-product-card:first-child, .top-product:first-child { grid-column: 1 / -1; }
    .top-product-card:first-child .top-product-media, .top-product:first-child .top-product-image { aspect-ratio: 1.55 / 1; }
    .top-product-media, .top-product-image { border-radius: 14px; }
    .top-product-card h3, .top-product-copy h3 { margin-top: 5px; font-size: 12px; }
    .top-product-copy > span { margin-top: 8px; }
    .top-product-copy p { display: block; margin-top: 5px; }
    .top-product-copy p strong, .top-product-copy p small { display: block; }
    .top-product-copy p strong { font-size: 17px; }
    .top-product-copy p small { margin-top: 2px; }
    .top-product-meta strong { font-size: 17px; }
    .distribution-section { margin-top: 32px; }
    .distribution-list { min-height: 240px; }
    .distribution-row { grid-template-columns: 25px minmax(0, 1fr); gap: 8px; }

    .summary-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-line > div { min-height: 76px; padding: 12px 13px; }
    .summary-line > div:nth-child(odd)::before { display: none; }
    .summary-line > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .summary-line dd { font-size: 18px; }
    .team-workbench { display: block; min-height: 0; margin-top: 24px; }
    .team-ranking-panel { padding: 18px 0 0; border-right: 0; }
    .team-ranking-panel > .panel-heading { min-height: 54px; }
    .team-ranking { min-height: 0; }
    .team-rank-item { min-height: 86px; gap: 7px 8px; padding: 9px 3px; }
    .team-rank-row { grid-template-columns: 26px minmax(0, 1fr) auto auto; grid-template-areas: "rank person person change" "rank sales ratio-one ratio-two"; }
    .team-rank-row > .team-rank-number { grid-area: rank; }
    .team-rank-row > .team-person { grid-area: person; }
    .team-rank-row > .team-sales { grid-area: sales; }
    .team-rank-row > .team-ratio:nth-of-type(4) { grid-area: ratio-one; }
    .team-rank-row > .team-ratio:nth-of-type(5) { grid-area: ratio-two; }
    .team-rank-row > .change { grid-area: change; justify-self: end; }
    .team-rank-track { height: 6px; }
    .team-rank-value { min-width: 72px; }
    .team-rank-value strong { font-size: 13px; }
    .team-inspector { display: none; }
    .data-section { margin-top: 30px; }
    .filter-bar { display: grid; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 0; }
    .search-field { width: 100%; grid-column: 1 / -1; }
    .search-field, .select-field { height: 44px; }
    .select-field { min-width: 0; }
    .desktop-table { display: none; }

    .product-heading { min-height: 86px; }
    .product-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-summary > div { min-height: 70px; padding: 10px 8px; }
    .product-summary > div:nth-child(odd)::before { display: block; }
    .product-summary > div:nth-child(3n+1)::before { display: none; }
    .product-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .product-summary dt { font-size: 11px; }
    .product-summary dd { font-size: 16px; }
    .product-toolbar { top: 0; display: block; margin: 12px -2px 0; padding: 9px 2px; }
    .product-toolbar .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-toolbar .search-field { width: 100%; }
    .view-toggle { display: flex; width: 100%; margin-top: 8px; }
    .view-toggle button { min-width: 0; flex: 1; }
    .product-view-tools { display: block; }
    .result-count { display: block; margin: 2px 0 6px; text-align: right; }
    .product-contribution { margin-top: 16px; }
    .contribution-layout { display: block; min-height: 0; }
    .contribution-chart { min-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
    .contribution-copy { padding: 20px 2px 24px; }
    .product-gallery-section { margin-top: 18px; }
    .product-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 10px; }
    .product-visual { aspect-ratio: 1 / 1; border-radius: 14px; }
    .product-rank, .product-segment { top: 7px; min-height: 26px; padding-inline: 6px; border-radius: 7px; font-size: 11px; }
    .product-rank { left: 7px; }
    .product-segment { right: 7px; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .product-card-body { padding-top: 9px; }
    .product-content > h3 { min-height: 37px; margin-top: 4px; font-size: 12px; line-height: 1.5; }
    .product-content > .product-owner, .product-content > .product-id { font-size: 11px; }
    .product-main { margin-top: 8px; padding-top: 8px; }
    .product-main strong { font-size: 18px; }
    .product-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
    .product-metrics > span { font-size: 11px; }
    .product-metrics > span:nth-child(3) { display: none; }
    .product-metrics strong { font-size: 11px; }
    .product-card-head { display: block; }
    .product-card-head h3 { min-height: 37px; font-size: 12px; line-height: 1.5; }
    .product-card-head p { font-size: 11px; }
    .owner-pill { max-width: 100%; min-height: 26px; margin-top: 6px; font-size: 11px; }
    .product-number { display: block; margin-top: 8px; padding-top: 8px; }
    .product-number strong { font-size: 18px; }
    .product-number > div:last-child, .product-card-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin-top: 8px; text-align: left; }
    .product-number small:nth-child(n+3), .product-card-facts > :nth-child(n+3) { display: none; }
    .product-number small, .product-card-facts span { font-size: 11px; }
    .product-number small b, .product-card-facts strong { font-size: 11px; }

    .risk-summary { display: grid; grid-template-columns: .85fr 1.15fr; }
    .risk-summary-group { padding: 14px 10px; }
    .risk-summary-group + .risk-summary-group { border-left: 1px solid var(--line); }
    .fine-summary { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0 !important; }
    .risk-status-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 7px; }
    .risk-status-facts > div { gap: 3px; }
    .risk-summary-group dd { font-size: 18px; }
    .risk-ledger { margin-top: 26px; }
    .risk-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .risk-mobile-list { display: block; padding-top: 12px; }

    .mobile-routes { position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; display: grid; height: calc(64px + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr); padding: 5px 7px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px); }
    .mobile-routes a { position: relative; display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border-radius: 12px; color: var(--quiet); font-size: 11px; text-decoration: none; }
    .mobile-routes a svg { width: 19px; height: 19px; }
    .mobile-routes a.is-active { color: var(--blue); }
    .mobile-routes a.is-active::before { position: absolute; top: -5px; width: 28px; height: 2px; border-radius: 2px; background: var(--blue); content: ""; }
    .drawer-sheet { top: 7%; right: 0; bottom: 0; left: 0; width: 100%; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; animation-name: drawer-up; }
    .drawer.is-closing .drawer-sheet { animation-name: drawer-down; }
    .drawer-body { padding-inline: 14px; }
    .detail-grid { grid-template-columns: 1fr; }
    .toasts { top: auto; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
}

@media (min-width: 768px) and (max-height: 820px) {
    .product-heading { min-height: 92px; }
    .product-summary > div { min-height: 74px; }
    .product-gallery-section { margin-top: 18px; }
    .product-visual { aspect-ratio: 1.9 / 1; }
}

@media (max-width: 360px) {
    :root { --page-x: 12px; }
    .mobile-brand strong { font-size: 13px; }
    .page-heading h1 { font-size: 25px; }
    .sales-value { font-size: 46px; }
    .trend-controls { gap: 4px; }
    .trend-controls .segmented button { min-width: 52px; padding-inline: 7px; }
    .product-summary > div { padding-inline: 6px; }
    .product-summary dt { font-size: 11px; }
    .product-summary dd { font-size: 15px; }
    .product-gallery { gap-inline: 8px; }
    .product-card-head h3 { font-size: 12px; }
    .owner-pill { display: none; }
    .team-rank-row { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
}

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

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } }
@keyframes product-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes source-pulse { 50% { opacity: .35; } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(18, 166, 106, .28); } 70% { box-shadow: 0 0 0 7px rgba(18, 166, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 166, 106, 0); } }
@keyframes boot-bars { to { height: 7px; opacity: .55; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { opacity: .75; transform: translateX(102%); } }
@keyframes sheet-out { to { opacity: .75; transform: translateX(102%); } }
@keyframes drawer-up { from { transform: translateY(102%); } }
@keyframes drawer-down { to { transform: translateY(102%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } }
