/* Visual identity and readability for the complaints dashboard. */
:root {
  --bg:#f3f5f8; --ink:#172032; --muted:#69768b; --line:#e4e9f1;
  --brand:#db2540; --brand-soft:#fdf0f3; --blue:#3974dd;
  --shadow:0 4px 20px #182b4905; --sidebar:228px;
}
body {font-size:14px; letter-spacing:-.08px}
.sidebar {background:#131c2b; border-right:0; padding:23px 17px 18px; color:#e6ebf3}
.brand {padding-bottom:24px; gap:12px; text-decoration:none}
.brand-mark {width:39px; height:39px; border-radius:11px; background:var(--brand); box-shadow:none}
.brand-name {font-size:20px; letter-spacing:-.6px; color:#fff}
.brand small {color:#97a6bc; font-size:9px; letter-spacing:1.5px; margin-top:1px}
.nav-label {color:#8090a7; font-size:9px; font-weight:650; letter-spacing:1.4px; margin-bottom:7px}
.nav-item {font-size:12px; color:#acb9cc; border-radius:8px; padding:10px 11px; margin:3px 0; gap:9px; min-height:42px}
.nav-item:hover {color:#fff; background:#202c3e}
.nav-item.active {color:#fff; background:#db2540; box-shadow:0 4px 12px #0001}
.nav-item.active:before {display:none}
.nav-item .icon {width:18px; height:18px}
.nav-item .badge {background:#ffffff12; color:#dce4ef; padding:2px 7px; font-size:10px}
.nav-item.active .badge {background:#ffffff24; color:#fff}
.nav-divider {background:#2a3545; margin:13px 11px}
.source-mini {background:#1d2839; border-color:#2b384b; border-radius:9px; margin:18px 5px 12px; padding:10px 12px; color:#9cacc3; font-size:11px}
.source-mini strong {color:#e8edf5; font-size:12px; margin-bottom:3px}
.source-mini .muted {color:#8294ae}
.status-dot {background:#5dbf9a; width:6px; height:6px}
.user {border-color:#2a3545; padding:16px 8px 0; gap:11px}
.user strong {color:#eef2f8; font-size:12px}
.user small {color:#8294ae; font-size:10px; margin-top:2px}
.sidebar .avatar {background:#344156; border-color:#41516a; color:#e2e9f3; width:33px; height:33px}
.topbar {height:64px; padding:0 32px; background:var(--surface); border-color:var(--line)}
.breadcrumbs {font-size:12px; gap:14px}
.breadcrumbs a {font-weight:600; text-decoration:none}
.breadcrumbs a:hover {text-decoration:underline}
.breadcrumbs b {font-weight:600}
.top-actions {gap:13px}
.search input {width:274px; min-height:36px; font-size:12px; border-radius:8px; background:var(--bg); padding-left:34px}
.search input::placeholder {color:#8994a5}
.search .icon {width:16px; height:16px}
.topbar .avatar {background:var(--brand-soft); border-color:#f4d5dc; color:var(--brand); width:33px; height:33px; font-size:11px}
.account-top,.account-sidebar {display:flex; align-items:center; gap:8px; min-width:0; text-align:left}
.account-top {min-height:42px; border-radius:8px; padding:4px 6px; font-size:.8125rem; font-weight:650}
.account-top:hover {background:var(--surface2)}
.account-sidebar {width:100%; padding-bottom:5px}
.account-sidebar:hover strong {text-decoration:underline}
.account-top .avatar,.account-sidebar .avatar {flex:none}
.account-caption {min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.account-caption strong {overflow:hidden; text-overflow:ellipsis}
.account-top .account-caption {max-width:8ch}
.account-form {display:grid; gap:12px}
.account-form .field {font-size:.875rem; font-weight:600}
.account-form input {min-height:42px; font-size:1rem}
.account-form p,.account-admin p {font-size:.875rem}
.account-actions {display:flex; flex-wrap:wrap; gap:8px}
.account-user-list {max-height:225px; overflow:auto; margin:0; padding:0; list-style:none; border-block:1px solid var(--line)}
.account-user-list li {padding:7px 0; overflow-wrap:anywhere}
.account-user-list li+li {border-top:1px solid var(--line)}
.account-user-list strong {margin-right:6px}
.account-admin {border-top:1px solid var(--line); margin-top:18px; padding-top:14px}
.account-admin p {margin-top:5px; color:var(--muted)}
.account-error {color:var(--brand); font-weight:600}
.account-error:empty {display:none}
@media (max-width:1000px) {
  .account-sidebar {justify-content:center}
  .account-sidebar .account-caption {display:none}
}
@media (max-width:650px) {
  .account-top .account-caption {display:none}
}
@media (max-width:550px) {
  .sidebar.open .account-sidebar {justify-content:flex-start}
  .sidebar.open .account-sidebar .account-caption {display:block}
}
.main {padding:24px 32px 26px; max-width:1740px}
.page-heading {margin-bottom:17px; align-items:center; gap:20px}
.page-heading h1 {font-size:31px; letter-spacing:-1.1px; font-weight:730; line-height:1.2}
.page-heading p {font-size:12px; color:var(--muted); margin-top:9px; max-width:540px; line-height:1.7}
.eyebrow {font-size:9px; font-weight:700; letter-spacing:1.25px; display:flex; align-items:center; gap:7px; margin-bottom:9px; color:var(--muted)}
.eyebrow>span {width:5px; height:5px; border-radius:50%; background:var(--brand)}
.heading-actions {gap:8px; align-items:center}
.btn {font-size:11px; min-height:39px; border-radius:8px; padding:10px 13px; font-weight:600}
.btn.primary {background:#db2540; border-color:#db2540; box-shadow:none}
.btn.primary:hover {background:#c41c35}
.btn.tiny {font-size:11px; min-height:31px; padding:6px 10px}
.text-link {font-size:12px; font-weight:600}
.source-strip {display:flex; align-items:center; gap:12px; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:8px 13px; margin-bottom:16px}
.source-strip-icon {width:32px; height:34px; display:grid; place-items:center; background:var(--surface2); color:var(--blue); border:1px solid var(--line); border-radius:7px; flex-shrink:0}
.source-strip-text {min-width:0}
.source-strip-text>span {display:block; font-size:8px; letter-spacing:1.1px; color:var(--muted); font-weight:650; margin-bottom:2px}
.source-strip-text strong {display:block; font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:340px}
.source-sheet {display:flex; align-items:center; gap:5px; font-size:10px; color:#4b7f70; background:#f0f7f4; border:1px solid #e0eee7; border-radius:5px; padding:4px 7px; margin-left:8px; white-space:nowrap}
.source-sheet .icon {width:12px; height:12px}
.source-dates {margin-left:auto; display:flex; align-items:center; gap:8px; font-size:11px; font-variant-numeric:tabular-nums; color:var(--muted); white-space:nowrap}
.source-dates .icon {width:15px; height:15px; color:#8795a8}
.source-dates small {margin:0 6px; font-size:10px}
.filter-panel {padding:13px 16px; border-radius:12px; margin-bottom:20px; box-shadow:none}
.quick-period {display:flex; align-items:center; gap:14px; border-bottom:1px solid var(--line); padding-bottom:12px; margin-bottom:11px}
.quick-period-label {display:flex; align-items:center; gap:9px; flex-shrink:0}
.quick-period-label>.icon {height:17px; width:17px; color:#8995a7}
.quick-period-label strong {font-size:11px; display:block; font-weight:600}
.quick-period-label span {font-size:9px; display:block; margin-top:3px; color:var(--muted)}
.quick-months {display:flex; flex-wrap:wrap; align-items:center; gap:6px; flex:1}
.quick-month {display:flex; align-items:center; justify-content:center; gap:9px; min-height:34px; padding:6px 9px; border:1px solid var(--line); background:var(--surface2); border-radius:7px; font-size:10px; font-weight:500; white-space:nowrap}
.quick-month>span {text-transform:capitalize}
.quick-month small {font-size:8px; color:var(--muted); margin-left:1px}
.quick-month>b {font-size:9px; min-width:22px; padding:1px 4px; background:var(--track); border-radius:4px; font-weight:600; color:#718097; font-variant-numeric:tabular-nums}
.quick-month:hover {border-color:#d5233b66; color:var(--brand)}
.quick-month.active {background:var(--brand-soft); color:var(--brand); border-color:#dc6b7e}
.quick-month.active>b {background:#f7d8df; color:#c5233c}
.quick-month.all-months {padding:6px 12px}
.quick-month.all-months.active {background:#233149; color:#fff; border-color:#233149}
.filter-row {gap:9px}
.filter-title {font-size:11px; font-weight:600; border:0; padding-right:7px}
.filter-title .icon {width:15px; height:15px}
.filter-button>summary {min-height:36px; min-width:126px; font-size:11px; border-radius:7px; padding:8px 10px; gap:13px}
.filter-button>summary .icon {width:14px; height:14px; color:#8894a6}
.filter-button>summary>span {max-width:225px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.filter-popover {padding:17px; border-radius:11px; box-shadow:0 12px 40px #132c4920}
.filter-popover h3 {font-size:13px}
.filter-popover p {font-size:11px; line-height:1.65}
.filter-popover .date-range {margin:0; padding:0; border:0; gap:11px}
.date-range input {font-size:12px; width:137px}
.filter-clear {font-size:10px; color:#6c7a8f; padding:7px 1px; gap:6px}
.filter-total {font-size:10px; color:#8793a4}
.active-filters {gap:7px; padding-top:12px; margin-top:13px}
.filter-chip {padding:5px 8px; font-size:10px; border:1px solid #f4d4dc; border-radius:5px}
.kpi-grid {gap:16px; margin-bottom:25px}
.kpi {border-radius:12px; padding:20px; min-height:155px; border-color:var(--line); box-shadow:var(--shadow)}
.kpi-label {font-size:12px; font-weight:500; color:var(--muted)}
.kpi-icon {width:32px; height:32px; border-radius:8px; background:#f1f4f8; color:#7d8fa9}
.kpi-icon .icon {width:18px; height:18px}
.kpi-value {font-size:40px; font-weight:720; letter-spacing:-1.4px; margin-top:9px; line-height:1.1}
.kpi-value small {font-size:22px}
.kpi-footer {font-size:10px; line-height:1.6; margin-top:13px; color:var(--muted)}
.kpi-footer b {font-size:11px; font-weight:500; color:#64738a}
.kpi.featured {background:#db2540; border:1px solid #db2540; padding:20px; color:white; box-shadow:0 5px 17px #db254015}
.kpi.featured .kpi-label {color:#fff}
.kpi.featured .kpi-icon {background:#ffffff1c; color:white}
.kpi.featured .kpi-footer {color:#ffebef}
.kpi.featured .dot {background:#fff}
.kpi-blue .kpi-icon {background:#edf3fd; color:#3974dd}
.kpi-blue .kpi-value {color:#2c63b9}
.kpi-mode .kpi-icon {background:#fcf5e8; color:#ba8b36}
.section-heading {display:flex; align-items:center; justify-content:space-between; gap:15px; margin:0 0 14px}
.section-heading>div {display:flex; align-items:center; gap:9px}
.section-heading h2 {font-size:14px; font-weight:650; letter-spacing:-.15px}
.section-line {width:3px; height:16px; border-radius:3px; background:var(--brand)}
.section-line.blue {background:var(--blue)}
.section-heading p {font-size:10px; color:var(--muted); display:flex; align-items:center; gap:6px}
.section-heading p .icon {width:12px; height:12px}
.section-heading .text-link {font-size:11px}
.chart-grid,.lower-grid {gap:20px; margin-bottom:25px; grid-template-columns:minmax(0,1.8fr) minmax(310px,1fr)}
.card {border-radius:12px; box-shadow:var(--shadow); border-color:var(--line)}
.card-head {padding:21px 22px 0; gap:12px}
.card-head h2 {font-size:16px; font-weight:650; letter-spacing:-.35px; line-height:1.4}
.card-head p {font-size:11px; margin-top:5px; line-height:1.6}
.card-tools {gap:7px}
.card-tools select {font-size:11px; padding:5px 8px; min-height:31px; border-radius:6px}
.card-tools .icon-button {height:31px; width:31px}
.card-tools .icon-button .icon {width:14px; height:14px}
.segmented {padding:3px; border-radius:7px; background:var(--surface2)}
.segmented button {font-size:10px; padding:5px 8px; border-radius:5px; min-height:25px}
.segmented button.active {background:var(--surface); color:var(--brand); box-shadow:0 1px 4px #1d2f4812; font-weight:600}
.chart-controls {padding:16px 22px 0}
.legend-small {font-size:10px}
.chart-canvas {padding:22px 17px 14px; min-height:250px; display:flex; align-items:center}
.plot text {font-size:16px; fill:var(--muted)}
.plot .value {font-size:17px; font-weight:600; fill:var(--ink)}
.gridline {stroke-dasharray:3 5; stroke:var(--line)}
.chart-foot {padding:13px 22px; font-size:10px; gap:13px}
.donut-wrap {padding:13px 22px 22px}
.donut {width:210px; height:210px; margin:0 auto 3px}
.donut .donut-number {font-size:32px; font-weight:700}
.legend {gap:12px; margin-top:5px}
.legend-row {font-size:11px; gap:9px; align-items:center}
.legend-row span {color:var(--muted); line-height:1.5}
.legend-row i {width:8px; height:8px; border-radius:3px}
.legend-row strong {display:flex; gap:9px; align-items:baseline; text-align:right}
.legend-row strong b {font-size:12px; font-weight:650; color:var(--ink)}
.legend-row strong small {font-size:10px; font-weight:400; color:var(--muted); min-width:37px}
.bar-list {padding:22px; gap:22px}
.bar-list.compact {gap:20px}
.bar-caption {font-size:11px; gap:15px; margin-bottom:9px; align-items:flex-end}
.bar-name {color:var(--muted); white-space:normal; line-height:1.55; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; max-width:calc(100% - 90px)}
.bar-number {font-size:13px; gap:10px; align-items:baseline}
.bar-number small {font-size:10px; width:39px}
.bar-track {height:7px; border-radius:3px; background:var(--track)}
.bar-track>span {border-radius:3px}
.insight-list {padding:22px; gap:21px}
.insight {gap:12px}
.insight-icon {width:34px; height:34px; border-radius:9px; background:var(--surface2)}
.insight-icon .icon {height:17px; width:17px}
.insight strong {font-size:12px; line-height:1.6; margin-bottom:5px}
.insight p {font-size:11px; line-height:1.75}
.quality-notice {font-size:11px; padding:12px; margin:0 22px 21px; border-radius:7px; color:#8a7440; background:#fcfaf3; border-color:#eee6d2}
.top-chassis .card-head {padding-bottom:19px}
.table {font-size:12px}
.table th {font-size:11px; padding:13px 22px; letter-spacing:0; background:var(--surface2); font-weight:500}
.table td {padding:15px 22px}
.table td.description {font-size:12px; line-height:1.65; min-width:260px}
.table .chassis-link {font-size:12px; font-weight:650}
.pill {font-size:10px; padding:4px 8px; border-radius:6px; gap:6px}
.mini-meter b {font-size:12px; font-weight:600}
.mini-meter>span {height:5px; width:94px}
.analysis-controls {padding:23px; gap:15px; background:var(--surface2)}
.field {font-size:11px; gap:7px}
.field select,.field input {min-height:39px; font-size:12px; border-radius:7px}
.analysis-chart {padding:20px; min-height:370px; overflow-x:auto}
.modal-chart {overflow-x:auto}
.analysis-chart .plot text {font-size:14px}
.analysis-chart .plot .value {font-size:15px}
.analysis-chart .bar-list {gap:24px}
.analysis-chart .bar-name {font-size:12px; max-width:calc(100% - 100px)}
.analysis-chart .bar-track {height:9px}
.analysis-chart .donut-wrap {gap:50px; flex-wrap:wrap}
.analysis-chart .legend-row {font-size:12px}
.analysis-chart .legend-row strong b {font-size:14px}
.analysis-chart .legend-row strong small {font-size:11px}
.analysis-bottom {font-size:11px; padding:15px 22px}
.compare-controls {padding:22px; border-radius:12px; gap:16px; flex-wrap:wrap}
.compare-controls .field {min-width:145px}
.compare-kpis .kpi.featured .kpi-footer {color:#ffebef}
.compare-legend {font-size:12px; padding:19px 22px 0; gap:24px}
.compare-legend i {width:8px; height:8px}
.compare-bars {padding:25px 22px; gap:27px}
.compare-row {font-size:12px; grid-template-columns:220px 1fr; gap:30px}
.compare-line {height:26px; gap:12px}
.compare-line b {height:14px; border-radius:4px}
.compare-line strong {font-size:12px}
.record-toolbar {padding:20px 22px}
.record-toolbar h2 {font-size:16px}
.record-toolbar p {font-size:11px; margin-top:5px}
.pagination {padding:17px 22px; font-size:11px}
.pagination-controls select {font-size:11px}
.data-body {padding:23px; font-size:12px}
.definition-list {gap:16px; grid-template-columns:minmax(110px,1fr) minmax(0,1.4fr)}
.definition-list dd {overflow-wrap:anywhere}
.info-note {font-size:12px; padding:15px; border:1px solid var(--line); border-radius:8px}
.data-body ul {font-size:12px; line-height:1.9}
.audit-row {font-size:13px; padding:16px 0}
.audit-row b {font-size:24px}
.data-actions {gap:8px}
.page-footer {font-size:10px; color:#8e9aab; line-height:1.6; margin-top:26px}
.dialog-head h2 {font-size:19px; letter-spacing:-.4px}
.dialog-body>p {font-size:13px}
.dialog-head p {font-size:12px}
.dialog-body .insight p {font-size:12px}
.tooltip {font-size:12px; padding:10px 13px; border-radius:8px; background:#1c2940}
.presentation .source-strip {margin-bottom:18px}
.presentation .kpi.featured {padding:22px}
.presentation .chart-controls {padding-top:14px}
.presentation .kpi-value {font-size:43px}

[data-theme=dark] {--bg:#141b27; --surface:#1d2737; --surface2:#232f42; --line:#303e53; --ink:#e9eff8; --muted:#a4b1c5; --track:#303e53; --brand:#f06c81; --brand-soft:#3d2a38}
[data-theme=dark] .sidebar {background:#101723; border-right:1px solid #293449}
[data-theme=dark] .source-sheet {background:#243b37; border-color:#344f48; color:#9dcebf}
[data-theme=dark] .source-dates .icon {color:#91a4bf}
[data-theme=dark] .quick-month>b {color:#bfccdd}
[data-theme=dark] .quick-month.active>b {background:#5a2c3d; color:#ffc1cf}
[data-theme=dark] .quick-month.all-months.active {background:#e1e9f5; color:#253349; border-color:#e1e9f5}
[data-theme=dark] .filter-clear {color:#a3b2c8}
[data-theme=dark] .filter-chip {border-color:#693b4c}
[data-theme=dark] .kpi.featured {background:#b92740; border-color:#b92740}
[data-theme=dark] .kpi-blue .kpi-value {color:#8eb4fa}
[data-theme=dark] .kpi-blue .kpi-icon {background:#293c5b; color:#90b6fc}
[data-theme=dark] .kpi-neutral .kpi-icon {background:#303d50; color:#b1c1d7}
[data-theme=dark] .kpi-mode .kpi-icon {background:#413a2c; color:#d5b16d}
[data-theme=dark] .kpi-footer b {color:#b3c1d6}
[data-theme=dark] .topbar .avatar {border-color:#754353}
[data-theme=dark] .quality-notice {color:#d1bd8b; background:#383328; border-color:#514735}

@media(min-width:1600px) {
  .main {padding:34px 42px 28px}
  .page-heading h1 {font-size:35px}
  .page-heading p {font-size:14px}
  .heading-actions .btn {font-size:12px; padding:11px 16px; min-height:42px}
  .kpi {min-height:170px; padding:23px}
  .kpi.featured {padding:23px}
  .kpi-value {font-size:46px}
  .kpi-label {font-size:13px}
  .kpi-footer {font-size:11px}
  .chart-canvas {min-height:300px}
  .donut {width:230px; height:230px}
  .legend-row {font-size:12px}
  .quick-month {font-size:12px; padding:8px 12px}
  .quick-period-label strong {font-size:12px}
  .quick-month>b {font-size:10px}
  .bar-caption {font-size:12px}
}
@media(max-width:1300px) {
  :root {--sidebar:208px}
  .sidebar {padding-left:13px; padding-right:13px}
  .brand {padding-left:8px; gap:10px}
  .brand-name {font-size:19px}
  .nav-item {font-size:11px; gap:10px}
  .main {padding:26px 25px}
  .topbar {padding:0 25px}
  .page-heading h1 {font-size:28px}
  .heading-actions {gap:6px}
  .heading-actions .btn {font-size:10px; padding:9px 11px; min-height:37px}
  .search input {width:240px}
  .quick-period {flex-wrap:wrap; gap:12px}
  .quick-period-label>div {display:flex; gap:12px; align-items:baseline}
  .quick-period-label span {font-size:10px; margin:0}
  .quick-months {flex-basis:100%}
  .quick-month {font-size:11px; gap:12px; flex-grow:1; min-height:35px}
  .kpi {padding:17px; min-height:149px}
  .kpi.featured {padding:17px}
  .kpi-label {font-size:11px}
  .kpi-value {font-size:37px}
  .kpi-footer {font-size:10px}
  .chart-grid,.lower-grid {grid-template-columns:minmax(0,1.65fr) minmax(285px,1fr); gap:17px}
  .card-head {padding:19px 18px 0}
  .card-head h2 {font-size:15px}
  .card-head p {font-size:10px}
  .card-tools .icon-button {display:none}
  .chart-controls {padding:15px 18px 0}
  .chart-canvas {min-height:245px; padding-left:12px; padding-right:12px}
  .donut {width:195px; height:195px}
  .donut-wrap {padding:13px 18px 20px}
  .legend-row {font-size:10px; gap:7px}
  .legend-row strong {gap:6px}
  .legend-row strong small {font-size:9px; min-width:32px}
  .bar-list {padding:20px 18px}
  .bar-name {font-size:10px}
  .insight-list {padding:20px 18px}
  .quality-notice {margin-left:18px; margin-right:18px; font-size:10px}
  .filter-row {gap:8px}
  .filter-title {display:none}
}
@media(max-width:1050px) {
  .page-heading {flex-wrap:wrap; row-gap:15px}
  .heading-actions {margin-left:auto; flex-direction:row}
  .page-heading p {max-width:none}
  .filter-clear {margin-left:auto}
  .filter-total {display:none}
  .data-grid {grid-template-columns:1fr}
}
@media(max-width:1000px) {
  :root {--sidebar:76px}
  .sidebar {padding:25px 10px 18px}
  .brand {padding:0 8px 28px}
  .brand-mark {width:36px; height:36px}
  .nav-item {justify-content:center; padding:13px; margin:7px 0}
  .nav-item .icon {width:20px; height:20px}
  .user {padding:15px 0 0}
  .main {padding:25px}
  .kpi-grid {gap:12px}
  .kpi-value {font-size:36px}
  .chart-grid,.lower-grid {grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr)}
  .section-heading h2 {font-size:13px}
  .page-heading {flex-wrap:nowrap}
  .page-heading h1 {font-size:27px}
}
@media(max-width:850px) {
  .page-heading {flex-wrap:wrap}
  .heading-actions {margin-left:0}
  .source-strip-text strong {max-width:250px}
  .source-sheet {display:none}
  .kpi-grid {grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px}
  .kpi {min-height:148px; padding:19px}
  .kpi.featured {padding:19px}
  .kpi-label {font-size:12px}
  .kpi-value {font-size:40px}
  .chart-grid,.lower-grid {grid-template-columns:1fr; gap:20px}
  .chart-canvas {min-height:230px; padding:22px 18px 12px}
  .plot text {font-size:17px}
  .plot .value {font-size:18px}
  .chart-grid .donut-wrap {display:flex; align-items:center; justify-content:space-evenly; padding:18px 24px 24px; gap:30px}
  .chart-grid .donut {width:210px; height:210px; margin:0}
  .chart-grid .legend {min-width:240px; gap:18px}
  .legend-row {font-size:12px; gap:9px}
  .legend-row strong {flex-direction:column; gap:0; align-items:flex-end}
  .legend-row strong b {font-size:14px}
  .legend-row strong small {font-size:10px}
  .bar-name {font-size:12px}
  .bar-number {font-size:14px}
  .insight-list {padding:22px; gap:21px}
  .insight strong {font-size:13px}
  .insight p {font-size:12px}
  .quality-notice {font-size:11px}
  .section-heading p {display:none}
  .compare-kpis {grid-template-columns:repeat(3,minmax(0,1fr))}
  .compare-kpis .kpi {padding:16px; min-height:145px}
  .compare-kpis .kpi-value {font-size:30px}
  .compare-row {grid-template-columns:175px 1fr; gap:20px}
  .compare-controls .field {min-width:130px}
  .page-footer {flex-wrap:wrap; font-size:9px}
}
@media(max-width:650px) {
  .main {padding:23px 18px}
  .topbar {padding:0 18px}
  .breadcrumbs {display:none}
  .top-actions {width:100%}
  .search {flex:1}
  .search input {width:100%}
  .page-heading h1 {font-size:27px}
  .source-strip {gap:10px; flex-wrap:wrap; padding:13px; margin-bottom:19px}
  .source-strip-text {flex:1}
  .source-strip-text strong {font-size:11px; max-width:280px}
  .source-dates {flex-basis:100%; margin:0; border-top:1px solid var(--line); padding-top:10px; font-size:11px; gap:8px}
  .filter-panel {padding:15px; margin-bottom:20px}
  .quick-period {padding-bottom:14px; margin-bottom:14px; gap:12px}
  .quick-period-label>div {display:block}
  .quick-period-label span {margin-top:2px}
  .quick-months {gap:6px}
  .quick-month {flex-basis:calc(33.333% - 6px); flex-grow:1; font-size:10px; gap:10px}
  .quick-month.all-months {flex-basis:100%; min-height:31px}
  .filter-row {display:grid; grid-template-columns:1fr 1fr; gap:8px}
  .filter-button>summary {font-size:10px; min-width:0; padding:9px 8px; gap:7px}
  .filter-button>summary>span {max-width:170px; font-size:10px}
  .filter-button>summary .icon {width:12px; height:12px}
  .filter-clear {grid-column:1/-1; justify-self:end; padding:3px 0; font-size:10px; margin-top:4px}
  .filter-spacer {display:none}
  .filter-button .filter-popover {min-width:250px; max-width:calc(100vw - 115px); left:0; right:auto}
  .filter-button:nth-of-type(even) .filter-popover {left:auto; right:0}
  .filter-popover.wide {width:292px}
  .date-range input {width:118px; padding:6px; font-size:11px}
  .kpi-grid {gap:12px}
  .kpi {padding:16px; min-height:145px}
  .kpi.featured {padding:16px}
  .kpi-label {font-size:11px}
  .kpi-icon {width:27px; height:27px}
  .kpi-icon .icon {width:15px; height:15px}
  .kpi-value {font-size:36px}
  .kpi-footer {font-size:9px; line-height:1.7}
  .kpi-footer b {font-size:10px}
  .card-head {padding:19px 17px 0; gap:10px}
  .card-head h2 {font-size:15px}
  .card-head p {font-size:10px}
  .card-tools select {font-size:10px; padding:5px 6px}
  .segmented button {font-size:10px; padding:4px 7px; min-height:23px}
  .chart-controls {padding:15px 17px 0; flex-wrap:wrap; gap:9px}
  .chart-canvas {padding:21px 7px 14px; min-height:185px}
  .plot text {font-size:24px}
  .plot .value {font-size:25px}
  .chart-grid .donut-wrap {padding:15px 17px 24px; gap:20px}
  .chart-grid .donut {width:170px; height:170px; flex-shrink:0}
  .chart-grid .legend {min-width:0; flex:1; gap:13px}
  .legend-row {font-size:10px; align-items:center; gap:7px}
  .legend-row strong b {font-size:12px}
  .legend-row strong small {font-size:9px}
  .bar-list {padding:22px 18px}
  .bar-name {font-size:11px; max-width:calc(100% - 80px)}
  .bar-number {font-size:12px; gap:8px}
  .bar-number small {font-size:10px; width:35px}
  .chart-foot {padding:12px 17px; font-size:9px}
  .chart-foot .text-link {font-size:10px}
  .table th {font-size:10px; padding:12px 17px}
  .table td {font-size:11px; padding:14px 17px}
  .table td.description {font-size:11px}
  .compare-kpis {grid-template-columns:1fr}
  .compare-kpis .kpi {min-height:105px; display:grid; grid-template-columns:1fr auto; column-gap:15px; padding:18px}
  .compare-kpis .kpi-value {grid-column:2; grid-row:1/3; align-self:center; margin:0; font-size:32px}
  .compare-kpis .kpi-footer {margin-top:5px}
  .compare-kpis .kpi-icon {display:none}
  .compare-row {grid-template-columns:130px 1fr; gap:15px; font-size:11px}
  .compare-bars {padding:22px 17px}
  .compare-controls {padding:16px; gap:10px}
  .compare-controls .field {min-width:100px; flex-basis:calc(50% - 20px)}
  .compare-controls .swap {border:0; width:25px}
  .analysis-controls {padding:17px; gap:12px}
  .analysis-controls .field,.analysis-controls .field.narrow {min-width:100px; flex:1 1 calc(50% - 12px)}
  .analysis-chart {padding:18px 8px; min-height:300px}
  .analysis-chart .plot text {font-size:15px}
  .analysis-chart .plot .value {font-size:17px}
  .analysis-chart .donut-wrap {gap:20px}
  .analysis-chart .donut {width:230px; height:230px}
  .analysis-chart .legend {min-width:260px}
  .analysis-chart .bar-name {font-size:11px}
  .section-heading h2 {font-size:12px}
  .section-heading .text-link {font-size:10px}
}
@media(max-width:550px) {
  :root {--sidebar:0px}
  .sidebar.open {width:230px; background:#131c2b; padding:25px 16px; border:0}
  .sidebar.open .brand {padding-left:8px; padding-bottom:30px}
  .sidebar.open .brand-name {font-size:20px}
  .sidebar.open .nav-item {font-size:12px; gap:12px}
  .sidebar.open .user {padding-left:8px; padding-top:15px}
  .sidebar.open .source-mini {margin-top:25px}
  .topbar {height:62px; padding:0 12px; gap:7px}
  .top-actions {gap:6px}
  .search input {font-size:11px; padding-right:10px}
  .main {padding:23px 15px}
  .page-heading {margin-bottom:18px; gap:15px}
  .page-heading h1 {font-size:27px; max-width:none; letter-spacing:-.9px}
  .page-heading p {max-width:none; font-size:12px; margin-top:7px}
  .eyebrow {font-size:8px; margin-bottom:8px; letter-spacing:1.1px}
  .heading-actions {width:100%; flex-direction:row; gap:7px; margin-left:0}
  .heading-actions .btn {font-size:10px; padding:9px 10px; min-height:37px; flex:1}
  .heading-actions .btn .icon {width:13px; height:13px}
  .heading-actions .primary {flex:1.45}
  .source-strip-text strong {font-size:11px; max-width:290px}
  .filter-button .filter-popover {max-width:calc(100vw - 65px); left:0; right:auto}
  .filter-button:nth-of-type(even) .filter-popover {left:auto; right:0}
  .filter-button .filter-popover.wide {left:auto!important; right:0!important; min-width:270px}
  .kpi-grid {gap:11px}
  .kpi,.kpi.featured {padding:15px; min-height:142px}
  .kpi-label {font-size:10px; gap:5px}
  .kpi-value {font-size:36px; margin-top:10px}
  .kpi-icon {width:25px; height:25px}
  .kpi-footer {margin-top:12px; font-size:9px}
  .kpi-footer b {font-size:10px}
  .chart-canvas {min-height:170px}
  .plot text {font-size:27px}
  .plot .value {font-size:28px}
  .chart-grid .donut {width:154px; height:154px}
  .chart-grid .donut-wrap {gap:12px; padding-left:15px; padding-right:15px}
  .chart-grid .legend {gap:12px}
  .legend-row i {margin-top:0; width:6px; height:6px}
  .legend-row strong small {min-width:28px}
  .legend-row span {font-size:10px}
  .card-head {align-items:flex-start}
  .card-head h2 {font-size:14px}
  .chart-grid .card-tools .segmented button {font-size:9px; padding:5px 6px}
  .section-heading {gap:10px; margin-bottom:13px}
  .section-heading h2 {font-size:12px}
  .section-heading .text-link {font-size:9px; white-space:nowrap}
  .section-line {height:14px}
  .bar-name {font-size:10px}
  .insight-list {padding:21px 18px; gap:20px}
  .insight strong {font-size:12px}
  .insight p {font-size:11px}
  .quality-notice {font-size:10px; margin:0 18px 19px}
  .table .chassis-link {font-size:11px}
  .compare-row {grid-template-columns:110px 1fr; font-size:10px; gap:12px}
  .compare-controls .field:last-child {flex-basis:calc(50% - 20px)}
  .analysis-chart:has(.plot) .plot {min-width:600px}
  .analysis-bottom {padding:14px 17px; font-size:10px}
  .record-toolbar {padding:17px; gap:12px}
  .record-toolbar h2 {font-size:15px}
  .pagination {padding:14px 16px; font-size:10px}
  .pagination-controls {flex-wrap:wrap}
  .data-body {padding:19px; font-size:11px}
  .data-body ul {font-size:11px}
  .info-note {font-size:11px}
  .audit-row {font-size:12px}
  .page-footer {font-size:9px; gap:10px}
  .presentation .main {padding:20px 15px}
  .presentation .kpi,.presentation .kpi.featured {padding:15px; min-height:142px}
  .presentation .heading-actions {width:auto; flex-wrap:wrap; align-self:flex-start}
  .presentation .heading-actions .btn {flex:none}
  .presentation .kpi-value {font-size:36px}
}
@media screen {
  :root {
    --bg:#f2f5fa; --surface:#fff; --surface2:#f7f9fc; --ink:#152236;
    --muted:#4d5c70; --line:#dce4ee; --brand:#b7203b; --brand-soft:#fceef2;
    --blue:#2e63be; --track:#e9eef5; --focus:#2860cb;
    --shadow:0 2px 9px #15223608;
  }
  [data-theme=dark] {
    --bg:#111826; --surface:#192435; --surface2:#202d41; --ink:#f2f6fc;
    --muted:#bac7d9; --line:#384a62; --brand:#ff8a9e; --brand-soft:#3c2635;
    --blue:#98bcff; --track:#303e53; --focus:#98bcff;
  }

  body {font-size:1rem;letter-spacing:normal}
  :is(button,a,input,select,summary):focus-visible {outline:2px solid var(--focus);outline-offset:2px}
  .sidebar {overflow-y:auto;scrollbar-width:thin}
  .brand-name {font-size:1.375rem}
  .brand small,.nav-label,.eyebrow,.source-strip-text>span {font-size:.6875rem;letter-spacing:.08em}
  .brand small,.nav-label {color:#a6b5ca}
  .nav-item,.sidebar.open .nav-item {font-size:.875rem;font-weight:600;line-height:1.35;color:#c5d0e0}
  .nav-item.active {color:#fff;background:#bf2440}
  .sidebar.open .nav-item.active {color:#fff}
  .nav-item .badge {font-size:.75rem}
  .source-mini,.user small {font-size:.8125rem;color:#aebdd2}
  .source-mini strong,.user strong,.breadcrumbs {font-size:.875rem}
  .source-mini .muted {color:#aebdd2}
  .search input {font-size:.875rem;min-height:42px}
  .search input::placeholder {color:var(--muted)}
  .topbar .icon-button {width:40px;height:40px}

  .page-heading h1 {font-size:clamp(1.875rem,1.35rem + 1.1vw,2.5rem);letter-spacing:-.035em}
  .page-heading p {font-size:.9375rem;line-height:1.55;max-width:60ch}
  .btn,.heading-actions .btn {font-size:.875rem;min-height:42px;font-weight:650}
  .btn.tiny {font-size:.8125rem;min-height:36px}
  .btn.primary,[data-theme=dark] .btn.primary {background:#bf2440;border-color:#bf2440}
  .btn.primary:hover,[data-theme=dark] .btn.primary:hover {background:#a91c35;border-color:#a91c35}
  .source-strip,.filter-panel {box-shadow:var(--shadow)}
  .source-strip-text strong {font-size:.9375rem}
  .source-sheet,.source-dates,.source-dates small {font-size:.8125rem}
  .source-sheet {color:#315f52}

  .quick-period-label strong,.filter-button>summary,.filter-popover h3 {font-size:.875rem}
  .quick-period-label span,.quick-month,.filter-title,.filter-clear,.filter-total,.filter-chip,.filter-popover p,.date-range input {font-size:.8125rem}
  .quick-month {min-height:38px}
  .quick-month small,.quick-month>b {font-size:.75rem}
  .quick-month>b,.filter-clear,.filter-total {color:var(--muted)}
  .filter-button>summary {min-height:40px}

  .kpi-label,.table,.table td.description,.table .chassis-link,.record-toolbar p {font-size:.875rem}
  .overview-kpis .kpi {min-height:118px;padding:14px 16px}
  .overview-kpis .kpi-value {font-size:clamp(1.875rem,2.5vw,2.375rem);margin-top:7px}
  .overview-kpis .kpi-footer {margin-top:8px}
  .overview-kpis .kpi-records {border-top:2px solid var(--brand)}
  .overview-kpis .kpi-records .kpi-icon {background:var(--brand-soft);color:var(--brand)}
  .kpi-footer,.kpi-footer b,.table th,.pill,.mini-meter b,.pagination,.pagination-controls select {font-size:.8125rem}
  .kpi-footer b {color:inherit}
  .table th {font-weight:650}
  .section-heading h2,.card-head h2,.record-toolbar h2 {font-size:1.125rem}
  .card-head p,.section-heading p,.section-heading .text-link,.chart-grid .card-tools .segmented button,.card-tools select {font-size:.8125rem}
  .legend-row,.legend-row span,.analysis-chart .legend-row,.bar-caption,.bar-name,.analysis-chart .bar-name,.bar-number small {font-size:.8125rem}
  .legend-row strong b,.analysis-chart .legend-row strong b,.bar-number {font-size:.9375rem}
  .legend-row strong small,.analysis-chart .legend-row strong small {font-size:.75rem}
  .insight strong,.compare-legend,.compare-row,.compare-line strong,.analysis-bottom {font-size:.875rem}
  .insight p,.quality-notice,.field {font-size:.8125rem}
  .field select,.field input {font-size:.875rem}
  .data-body,.data-body ul,.info-note,.audit-row {font-size:.875rem}
  .page-footer {font-size:.75rem;color:var(--muted)}

  .dialog-head h2 {font-size:1.5rem}
  .dialog-head p,.dialog-body>p,.dialog-body .insight p {font-size:.875rem}
  .record-detail-grid label,.description-label {font-size:.8125rem}
  .record-detail-grid strong,.record-description {font-size:1rem;overflow-wrap:anywhere}
}

@media screen and (max-width:650px) {
  .search input,.field input,.field select {font-size:1rem}
  .heading-actions {flex-wrap:wrap}
  .heading-actions .btn {flex:1 1 auto;white-space:normal;min-height:44px}
  .filter-row {grid-template-columns:repeat(2,minmax(0,1fr))}
  .filter-button>summary {min-height:44px}
  .filter-button>summary>span {font-size:inherit;min-width:0;white-space:normal}
  .chart-grid .card-head {flex-wrap:wrap}
}

@media print {
  :root {--bg:white; --ink:#172032; --muted:#68758b; --line:#e4e9f1; --surface:white; --surface2:#f8f9fb; --track:#eef0f4}
  .main {padding:0}
  .source-strip {padding:8px 12px; margin-bottom:12px; break-inside:avoid}
  .source-strip-icon {height:29px; width:27px}
  .source-strip-text strong {font-size:10px}
  .source-dates {font-size:10px; border:0; margin-left:auto; flex-basis:auto; padding:0}
  .source-sheet {display:none}
  .page-heading h1 {font-size:25px}
  .kpi-grid {grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:15px}
  .kpi,.kpi.featured {padding:12px; min-height:112px; box-shadow:none}
  .kpi-value {font-size:30px}
  .kpi-label {font-size:10px}
  .kpi-footer {font-size:9px; margin-top:9px}
  .kpi-icon {height:22px; width:22px}
  .section-heading {margin-bottom:10px}
  .section-heading h2 {font-size:12px}
  .section-heading p {display:none}
  .chart-grid,.lower-grid {grid-template-columns:1.65fr 1fr; gap:13px; margin-bottom:16px}
  .card-head {padding:14px 16px 0}
  .card-head h2 {font-size:13px}
  .card-head p {font-size:9px}
  .chart-canvas {min-height:0; padding:13px 10px}
  .chart-controls {padding:12px 16px 0}
  .chart-grid .donut-wrap {display:block; padding:8px 15px 14px}
  .chart-grid .donut {width:145px; height:145px; margin:auto}
  .chart-grid .legend {min-width:0; gap:7px}
  .legend-row {font-size:9px}
  .legend-row strong {flex-direction:row; gap:8px}
  .legend-row strong b {font-size:10px}
  .legend-row strong small {font-size:9px}
  .plot text {font-size:16px}
  .plot .value {font-size:17px}
  .bar-list,.bar-list.compact {padding:15px; gap:13px}
  .bar-caption {font-size:9px}
  .bar-name {font-size:9px}
  .bar-number {font-size:11px}
  .insight-list {padding:15px; gap:12px}
  .insight strong {font-size:10px}
  .insight p,.quality-notice {font-size:9px}
  .quality-notice {padding:9px; margin:0 15px 13px}
  .table th,.table td {padding:8px 12px; font-size:9px}
  .compare-kpis {grid-template-columns:repeat(3,minmax(0,1fr))}
}
