:root {
  --ink: #202c3d; --ink-soft: #44536a; --muted: #637086;
  --line: #d7dfe9; --line-strong: #c3cedd;
  --canvas: #e7ecf3; --surface: #f4f6fa; --surface-soft: #eaf0f7; --rail: #192436;
  --primary: #496dad; --primary-dark: #365588; --primary-soft: #e0e9f7;
  --coral: #a26659; --coral-soft: #f1e5e0; --gold: #85602c; --gold-soft: #f0e8d8;
  --danger: #ab514e; --danger-soft: #f3e4e4;
  --shadow: 0 10px 32px #23365312, 0 2px 6px #23365306;
  --rail-width: 184px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--canvas); font-synthesis: none; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; font-size: 13px; background: var(--canvas); }
button, input, select { font: inherit; }
button, summary, select, input[type="checkbox"] { cursor: pointer; }
button { transition: background 120ms, color 120ms, border-color 120ms; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #668ac4; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .38; }
[hidden] { display: none !important; }
svg.nav-icon, button > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 12px; background: var(--ink); color: #fff; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); }
.side-rail { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--rail-width); display: flex; flex-direction: column; padding: 30px 16px 20px; border-right: 1px solid #26354c; background: var(--rail); color: #e8eef8; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 45px; color: #e8eef8; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid #405573; border-radius: 9px; background: #2d4160; color: #edf3fc; font-size: 19px; font-weight: 500; }
.brand strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: .4px; }
.brand small { display: block; margin-top: 5px; color: #a6b5ca; font-size: 8px; letter-spacing: 1.1px; }
.section-nav { display: grid; gap: 7px; }
.section-nav button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: #b7c4d6; text-align: left; font-size: 13px; }
.section-nav button:hover { background: #26364e; color: #edf3fc; }
.section-nav button[aria-current="page"] { background: #2c405e; color: #edf3fc; font-weight: 600; box-shadow: inset 3px 0 #88a9df; }
.rail-status { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 18px 10px 0; border-top: 1px solid #34435a; }
.rail-status strong, .rail-status small { display: block; }
.rail-status strong { font-size: 10px; font-weight: 400; color: #c3cfdf; }
.rail-status small { margin-top: 5px; color: #a6b5ca; font-size: 10px; font-variant-numeric: tabular-nums; }
.status-light { width: 6px; height: 6px; border-radius: 50%; background: #adb4bf; flex: none; }
.status-light.ready { background: #739487; }
.status-light.warn { background: #b9975e; }
.status-light.error { background: #bf726c; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { height: 65px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 36px; border-bottom: 1px solid var(--line); background: #e7ecf3ed; backdrop-filter: blur(12px); }
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 18px; }
.breadcrumb { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink-soft); font-weight: 500; }
.breadcrumb > span:nth-child(2) { color: #8f9eb4; }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 12px; }
.back-button { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.back-button:hover { border-color: #aabbd5; background: var(--surface-soft); color: var(--primary-dark); }
.back-button svg { width: 15px; height: 15px; }
.revision-chip { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.icon-button.busy svg { animation: rotate 700ms linear infinite; }
.user-button { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 3px 6px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.user-button:hover, .user-button[aria-expanded="true"] { background: var(--surface-soft); }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); color: var(--ink-soft); font-size: 11px; }
.user-copy { text-align: left; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.user-menu { position: absolute; right: 0; top: 45px; min-width: 190px; z-index: 30; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.user-menu div { padding: 10px; border-bottom: 1px solid var(--line); }
.user-menu strong, .user-menu small { display: block; }
.user-menu small { margin-top: 5px; color: var(--muted); }
.user-menu button { width: 100%; padding: 10px; border: 0; background: none; color: var(--danger); text-align: left; }
main { max-width: 1760px; margin: 0 auto; padding: 34px 36px 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 1.8px; }
.page-heading h1 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.6px; }
.page-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.data-dates { display: flex; flex: none; gap: 26px; margin: 0; }
.data-dates dt { color: var(--muted); font-size: 10px; }
.data-dates dd { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.notice-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid #eee4d1; border-radius: 8px; background: var(--gold-soft); color: var(--gold); }
.notice-icon, .state-symbol { width: 22px; height: 22px; display: grid; place-items: center; flex: none; border: 1px solid currentColor; border-radius: 50%; font-weight: 500; }
.notice-banner strong { font-size: 12px; }
.notice-banner p { margin: 4px 0 0; font-size: 11px; }
.notice-banner button { margin-left: auto; border: 0; background: none; color: inherit; font-size: 20px; }
.filter-workbench { position: relative; z-index: 8; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 8px #23365303; }
.workbench-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 15px; }
.workbench-head h2 { display: inline; margin: 0; font-size: 12px; font-weight: 600; }
.workbench-head p { display: inline; margin: 0 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.workbench-tools, .filter-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.cohort-control { display: inline-flex; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 6px; background: var(--surface-soft); }
.cohort-control legend, .multi-filter legend, caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cohort-control button { padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; }
.cohort-control button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #18202c0a; }
.primary-button, .text-button, .pagination button, .table-actions select { min-height: 33px; padding: 0 12px; border-radius: 6px; font-size: 11px; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; font-weight: 500; }
.primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.text-button, .pagination button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); }
.text-button:hover, .pagination button:hover:not(:disabled) { background: var(--surface-soft); border-color: #b8bfc7; }
#reset-filters { border-color: transparent; background: transparent; color: var(--muted); }
.filter-grid { display: grid; gap: 10px; }
.primary-filters { grid-template-columns: 180px 180px minmax(0, 1fr); margin-bottom: 10px; }
.dimension-filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field { position: relative; min-width: 0; }
.field > span { position: absolute; top: 7px; left: 12px; color: var(--muted); font-size: 10px; pointer-events: none; }
.field input { width: 100%; height: 47px; padding: 20px 12px 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink-soft); font-size: 12px; }
.field input:hover, .field input:focus { border-color: #8da6ce; }
.field input::placeholder { color: var(--muted); }
.search-field input { padding-right: 38px; }
.search-field kbd { position: absolute; right: 12px; top: 15px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 10px inherit; }
.multi-filter { position: relative; min-width: 0; }
.multi-filter summary { height: 35px; display: flex; align-items: center; gap: 7px; padding: 0 25px 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; list-style: none; background: var(--surface); }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: ""; position: absolute; right: 12px; top: 13px; width: 5px; height: 5px; border-right: 1px solid #8a919a; border-bottom: 1px solid #8a919a; transform: rotate(45deg); }
.multi-filter[open] summary { border-color: #8da6ce; }
.multi-filter summary span { flex: none; color: var(--muted); font-size: 10px; }
.multi-filter summary strong { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.multi-filter fieldset { position: absolute; top: 41px; left: 0; z-index: 30; width: max(230px, 100%); max-height: 300px; overflow: auto; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.multi-filter:last-child fieldset { left: auto; right: 0; }
.option-list { display: grid; gap: 2px; }
.option-list label { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--ink-soft); font-size: 12px; }
.option-list label:hover { background: var(--surface-soft); }
.option-list input { accent-color: var(--primary); }
.option-list .no-options { padding: 14px 8px; color: var(--muted); font-size: 11px; }
.coverage-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 2px 0; }
.coverage-strip > div { display: flex; align-items: center; gap: 8px; }
.coverage-strip span, .coverage-strip p { color: var(--muted); font-size: 10px; }
.coverage-strip strong { font-size: 10px; font-weight: 500; color: var(--ink-soft); }
.coverage-strip i { display: none; }
.coverage-strip p { margin: 0 0 0 auto; }
.kpi-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 26px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kpi { min-width: 0; padding: 22px; border-right: 1px solid var(--line); }
.kpi:nth-child(4n), .kpi:last-child { border-right: 0; }
.kpi span, .kpi small { display: block; color: var(--muted); font-size: 11px; }
.kpi strong { display: block; margin: 14px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 23px; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi small { font-size: 10px; }
.kpi.skeleton strong { color: transparent; width: 65%; border-radius: 3px; background: var(--surface-soft); animation: pulse 1.2s ease-in-out infinite; }
.kpi-band.sales-metrics { gap: 16px; border: 0; border-radius: 0; background: transparent; }
.metric-card { min-width: 0; padding: 3px 24px 5px; border-right: 1px solid var(--line); background: transparent; }
.sales-metrics > .metric-card { padding: 22px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px #23365304; }
.metric-card header { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.metric-value { display: block; margin: 16px 0 8px; font-size: clamp(20px, 1.8vw, 30px); font-weight: 550; letter-spacing: -.9px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.metric-unavailable { color: var(--muted); font-weight: 400; }
.metric-card > p { margin: 0; min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.metric-card dl { margin: 15px 0 0; }
.metric-card dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-top: 11px; font-size: 11px; }
.metric-card dt { color: var(--muted); font-size: 11px; }
.metric-card dd { margin: 0; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.metric-split div:first-child dt::before, .metric-split div:last-child dt::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--primary); }
.metric-split div:last-child dt::before { background: #a7b0bf; }
.metric-breakdown { margin-top: 18px; }
.metric-breakdown summary { width: fit-content; color: var(--muted); font-size: 10px; list-style: none; }
.metric-breakdown summary::after { content: "+"; margin-left: 7px; }
.metric-breakdown[open] summary::after { content: "−"; }
.metric-breakdown summary::-webkit-details-marker { display: none; }
.metric-breakdown dl { padding: 4px 0 6px; }
.metric-notes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-top: 0; padding: 0 2px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.metric-notes > .completion-pending { flex: 1 0 100%; order: 3; margin: 0; padding: 8px 12px; border-radius: 5px; background: var(--gold-soft); }
.metric-notes details[open] { flex: 1 0 100%; }
.metric-notes summary { color: var(--muted); cursor: pointer; }
.metric-notes p { max-width: 1000px; margin: 8px 0; }
.scope-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 22px; }
.scope-counts strong { color: var(--ink-soft); font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.scope-counts small { margin-left: 4px; font-size: 10px; font-weight: 400; color: var(--muted); }
.scope-counts > span { font-size: 10px; color: var(--muted); }
.detail-sales-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; padding: 4px 0; }
.detail-sales-metrics .metric-card { padding: 0 22px; }
.detail-sales-metrics .metric-card:nth-child(2n+1) { padding-left: 0; }
.detail-sales-metrics .metric-card:nth-child(2n) { padding-right: 0; border-right: 0; }
.detail-sales-metrics .metric-value { font-size: 25px; }
.domain-pending { margin-top: 28px; padding: 30px; border: 1px solid var(--line); border-radius: 10px; }
.domain-pending h2 { font-size: 20px; font-weight: 550; }
.domain-pending > p { color: var(--muted); line-height: 1.8; max-width: 800px; }
.pending-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.pending-fields div { padding: 16px; border-radius: 6px; background: var(--surface-soft); }
.pending-fields span, .pending-fields strong { display: block; font-size: 12px; }
.pending-fields strong { margin-top: 12px; color: var(--muted); font-weight: 400; }
.state-panel { min-height: 300px; display: grid; justify-items: center; align-content: center; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.state-panel strong { margin-top: 18px; font-size: 14px; font-weight: 500; }
.state-panel p { margin: 9px 0 20px; color: var(--muted); font-size: 11px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: rotate 650ms linear infinite; }
.error-state .state-symbol { color: var(--danger); }
.password-login { width: min(380px, calc(100% - 32px)); display: grid; gap: 9px; margin-top: 4px; }
.password-login > label { color: var(--ink-soft); font-size: 11px; text-align: left; }
.password-login > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.password-login input { min-width: 0; height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); }
.password-login .login-error { margin: 0; color: var(--danger); text-align: left; line-height: 1.5; }
.feishu-login { display: inline-flex; align-items: center; justify-content: center; justify-self: center; text-decoration: none; }
.visual-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 24px; margin: 28px 0 32px; }
.chart-panel { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.chart-panel figcaption { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 20px; }
.chart-panel figcaption strong, .chart-panel figcaption small { display: block; }
.chart-panel figcaption strong { font-size: 12px; font-weight: 550; }
.chart-panel figcaption small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.chart-legend { display: inline-flex; align-items: center; color: var(--muted); font-size: 10px; }
.chart-legend i { width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--primary); }
.ranking-row { display: grid; grid-template-columns: 18px minmax(72px, 115px) minmax(50px, 1fr) 70px; gap: 9px; align-items: center; min-height: 25px; }
.rank-index { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.ranking-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 10px; }
.ranking-row .track { height: 5px; border-radius: 4px; background: var(--surface-soft); }
.ranking-row .bar { display: block; height: 100%; min-width: 1px; border-radius: 4px; background: #86a0c9; }
.ranking-row:first-child .bar { background: var(--primary); }
.ranking-row .value { text-align: right; font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-empty { min-height: 200px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.mix-chart { min-height: 200px; display: flex; flex-direction: column; justify-content: center; padding: 0 3px; }
.mix-bar { height: 12px; overflow: hidden; border-radius: 5px; background: var(--surface-soft); }
.mix-svg { display: block; width: 100%; height: 12px; }
.mix-svg rect { stroke: var(--surface); stroke-width: 4px; }
.mix-color-0 { fill: #5276b2; background: #5276b2; }
.mix-color-1 { fill: #829ac0; background: #829ac0; }
.mix-color-2 { fill: #c1cbd4; background: #c1cbd4; }
.mix-color-3 { fill: #9dabb8; background: #9dabb8; }
.mix-color-4 { fill: #c7b8a1; background: #c7b8a1; }
.mix-color-5 { fill: #a19dab; background: #a19dab; }
.mix-color-6 { fill: #c7a9a3; background: #c7a9a3; }
.mix-color-7 { fill: #70757e; background: #70757e; }
.mix-legend { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 24px; }
.mix-item { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 9px; align-items: center; font-size: 11px; }
.mix-item i { width: 6px; height: 6px; border-radius: 50%; }
.mix-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mix-item strong { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.table-section { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.table-toolbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.table-toolbar h2 { margin: 0; font-size: 13px; font-weight: 600; }
.table-toolbar p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.table-actions label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.table-actions select { min-height: 32px; padding: 0 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.table-actions .text-button { border-color: var(--line); }
.export-button { display: inline-flex; align-items: center; gap: 6px; }
.export-button svg { width: 14px; height: 14px; }
.table-scroll { max-height: 620px; overflow: auto; scrollbar-width: thin; scrollbar-color: #acb8ca transparent; }
table { width: 100%; min-width: 1060px; border-collapse: separate; border-spacing: 0; font-size: 11px; }
th { position: sticky; top: 0; z-index: 2; padding: 12px 18px; border-block: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 10px; font-weight: 500; white-space: nowrap; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
th button { border: 0; padding: 0; background: none; color: inherit; font-weight: inherit; }
th button:hover { color: var(--ink); }
td { padding: 17px 18px; border-bottom: 1px solid var(--line); background: var(--surface); vertical-align: middle; }
th:first-child, td:first-child { position: sticky; left: 0; border-right: 1px solid var(--line); }
th:first-child { z-index: 3; }
td:first-child { z-index: 1; }
tbody tr:hover td { background: #e7eef8; }
tbody tr:last-child td { border-bottom: 0; }
.style-button { max-width: 190px; display: block; padding: 0; border: 0; background: none; color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: -.15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.style-button:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.cell-sub { max-width: 200px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.taxonomy { max-width: 155px; }
.taxonomy strong, .taxonomy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taxonomy strong { color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.taxonomy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.status-cell { display: grid; grid-template-columns: auto auto; gap: 9px 12px; min-width: 139px; text-align: right; }
.status-cell span { color: var(--muted); font-size: 9px; text-align: left; }
.status-cell strong { color: var(--ink); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.status-cell strong:last-child { color: var(--muted); }
.completion-pending { color: var(--gold); font-size: 10px; line-height: 1.7; }
.style-completion-note { display: block; margin-top: 6px; font-size: 9px; }

.tag { display: inline-block; padding: 3px 5px; border-radius: 3px; background: var(--primary-soft); color: var(--primary-dark); font-size: 9px; white-space: nowrap; }
.tag.manual { background: var(--gold-soft); color: #795518; }
.tag.coral { background: var(--coral-soft); color: #8c3d2d; }
.mapping { display: inline-flex; align-items: center; gap: 5px; }
.mapping::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #68a889; }
.mapping.unknown::before { background: #b0b8b3; }
.mapping.conflict::before { background: var(--coral); }
.empty-table { min-height: 230px; display: grid; justify-items: center; align-content: center; text-align: center; }
.empty-table > span { font-size: 27px; color: #9aa69f; }
.empty-table strong { margin-top: 8px; }
.empty-table p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; }
.pagination { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 15px; border-top: 1px solid var(--line); }
.pagination p { margin: 0; color: var(--muted); font-size: 10px; }
.pagination div { display: flex; gap: 7px; }
.pagination button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: #20263135; backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; inset: 12px 12px 12px auto; z-index: 60; width: min(790px, calc(100vw - 24px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 70px #20263126; }
.drawer-header { min-height: 104px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 30px 22px; }
.drawer-header > div { min-width: 0; }
.drawer-header h2 { margin: 0; font-size: 24px; font-weight: 550; letter-spacing: -.5px; overflow-wrap: anywhere; }
.drawer-header p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.drawer-tabs { display: flex; overflow-x: auto; gap: 28px; padding: 0 30px; border-bottom: 1px solid var(--line); }
.drawer-tabs button { min-width: 44px; padding: 14px 0 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 12px; }
.drawer-tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.drawer-content { min-height: 0; overflow: auto; padding: 27px 30px 35px; scrollbar-width: thin; }
.detail-loading { min-height: 260px; display: grid; place-items: center; }
.detail-section h3 { margin: 0 0 20px; font-size: 12px; font-weight: 550; }
.detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-heading h3 { margin: 0; }
.detail-heading small { color: var(--muted); font-size: 9px; }
.daily-chart-heading { align-items: center; margin-top: 30px; }
.daily-chart-heading > div:first-child { display: grid; gap: 4px; }
.daily-chart-heading small { font-size: 9px; }
.chart-toggle { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 0; border-radius: 6px; background: var(--surface-soft); }
.chart-toggle button { min-width: 42px; padding: 6px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 10px; }
.chart-toggle button:last-child { border-right: 0; }
.chart-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #18202c0d; }
.daily-chart { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.daily-chart-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 10px; }
.daily-chart-meta small { color: var(--muted); font-size: 9px; }
.daily-chart-scroll { overflow-x: auto; }
.daily-chart-svg { display: block; width: 100%; min-width: 460px; height: auto; margin-top: 5px; }
.daily-chart-grid { stroke: var(--line); stroke-width: 1; }
.daily-chart-axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.daily-chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.daily-chart-point { cursor: crosshair; stroke: var(--surface); stroke-width: 1.8; }
.daily-chart-point:hover { stroke: var(--ink); stroke-width: 2.5; }
.daily-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 5px 0 20px; color: var(--muted); font-size: 9px; }
.daily-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.daily-chart-legend i { width: 8px; height: 3px; border-radius: 2px; }
.daily-chart-date { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.daily-chart-date select { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 11px; }
.daily-chart-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; margin: 12px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.daily-chart-values dt { color: var(--muted); font-size: 9px; }
.daily-chart-values dd { margin: 5px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.daily-completion-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.daily-completion-values > div { display: grid; grid-template-columns: auto auto; gap: 4px 7px; padding: 8px; border-radius: 4px; background: var(--surface-soft); }
.daily-completion-values strong { grid-column: 1 / -1; font-size: 10px; color: var(--primary-dark); }
.daily-completion-values span { color: var(--muted); font-size: 9px; }
.daily-completion-values b { font-size: 10px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.daily-chart-empty { display: grid; min-height: 220px; place-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: 10px; text-align: center; }
.detail-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-bottom: 20px; }
.detail-kpis div { padding: 13px 11px; border-right: 1px solid var(--line); }
.detail-kpis div:nth-child(3n) { border-right: 0; }
.detail-kpis span, .detail-kpis strong { display: block; }
.detail-kpis span { color: var(--muted); font-size: 9px; }
.detail-kpis strong { margin-top: 6px; overflow-wrap: anywhere; font-size: 16px; font-variant-numeric: tabular-nums; }
.inventory-heading { margin-top: 25px; }
.inventory-bucket-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.inventory-bucket-grid > div { min-width: 0; padding: 12px 10px; background: var(--surface-soft); }
.inventory-bucket-grid dt { color: var(--muted); font-size: 10px; }
.inventory-bucket-grid dd { margin: 7px 0 0; }
.inventory-bucket-grid strong, .inventory-sku-table td strong { display: block; font-weight: 550; font-variant-numeric: tabular-nums; }
.inventory-bucket-grid strong { font-size: 15px; }
.inventory-bucket-grid small, .inventory-sku-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inventory-warehouse { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.inventory-warehouse > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.inventory-warehouse h4 { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.inventory-warehouse header span { flex: none; color: var(--muted); font-size: 9px; }
.inventory-table-scroll { max-height: 480px; overflow: auto; scrollbar-width: thin; scrollbar-color: #acb8ca transparent; }
.inventory-sku-table { table-layout: fixed; width: 1480px; min-width: 1480px; font-size: 11px; }
.inventory-sku-table col { width: 110px; }
.inventory-sku-table .inventory-color-col { width: 92px; }
.inventory-sku-table .inventory-size-col { width: 68px; }
.inventory-sku-table .inventory-sku-col { width: 220px; }
.inventory-sku-table th, .inventory-sku-table td { padding: 11px 10px; }
.inventory-sku-table .inventory-color, .inventory-sku-table .inventory-size { position: sticky; overflow-wrap: anywhere; border-right: 1px solid var(--line); }
.inventory-sku-table .inventory-color { left: 0; }
.inventory-sku-table .inventory-size { left: 92px; text-align: center; }
.inventory-sku-table th.inventory-color, .inventory-sku-table th.inventory-size { z-index: 3; }
.inventory-sku-table td.inventory-color, .inventory-sku-table td.inventory-size { z-index: 1; }
.inventory-sku-table td.inventory-size strong { color: var(--primary-dark); font-size: 12px; }
.inventory-sku-table .inventory-sku { overflow-wrap: anywhere; }
.inventory-sku-table .inventory-sku strong { font-size: 10px; font-weight: 500; }
.record-list { display: grid; gap: 9px; }
.record-item { padding: 13px 14px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 5px; background: var(--surface-soft); }
.record-item header { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.record-item header strong { font-size: 11px; }
.record-item header span { color: var(--muted); font-size: 9px; }
.record-action { border: 0; background: transparent; color: var(--danger); padding: 3px 5px; font-size: 10px; }
.record-action:hover { text-decoration: underline; }
.definition-grid { display: grid; grid-template-columns: minmax(115px, 0.35fr) minmax(0, 1fr); margin: 0; }
.definition-grid dt, .definition-grid dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.definition-grid dt { color: var(--muted); font-size: 10px; }
.definition-grid dd { font-size: 11px; }
.definition-grid > :nth-last-child(-n+2) { border-bottom: 0; }
.detail-empty { min-height: 220px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.detail-empty strong { color: var(--ink-soft); }
.detail-empty p { max-width: 390px; margin: 7px 0; font-size: 11px; line-height: 1.7; }
.detail-empty.compact { min-height: 110px; }
.detail-error { padding: 18px; border: 1px solid #e7b6b0; background: var(--danger-soft); color: var(--danger); }
.detail-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.batch-list { gap: 12px; }
.batch-record { padding: 0; overflow: hidden; border-left-color: var(--primary); background: var(--surface); }
.batch-record > header { min-height: 51px; align-items: center; margin: 0; padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.batch-record > header div { display: grid; gap: 3px; }
.batch-record > header div span { font-size: 9px; }
.batch-record > header div strong { font-size: 12px; }
.batch-status { padding: 3px 6px; border-radius: 3px; background: var(--primary-soft); color: var(--primary-dark) !important; }
.batch-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.batch-stage { min-height: 82px; display: grid; align-content: center; gap: 5px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.batch-stage:nth-child(4n) { border-right: 0; }
.batch-stage span, .batch-stage small { color: var(--muted); }
.batch-stage span { font-size: 9px; }
.batch-stage strong { overflow-wrap: anywhere; font-size: 11px; }
.batch-stage small { font-size: 9px; line-height: 1.45; }
.batch-meta { padding: 5px 13px 10px; }
.batch-empty { margin: 0 !important; padding: 18px 13px; text-align: left; }
.manual-tag-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.manual-tag-form h4 { margin: 0 0 12px; font-size: 12px; }
.manual-tag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.manual-tag-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.manual-tag-grid input, .manual-tag-grid select { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 8px; background: var(--surface); color: var(--ink); }
.manual-tag-reason { grid-column: 1 / -1; }
.manual-tag-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 360px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-soft); font-size: 11px; }
.noscript { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--surface); }


@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
@media (max-width: 1280px) {
  :root { --rail-width: 164px; }
  main, .topbar { padding-inline: 26px; }
  .metric-card { padding-inline: 16px; }
  .metric-value { font-size: 23px; }
  .metric-card dl div { flex-wrap: wrap; }
  .metric-card dd { margin-left: auto; }
  .dimension-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-dates { gap: 16px; }
  .coverage-strip p { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 1050px) {
  .data-dates { display: none; }
  .workbench-head p { display: block; margin: 6px 0 0; }
  .kpi-band.sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .metric-notes { margin-top: 0; }
  .visual-grid { grid-template-columns: minmax(0, 1.3fr) minmax(230px, 1fr); gap: 16px; }
  .chart-panel { padding: 18px; }
  .ranking-row { grid-template-columns: 16px 80px minmax(30px, 1fr) 62px; gap: 6px; }
}
@media (max-width: 800px) {
  :root { --rail-width: 0px; }
  .app-shell { display: block; padding-bottom: 75px; }
  .workspace { display: block; }
  .side-rail { inset: auto 0 0; width: 100%; height: calc(62px + env(safe-area-inset-bottom, 0px)); padding: 0 8px env(safe-area-inset-bottom, 0px); border: 0; border-top: 1px solid var(--line); background: var(--rail); }
  .brand, .rail-status { display: none; }
  .section-nav { height: 62px; grid-template-columns: 1fr; gap: 4px; }
  .section-nav button { min-height: 56px; flex-direction: column; justify-content: center; gap: 5px; padding: 6px 3px; border-radius: 0; font-size: 10px; }
  .section-nav button[aria-current="page"] { background: transparent; color: #d5e4ff; box-shadow: inset 0 2px #88a9df; }
  .topbar { height: 57px; padding: 0 20px; }
  .topbar-leading { gap: 10px; }
  .back-button { padding-inline: 7px; }
  .revision-chip, .user-copy { display: none; }
  main { padding: 26px 20px 36px; }
  .page-heading h1 { font-size: 26px; }
  .primary-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .filter-workbench { padding: 16px; }
  .visual-grid { grid-template-columns: minmax(0, 1.3fr) minmax(210px, 1fr); }
  .table-toolbar { padding: 17px; align-items: flex-start; flex-direction: column; gap: 16px; }
  .table-actions { width: 100%; justify-content: flex-start; }
  .table-actions label { margin-left: auto; }
  .pending-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  main { padding: 23px 16px 30px; }
  .topbar { padding-inline: 16px; }
  .topbar-leading { gap: 8px; }
  .breadcrumb > span { display: none; }
  .breadcrumb { font-size: 11px; }
  .topbar-actions { gap: 4px; }
  .page-heading { margin-bottom: 23px; }
  .page-heading > div > p:last-child { max-width: 320px; font-size: 11px; }
  .workbench-head { align-items: flex-start; }
  .workbench-head p { max-width: 190px; font-size: 9px; }
  .workbench-tools { flex-direction: column; align-items: flex-end; }
  .primary-button, .text-button { padding-inline: 10px; }
  .dimension-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .multi-filter:last-child { grid-column: 1 / -1; }
  .multi-filter fieldset, .multi-filter:last-child fieldset { position: fixed; inset: auto 12px 75px; width: auto; max-height: min(55vh, 370px); }
  .coverage-strip { gap: 9px 14px; }
  .coverage-strip p { line-height: 1.7; }
  .kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px; }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi strong { font-size: 19px; }
  .kpi-band.sales-metrics { margin-top: 24px; gap: 12px; }
  .sales-metrics > .metric-card { padding: 16px 13px; border-radius: 10px; }
  .metric-card { padding-inline: 14px; }
  .metric-value { font-size: 21px; letter-spacing: -.7px; }
  .metric-card header { font-size: 11px; }
  .metric-card > p { min-height: 32px; font-size: 10px; }
  .metric-card dl div { gap: 4px; }
  .metric-card dt { font-size: 10px; }
  .metric-card dd { font-size: 11px; }
  .metric-breakdown { margin-top: 15px; }
  .metric-notes { gap: 10px; }
  .scope-counts { gap: 8px 16px; }
  .scope-counts > span { flex-basis: 100%; }
  .visual-grid { grid-template-columns: 1fr; gap: 16px; margin-block: 24px; }
  .ranking-row { grid-template-columns: 18px 100px minmax(50px, 1fr) 70px; min-height: 27px; }
  .mix-chart { min-height: 135px; }
  .table-toolbar p { max-width: 290px; line-height: 1.7; }
  .table-actions { gap: 6px; }
  .table-actions .text-button { font-size: 10px; }
  .table-actions #table-refresh { display: none; }
  th:first-child, td:first-child { position: static; }
  .pagination { padding: 12px; gap: 10px; }
  .pagination p { font-size: 9px; }
  .pagination button { padding-inline: 9px; }
  .detail-drawer { inset: 0; width: 100%; border: 0; border-radius: 0; }
  .drawer-header { padding: 23px 20px 18px; }
  .drawer-tabs { padding-inline: 20px; gap: 24px; }
  .drawer-content { padding: 23px 20px 32px; }
  .detail-sales-metrics .metric-card { padding-inline: 12px; }
  .detail-sales-metrics .metric-card:nth-child(2n+1) { padding-left: 0; }
  .detail-sales-metrics .metric-card:nth-child(2n) { padding-right: 0; }
  .detail-sales-metrics .metric-value { font-size: 21px; }
  .detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-kpis div:nth-child(3n) { border-right: 1px solid var(--line); }
  .detail-kpis div:nth-child(2n) { border-right: 0; }
  .inventory-bucket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-bucket-grid > div { padding: 11px 12px; }
  .inventory-heading { align-items: flex-start; gap: 8px; }
  .inventory-heading small { max-width: 110px; text-align: right; line-height: 1.5; }
  .daily-chart-heading { flex-wrap: wrap; gap: 12px; }
  .daily-chart-meta { flex-direction: column; gap: 5px; }
  .daily-chart-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-completion-values { gap: 8px; }
  .daily-completion-values > div { padding: 10px; }
  .definition-grid { grid-template-columns: 100px minmax(0, 1fr); }
  .manual-tag-grid { grid-template-columns: 1fr; }
  .manual-tag-reason { grid-column: auto; }
  .batch-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-stage:nth-child(2n) { border-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { --canvas: #fff; --surface: #fff; --surface-soft: #f7f7f5; }
  .side-rail, .topbar, .filter-actions, .table-actions, .pagination, .detail-drawer, .drawer-backdrop { display: none !important; }
  .workspace { grid-column: 1 / -1; }
  main { max-width: none; padding: 0; }
  .table-scroll { max-height: none; overflow: visible; }
  th:first-child, td:first-child { position: static; }
  .chart-panel, .table-section { break-inside: avoid; }
}
