body { font-family: 'Inter', sans-serif; }
body.modal-open { overflow: hidden; }
#loading-spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.treemap-cell { cursor: pointer; transition: opacity 0.12s ease; }
.treemap-cell:hover rect { opacity: 0.82; }
.treemap-cell-static { cursor: default; }
.treemap-cell-static:hover rect { opacity: 1; }
.bar-row { cursor: pointer; transition: opacity 0.12s ease; }
.bar-row:hover { opacity: 0.85; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-line-actual { stroke-dasharray: 6 4; }
.chart-area { opacity: 0.12; }
.chart-dot { transition: r 0.1s ease; }
.chart-dot:hover { r: 6; }
.sparkline { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.table-sort-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.table-sort-btn-left { justify-content: flex-start; }
.table-sort-btn-right { justify-content: flex-end; }
.table-sort-btn:hover { color: #64748b; }
.table-sort-btn.is-active { color: #334155; }
.table-sort-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 6px;
}
.table-sort-indicator {
  display: inline-block;
  min-width: 1ch;
  font-size: 11px;
  line-height: 1;
  opacity: 0.8;
}
.fade-in { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.nav-btn { padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #475569; transition: all 0.15s ease; cursor: pointer; border: none; background: transparent; }
.nav-btn:hover { background: #f1f5f9; color: #334155; }
.nav-btn.active { background: #eff6ff; color: #1d4ed8; }
#tooltip { background: rgba(15,23,42,0.92); color: #e2e8f0; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 32px rgba(0,0,0,0.25); backdrop-filter: blur(8px); max-width: 240px; z-index: 90; }
.badge-up { background: #dcfce7; color: #15803d; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-down { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-neutral { background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-spike { background: #fef3c7; color: #b45309; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.card { background: white; border-radius: 16px; border: 1px solid #f1f5f9; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.overview-mode-switch { display: inline-flex; align-items: center; padding: 4px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; }
.overview-mode-btn { padding: 8px 14px; border: none; background: transparent; color: #64748b; border-radius: 999px; font-size: 13px; font-weight: 600; transition: background 0.15s ease, color 0.15s ease; }
.overview-mode-btn:hover { background: #f8fafc; color: #334155; }
.overview-mode-btn.is-active { background: #0f172a; color: #fff; }
.overview-filter-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 13px; font-weight: 600; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.overview-filter-toggle:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06); }
.overview-filter-toggle.is-active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.overview-filter-switch { width: 38px; height: 22px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background 0.15s ease; }
.overview-filter-toggle.is-active .overview-filter-switch { background: #2563eb; }
.overview-filter-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2); transition: transform 0.15s ease; }
.overview-filter-toggle.is-active .overview-filter-thumb { transform: translateX(16px); }
.crumb-link { color: #0284c7; cursor: pointer; font-weight: 500; text-decoration: none; }
.crumb-link:hover { color: #0369a1; }
.appbar-subtitle .appbar-crumb { cursor: pointer; text-decoration: none; }
.appbar-subtitle .appbar-crumb:hover { opacity: 0.8; }
.appbar-subtitle .appbar-crumb-sep { opacity: 0.5; margin: 0 5px; }
.appbar-search-box input {
  color: #0f172a !important;
  caret-color: #0f172a;
}
.appbar-search-box input::placeholder {
  color: #94a3b8 !important;
}
.dept-card { cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.dept-card-static { cursor: default; }
.dept-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-1px); }
.dept-card.dept-card-static:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.04); transform: none; }
.search-result { cursor: pointer; transition: background 0.1s; }
.search-result:hover { background: #f8fafc; }
mark { background: #fef08a; border-radius: 2px; padding: 0 2px; }
.axis-label { font-size: 11px; fill: #94a3b8; }
.axis line, .axis path { stroke: #e2e8f0; }
.dept-trend-trigger {
  width: 100%;
  display: block;
  border: none;
  border-radius: 14px;
  background: transparent;
  padding: 8px;
  margin: 0 -8px;
  text-align: left;
  cursor: zoom-in;
  transition: background 0.15s ease, transform 0.15s ease;
}
.dept-trend-trigger:hover { background: #f8fafc; }
.dept-trend-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.dept-trend-trigger-note {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}
.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--appbar-height, 56px) + 12px) 12px 12px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(8px);
}
.chart-modal.visible { display: flex; }
.chart-modal-panel {
  width: min(1200px, calc(100vw - 24px));
  max-height: calc(100vh - var(--appbar-height, 56px) - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}
.chart-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 12px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.chart-modal-eyebrow {
  margin-bottom: 6px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chart-modal-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.chart-modal-meta {
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.chart-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chart-modal-close:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.chart-modal-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.chart-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.chart-mode-copy {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
.chart-mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
.chart-mode-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.chart-mode-btn:hover {
  background: #f8fafc;
  color: #334155;
}
.chart-mode-btn.is-active {
  background: #0f172a;
  color: #fff;
}
.chart-modal-controls {
  padding: 0 24px 12px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}
.chart-modal-chart {
  flex: 1 1 auto;
  height: min(400px, calc(100vh - var(--appbar-height, 56px) - 150px));
  padding: 0 24px 20px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 28%);
}

/* ── Sidebar ───────────────────────────────────── */
#budget-sidebar {
  position: fixed;
  top: var(--appbar-height, 56px);
  left: 0;
  bottom: 0;
  width: 260px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
  z-index: 30;
  transform: translateX(-100%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#budget-sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 20px rgba(0,0,0,0.08);
}
#sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--appbar-height, 56px);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 25;
}
#sidebar-overlay.visible { display: block; }
@media (min-width: 1024px) {
  #sidebar-overlay { display: none !important; }
}
@media (min-width: 1024px) {
  body.sidebar-open #page-wrapper { margin-left: 260px; }
}
@media (max-width: 767px) {
  #budget-sidebar,
  #sidebar-overlay {
    top: calc(var(--appbar-height, 56px) + 4px);
  }

  #budget-sidebar { width: 100%; }

  #page-wrapper {
    padding-top: calc(var(--appbar-height, 56px) + 6px);
  }

  #breadcrumb {
    padding-top: 8px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
#page-wrapper {
  padding-top: var(--appbar-height, 56px);
  transition: margin-left 0.25s ease;
}
/* Sidebar internals */
.sb-year-row {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.sb-year-row label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.sb-year-row select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
}
.sb-nav-links {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-nav-btn {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.sb-nav-btn:hover { background: #f1f5f9; color: #334155; }
.sb-nav-btn.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
#sidebar-areas {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sb-area-section { margin-bottom: 2px; }
.sb-area-header {
  padding: 7px 10px;
  margin: 0 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  transition: background 0.1s;
  user-select: none;
}
.sb-area-header:hover { background: #f8fafc; }
.sb-area-header.active { background: #eff6ff; color: #1d4ed8; }
.sb-area-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-area-name { flex: 1; }
.sb-chevron { font-size: 9px; color: #94a3b8; transition: transform 0.18s; }
.sb-area-section:not(.collapsed) .sb-chevron { transform: rotate(0deg); }
.sb-area-section.collapsed .sb-chevron { transform: rotate(-90deg); }
.sb-dept-list {
  padding: 2px 8px 4px 30px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sb-area-section.collapsed .sb-dept-list { display: none; }
.sb-dept-btn {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sb-dept-btn:hover { background: #f1f5f9; color: #1e293b; }
.sb-dept-btn.active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.sb-sidebar-footer {
  padding: 10px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.sb-footer-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sb-footer-link:hover,
.sb-footer-link.active {
  background: #eff6ff;
  color: #1d4ed8;
}
.sb-footer-link i {
  width: 1.25rem;
  font-size: 1rem;
  text-align: center;
  flex-shrink: 0;
}
/* Breadcrumb */
#breadcrumb { padding: 6px 24px 0; }

.about-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0 0 2rem;
}

.about-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  padding: 2rem 2.25rem;
  display: grid;
  gap: 1.5rem;
}

.about-card h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.about-card h2 {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  line-height: 1.2;
  color: #0f172a;
}

.about-card p {
  margin: 0;
  color: #475569;
  line-height: 1.72;
  font-size: 0.98rem;
}

.about-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 0.45rem;
}

.about-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 0.75rem;
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e2e8f0;
  float: right;
  margin: 0 0 1rem 1.5rem;
}

/* ── Responsive view layout (avoids Tailwind CDN timing issues) ── */
.view-columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 1024px) {
  .view-columns {
    flex-direction: row;
  }
}
.view-main {
  flex: 1 1 0%;
  min-width: 0;
}
.view-sidebar {
  flex-shrink: 0;
  width: 288px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.view-sidebar-sm {
  flex-shrink: 0;
  width: 256px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dept-lineitem-mobile-meta {
  display: none;
}
.lineitem-trend-chart {
  min-height: 0;
}
@media (max-width: 1023px) {
  .view-sidebar,
  .view-sidebar-sm {
    width: 100%;
    max-width: none;
    align-self: stretch;
  }

  .view-sidebar > *,
  .view-sidebar-sm > * {
    width: 100%;
  }
}

@media (max-width: 1023px) and (orientation: landscape) {
  .view-main {
    order: 2;
  }

  .view-sidebar,
  .view-sidebar-sm {
    order: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
  }

  .view-sidebar > *,
  .view-sidebar-sm > * {
    min-width: 0;
  }

  .view-sidebar > .notes-panel,
  .view-sidebar-sm > .notes-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .dept-trend-trigger {
    margin: 0 -6px;
    padding: 6px;
  }

  .dept-trend-trigger-note {
    margin-top: 8px;
    font-size: 13px;
  }

  .chart-modal {
    padding: calc(var(--appbar-height, 56px) + 4px) 6px 10px;
    align-items: stretch;
  }

  .chart-modal-panel {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100vh - var(--appbar-height, 56px) - 14px);
    max-height: calc(100vh - var(--appbar-height, 56px) - 14px);
    border-radius: 22px 22px 14px 14px;
    box-sizing: border-box;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.16);
  }

  .chart-modal-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
    opacity: 0.95;
  }

  .chart-modal-header {
    padding: 22px 16px 12px;
    flex-direction: column;
    gap: 12px;
  }

  .chart-modal-heading h2 {
    font-size: 1.4rem;
    line-height: 1.08;
  }

  .chart-modal-meta {
    font-size: 14px;
    line-height: 1.45;
  }

  .chart-modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .chart-mode-row {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 0;
    gap: 10px;
  }

  .chart-mode-copy {
    font-size: 14px;
  }

  .chart-mode-switch {
    width: 100%;
  }

  .chart-mode-btn {
    flex: 1 1 0%;
    min-height: 42px;
    font-size: 14px;
  }

  .chart-modal-controls {
    padding: 0 16px 12px;
  }

  .chart-modal-chart {
    height: auto;
    min-height: 260px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .sb-year-row {
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
  }

  .sb-year-row label {
    font-size: 12.5px;
    margin-bottom: 7px;
  }

  .sb-year-row select {
    min-height: 48px;
    padding: 11px 13px;
    font-size: 17px;
  }

  .sb-nav-links {
    padding: 10px 12px;
    gap: 6px;
  }

  .sb-nav-btn {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 18px;
    line-height: 1.3;
    border-radius: 10px;
  }

  .sb-area-header {
    min-height: 48px;
    padding: 11px 14px;
    margin: 0 10px;
    font-size: 17px;
    line-height: 1.3;
    gap: 10px;
    border-radius: 10px;
  }

  .sb-area-dot {
    width: 10px;
    height: 10px;
  }

  .sb-chevron {
    font-size: 11px;
  }

  .sb-dept-list {
    padding: 4px 10px 10px 20px;
    gap: 4px;
  }

  .sb-dept-btn {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    border-radius: 8px;
  }

  .sb-home-link {
    padding: 12px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .sb-home-btn {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 18px;
    line-height: 1.3;
    border-radius: 10px;
  }

  .sb-sidebar-footer {
    padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .sb-footer-link {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.3;
  }

  .sb-footer-link i {
    font-size: 1.05rem;
  }

  .view-columns {
    gap: 16px;
  }

  .view-main {
    order: 2;
  }

  .view-sidebar,
  .view-sidebar-sm {
    order: 1;
    width: 100%;
    max-width: none;
    gap: 12px;
  }

  .view-sidebar > *,
  .view-sidebar-sm > * {
    width: 100%;
  }

  #breadcrumb,
  #app-content .text-xs {
    font-size: 0.875rem;
    line-height: 1.45;
  }

  #app-content .text-sm {
    font-size: 1rem;
    line-height: 1.5;
  }

  #app-content .text-base {
    font-size: 1.0625rem;
    line-height: 1.55;
  }

  #app-content .text-lg {
    font-size: 1.1875rem;
    line-height: 1.4;
  }

  #app-content .text-xl {
    font-size: 1.3125rem;
    line-height: 1.35;
  }

  #app-content .text-2xl {
    font-size: 1.625rem;
    line-height: 1.25;
  }

  .badge-up,
  .badge-down,
  .badge-neutral,
  .badge-spike {
    font-size: 13px;
    padding: 3px 9px;
  }

  .note-scope {
    font-size: 12px;
  }

  .note-body {
    font-size: 14px;
    line-height: 1.6;
  }

  .dept-lineitems-heading {
    display: none;
  }

  .summary-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .summary-card-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .summary-card-value {
    font-size: 1.125rem;
    line-height: 1.4;
  }

  .dept-lineitems-table thead {
    display: none;
  }

  .dept-lineitem-primary {
    display: block;
    width: 100%;
  }

  .dept-lineitem-mobile-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
  }

  .dept-lineitem-mobile-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .dept-lineitem-mobile-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #94a3b8;
    text-transform: uppercase;
  }

  .dept-lineitem-amount,
  .dept-lineitem-change,
  .dept-lineitem-trend {
    display: none;
  }

  .lineitem-trend-card {
    padding: 14px;
  }

  .lineitem-trend-title {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.4;
  }

  .about-page {
    width: 100%;
  }

  .about-card {
    padding: 1.4rem 1.2rem;
    border-radius: 22px;
  }

  .about-card h1 {
    font-size: 1.75rem;
  }

  .about-card h2 {
    font-size: 1.15rem;
  }

  .about-photo {
    width: 144px;
    height: 144px;
    float: none;
    display: block;
    margin: 0 auto 1rem;
  }

  .lineitem-detail-table th,
  .lineitem-detail-table td {
    white-space: nowrap;
  }

  .lineitem-detail-perresident {
    display: none;
  }

  .lineitem-detail-table th,
  .lineitem-detail-table td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .lineitem-detail-table .lineitem-detail-year {
    padding-left: 16px;
  }

  .lineitem-detail-table .lineitem-detail-change {
    padding-right: 16px;
  }
}

@media (max-width: 1023px) and (orientation: landscape) {
  .chart-modal {
    padding: calc(var(--appbar-height, 56px) + 2px) 0 8px;
  }

  .chart-modal-panel {
    display: grid;
    grid-template-columns: clamp(148px, 24vw, 176px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - var(--appbar-height, 56px) - 10px);
    max-height: calc(100vh - var(--appbar-height, 56px) - 10px);
    border-radius: 18px 18px 0 0;
  }

  .chart-modal-panel::before {
    display: none;
  }

  .chart-modal-panel > * {
    min-width: 0;
  }

  .chart-modal-header {
    grid-column: 1;
    grid-row: 1;
    padding: 10px 10px 8px;
    gap: 8px;
    border-right: 1px solid #eef2f7;
    border-bottom: none;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  }

  .chart-modal-eyebrow {
    display: none;
  }

  .chart-modal-heading {
    min-width: 0;
    flex: 1 1 auto;
  }

  .chart-modal-heading h2 {
    font-size: 0.95rem;
    line-height: 1.1;
  }

  .chart-modal-meta {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .chart-modal-meta .badge-up,
  .chart-modal-meta .badge-down,
  .chart-modal-meta .badge-neutral,
  .chart-modal-meta .badge-spike {
    display: none;
  }

  .chart-modal-close {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    flex-shrink: 0;
  }

  .chart-modal-controls {
    grid-column: 1;
    grid-row: 2;
    padding: 8px 10px 10px;
    border-right: 1px solid #eef2f7;
    border-bottom: none;
    background: #f8fafc;
  }

  .chart-mode-row {
    gap: 6px;
    align-items: stretch;
  }

  .chart-modal-controls .chart-mode-copy {
    display: none;
  }

  .chart-mode-switch {
    width: 100%;
    padding: 2px;
  }

  .chart-mode-btn {
    min-height: 32px;
    font-size: 11px;
    padding: 6px 8px;
  }

  .chart-modal-chart {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 0;
    height: 100%;
    padding: 6px 8px 6px 4px;
    background: #ffffff;
  }
}
.notes-panel {
  border-color: #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note-card {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
}
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.note-scope {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.note-year {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: normal;
  text-align: center;
}
.note-body {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}
