/* Native controls and restrained chart colour, not a decorative theme. */
:root { --plot-0: #1295bb; --plot-1: #6095a6; --plot-2: #7463cc; --plot-3: #338890; }
html[data-theme="dark"] { --plot-0: #56c4e8; --plot-1: #8fd0e3; --plot-2: #a395ec; --plot-3: #6bd2cb; }
.view-head .eyebrow, .panel-head .eyebrow, .modal-head .eyebrow { display: none; }
.nav-item { border-radius: 999px; }
html[data-theme="dark"] .primary-button { background: #efefef; border-color: #efefef; color: #202223; }
html[data-theme="dark"] .primary-button:hover { background: #fff; }
/* Hover remains immediate. Press feedback and contextual loading are retained. */
button:not(:disabled), .side-footer a, .chart-report-link { transition: transform 150ms ease; }
.workspace[data-section="analytics"] .control-bar { background: var(--bg); border-bottom: 0; padding-bottom: 0; }
.workspace[data-section="analytics"] .date-controls label { display: none; }
.workspace[data-section="analytics"] .date-controls select,
.workspace[data-section="analytics"] #customRangeButton { border-radius: 999px; background-color: var(--surface); min-height: 32px; font-size: 12px; }
.workspace[data-section="analytics"] .content { padding-top: 18px; }
.analytics-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.analytics-heading h1 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 650; letter-spacing: -.35px; }
.analytics-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.analytics-edit-note, .analytics-notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; }
.analytics-board { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); grid-auto-rows: 310px; gap: 16px; }
.analytics-card { min-width: 0; grid-column: span var(--card-width,1); grid-row: span var(--card-height,1); display: flex; flex-direction: column; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 1px 1px rgba(0,0,0,.035); overflow: hidden; }
.analytics-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-shrink: 0; }
.analytics-card h2 { font-size: 12px; line-height: 1.5; font-weight: 500; margin: 0; text-decoration: underline dotted var(--line-strong); text-underline-offset: 4px; }
.analytics-details-button { display: grid; place-items: center; flex: 0 0 24px; width: 24px; min-height: 24px; margin: -3px -4px 0 0; padding: 4px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.analytics-details-button:hover { background: var(--surface-subdued); color: var(--text); }
.analytics-details-button svg { width: 16px; height: 16px; stroke-width: 1.3; }
.analytics-card-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 6px; }
.analytics-metric { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; flex: 0 0 auto; margin: 0 0 5px; }
.analytics-metric > strong { font-size: 24px; font-weight: 650; letter-spacing: -.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.analytics-metric > small { font-size: 11px; color: var(--muted); }
.analytics-metric.large { margin: 16px 0 22px; }
.analytics-metric.large > strong { font-size: 34px; }
.analytics-change { white-space: nowrap; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-change.good { color: var(--success); }
.analytics-change.bad { color: var(--danger); }
.analytics-chart { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.analytics-plot { flex: 1; min-height: 125px; position: relative; }
.analytics-plot > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.analytics-plot text { fill: var(--muted); stroke: none; font: 10px "Segoe UI", -apple-system, sans-serif; }
.analytics-gridline { stroke: var(--line); stroke-width: .65; }
.analytics-plot .plot-line { fill: none; stroke: var(--plot-color); stroke-width: 1.65; }
.analytics-plot .comparison { stroke-dasharray: 1.5 3.5; }
.analytics-plot .plot-fill { fill: var(--plot-color); stroke: none; }
.analytics-plot .plot-area { fill: var(--plot-color); fill-opacity: .22; stroke: none; }
.analytics-plot .plot-area.subtle { fill-opacity: .055; }
.analytics-cursor { stroke: var(--muted); stroke-width: .6; stroke-dasharray: 3 3; }
.tone-0 { --plot-color: var(--plot-0); }
.tone-1 { --plot-color: var(--plot-1); }
.tone-2 { --plot-color: var(--plot-2); }
.tone-3 { --plot-color: var(--plot-3); }
.analytics-legend { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 9px 0 0; color: var(--muted); font-size: 9px; flex-shrink: 0; }
.analytics-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.analytics-legend > span > span { overflow-wrap: anywhere; }
.chart-swatch { display: inline-block; width: 9px; height: 7px; flex-shrink: 0; border-radius: 1px; background: var(--plot-color); }
.analytics-legend .chart-swatch { height: 2px; width: 13px; }
.chart-swatch.dotted { background: none; border-top: 2px dotted var(--plot-color); }
.analytics-card-period { color: var(--muted); font-size: 9px; margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--line); flex-shrink: 0; }
.analytics-tooltip { z-index: 5; position: absolute; top: 6px; max-width: min(310px,95%); padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); pointer-events: none; font-size: 11px; }
.analytics-tooltip > div { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 16px; padding: 4px 0; }
.analytics-tooltip small { grid-column: 1; color: var(--muted); font-size: 10px; }
.analytics-tooltip b { grid-column: 2; grid-row: span 2; align-self: center; font-variant-numeric: tabular-nums; }
.analytics-donut { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
.donut-ring { width: min(54%,174px); position: relative; flex-shrink: 0; aspect-ratio: 1; }
.donut-ring > svg { display: block; width: 100%; height: 100%; }
.donut-segment { fill: none; stroke: var(--plot-color); stroke-width: 22; stroke-linecap: butt; transform: rotate(-90deg); transform-origin: 80px 80px; }
.donut-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.donut-total strong { font-size: 21px; letter-spacing: -.4px; }
.donut-total small { font-size: 9px; color: var(--muted); }
.donut-legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 0; font-size: 10px; }
.donut-legend li { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 4px 6px; align-items: center; margin: 12px 0; }
.donut-legend b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.donut-legend small { grid-column: 2/4; color: var(--muted); font-size: 9px; }
.analytics-rankings { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding-top: 8px; }
.analytics-ranking-row { background: var(--surface-subdued); padding: 11px 10px; border-radius: 6px; font-size: 11px; }
.analytics-ranking-row > div:first-child { display: flex; align-items: center; gap: 8px; }
.analytics-ranking-row span[data-no-translate] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-ranking-row strong { font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; }
.product-ranking { gap: 12px; }
.product-ranking .analytics-ranking-row { background: none; border-radius: 0; padding: 0 2px; }
.product-ranking small { color: var(--muted); font-size: 9px; }
.analytics-bars { display: grid; gap: 3px; margin-top: 5px; }
.analytics-bars i { display: block; height: 6px; border-radius: 0 3px 3px 0; background: var(--plot-0); }
.analytics-bars .previous-bar { height: 4px; background: var(--plot-1); }
.analytics-values { margin: 7px 0 0; min-height: 0; overflow: auto; font-size: 12px; }
.analytics-values > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.analytics-values dt { color: var(--muted); }
.analytics-values dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-values > div:last-child { border-bottom: 0; }
.analytics-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.analytics-footnote { color: var(--muted); font-size: 9px; margin-top: 7px; }
.analytics-empty-layout { padding: 42px 20px; text-align: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.analytics-empty-layout h2 { font-size: 17px; }
.analytics-empty-layout p { color: var(--muted); font-size: 12px; }
.analytics-card-placeholder .placeholder-chart { flex: 1; height: auto; min-height: 100px; }
.analytics-board.is-editing { grid-auto-rows: 382px; }
.analytics-card-controls { display: flex; gap: 8px; align-items: flex-end; margin: 8px -2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.analytics-card-controls label { flex: 1; min-width: 0; display: grid; gap: 3px; font-size: 10px; color: var(--muted); }
.analytics-card-controls select { width: 100%; min-height: 31px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); background: var(--surface); font-size: 11px; }
.analytics-remove { min-height: 31px; border: 0; border-radius: 6px; padding: 0 6px; color: var(--danger); background: none; font-size: 11px; cursor: pointer; }
.analytics-remove:hover { background: var(--danger-soft); }
.analytics-picker-intro { font-size: 13px; color: var(--muted); }
.analytics-picker { display: grid; gap: 8px; margin: 18px 0; }
.analytics-picker > label { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 13px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.analytics-picker > label:has(input:checked) { background: var(--surface-subdued); border-color: var(--line-strong); }
.analytics-picker input { accent-color: #303030; width: 17px; height: 17px; }
.analytics-picker strong { display: block; font-size: 13px; font-weight: 600; }
.analytics-picker small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.analytics-type { color: var(--muted); font-size: 10px; }
.analytics-details-period { color: var(--muted); font-size: 12px; }
.analytics-details-table { overflow: auto; }
@media (max-width: 1140px) { .analytics-board { grid-template-columns: repeat(2,minmax(0,1fr)); } .analytics-card { grid-column: span min(var(--card-width,1),2); } }
@media (max-width: 760px) { .analytics-board { grid-template-columns: minmax(0,1fr); grid-auto-rows: 328px; gap: 12px; } .analytics-card { grid-column: 1; padding: 14px 16px 10px; } .analytics-heading { align-items: flex-start; gap: 10px; } .analytics-toolbar { gap: 6px; } .analytics-heading h1 { font-size: 21px; padding-top: 8px; } .analytics-heading:has([data-analytics-save]) { flex-direction: column; } .analytics-toolbar .text-button { order: 1; } .analytics-details-button { min-width: 44px; min-height: 44px; margin: -11px -8px -7px 0; } .analytics-card h2 { font-size: 13px; } .analytics-legend, .analytics-card-period { font-size: 10px; } .analytics-card-controls select, .analytics-remove { min-height: 44px; } .analytics-board.is-editing { grid-auto-rows: 405px; } .donut-ring { width: min(52%,185px); } .donut-legend { font-size: 12px; } .analytics-type { display: none; } .analytics-picker > label { grid-template-columns: 18px minmax(0,1fr); } }
@media (prefers-reduced-motion: reduce) { button:not(:disabled), .side-footer a, .chart-report-link { transition: none; } }
