:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --panel-hover: #f8f9fb;
  --surface: #f5f6f8;
  --border: #e2e5ea;
  --border-light: #eef0f2;
  --text: #1e2229;
  --text-secondary: #5e6873;
  --muted: #8d96a3;
  --accent: #0d6e6e;
  --accent-strong: #095454;
  --accent-light: #e8f4f4;
  --blue: #156082;
  --blue-soft: #eaf1f9;
  --orange: #e97132;
  --orange-dark: #c75a24;
  --red: #c7433a;
  --green: #2e7d32;
  --green-soft: #eaf7ec;
  --gold: #b8860b;
  --gold-soft: #fef8e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; border: none; outline: none; }
select { outline: none; }
svg { display: block; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d4da; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #b0b6be; }

.app-shell {
  width: min(1700px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 0 0 24px;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, #0a8a8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13,110,110,0.25);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.source-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 14px;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: #c0c6ce;
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-sm:hover {
  background: var(--surface);
  border-color: #c0c6ce;
}

.btn-sm:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== CONTROL BAND ===== */
.control-band {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(240px, 380px) auto;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.control-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-band select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.82rem;
  transition: border-color 0.12s;
}

.control-band select:hover { border-color: #c0c6ce; }
.control-band select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,110,110,0.08); }
.control-band option { background: var(--panel); color: var(--text); }

.control-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  min-width: 0;
}

.control-actions .btn {
  height: 32px;
  white-space: nowrap;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 12px;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.dashboard-view[hidden],
.control-band[hidden] {
  display: none !important;
}

/* ===== CHART CARDS ===== */
.chart-stack {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.chart-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card-full {
  grid-column: 1 / -1;
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-light);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chart-heading h2 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text);
}

.chart-heading .eyebrow {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}

.chart-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.period-controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 0;
}

.period-slider {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.chart-box {
  width: 100%;
  min-height: 346px;
  padding: 2px 10px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-box svg {
  width: 100%;
  min-width: 640px;
  height: 350px;
}

.chart-card-full .chart-box svg {
  min-width: 1080px;
  height: 360px;
}

.schedule-view {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 0;
}

.summary-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.summary-pill strong {
  color: var(--text);
  font-size: 0.82rem;
}

.schedule-chart-box svg {
  min-width: 980px;
  height: 350px;
}

.schedule-table-wrap {
  max-height: 430px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-table {
  min-width: 1060px;
}

.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ===== SVG CHART STYLES ===== */
.axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.x-sub-label {
  fill: #a8b0b9;
  font-size: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.grid-line {
  stroke: #eaecf0;
  stroke-width: 1;
}

.axis-line {
  stroke: #cfd5dc;
  stroke-width: 1;
}

.axis-line-right,
.axis-tick {
  stroke: #c0c8d0;
  stroke-width: 1;
}

.y-label-right {
  fill: var(--green);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.axis-title-left,
.axis-title-right {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bar {
  rx: 2px;
  transition: opacity 0.12s;
}

.drill-bar {
  cursor: pointer;
  outline: none;
}

.schedule-drill-bar {
  cursor: pointer;
  outline: none;
}

.schedule-drill-bar:focus {
  stroke: var(--orange);
  stroke-width: 2;
}

.bar-group:hover .bar {
  opacity: 0.75;
}

.schedule-bar-rem {
  opacity: 0.94;
}

.drill-bar:focus {
  stroke: var(--orange);
  stroke-width: 2;
}

.eff-line {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eff-marker circle,
.legend-eff-marker {
  fill: var(--panel);
  stroke: var(--orange);
  stroke-width: 2.2;
}

.eff-label {
  fill: var(--orange-dark);
  font-size: 10.5px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.legend-eff-line { stroke-width: 2.4; }

.legend text {
  fill: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== BAR DATA LABELS ===== */
.bar-data-label {
  font-size: 9.5px;
  font-weight: 650;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2.5px;
  stroke-linejoin: round;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}

.bar-label-a { fill: #4a6a7a; }
.bar-label-b { fill: #3d6b4a; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid #cfe0df;
  border-radius: var(--radius-sm);
  background: #eff8f7;
  color: var(--accent-strong);
  box-shadow: var(--shadow-md);
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 50;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ===== DRILLDOWN MODAL ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17,24,39,0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drilldown-drawer {
  position: fixed;
  z-index: 81;
  top: 50%;
  left: 50%;
  width: min(1120px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translate(-50%, -46%) scale(0.98);
  transition: opacity 0.16s, transform 0.18s cubic-bezier(0.4,0,0.2,1);
}

.drilldown-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
  font-weight: 650;
}

.drawer-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-actions .btn svg {
  width: 15px;
  height: 15px;
}

.btn-close {
  align-self: start;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.btn-close:hover {
  background: #e8ebef;
  color: var(--text);
}

.btn-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawer-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 20px 0;
  flex: 0 1 auto;
}

.drawer-section:last-of-type {
  padding-bottom: 20px;
  flex: 1 1 auto;
}

.drawer-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.drawer-table-wrap {
  max-height: min(28vh, 260px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.drawer-table-detail {
  max-height: min(42vh, 420px);
  flex: 1 1 auto;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: var(--panel);
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fa;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.data-table .numeric {
  text-align: right;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
  padding: 20px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .chart-stack {
    grid-template-columns: 1fr;
  }

  .chart-card-full {
    grid-column: auto;
  }

  .chart-box svg {
    min-width: 920px;
  }

  .chart-card-full .chart-box svg {
    min-width: 1080px;
  }

  .schedule-chart-box svg {
    min-width: 980px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: calc(100vw - 14px);
    padding-bottom: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 0 8px;
  }

  .topbar-left { flex-wrap: wrap; }
  .topbar-actions { justify-content: flex-end; }

  .control-band {
    grid-template-columns: 1fr 1fr;
    margin: 8px 0;
    padding: 9px;
  }
  .control-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .chart-stack { grid-template-columns: 1fr; }

  .chart-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .chart-actions { justify-content: space-between; }

  .chart-box {
    min-height: 326px;
    padding: 2px 8px 8px;
  }

  .chart-box svg {
    min-width: 820px;
    height: 330px;
  }

  .chart-card-full .chart-box svg {
    min-width: 1000px;
    height: 340px;
  }

  .schedule-chart-box svg {
    min-width: 900px;
    height: 330px;
  }

  .schedule-table {
    min-width: 980px;
  }

  .period-controls {
    grid-template-columns: 1fr 1fr;
  }

  .period-slider {
    grid-column: 1 / -1;
    order: -1;
  }

  .drilldown-drawer {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 560px) {
  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .source-line {
    font-size: 0.66rem;
  }

  .topbar-actions .btn,
  .control-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .control-band { grid-template-columns: 1fr; }

  .chart-heading {
    padding: 9px 10px 7px;
  }

  .period-controls {
    padding: 7px 10px 0;
  }

  .chart-box {
    min-height: 300px;
    padding: 0 7px 8px;
  }

  .chart-box svg {
    min-width: 760px;
    height: 308px;
  }

  .chart-card-full .chart-box svg {
    min-width: 900px;
    height: 318px;
  }

  .tab-bar {
    overflow-x: auto;
  }

  .tab-button {
    flex: 1 0 auto;
  }

  .summary-strip {
    padding: 8px 10px 0;
  }

  .schedule-chart-box svg {
    min-width: 820px;
    height: 318px;
  }

  .schedule-table {
    min-width: 920px;
  }

  .drawer-header {
    align-items: stretch;
    flex-direction: column;
  }

  .drawer-actions {
    justify-content: space-between;
  }

  .drawer-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .drawer-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .data-table {
    font-size: 0.72rem;
  }
}

/* ===== PRINT ===== */
@page {
  size: Letter landscape;
  margin: 0.25in;
}

@page printPortrait {
  size: Letter portrait;
  margin: 0.28in;
}

@media print {
  html,
  body {
    width: 100%;
    min-height: 0;
    margin: 0 !important;
    background: #fff !important;
    overflow: hidden;
  }

  body {
    color-adjust: exact;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .app-shell {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.is-printing.print-landscape {
    width: 10.5in;
    min-height: 8in;
  }

  body.is-printing.print-portrait {
    width: 7.94in;
    min-height: 10.44in;
  }

  body.is-printing .app-shell > :not(.chart-stack),
  body.is-printing .chart-stack > :not(.print-solo),
  body.is-printing .drawer-overlay,
  body.is-printing .drilldown-drawer,
  body.is-printing .toast {
    display: none !important;
  }

  body.is-printing .print-solo {
    display: block !important;
    position: relative !important;
    width: 100%;
    page: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin: 0;
    padding: 0;
    break-inside: avoid;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  body.is-printing .print-solo .period-controls,
  body.is-printing .print-solo .btn-icon {
    display: none !important;
  }

  body.is-printing .print-solo * {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-printing .chart-heading {
    padding: 0 0 2px;
    border-bottom: 1px solid #ccc;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    min-height: 0;
  }

  body.is-printing .chart-heading h2 { font-size: 0.85rem; flex-shrink: 0; }
  body.is-printing .chart-heading .eyebrow { font-size: 0.16in; }

  body.is-printing .chart-actions {
    flex-wrap: nowrap !important;
    flex-shrink: 1;
    min-width: 0;
  }

  body.is-printing .chart-actions .chip {
    display: none !important;
  }

  body.is-printing .chip {
    font-size: 0.62rem;
    min-height: 0;
    padding: 1px 8px;
  }

  body.is-printing .chart-box {
    padding: 0 3px 1px;
    min-height: auto;
    overflow: hidden;
  }

  body.is-printing .chart-box svg {
    min-width: 0 !important;
    width: 10.35in;
    max-width: 100%;
  }

  body.is-printing .chart-stack {
    display: block !important;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  body.is-printing.print-portrait .print-solo {
    page: printPortrait;
  }

  /* Single chart print: one chart fitted to Letter 8.5 x 11 */
  body.is-printing.print-landscape:not(.is-printing-both).print-scale-fit .chart-box svg {
    height: 7.25in;
  }

  body.is-printing.print-landscape:not(.is-printing-both).print-scale-compact .chart-box svg {
    height: 6.8in;
  }

  body.is-printing.print-landscape:not(.is-printing-both).print-scale-large .chart-box svg {
    height: 7.45in;
  }

  body.is-printing.print-portrait:not(.is-printing-both).print-scale-fit .chart-box svg {
    width: 7.85in;
    height: 9.55in;
  }

  body.is-printing.print-portrait:not(.is-printing-both).print-scale-compact .chart-box svg {
    width: 7.85in;
    height: 9.3in;
  }

  body.is-printing.print-portrait:not(.is-printing-both).print-scale-large .chart-box svg {
    width: 7.85in;
    height: 9.75in;
  }

  /* Daily + weekly print: two charts fitted to one Letter page */
  body.is-printing-both.print-landscape.print-scale-fit .chart-box svg {
    height: 3.32in;
  }

  body.is-printing-both.print-landscape.print-scale-compact .chart-box svg {
    height: 3.12in;
  }

  body.is-printing-both.print-landscape.print-scale-large .chart-box svg {
    height: 3.42in;
  }

  body.is-printing-both.print-portrait.print-scale-fit .chart-box svg {
    height: 4.8in;
  }

  body.is-printing-both.print-portrait.print-scale-compact .chart-box svg {
    height: 4.55in;
  }

  body.is-printing-both.print-portrait.print-scale-large .chart-box svg {
    height: 4.9in;
  }

  body.is-printing-both .chart-stack .print-solo + .print-solo {
    margin-top: 0.04in;
  }

  body.is-printing-both .chart-stack .print-solo:last-child {
    page-break-inside: avoid;
  }

  /* Browser print without using the app buttons: compress the dashboard to one page. */
  body:not(.is-printing) .topbar-actions,
  body:not(.is-printing) .control-band,
  body:not(.is-printing) .period-controls,
  body:not(.is-printing) .btn-icon,
  body:not(.is-printing) .drawer-overlay,
  body:not(.is-printing) .drilldown-drawer,
  body:not(.is-printing) .toast {
    display: none !important;
  }

  body:not(.is-printing) .topbar {
    padding: 0 0 0.04in;
    margin: 0;
    border-bottom: 1px solid #d9dde3;
  }

  body:not(.is-printing) .brand-icon {
    width: 0.28in;
    height: 0.28in;
  }

  body:not(.is-printing) .brand-text h1 {
    font-size: 0.2in;
  }

  body:not(.is-printing) .source-line {
    font-size: 0.09in;
  }

  body:not(.is-printing) .chart-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.07in;
  }

  body:not(.is-printing) .chart-card {
    border: 1px solid #dfe3e8;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body:not(.is-printing) .chart-heading {
    padding: 0.04in 0.06in 0.03in;
    gap: 0.05in;
  }

  body:not(.is-printing) .chart-heading h2 {
    font-size: 0.13in;
  }

  body:not(.is-printing) .chart-heading .eyebrow {
    font-size: 0.14in;
  }

  body:not(.is-printing) .chart-actions .chip {
    font-size: 0.075in;
  }

  body:not(.is-printing) .chip {
    min-height: 0;
    padding: 0.01in 0.06in;
  }

  body:not(.is-printing) .chart-box {
    min-height: 0;
    padding: 0 0.04in 0.04in;
    overflow: hidden;
  }

  body:not(.is-printing) .chart-box svg {
    min-width: 0 !important;
    width: 100%;
    height: 2.55in;
  }

  body:not(.is-printing) .chart-card-full .chart-box svg {
    height: 2.2in;
  }
}
