@font-face{font-family:Onest;src:url('assets/fonts/Onest-Variable.ttf') format('truetype');font-weight:100 900;font-style:normal;font-display:swap}
:root{color-scheme:light;--bg:#f5f6f8;--surface:#fff;--surface-raised:#eef2f6;--line:#dde1e8;--text:#282e33;--muted:#696d71;--blue:#3086d8;--green:#187f65;--orange:#95621a;--red:#ba4253;--control:#f3f5f8;--hover:#edf4fc;--active:#e8f2fc;--strong:#3e5265;--link:#1268ba;--tooltip:#fff;--shadow:0 6px 24px #20364d0b;--good-bg:#e5f5ee;--bad-bg:#fcecef;--grid:#dde4eb}
:root[data-theme=dark]{color-scheme:dark;--bg:#111820;--surface:#19232e;--surface-raised:#202d3a;--line:#304151;--text:#ecf1f6;--muted:#a1b0bf;--blue:#66b2f5;--green:#6bd5b2;--orange:#f3ba79;--red:#f298a4;--control:#121e2a;--hover:#23384c;--active:#213e58;--strong:#c3d4e6;--link:#84c4ff;--tooltip:#182633;--shadow:0 8px 28px #0002;--good-bg:#1b3b32;--bad-bg:#442a35;--grid:#304151}
body{font-family:Onest,'Segoe UI',Arial,sans-serif}button,input,select,summary{font-family:inherit}body,button,input,select{accent-color:var(--blue)}
.sidebar{background:var(--surface)}.brand-mark{background:#3086d8;color:white}.brand{letter-spacing:.3px}.brand small{letter-spacing:1px}.topbar{background:var(--bg)}.crumb b{color:var(--strong)}
.topbar-actions{display:flex;gap:20px;align-items:center;min-width:0}.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:34px;padding:7px 10px;background:var(--surface);border:1px solid var(--line);border-radius:8px;color:var(--strong);font-size:11px;white-space:nowrap}.theme-toggle:hover{background:var(--hover)}.theme-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.main-nav button.active,.section-tabs button.active{background:var(--active);border-color:color-mix(in srgb,var(--blue) 30%,var(--line));color:var(--link)}.main-nav button:not(:disabled):hover{background:var(--hover)}
.panel,.kpi{box-shadow:var(--shadow)}.kpi,.kpi.featured{background:linear-gradient(125deg,var(--active),var(--surface));border-color:color-mix(in srgb,var(--blue) 32%,var(--line))}.kpi-label,.kpi-label span:last-child{color:var(--muted)}.kpi-value{letter-spacing:-.9px;font-weight:600}.panel h2{font-weight:600}.page-heading h1{font-weight:650}
.filter-tools{background:var(--bg)}.filter-bar,.extra-filters{box-shadow:var(--shadow)}.filter-bar select,.filter-bar input,.extra-filters select,.extra-filters input:not([type=checkbox]),.cost-filter-row select{background:var(--control)!important;color:var(--text)!important;border-color:var(--line)!important;color-scheme:inherit}.filter-bar select:focus-visible,.filter-bar input:focus-visible,.extra-filters select:focus-visible{outline-color:var(--blue)}
.g-multi summary,#extra-filters .g-multi summary,#extra-filters>label>input,.detail-metric,.region-sort select,.g-table-controls select,.expense-timeline-heading select{background:var(--control);border-color:var(--line);color:var(--text)}.g-options{background:var(--surface);border-color:var(--line);box-shadow:0 10px 28px #172d4520}.g-options label:hover{background:var(--hover)}.g-options input{accent-color:var(--blue)}
.apply-button{background:#3086d8;color:white}.text-button,.metric-method summary,.g-method summary{color:var(--link)}.filter-toggle,.expand-panel{background:var(--surface);color:var(--strong);border-color:var(--line)}.filter-toggle:hover,.expand-panel:hover{background:var(--hover);color:var(--link)}
.segmented,.time-grain.segmented,.data-view-switch.segmented{background:var(--control);border-color:var(--line)}.segmented button,.time-grain.segmented button,.data-view-switch.segmented button{color:var(--muted)}.segmented button.active,.time-grain.segmented button.active,.data-view-switch.segmented button.active{background:var(--active);color:var(--link)}.time-grain.segmented button:hover,.data-view-switch.segmented button:hover{background:var(--hover);color:var(--link)}
.chart-tabs button.active{color:var(--link)}.chart-legend,.category-legend,.comparison-note,.region-note,.quiet-note,.workspace-footer,.g-filter-label{color:var(--muted)}.signal b,.region-name,.expense-row .amount,.expense-row .label,.profile,.profile-name,.metric-method{color:var(--strong)}.signal-icon{background:var(--surface-raised)}.signal-icon.good,.delta{background:var(--good-bg);color:var(--green)}.delta.bad{background:var(--bad-bg);color:var(--red)}.delta.neutral{background:var(--surface-raised);color:var(--muted)}
.expense-row,.region-table td{border-color:var(--line)}.region-bar,.g-execution-track,.inventory-share-track{background:var(--surface-raised)}.chart-tooltip{background:var(--tooltip);border-color:var(--line);box-shadow:0 8px 26px #142e4520;color:var(--text)}.chart-tooltip strong{color:var(--text)}.chart-tooltip span,.chart-tooltip small{color:var(--muted)}
table th,.sales-summary th,.g-compare-table th,.detail-panel th,.detail-panel th:first-child,.g-table-panel th:first-child{background:var(--surface-raised)!important;color:var(--muted)}.detail-panel td:first-child,.g-table-panel td:first-child{background:var(--surface)}.detail-panel tfoot td,.detail-panel tfoot td:first-child,.g-table-panel tfoot td,.g-table-panel tfoot td:first-child,.inventory-view-body tfoot td{background:var(--surface-raised)!important;border-color:var(--line);color:var(--text)}.g-compare-table tbody tr:hover{background:var(--hover)}
.g-metric-strip,.priority-quadrant>div{background:var(--surface-raised);border-color:var(--line)}.priority-quadrant h3{color:var(--link)}.g-table-panel .export-actions button{background:var(--control);border-color:var(--line);color:var(--link)}.telegram-profile .avatar{background:var(--active);color:var(--blue)}
.panel-expanded{background:var(--surface)!important;box-shadow:0 0 0 40px color-mix(in srgb,var(--bg) 94%,transparent)!important}.panel-expanded>.panel-heading{background:var(--surface)}.mobile-nav{background:color-mix(in srgb,var(--surface) 94%,transparent);border-color:var(--line)}
svg text{font-family:Onest,'Segoe UI',Arial,sans-serif;fill:var(--muted)}svg line[stroke="#2b3541"],svg line[stroke="#304052"]{stroke:var(--grid)}svg .chart-crosshair{stroke:var(--strong)}svg .chart-indicator circle{stroke:var(--surface)}
/* Category plots retain their own canvas size; they scroll instead of shrinking. */
.category-scroll>svg,.trend-chart .category-scroll>svg,.panel-expanded .category-scroll>svg{width:var(--category-width)!important;min-width:var(--category-width)!important;height:460px!important;max-width:none!important}.trend-chart.category-chart{height:auto;min-height:0}.category-scroll{overscroll-behavior-x:contain;scrollbar-color:var(--line) transparent;scrollbar-width:thin}
@media(max-width:850px){.topbar-actions{gap:10px}.theme-toggle{padding:6px 8px;font-size:10px}.topbar .freshness{max-width:140px}.sidebar{background:var(--surface)}}
@media(max-width:480px){.topbar{padding:0 14px}.theme-toggle span{display:none}.theme-toggle{width:34px;min-width:34px}.topbar-actions{gap:8px}.topbar .freshness{max-width:132px}}

.section-tabs{min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}.section-tabs button{flex:0 0 auto;white-space:nowrap}svg line[stroke="#c8d7e9"]{stroke:var(--strong)}

@media(max-width:650px){#extra-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:12px}#extra-filters>label,#extra-filters>div,#extra-filters>.section-filter-field{min-width:0!important;width:100%;max-width:100%}#extra-filters .g-multi{min-width:0;width:100%}#extra-filters>button{grid-column:1/-1;justify-self:end}.kpi-value,.six-cards .kpi-value,.g-kpis .kpi-value{font-size:clamp(20px,5.8vw,26px);letter-spacing:-.6px}}

.level2-segment{margin-bottom:28px}.level2-title{font-size:22px;margin:0 0 16px}.level2-kpis{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:20px}.level2-kpis .kpi{min-height:112px}.level2-chart{height:320px}.level2-chart svg{width:100%;height:100%}.level2-segment .view-switch-row{display:flex;align-items:center;justify-content:space-between;padding:0 26px 16px;gap:12px}.level2-segment .export-actions{display:flex;gap:16px}@media(max-width:700px){.level2-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.level2-segment .view-switch-row{padding:0 16px 16px}.level2-kpis .kpi-value{font-size:24px}}

.level2-kpis .kpi:last-child{grid-column:auto}

.price-table-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:0 22px 18px;flex-wrap:wrap}.price-table-toolbar .export-actions{display:flex;gap:14px}.price-table-toolbar .segmented{max-width:100%;overflow-x:auto;white-space:nowrap}

.level2-prior{font-size:11px;color:var(--muted);margin-top:9px}.level2-kpis .kpi-change{flex-wrap:wrap;gap:6px}.level2-kpis .kpi-change>span:last-child{font-size:10px}

#expense-article{width:min(100%,400px)}#expense-article .g-filter-field{width:100%}.cost-filter-row{position:relative;z-index:2}
.level2-segment .g-compare-table{width:100%;table-layout:fixed;min-width:760px}
.level2-segment .g-compare-table th{white-space:normal!important;overflow-wrap:break-word;font-size:10px;line-height:1.3;padding:10px 7px;min-width:0}
.level2-segment .g-compare-table td{font-size:11px;padding:8px 7px}
.level2-segment .g-compare-table th:first-child,.level2-segment .g-compare-table td:first-child{width:120px;white-space:normal}
table .table-total-row>*{background:var(--active)!important;color:var(--text)!important;font-weight:700!important;border-top:2px solid var(--blue)!important;border-bottom:2px solid var(--blue)!important}
table .table-total-row>*:first-child{border-left:2px solid var(--blue)!important}table .table-total-row>*:last-child{border-right:2px solid var(--blue)!important}

table .table-total-row>*,.detail-panel tfoot .table-total-row>td,.g-table-panel tfoot .table-total-row>td,.detail-panel tfoot .table-total-row>td:first-child,.g-table-panel tfoot .table-total-row>td:first-child{background:var(--active)!important;color:var(--text)!important;font-weight:700!important;border-top:2px solid var(--blue)!important;border-bottom:2px solid var(--blue)!important;box-shadow:inset 0 1px var(--blue),inset 0 -1px var(--blue)}

.op-panel .g-compare-table{width:100%;min-width:820px;table-layout:fixed}
.op-panel .g-compare-table th{white-space:normal;overflow-wrap:break-word;font-size:10px;line-height:1.3;padding:10px 7px}
.op-panel .g-compare-table td{font-size:11px;padding:8px 7px}
.op-panel .g-compare-table th:first-child,.op-panel .g-compare-table td:first-child{width:22%;min-width:150px;white-space:normal;overflow-wrap:anywhere}
.op-panel .trend-chart>svg{display:block;width:100%;height:100%}

#extra-filters>.week-filter-field{flex:1 1 200px;min-width:180px;max-width:280px}#extra-filters>.week-filter-field select{width:100%;min-width:0;height:38px;padding:0 12px;background:var(--surface-raised);border:1px solid var(--line);border-radius:6px}@media(max-width:600px){#extra-filters>.week-filter-field{min-width:0;max-width:none}}

.cost-filter-row #expense-article .g-options{display:flex;flex-direction:column;align-items:stretch;left:0;right:auto;min-width:0;width:100%;box-sizing:border-box;max-height:280px;overflow-y:auto;padding:6px}
.cost-filter-row #expense-article .g-options label{display:flex;align-items:flex-start;gap:9px;width:100%;padding:8px;margin:0;white-space:normal;text-align:left;font-size:12px;line-height:1.4;cursor:pointer}
.cost-filter-row #expense-article .g-options input[type="checkbox"]{flex:0 0 auto;width:15px;height:15px;margin:1px 0 0}

.g-options .multi-search-bar{position:sticky;top:-6px;z-index:3;padding:6px 2px 9px;background:var(--surface-raised);flex:0 0 auto}
.g-options .multi-search-bar input[type="search"]{display:block;width:100%;min-width:0;height:34px;padding:6px 10px;margin:0;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:5px;font:inherit;box-sizing:border-box}
.g-options label[hidden]{display:none!important}.multi-search-empty{padding:12px;color:var(--muted);font-size:12px}.multi-search-empty[hidden]{display:none!important}

.plan-rule-controls{display:flex;align-items:center;gap:8px;min-width:0}.plan-rule-controls select{height:38px;min-width:0;width:100%;padding:0 10px;background:var(--surface-raised);border:1px solid var(--line);border-radius:6px}.plan-rule-controls input{min-width:70px!important;margin:0!important}.plan-rule-controls input[hidden]{display:none!important}
