    :root {
      --bg: #f4f1eb;
      --paper: rgba(255, 255, 255, 0.82);
      --surface: rgba(255, 255, 255, 0.82);
      --surface-strong: rgba(255, 255, 255, 0.94);
      --surface-soft: rgba(248, 246, 242, 0.82);
      --ink: #18212b;
      --muted: #5d6872;
      --line: rgba(24, 33, 43, 0.1);
      --line-strong: rgba(24, 33, 43, 0.16);
      --accent: #23425e;
      --accent-soft: #e6eef5;
      --success: #24664a;
      --success-soft: #e4f3ea;
      --warning: #9a6a20;
      --warning-soft: #fbf2df;
      --danger: #a14842;
      --shadow: 0 24px 60px rgba(24, 33, 43, 0.08);
      --sans: "Segoe UI Variable Text", "SF Pro Text", "Helvetica Neue", sans-serif;
      --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    }

    html {
      scrollbar-gutter: stable;
      -webkit-text-size-adjust: 100%;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: var(--sans);
      background:
        radial-gradient(circle at top left, rgba(255,255,255,0.92), rgba(255,255,255,0) 38%),
        linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
      color: var(--ink);
      min-height: 100vh;
      padding: 24px;
    }
    a { color: inherit; text-decoration: none; }
    button,
    input,
    select { font: inherit; }
    button { cursor: pointer; }

    .page {
      max-width: 1180px;
      margin: 0 auto;
    }
    .frame {
      background: var(--paper);
      border: 1px solid rgba(255,255,255,0.7);
      box-shadow: var(--shadow);
      border-radius: 36px;
      backdrop-filter: blur(18px);
      overflow: hidden;
      animation: page-soft-rise 0.45s ease-out both;
    }
    .content > .panel.headline,
    .content > .state-panel,
    .content > .view-section {
      animation: page-soft-rise 0.42s ease-out both;
      animation-delay: 0.08s;
    }
    @keyframes page-soft-rise {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @media (prefers-reduced-motion: reduce) {
      .frame,
      .content > .panel.headline,
      .content > .state-panel,
      .content > .view-section {
        animation: none;
      }
    }
    .nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 22px 26px;
      border-bottom: 1px solid var(--line);
    }
    .brand {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      font-size: 1.2rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .brand-mark {
      width: 32px;
      height: 32px;
      flex-shrink: 0;
      display: block;
      filter: drop-shadow(0 2px 5px rgba(35, 66, 94, 0.22));
    }
    .nav-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .nav-link,
    .nav-pill,
    .filter-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 12px 18px;
      font-size: 0.9rem;
      font-weight: 700;
      border: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.8);
      color: var(--ink);
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    }
    .nav-link:hover,
    .filter-btn:hover {
      transform: translateY(-1px);
    }
    .nav-pill {
      color: var(--ink);
      cursor: default;
    }
    .nav-pill[aria-current="page"] {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(230, 238, 245, 0.65));
      border-color: rgba(35, 66, 94, 0.34);
      box-shadow:
        0 0 0 1px rgba(35, 66, 94, 0.06),
        0 4px 16px rgba(35, 66, 94, 0.1);
      color: var(--accent);
    }
    .nav-danger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 12px 18px;
      font-size: 0.9rem;
      font-weight: 700;
      border: 1px solid rgba(161, 72, 66, 0.18);
      background: rgba(255, 255, 255, 0.8);
      color: var(--danger);
      cursor: pointer;
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    }
    .nav-danger:hover {
      transform: translateY(-1px);
    }
    .nav-menu-btn {
      display: none;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      padding: 0;
      border-radius: 999px;
      border: 1px solid var(--line-strong);
      background: #ffffff;
      color: var(--accent);
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(24, 33, 43, 0.05);
      flex-shrink: 0;
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }
    .nav-menu-btn:hover {
      border-color: rgba(35, 66, 94, 0.28);
      box-shadow: 0 6px 16px rgba(24, 33, 43, 0.08);
    }
    .nav-menu-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(35, 66, 94, 0.2);
    }
    .nav-menu-panel {
      display: none;
    }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .content {
      padding: 24px;
      display: grid;
      gap: 18px;
    }
    .panel {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 30px;
      padding: 28px;
    }
    .panel-soft {
      background: var(--surface-soft);
    }
    .headline {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 18px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.86)),
        linear-gradient(135deg, rgba(230,238,245,0.3), rgba(255,255,255,0));
    }
    /* Match settings (API key) + profile page h1: sans, same scale as other app chrome. */
    .headline h1 {
      font-family: var(--sans);
      font-size: clamp(2rem, 4vw, 2.8rem);
      font-weight: 760;
      letter-spacing: -0.03em;
      line-height: 1.05;
      margin-bottom: 16px;
    }
    .scope-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
    }
    .scope-summary {
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.6;
    }
    .clear-link {
      display: none;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 10px 14px;
      border: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.84);
      color: var(--ink);
      font-size: 0.84rem;
      font-weight: 700;
      transition: transform 0.16s ease, border-color 0.16s ease;
    }
    .clear-link:hover {
      transform: translateY(-1px);
    }
    .clear-link--stable {
      display: inline-flex;
      min-width: 138px;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: transform 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
    }
    .clear-link--stable.is-visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .state-panel {
      text-align: center;
      padding: 72px 24px;
    }
    .state-panel h2 {
      font-size: 1.2rem;
      letter-spacing: -0.02em;
      margin-bottom: 8px;
    }
    .state-panel p {
      color: var(--muted);
      line-height: 1.68;
    }
    .state-panel a {
      color: var(--accent);
      font-weight: 700;
    }
    .spinner {
      width: 30px;
      height: 30px;
      border: 3px solid rgba(24, 33, 43, 0.12);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
      margin-bottom: 18px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    .dashboard {
      display: grid;
      gap: 18px;
    }
    .metrics-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }
    .metric-card {
      background: var(--surface-strong);
      border: 1px solid var(--line);
      border-radius: 24px;
      padding: 18px;
      display: grid;
      gap: 10px;
    }
    /* Same family as workspace “Analysis summary” metrics (index): green → amber → navy → purple */
    .metric-card.success {
      background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, transparent 42%),
        linear-gradient(180deg, rgba(36, 102, 74, 0.2) 0%, rgba(36, 102, 74, 0.09) 100%);
      border-color: rgba(36, 102, 74, 0.34);
    }
    .metric-card.warning {
      background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.45) 0%, transparent 42%),
        linear-gradient(180deg, rgba(154, 106, 32, 0.2) 0%, rgba(154, 106, 32, 0.09) 100%);
      border-color: rgba(154, 106, 32, 0.32);
    }
    .metric-card.neutral {
      background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.45) 0%, transparent 42%),
        linear-gradient(180deg, rgba(53, 98, 146, 0.2) 0%, rgba(53, 98, 146, 0.09) 100%);
      border-color: rgba(53, 98, 146, 0.3);
    }
    .metric-card.accent {
      background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.45) 0%, transparent 42%),
        linear-gradient(180deg, rgba(99, 84, 167, 0.2) 0%, rgba(99, 84, 167, 0.09) 100%);
      border-color: rgba(99, 84, 167, 0.3);
    }
    .metric-label {
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #000;
      font-weight: 700;
    }
    .metric-value {
      font-size: clamp(1.5rem, 2.3vw, 2rem);
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1;
    }
    .metric-card-editable {
      position: relative;
    }
    .metric-label-row {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .metric-edit-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      padding: 0;
      border: none;
      background: transparent;
      color: #000;
      border-radius: 6px;
      cursor: pointer;
      transition: background 120ms ease, color 120ms ease;
    }
    .metric-edit-btn:hover,
    .metric-edit-btn[aria-expanded="true"] {
      background: rgba(35, 66, 94, 0.08);
      color: var(--accent);
    }
    .metric-popover {
      position: absolute;
      top: calc(100% + 6px);
      left: 14px;
      right: 14px;
      z-index: 40;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 16px;
      box-shadow: 0 14px 32px rgba(35, 66, 94, 0.14);
      padding: 12px;
      display: grid;
      gap: 10px;
    }
    .metric-popover[hidden] {
      display: none;
    }
    .metric-popover-label {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #7a8390;
      font-weight: 700;
    }
    .rolling-presets {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .rolling-preset {
      flex: 1 1 auto;
      min-width: 38px;
      padding: 6px 8px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: #fff;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--accent);
      cursor: pointer;
      transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    }
    .rolling-preset:hover {
      border-color: var(--accent);
    }
    .rolling-preset.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }
    .rolling-custom {
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .rolling-custom input {
      flex: 1;
      min-width: 0;
      padding: 6px 10px;
      border-radius: 10px;
      border: 1px solid var(--line);
      font-size: 0.85rem;
      background: #fff;
      color: var(--accent);
      font-weight: 600;
    }
    .rolling-custom input:focus {
      outline: none;
      border-color: var(--accent);
    }
    .rolling-ok {
      padding: 6px 12px;
      border-radius: 10px;
      border: 1px solid var(--accent);
      background: var(--accent);
      color: #fff;
      font-size: 0.8rem;
      font-weight: 700;
      cursor: pointer;
      transition: opacity 120ms ease;
    }
    .rolling-ok:hover {
      opacity: 0.88;
    }
    /* Spend Trend | Compare — column mix shifts with month count (see --density classes). */
    .insight-grid {
      display: grid;
      gap: 18px;
      align-items: stretch;
    }
    .insight-grid--density-a {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .insight-grid--density-b {
      grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    }
    .insight-grid--density-c {
      grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    }
    .insight-aside {
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .insight-compare-inner {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
    .compare-head-tools {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }
    .compare-mode-pills {
      display: inline-flex;
      gap: 3px;
      padding: 4px;
      background: var(--surface-soft);
      border: 1px solid var(--line);
      border-radius: 999px;
    }
    .compare-mode-pill {
      border: none;
      border-radius: 999px;
      padding: 7px 14px;
      font-size: 0.76rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
      background: transparent;
      cursor: pointer;
    }
    .compare-mode-pill:hover {
      color: var(--ink);
    }
    .compare-mode-pill.active {
      background: var(--accent);
      color: #fff;
    }
    .compare-chart-shell {
      display: grid;
      grid-template-columns: minmax(20px, 26px) 50px minmax(0, 1fr);
      gap: 6px 10px;
      align-items: stretch;
      flex: 1;
      min-height: 200px;
    }
    .compare-y-axis-label {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-bottom: 26px;
      border-right: 1px solid rgba(24, 33, 43, 0.08);
    }
    .compare-y-axis-label-text {
      writing-mode: vertical-rl;
      text-orientation: mixed;
      transform: rotate(180deg);
      font-size: 0.58rem;
      font-weight: 800;
      letter-spacing: 0.11em;
      text-transform: uppercase;
      color: #5c6570;
      line-height: 1.2;
      max-height: 100%;
    }
    .compare-y-axis {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      font-size: 0.65rem;
      letter-spacing: 0.02em;
      color: #7a8390;
      font-weight: 700;
      text-align: right;
      padding-bottom: 26px;
      line-height: 1.2;
      border-right: 1px solid rgba(24, 33, 43, 0.1);
      padding-right: 4px;
    }
    .compare-plot {
      display: flex;
      flex-direction: column;
      min-width: 0;
      flex: 1;
    }
    .compare-bars {
      flex: 1;
      display: flex;
      align-items: stretch;
      justify-content: stretch;
      min-height: 156px;
      border-bottom: 1px solid rgba(24, 33, 43, 0.12);
      padding-bottom: 0;
    }
    .compare-bar-col {
      flex: 1 1 0;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-end;
    }
    /* Label anchored just above the bar; fill height stays h% of track (y-axis accurate). */
    .compare-bar-stack {
      --compare-h-pct: 0%;
      position: relative;
      width: 100%;
      max-width: 56px;
      margin: 0 auto;
      min-height: 0;
      flex: 1 1 auto;
    }
    .compare-bar-value {
      position: absolute;
      left: 0;
      right: 0;
      bottom: calc(var(--compare-h-pct) + 3px);
      z-index: 1;
      font-size: 0.68rem;
      font-weight: 800;
      color: var(--accent);
      letter-spacing: -0.02em;
      text-align: center;
      white-space: nowrap;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .compare-bar-track {
      flex: 1 1 auto;
      width: 100%;
      margin: 0 auto;
      min-height: 104px;
      display: flex;
      align-items: stretch;
      justify-content: center;
      border-radius: 12px 12px 0 0;
      background: transparent;
    }
    .compare-bar-fill {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      height: var(--compare-h-pct);
      min-height: 3px;
      border-radius: 12px 12px 0 0;
    }
    .compare-x-labels {
      display: flex;
      justify-content: stretch;
      padding-top: 10px;
      gap: inherit;
    }
    .compare-x-labels span {
      flex: 1 1 0;
      min-width: 0;
      text-align: center;
      font-size: 0.72rem;
      font-weight: 800;
      color: var(--muted);
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .compare-footnote {
      margin-top: 12px;
      font-size: 0.74rem;
      line-height: 1.45;
      color: var(--muted);
      font-weight: 600;
    }
    .compare-empty {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 140px;
      color: var(--muted);
      font-size: 0.88rem;
      text-align: center;
      padding: 16px 8px;
    }
    .trend-head-wrap {
      position: relative;
      flex-shrink: 0;
    }
    .trend-month-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      padding: 0;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.9);
      color: var(--accent);
      cursor: pointer;
      transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
    }
    .trend-month-btn:hover,
    .trend-month-btn[aria-expanded="true"] {
      border-color: rgba(35, 66, 94, 0.28);
      background: rgba(35, 66, 94, 0.05);
    }
    .trend-month-popover {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      left: auto;
      min-width: 240px;
      max-width: min(320px, calc(100vw - 48px));
      z-index: 50;
    }
    .trend-month-popover[hidden] {
      display: none;
    }
    .trend-month-checks {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: min(280px, 42vh);
      overflow-y: auto;
    }
    .trend-month-option {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--accent);
      transition: background 120ms ease;
    }
    .trend-month-option:hover {
      background: rgba(35, 66, 94, 0.06);
    }
    .trend-month-option input {
      width: 16px;
      height: 16px;
      accent-color: var(--accent);
      flex-shrink: 0;
    }
    .trend-month-option input:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .trend-month-cap-note {
      margin: 10px 0 0;
      padding-top: 10px;
      border-top: 1px solid var(--line);
      font-size: 0.74rem;
      line-height: 1.45;
      color: var(--muted);
      font-weight: 600;
    }
    .trend-month-cap-note strong {
      color: var(--ink);
      font-weight: 800;
    }
    .section-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 14px;
      margin-bottom: 18px;
    }
    .section-head h2 {
      font-size: 1.1rem;
      letter-spacing: -0.02em;
    }
    .section-head span {
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 700;
      white-space: nowrap;
    }

    .trend-list,
    .merchant-list,
    .card-list {
      display: grid;
      gap: 12px;
    }
    .interactive-row {
      width: 100%;
      border: 1px solid transparent;
      background: transparent;
      color: var(--ink);
      text-align: left;
      padding: 12px 14px;
      border-radius: 18px;
      transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
    }
    .interactive-row:hover {
      background: rgba(255,255,255,0.7);
      border-color: var(--line);
      transform: translateY(-1px);
    }
    /* Active filter: thin accent bar + tint. Cards & merchants only (Spend
       Trend months are chosen via the header popover, not row clicks). */
    .interactive-row.active {
      background: rgba(35, 66, 94, 0.04);
      border-color: transparent;
      box-shadow: inset 3px 0 0 var(--accent);
    }
    .trend-row,
    .merchant-row,
    .card-row {
      display: grid;
      gap: 10px;
      align-items: center;
    }
    .trend-row {
      grid-template-columns: 98px minmax(0, 1fr) auto;
      padding: 12px 14px;
      border-radius: 18px;
      border: 1px solid transparent;
      background: rgba(255, 255, 255, 0.45);
    }
    .trend-label,
    .merchant-label,
    .card-label {
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    .trend-track,
    .share-track {
      position: relative;
      height: 10px;
      border-radius: 999px;
      background: rgba(24, 33, 43, 0.08);
      overflow: hidden;
    }
    .trend-fill,
    .share-fill {
      position: absolute;
      inset: 0 auto 0 0;
      border-radius: 999px;
      background: linear-gradient(90deg, #2b5376, #7f9cb8);
    }
    .trend-value,
    .merchant-value,
    .card-value {
      font-size: 0.92rem;
      font-weight: 700;
      white-space: nowrap;
    }
    .card-row {
      grid-template-columns: minmax(0, 1fr) auto;
      padding: 14px 0;
      border-top: 1px solid var(--line);
    }
    .card-row:first-child {
      border-top: none;
      padding-top: 0;
    }
    .card-meta,
    .merchant-meta {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.5;
    }
    /* --- "Top X" table shell ---------------------------------------------
       Shared table-style container used by Top Cards and Top Merchants.
       Tinted header strip matches the Transactions `thead` aesthetic; row
       delineation is by border-bottom (not gap) so the contents read as a
       proper table. */
    .top-table {
      border: 1px solid var(--line);
      border-radius: 18px;
      overflow: hidden;
      background: rgba(255,255,255,0.6);
    }
    .top-thead {
      display: grid;
      grid-template-columns: minmax(0, 1.7fr) minmax(140px, 1.3fr) auto;
      gap: 14px;
      padding: 12px 20px;
      background: rgba(248,246,242,0.7);
      border-bottom: 1px solid var(--line);
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #7a8390;
      font-weight: 700;
      align-items: center;
    }
    .top-thead span:last-child { text-align: right; }

    /* The list ditches gap-based layout and uses row borders. Applies to
       both the merchants list and the cards list when they're inside a
       .top-table shell. */
    .top-table .merchant-list,
    .top-table .card-list { display: block; }
    .top-table .merchant-row,
    .top-table .card-row {
      /* Two-row grid: bar + $ share the first data row (centered together);
         "% of spend" sits below spanning Share+Total columns. */
      grid-template-columns: minmax(0, 1.7fr) minmax(140px, 1.3fr) auto;
      grid-template-rows: auto auto;
      grid-template-areas:
        "top-name share-track top-value"
        "top-name share-meta share-meta";
      gap: 6px 14px;
      padding: 14px 20px;
      border: none;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      align-items: center;
    }
    .top-table .merchant-row:last-child,
    .top-table .card-row:last-child { border-bottom: none; }
    /* Flatten the default interactive-row hover lift inside the table so
       rows don't detach from their neighbors. */
    .top-table .merchant-row:hover,
    .top-table .card-row:hover {
      transform: none;
      background: rgba(255,255,255,0.85);
      border-color: transparent;
      border-bottom-color: var(--line);
    }
    .top-table .merchant-row:last-child:hover,
    .top-table .card-row:last-child:hover { border-bottom-color: transparent; }

    .top-table .top-name-col {
      grid-area: top-name;
      min-width: 0;
      align-self: start;
    }
    .top-table .share-track {
      grid-area: share-track;
      align-self: center;
      min-width: 0;
    }
    .top-table .top-value-col {
      grid-area: top-value;
      align-self: center;
    }
    .top-table .top-share-label {
      grid-area: share-meta;
      color: var(--muted);
      font-size: 0.78rem;
    }
    .top-value-col {
      font-size: 0.95rem;
      font-weight: 700;
      white-space: nowrap;
      text-align: right;
    }
    .mini-empty {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.65;
      padding: 10px 0 2px;
    }

    .ledger-panel {
      padding: 0;
      overflow: hidden;
    }
    .ledger-filters {
      padding: 18px 28px;
      border-bottom: 1px solid var(--line);
      background: rgba(255,255,255,0.9);
      display: grid;
      gap: 16px;
    }
    .ledger-count-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    /* Export — shared placement: icon + short label, aligned with count/clear cluster */
    .view-head-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }
    .export-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 9px 14px;
      min-height: 40px;
      border-radius: 12px;
      border: 1px solid rgba(35, 66, 94, 0.22);
      background: rgba(255, 255, 255, 0.95);
      color: var(--ink);
      font: inherit;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      cursor: pointer;
      transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
    }
    .export-btn:hover {
      border-color: rgba(35, 66, 94, 0.38);
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(35, 66, 94, 0.1);
    }
    .export-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(35, 66, 94, 0.2);
    }
    .export-btn-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      flex-shrink: 0;
    }
    .export-btn-label {
      line-height: 1;
    }

    .ledger-tools {
      display: grid;
      gap: 20px;
      align-items: end;
    }
    .ledger-filters .ledger-tools:first-of-type {
      grid-template-columns: minmax(0, 1fr) auto minmax(280px, 1fr);
    }
    .ledger-filters .ledger-tools:last-of-type {
      grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    }
    .control {
      display: grid;
      gap: 8px;
    }
    .control label {
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--ink);
      font-weight: 700;
    }
    .search-input,
    .card-select {
      width: 100%;
      min-height: 48px;
      padding: 0 15px;
      border-radius: 16px;
      border: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.96);
      color: var(--ink);
      outline: none;
    }
    .search-input:focus,
    .card-select:focus {
      border-color: rgba(35, 66, 94, 0.42);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .filter-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .filter-btn {
      padding: 11px 14px;
      font-size: 0.84rem;
      min-height: 48px;
    }
    .filter-btn.active {
      background: var(--accent);
      color: #ffffff;
      border-color: transparent;
      box-shadow: 0 14px 28px rgba(35, 66, 94, 0.16);
    }

    .ledger-filters .ledger-tools + .ledger-tools {
      /* Negative margin pulls row 2 (Month/Amount) closer to row 1
         (Search/Status/Card). The `.ledger-filters` grid gap is 16px, so the
         effective spacing here is (16 + this value). Use 0 for 16px,
         -6 for 10px, -10 for 6px, etc. */
      margin-top: -6px;
    }
    .amount-row {
      display: grid;
      grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
      gap: 8px;
      align-items: stretch;
    }
    #transactionsView .amount-row {
      grid-template-columns: minmax(0, 110px) 100px;
      justify-content: start;
    }
    .amount-op {
      width: 100%;
      min-height: 48px;
      padding: 0 12px;
      border-radius: 16px;
      border: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.96);
      color: var(--ink);
      font: inherit;
      outline: none;
      transition: border-color 0.16s ease, box-shadow 0.16s ease;
    }
    .amount-op:focus {
      border-color: rgba(35, 66, 94, 0.42);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .amount-input-wrap {
      display: flex;
      align-items: center;
      min-height: 48px;
      padding: 0 14px;
      border-radius: 16px;
      border: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.96);
      transition: border-color 0.16s ease, box-shadow 0.16s ease;
    }
    .amount-input-wrap:focus-within {
      border-color: rgba(35, 66, 94, 0.42);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .amount-prefix {
      color: var(--muted);
      font-weight: 700;
      margin-right: 6px;
    }
    .amount-input {
      flex: 1;
      min-width: 0;
      border: none;
      background: transparent;
      padding: 0;
      font: inherit;
      color: var(--ink);
      outline: none;
      min-height: 44px;
      appearance: textfield;
    }
    .amount-input::-webkit-outer-spin-button,
    .amount-input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    .batches-tools {
      grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(190px, 0.8fr);
      gap: 12px;
      padding: 18px 28px;
      border-bottom: 1px solid var(--line);
      background: rgba(255,255,255,0.9);
    }
    .batches-count-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .table-wrap {
      overflow-x: auto;
    }
    table {
      width: 100%;
      border-collapse: collapse;
    }
    .ledger-table {
      table-layout: fixed;
    }
    .ledger-col-date {
      width: 16%;
    }
    .ledger-col-merchant {
      width: 29%;
    }
    .ledger-col-card {
      width: 19%;
    }
    .ledger-col-status {
      width: 220px;
    }
    .ledger-col-amount {
      width: 230px;
    }
    thead th {
      text-align: left;
      padding: 15px 24px;
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #7a8390;
      font-weight: 700;
      border-bottom: 1px solid var(--line);
      background: rgba(248,246,242,0.7);
    }
    .amount-head {
      text-align: left;
    }
    tbody td {
      padding: 18px 24px;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
      font-size: 0.94rem;
    }
    tbody tr:last-child td {
      border-bottom: none;
    }
    .ledger-editable,
    .merchant-cell-shell,
    .amount-cell-inner {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .merchant-cell-shell {
      justify-content: space-between;
      align-items: center;
    }
    .merchant-cell {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .merchant-name {
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    .merchant-sub {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.45;
    }
    .merchant-sub-separator {
      color: rgba(27, 39, 51, 0.58);
      font-size: 0.72rem;
      line-height: 1;
    }
    .merchant-note-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 0;
      padding: 0;
      border: none;
      background: transparent;
      color: var(--accent);
      font: inherit;
      font-weight: 700;
      line-height: inherit;
      white-space: nowrap;
      cursor: pointer;
    }
    .merchant-note-link:hover {
      color: #162f45;
      text-decoration: underline;
      text-underline-offset: 4px;
    }
    .merchant-note-link:focus-visible {
      outline: 2px solid rgba(35, 66, 94, 0.34);
      outline-offset: 3px;
      border-radius: 4px;
    }
    .amount-cell {
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
      text-align: left;
    }
    .amount-cell-inner {
      display: inline-grid;
      grid-template-columns: 88px 32px 32px;
      align-items: center;
      column-gap: 8px;
      justify-content: flex-start;
      margin-left: -41.5px;
    }
    .date-cell .ledger-editable {
      display: inline-grid;
      grid-template-columns: 110px 32px;
      align-items: center;
      column-gap: 10px;
      justify-content: flex-start;
    }
    .date-cell .ledger-editable-text {
      display: block;
      width: 100%;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .amount-value {
      display: block;
      width: 100%;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }
    .amount-value,
    .ledger-editable-text {
      min-width: 0;
    }
    .card-cell {
      color: var(--ink);
      line-height: 1.45;
    }
    .cell-icon-btn,
    .status-toggle-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      padding: 0;
      border-radius: 999px;
      border: 1px solid rgba(35, 66, 94, 0.18);
      background: rgba(255, 255, 255, 0.94);
      color: var(--accent);
      cursor: pointer;
      flex-shrink: 0;
      transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, opacity 120ms ease;
    }
    .cell-icon-btn:hover:not(:disabled),
    .status-toggle-btn:hover:not(:disabled) {
      background: rgba(35, 66, 94, 0.06);
      border-color: rgba(35, 66, 94, 0.36);
    }
    .cell-icon-btn:active:not(:disabled),
    .status-toggle-btn:active:not(:disabled) {
      transform: scale(0.96);
    }
    .cell-icon-btn:disabled,
    .status-toggle-btn:disabled {
      opacity: 0.55;
      cursor: default;
    }
    .cell-icon-btn svg,
    .status-toggle-btn svg {
      display: block;
    }
    .tx-memo-btn {
      color: #65788a;
      border-color: rgba(35, 66, 94, 0.16);
    }
    .tx-memo-btn:hover:not(:disabled) {
      color: var(--accent);
      background: rgba(35, 66, 94, 0.055);
      border-color: rgba(35, 66, 94, 0.32);
    }
    .tx-memo-btn--active {
      color: var(--accent);
      background: rgba(35, 66, 94, 0.075);
      border-color: rgba(35, 66, 94, 0.28);
      box-shadow: inset 0 0 0 1px rgba(35, 66, 94, 0.02);
    }
    .cell-icon-btn--confirm {
      color: var(--success);
      border-color: rgba(36, 102, 74, 0.26);
    }
    .cell-icon-btn--confirm:hover:not(:disabled) {
      background: rgba(36, 102, 74, 0.08);
      border-color: rgba(36, 102, 74, 0.38);
    }
    .cell-icon-btn--cancel {
      color: var(--danger);
      border-color: rgba(161, 72, 66, 0.24);
    }
    .cell-icon-btn--cancel:hover:not(:disabled) {
      background: rgba(161, 72, 66, 0.08);
      border-color: rgba(161, 72, 66, 0.36);
    }
    .status-toggle-btn--settled {
      color: var(--success);
      border-color: rgba(36, 102, 74, 0.24);
    }
    .status-toggle-btn--settled:hover:not(:disabled) {
      background: rgba(36, 102, 74, 0.08);
      border-color: rgba(36, 102, 74, 0.36);
    }
    .status-toggle-btn--pending {
      color: var(--warning);
      border-color: rgba(154, 106, 32, 0.26);
    }
    .status-toggle-btn--pending:hover:not(:disabled) {
      background: rgba(154, 106, 32, 0.08);
      border-color: rgba(154, 106, 32, 0.38);
    }
    .inline-edit-box {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .inline-edit-box--merchant {
      width: 100%;
    }
    .inline-edit-input {
      width: 100%;
      min-width: 0;
      height: 40px;
      border-radius: 14px;
      border: 1px solid var(--line-strong);
      background: rgba(255, 255, 255, 0.98);
      padding: 0 14px;
      font: inherit;
      color: var(--ink);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    }
    .inline-edit-input:focus {
      outline: none;
      border-color: rgba(35, 66, 94, 0.34);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .inline-edit-input--amount {
      appearance: textfield;
      border: none;
      box-shadow: none;
      background: transparent;
      height: auto;
      padding: 0;
    }
    .inline-edit-input--amount::-webkit-outer-spin-button,
    .inline-edit-input--amount::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    .inline-edit-amount-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 116px;
      height: 40px;
      padding: 0 14px;
      border-radius: 14px;
      border: 1px solid var(--line-strong);
      background: rgba(255, 255, 255, 0.98);
    }
    .inline-edit-amount-wrap:focus-within {
      border-color: rgba(35, 66, 94, 0.34);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .inline-edit-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .mobile-ledger-row {
      display: none;
    }
    .tx-modal-card .modal-actions {
      justify-content: flex-end;
    }
    /* Match value typography to status pill; keeps grid calm on long card names. */
    .tx-modal-stats .modal-stat > strong:not(.modal-status-pill) {
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      line-height: 1.4;
      color: var(--ink);
      font-variant-numeric: tabular-nums;
    }
    .tx-modal-stats .modal-stat > strong#txModalCardBrand {
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    .status-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 8px 11px;
      border-radius: 999px;
      font-size: 0.76rem;
      font-weight: 700;
      border: 1px solid var(--line);
      background: rgba(255,255,255,0.82);
      white-space: nowrap;
    }
    .status-pill::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
    }
    .status-pill.pending {
      background: var(--warning-soft);
      color: var(--warning);
      border-color: rgba(154, 106, 32, 0.18);
    }
    .status-pill.pending::before {
      background: var(--warning);
    }

    tbody tr.ledger-row-pending {
      box-shadow: inset 3px 0 0 var(--warning);
    }
    .status-cell-inner {
      display: inline-grid;
      grid-template-columns: 126px 32px;
      align-items: center;
      column-gap: 10px;
    }

    .ledger-empty {
      padding: 48px 24px 52px;
      text-align: center;
      color: var(--muted);
      line-height: 1.65;
    }

    @media (max-width: 1180px) {
      .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .insight-grid.insight-grid--density-a,
      .insight-grid.insight-grid--density-b,
      .insight-grid.insight-grid--density-c {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .insight-grid > .insight-aside {
        grid-column: 1 / -1;
      }
      .ledger-tools {
        grid-template-columns: 1fr;
      }
    }

    .view-switcher {
      display: flex;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
      margin-top: 18px;
    }
    .view-tabs {
      display: inline-flex;
      gap: 6px;
      padding: 5px;
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
    }
    .view-tab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid transparent;
      border-radius: 999px;
      padding: 9px 18px;
      font-size: 0.88rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: var(--ink);
      background: rgba(255, 255, 255, 0.55);
      transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }
    .view-tab:hover {
      color: var(--ink);
      background: rgba(255, 255, 255, 0.95);
      border-color: var(--line);
    }
    .view-tab.active {
      background: var(--accent);
      color: #ffffff;
      border-color: transparent;
      box-shadow: 0 10px 22px rgba(35, 66, 94, 0.18);
    }
    .view-section {
      display: grid;
      gap: 18px;
    }
    .view-section[hidden] {
      display: none;
    }

    .batches-panel {
      padding: 0;
      overflow: hidden;
    }
    /* Summary: export-only strip — spacing comes from .content gap + .view-section gap only,
       so the row sits evenly between the headline panel and the metric cards (no negative margin
       or extra bottom padding throwing the rhythm off). */
    .summary-export-bar {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      padding: 0;
      margin-top: 0;
      border-bottom: none;
    }
    .summary-export-bar .view-head-actions {
      gap: 10px;
    }

    /* Same column template as .ledger-tools: CSV sits in column 3, right edge
       aligned with Card (Transactions) or Items (Batches) below. Clear stays left of CSV. */
    .batches-top,
    .transactions-top {
      padding: 26px 28px 18px;
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(190px, 0.8fr);
      gap: 12px;
      align-items: end;
      border-bottom: 1px solid var(--line);
    }
    .batches-top > div:first-of-type,
    .transactions-top > div:first-of-type {
      grid-column: 1 / 3;
      min-width: 0;
    }
    .batches-top .view-head-actions,
    .transactions-top .view-head-actions {
      grid-column: 3;
      justify-self: stretch;
      width: 100%;
      justify-content: flex-end;
    }

    /* Placed after base header rules so it wins over the 3-column template. */
    @media (max-width: 1180px) {
      .batches-top,
      .transactions-top {
        grid-template-columns: 1fr;
      }
      .batches-top > div:first-of-type,
      .transactions-top > div:first-of-type {
        grid-column: 1;
      }
      .batches-top .view-head-actions,
      .transactions-top .view-head-actions {
        grid-column: 1;
        justify-content: flex-end;
      }
    }

    .batches-top h2,
    .transactions-top h2 {
      font-size: 1.1rem;
      letter-spacing: -0.02em;
      margin-bottom: 4px;
    }
    .batches-top p,
    .transactions-top p {
      color: var(--muted);
      font-size: 0.86rem;
      line-height: 1.55;
    }
    .batches-list {
      display: grid;
      gap: 0;
    }
    .batch-row {
      width: 100%;
      display: grid;
      grid-template-columns: minmax(180px, 1.3fr) 90px 110px 110px minmax(0, 1.4fr) 44px;
      gap: 18px;
      align-items: center;
      padding: 18px 28px;
      border: none;
      background: transparent;
      color: var(--ink);
      border-bottom: 1px solid var(--line);
      text-align: left;
      transition: background 0.16s ease;
    }
    .batch-row:last-child {
      border-bottom: none;
    }
    .batch-row:hover {
      background: rgba(35, 66, 94, 0.035);
    }
    .batch-cell-primary strong {
      display: block;
      font-size: 0.96rem;
      letter-spacing: -0.01em;
      margin-bottom: 3px;
    }
    .batch-cell-primary span {
      color: var(--muted);
      font-size: 0.82rem;
    }
    .batch-mobile-inline {
      display: none;
    }
    .batch-cell-number {
      font-weight: 700;
      letter-spacing: -0.02em;
      font-size: 0.96rem;
    }
    .batch-cell-sub {
      color: var(--muted);
      font-size: 0.78rem;
      margin-top: 2px;
    }
    .batch-cell-card {
      color: var(--ink);
      font-size: 0.88rem;
      line-height: 1.4;
    }
    .batch-cell-card .mixed-flag {
      display: inline-block;
      margin-left: 6px;
      font-size: 0.72rem;
      color: var(--warning);
      font-weight: 700;
    }
    .batch-chevron {
      width: 34px;
      height: 34px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,0.8);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
    }
    .batch-row:hover .batch-chevron {
      color: var(--accent);
      border-color: rgba(35, 66, 94, 0.28);
      transform: translateX(1px);
    }
    .batch-chevron svg {
      width: 14px;
      height: 14px;
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(24, 33, 43, 0.38);
      backdrop-filter: blur(6px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
      padding: 24px;
    }
    .modal-overlay.visible {
      display: flex;
      animation: modal-fade 0.18s ease-out;
    }
    @keyframes modal-fade {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    .modal-card {
      width: min(560px, 100%);
      max-height: calc(100vh - 48px);
      overflow-y: auto;
      background: #ffffff;
      border: 1px solid var(--line);
      border-radius: 28px;
      box-shadow: 0 40px 100px rgba(24, 33, 43, 0.28);
      padding: 28px;
      animation: modal-pop 0.2s ease-out;
    }
    @keyframes modal-pop {
      from { opacity: 0; transform: translateY(6px) scale(0.98); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    .modal-title {
      font-family: var(--serif);
      font-size: 1.6rem;
      font-weight: 600;
      letter-spacing: -0.03em;
      margin-bottom: 8px;
    }
    .modal-subtitle {
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.6;
      margin-bottom: 22px;
    }
    .modal-section {
      border-top: 1px solid var(--line);
      padding-top: 16px;
      margin-top: 16px;
    }
    .modal-section:first-of-type {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }
    .modal-section h3 {
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #7a8390;
      font-weight: 700;
      margin-bottom: 10px;
    }
    .modal-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .modal-stat {
      background: var(--surface-soft);
      border: 1px solid rgba(24, 33, 43, 0.06);
      border-radius: 16px;
      padding: 12px 14px;
    }
    .modal-stat span {
      display: block;
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #7a8390;
      font-weight: 700;
      margin-bottom: 3px;
    }
    .modal-stat strong {
      font-size: 1.05rem;
      letter-spacing: -0.02em;
    }
    .modal-tx-list {
      display: grid;
      gap: 8px;
      max-height: 220px;
      overflow-y: auto;
      padding-right: 4px;
    }
    .modal-tx-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,0.76);
      border: 1px solid var(--line);
      font-size: 0.88rem;
    }
    .modal-tx-row .tx-vendor {
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    .modal-tx-row .tx-meta {
      color: var(--muted);
      font-size: 0.76rem;
      margin-top: 2px;
    }
    .modal-tx-row .tx-amount {
      font-weight: 700;
      white-space: nowrap;
    }
    .modal-actions {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-top: 24px;
      flex-wrap: wrap;
    }
    .tx-modal-actions {
      justify-content: flex-end;
    }
    .modal-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border-radius: 999px;
      padding: 12px 20px;
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      border: 1px solid transparent;
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    }
    .modal-btn:hover:not(:disabled) {
      transform: translateY(-1px);
    }
    .modal-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .modal-btn-secondary {
      background: rgba(255,255,255,0.9);
      color: var(--ink);
      border-color: var(--line-strong);
    }
    .modal-btn-danger {
      background: var(--danger);
      color: #ffffff;
      box-shadow: 0 12px 28px rgba(161, 72, 66, 0.22);
    }
    .modal-btn-tx-save {
      background: var(--success);
      color: #ffffff;
      border-color: transparent;
      box-shadow: 0 12px 28px rgba(36, 102, 74, 0.28);
    }
    .modal-btn-tx-save:hover:not(:disabled) {
      background: #1d563f;
      box-shadow: 0 14px 30px rgba(36, 102, 74, 0.32);
    }
    .modal-btn-tx-save .spinner {
      border-color: rgba(255, 255, 255, 0.35);
      border-top-color: #ffffff;
    }
    .modal-btn-tx-status {
      border-color: transparent;
    }
    .modal-btn-tx-status.is-settled {
      background: var(--success);
      color: #ffffff;
      box-shadow: 0 12px 28px rgba(36, 102, 74, 0.22);
    }
    .modal-btn-tx-status.is-settled:hover:not(:disabled) {
      background: #1d563f;
    }
    .modal-btn-tx-status.is-pending {
      background: var(--warning-soft);
      color: var(--warning);
      border-color: rgba(154, 106, 32, 0.26);
      box-shadow: none;
    }
    .modal-btn-tx-status.is-pending:hover:not(:disabled) {
      background: rgba(241, 225, 197, 0.92);
      border-color: rgba(154, 106, 32, 0.38);
    }
    .modal-btn-tx-status .spinner {
      border-color: rgba(255, 255, 255, 0.35);
      border-top-color: currentColor;
    }
    .modal-status-pill {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      max-width: 100%;
      margin-top: 2px;
      padding: 5px 11px;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .modal-status-pill.settled {
      background: rgba(36, 102, 74, 0.12);
      color: var(--success);
      border: 1px solid rgba(36, 102, 74, 0.22);
    }
    .modal-status-pill.pending {
      background: var(--warning-soft);
      color: var(--warning);
      border: 1px solid rgba(154, 106, 32, 0.22);
    }
    .modal-stat strong.modal-status-pill {
      font-size: 0.82rem;
      letter-spacing: 0.02em;
      font-weight: 700;
    }
    .tx-edit-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .tx-edit-field {
      display: grid;
      gap: 6px;
      min-width: 0;
    }
    .tx-edit-field--full {
      grid-column: 1 / -1;
    }
    .tx-edit-field > span {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #7a8390;
      font-weight: 700;
    }
    .tx-edit-input {
      width: 100%;
      min-height: 44px;
      border-radius: 16px;
      border: 1px solid var(--line-strong);
      background: #ffffff;
      padding: 0 15px;
      font: inherit;
      color: var(--ink);
    }
    .tx-edit-input:focus {
      outline: none;
      border-color: rgba(35, 66, 94, 0.34);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .tx-edit-amount-wrap {
      min-height: 44px;
      padding-right: 14px;
    }
    .tx-edit-amount-wrap .tx-edit-input {
      min-height: auto;
      padding: 0;
      border: none;
      box-shadow: none;
      background: transparent;
    }
    .memo-modal-card {
      width: min(600px, 100%);
    }
    .memo-modal-actions {
      justify-content: flex-end;
    }
    .memo-modal-stats .modal-stat > strong:not(.modal-status-pill) {
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      line-height: 1.4;
      color: var(--ink);
      font-variant-numeric: tabular-nums;
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    .memo-field {
      display: block;
    }
    .memo-textarea {
      width: 100%;
      min-height: 150px;
      resize: vertical;
      border-radius: 16px;
      border: 1px solid var(--line-strong);
      background: #ffffff;
      padding: 13px 15px;
      font: inherit;
      font-size: 0.92rem;
      line-height: 1.55;
      color: var(--ink);
    }
    .memo-textarea:focus {
      outline: none;
      border-color: rgba(35, 66, 94, 0.34);
      box-shadow: 0 0 0 4px rgba(35, 66, 94, 0.08);
    }
    .memo-textarea::placeholder {
      color: var(--muted);
    }
    .modal-btn .spinner {
      width: 14px;
      height: 14px;
      border-width: 2px;
      margin-bottom: 0;
      border-color: rgba(255,255,255,0.35);
      border-top-color: #ffffff;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 28px;
      transform: translateX(-50%);
      background: rgba(24, 33, 43, 0.92);
      color: #ffffff;
      padding: 14px 20px;
      border-radius: 999px;
      font-size: 0.88rem;
      opacity: 0;
      transition: opacity 0.24s ease, transform 0.24s ease;
      pointer-events: none;
      box-shadow: 0 18px 40px rgba(24, 33, 43, 0.22);
      white-space: nowrap;
      z-index: 60;
    }
    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(-2px);
    }

    @media (max-width: 980px) {
      /* Brand + hamburger on row 1; 2×2 pill grid on row 2; Sign Out hides behind the hamburger. */
      .nav {
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
      }
      .nav .brand {
        flex: 1;
        min-width: 0;
        order: 1;
      }
      .nav-menu-btn {
        display: inline-flex;
        order: 2;
      }
      .nav .nav-actions {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
        align-items: stretch;
        gap: 8px;
      }
      .nav .nav-actions > * {
        justify-self: stretch;
        margin: 0;
      }
      .nav .nav-actions > .nav-link,
      .nav .nav-actions > .nav-pill {
        flex: none;
        width: 100%;
        min-height: 44px;
      }
      .nav .nav-actions > .nav-danger--desktop {
        display: none;
      }
      .nav-menu-panel {
        order: 4;
        flex-basis: 100%;
        width: 100%;
        display: none;
      }
      .nav.nav--open .nav-menu-panel {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .nav-menu-panel > .nav-danger {
        width: 100%;
        min-height: 44px;
      }
      .batch-row {
        grid-template-columns: 1fr auto;
        row-gap: 10px;
        column-gap: 14px;
      }
      .batch-row > *:nth-child(2),
      .batch-row > *:nth-child(3),
      .batch-row > *:nth-child(4),
      .batch-row > *:nth-child(5) {
        grid-column: 1;
      }
      .batch-chevron {
        grid-column: 2;
        grid-row: 1 / span 5;
        align-self: center;
      }
      .batches-top,
      .transactions-top {
        grid-template-columns: 1fr;
      }
      .batches-top > div:first-of-type,
      .transactions-top > div:first-of-type {
        grid-column: 1;
      }
      .batches-top .view-head-actions,
      .transactions-top .view-head-actions {
        grid-column: 1;
        width: 100%;
        justify-content: flex-end;
        justify-self: end;
      }
    }

    @media (max-width: 860px) {
      body { padding: 16px; }
      .metrics-grid {
        grid-template-columns: 1fr 1fr;
      }
      .insight-grid.insight-grid--density-a,
      .insight-grid.insight-grid--density-b,
      .insight-grid.insight-grid--density-c {
        grid-template-columns: 1fr;
      }
      .insight-grid > .insight-aside {
        grid-column: auto;
      }
      .trend-row {
        grid-template-columns: 82px minmax(0, 1fr) auto;
      }
    }

    @media (max-width: 640px) {
      .content {
        padding: 18px;
      }
      .panel {
        padding: 20px;
        border-radius: 24px;
      }
      .headline {
        justify-content: center;
        text-align: center;
      }
      .headline > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      .headline h1 {
        text-align: center;
        margin-bottom: 9px;
      }
      .metrics-grid {
        grid-template-columns: 1fr;
      }
      .scope-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 10px;
      }
      .scope-summary {
        min-width: 0;
      }
      .scope-bar .clear-link--stable {
        display: none;
        min-width: 0;
        justify-self: end;
      }
      .scope-bar.has-filters .clear-link--stable.is-visible {
        display: inline-flex;
      }
      .ledger-filters .ledger-tools:first-of-type,
      .ledger-filters .ledger-tools:last-of-type {
        grid-template-columns: 1fr;
      }
      .ledger-filters .ledger-tools + .ledger-tools {
        margin-top: 0;
      }
      .ledger-filters {
        padding: 16px 20px;
      }
      #transactionsView .amount-row {
        grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
      }
      .table-wrap {
        overflow-x: hidden;
      }
      .batches-top,
      .transactions-top {
        padding: 20px 20px 16px;
      }
      .summary-export-bar {
        margin-top: 0;
        padding: 0;
      }
      thead {
        display: none;
      }
      table,
      tbody,
      tr {
        display: block;
      }
      table {
        width: 100%;
      }
      tbody {
        display: grid;
      }
      tbody tr {
        padding: 0;
        border-bottom: 1px solid var(--line);
        box-shadow: none;
      }
      tbody tr:first-child {
        border-top: 1px solid var(--line);
      }
      tbody tr.ledger-row-pending {
        box-shadow: none;
      }
      tbody td {
        display: none;
        padding: 0;
        border-bottom: none;
      }
      tbody td[colspan] {
        display: block;
      }
      tbody td[data-label="Merchant"] {
        display: block;
      }
      tbody td[data-label="Merchant"]::before {
        content: none;
      }
      tbody td[data-label="Merchant"] .merchant-cell,
      tbody td[data-label="Merchant"] .merchant-cell-shell,
      tbody td[data-label="Merchant"] .inline-edit-box--merchant {
        display: none;
      }
      .mobile-ledger-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 116px 56px 30px;
        width: 100%;
        border: none;
        background: transparent;
        color: var(--ink);
        padding: 12px 4px;
        column-gap: 8px;
        align-items: center;
        text-align: left;
        transition: background 0.16s ease, box-shadow 0.16s ease;
      }
      tbody tr.ledger-row-pending .mobile-ledger-row {
        box-shadow: none;
        border-radius: 0;
        background: transparent;
        border: none;
      }
      .mobile-ledger-main {
        min-width: 0;
      }
      .mobile-ledger-vendor {
        font-size: 0.95rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .mobile-ledger-meta {
        margin-top: 3px;
        color: var(--muted);
        font-size: 0.78rem;
        line-height: 1.4;
      }
      .mobile-ledger-status-pill {
        justify-self: stretch;
        align-self: center;
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 5px 9px;
        border-radius: 999px;
        white-space: nowrap;
        line-height: 1;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
      }
      .mobile-ledger-status-pill.settled {
        background: rgba(36, 102, 74, 0.14);
        color: var(--success);
        border: 1px solid rgba(36, 102, 74, 0.26);
      }
      .mobile-ledger-status-pill.pending {
        background: var(--warning-soft);
        color: var(--warning);
        border: 1px solid rgba(154, 106, 32, 0.28);
      }
      tbody tr:not(.ledger-row-pending) .mobile-ledger-row.is-active {
        border-radius: 14px;
        padding-left: 8px;
        padding-right: 8px;
        background:
          linear-gradient(180deg, rgba(36, 102, 74, 0.12) 0%, rgba(36, 102, 74, 0.05) 100%);
        box-shadow: inset 0 0 0 1px rgba(36, 102, 74, 0.28);
      }
      tbody tr.ledger-row-pending .mobile-ledger-row.is-active {
        border-radius: 14px;
        padding-left: 8px;
        padding-right: 8px;
        background:
          linear-gradient(180deg, rgba(154, 106, 32, 0.14) 0%, rgba(154, 106, 32, 0.06) 100%);
        box-shadow: inset 0 0 0 1px rgba(154, 106, 32, 0.32);
      }
      .mobile-ledger-amount {
        font-size: 0.92rem;
        font-weight: 800;
        letter-spacing: -0.01em;
        white-space: nowrap;
        text-align: right;
        min-width: 0;
        width: 100%;
        justify-self: end;
        font-variant-numeric: tabular-nums;
      }
      .mobile-ledger-chevron {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 999px;
        border: 1px solid var(--line);
        color: var(--muted);
        background: rgba(255, 255, 255, 0.86);
        justify-self: end;
      }
      .trend-row {
        grid-template-columns: 1fr;
      }
      .trend-track {
        order: 3;
      }
      .trend-value {
        order: 2;
      }
      /* Top-X tables collapse to stacked cards on narrow screens. */
      .top-thead { display: none; }
      .top-table .merchant-row,
      .top-table .card-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        grid-template-areas:
          "top-name top-value"
          "share-track share-track"
          "share-meta share-meta";
        gap: 8px 14px;
        padding: 14px 18px;
      }
      .top-table .top-name-col {
        align-self: start;
      }
      .toast {
        white-space: normal;
        max-width: min(340px, calc(100vw - 32px));
        text-align: center;
        line-height: 1.45;
        padding: 12px 18px;
        bottom: max(20px, env(safe-area-inset-bottom, 0px));
      }

      /* Segmented control: even vertical padding in the track + equal-height tabs (Summary / …). */
      .view-switcher {
        margin-top: 7px;
        width: 100%;
        justify-content: center;
      }
      .view-tabs {
        display: flex;
        width: 100%;
        max-width: 100%;
        align-items: stretch;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        gap: 5px;
        padding: 8px;
        border-radius: 22px;
      }
      .view-tabs::-webkit-scrollbar {
        display: none;
      }
      .view-tab {
        flex: 1 1 0;
        min-width: 0;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 11px;
        font-size: 0.78rem;
        line-height: 1.25;
        white-space: nowrap;
      }
      .view-tab.active {
        box-shadow: 0 6px 18px rgba(35, 66, 94, 0.2);
      }

      .compare-mode-pills {
        padding: 8px;
        gap: 5px;
      }
      .compare-mode-pill {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
      }
    }

    @media (max-width: 480px) {
      body {
        padding:
          max(12px, env(safe-area-inset-top, 0px))
          max(12px, env(safe-area-inset-right, 0px))
          max(14px, env(safe-area-inset-bottom, 0px))
          max(12px, env(safe-area-inset-left, 0px));
        touch-action: manipulation;
      }
      .frame {
        border-radius: 22px;
      }
      .nav {
        padding: 16px 18px;
        gap: 14px;
      }
      .nav-actions {
        gap: 8px;
      }
      .nav-link,
      .nav-pill,
      .nav-danger,
      .filter-btn {
        min-height: 44px;
      }
      .nav-danger {
        width: 100%;
      }
      .content {
        padding: 12px;
      }
      .panel {
        padding: 18px 16px;
        border-radius: 20px;
      }
      .headline h1 {
        font-size: clamp(1.55rem, 7vw, 2rem);
        margin-bottom: 8px;
      }
      .view-tab {
        min-height: 44px;
      }
      .export-btn {
        min-height: 44px;
      }
      .cell-icon-btn,
      .status-toggle-btn {
        width: 44px;
        height: 44px;
      }
      .modal-card {
        margin: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
          max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      }
      .tx-edit-grid {
        grid-template-columns: 1fr;
      }
      .tx-edit-field--full {
        grid-column: auto;
      }
      .tx-modal-actions {
        flex-direction: column;
      }
      .tx-modal-actions .modal-btn {
        width: 100%;
      }
      .batches-tools {
        padding: 14px 16px;
      }
      .ledger-filters {
        padding: 14px 16px;
      }
      .batches-top,
      .transactions-top {
        padding: 14px 16px;
      }
      .batch-row {
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: center;
        column-gap: 10px;
        row-gap: 0;
        padding: 14px 16px;
      }
      .batch-row > *:nth-child(2),
      .batch-row > *:nth-child(3),
      .batch-row > *:nth-child(4),
      .batch-row > *:nth-child(5) {
        display: none;
      }
      .batch-cell-primary {
        display: flex;
        align-items: baseline;
        gap: 8px;
        min-width: 0;
        white-space: nowrap;
      }
      .batch-cell-primary strong {
        margin-bottom: 0;
        font-size: 0.94rem;
        flex-shrink: 0;
      }
      .batch-cell-primary > span:first-of-type {
        display: none;
      }
      .batch-mobile-inline {
        display: block;
        min-width: 0;
        color: var(--muted);
        font-size: 0.78rem;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .batch-chevron {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
      }
    }

    /* Only when using Summary → PDF (see history.js); plain Cmd+P elsewhere is unchanged. */
    @media print {
      @page {
        margin: 0.45in;
      }
      html.print-summary,
      html.print-summary * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      html.print-summary body {
        background: #ffffff !important;
        color: #18212b !important;
        padding: 0 !important;
      }
      html.print-summary .no-print {
        display: none !important;
      }
      html.print-summary .metric-edit-btn,
      html.print-summary .metric-popover,
      html.print-summary .trend-head-wrap,
      html.print-summary .clear-link {
        display: none !important;
      }
      html.print-summary #transactionsView,
      html.print-summary #batchesView {
        display: none !important;
      }
      html.print-summary #summaryView {
        display: grid !important;
        gap: 12px;
        color: #18212b;
      }
      html.print-summary #summaryView[hidden] {
        display: none !important;
      }
      html.print-summary .page {
        max-width: none;
        padding: 0;
      }
      html.print-summary .frame {
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: #ffffff;
      }
      html.print-summary #summaryView::before {
        content: "Compline Summary";
        display: block;
        margin: 0 0 8px;
        color: #18212b;
        font-size: 20pt;
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.1;
      }
      html.print-summary .content {
        padding: 0;
        display: block;
      }
      html.print-summary .panel {
        break-inside: avoid;
        page-break-inside: avoid;
        border-radius: 14px;
        border: 1px solid rgba(24, 33, 43, 0.14);
        background: #ffffff;
        padding: 18px;
        box-shadow: none;
      }
      html.print-summary .scope-bar {
        margin: 0 0 12px;
        padding: 10px 14px;
        border: 1px solid rgba(35, 66, 94, 0.18);
        border-left: 4px solid #23425e;
        border-radius: 12px;
        background: #eef4f8;
      }
      html.print-summary .scope-summary {
        color: #334556;
        font-size: 9.5pt;
        line-height: 1.45;
        font-weight: 650;
      }
      html.print-summary .metrics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 9px;
        margin-bottom: 12px;
      }
      html.print-summary .metric-card {
        min-height: 0;
        border-radius: 14px;
        padding: 13px 14px;
        gap: 7px;
        border-width: 1px;
      }
      html.print-summary .metric-card.success {
        background: #eaf5ef;
        border-color: #8fbda4;
      }
      html.print-summary .metric-card.warning {
        background: #fbf2df;
        border-color: #d5b87b;
      }
      html.print-summary .metric-card.neutral {
        background: #e9f1f8;
        border-color: #9fb9d1;
      }
      html.print-summary .metric-card.accent {
        background: #efedf8;
        border-color: #b6addd;
      }
      html.print-summary .metric-label {
        color: #4b5966;
        font-size: 7.5pt;
        letter-spacing: 0.1em;
      }
      html.print-summary .metric-value {
        color: #18212b;
        font-size: 18pt;
        letter-spacing: -0.03em;
      }
      html.print-summary .insight-grid,
      html.print-summary .insight-grid.insight-grid--density-a,
      html.print-summary .insight-grid.insight-grid--density-b,
      html.print-summary .insight-grid.insight-grid--density-c {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 12px;
      }
      html.print-summary .section-head {
        align-items: baseline;
        margin-bottom: 12px;
      }
      html.print-summary .section-head h2 {
        color: #18212b;
        font-size: 13pt;
      }
      html.print-summary .section-head span {
        color: #5d6872;
        font-size: 8pt;
      }
      html.print-summary .compare-head-tools {
        display: flex;
      }
      html.print-summary .compare-mode-pills {
        padding: 0;
        border: none;
        background: transparent;
      }
      html.print-summary .compare-mode-pill {
        display: none;
      }
      html.print-summary .compare-mode-pill.active {
        display: inline-flex;
        align-items: center;
        background: #23425e;
        color: #ffffff;
        border-radius: 999px;
        padding: 5px 9px;
        font-size: 7pt;
      }
      html.print-summary .trend-list,
      html.print-summary .merchant-list,
      html.print-summary .card-list {
        gap: 8px;
      }
      html.print-summary .trend-row {
        background: #f7f9fb;
        border-color: rgba(35, 66, 94, 0.12);
        border-radius: 10px;
        padding: 9px 10px;
        grid-template-columns: 82px minmax(0, 1fr) auto;
      }
      html.print-summary .trend-label,
      html.print-summary .merchant-label,
      html.print-summary .card-label,
      html.print-summary .trend-value,
      html.print-summary .merchant-value,
      html.print-summary .card-value,
      html.print-summary .top-value-col {
        color: #18212b;
      }
      html.print-summary .trend-track,
      html.print-summary .share-track {
        background: #dfe7ee;
      }
      html.print-summary .trend-fill,
      html.print-summary .share-fill {
        background: linear-gradient(90deg, #23425e, #7f9cb8);
      }
      html.print-summary .compare-chart-shell {
        min-height: 170px;
      }
      html.print-summary .compare-bars {
        min-height: 122px;
        border-bottom-color: rgba(24, 33, 43, 0.22);
      }
      html.print-summary .compare-bar-value {
        color: #23425e;
      }
      html.print-summary .compare-bar-fill {
        background: linear-gradient(180deg, #5f7f9c, #23425e);
      }
      html.print-summary .compare-y-axis,
      html.print-summary .compare-y-axis-label {
        border-right-color: rgba(24, 33, 43, 0.16);
      }
      html.print-summary .compare-y-axis,
      html.print-summary .compare-x-labels span,
      html.print-summary .compare-y-axis-label-text,
      html.print-summary .compare-footnote,
      html.print-summary .card-meta,
      html.print-summary .merchant-meta,
      html.print-summary .top-share-label {
        color: #5d6872;
      }
      html.print-summary .top-table {
        border-radius: 12px;
        border-color: rgba(24, 33, 43, 0.14);
        background: #ffffff;
      }
      html.print-summary .top-thead {
        background: #edf2f6;
        border-bottom-color: rgba(24, 33, 43, 0.14);
        color: #4b5966;
        padding: 9px 14px;
        font-size: 7.5pt;
      }
      html.print-summary .top-table .merchant-row,
      html.print-summary .top-table .card-row {
        padding: 10px 14px;
        border-bottom-color: rgba(24, 33, 43, 0.12);
        background: #ffffff;
      }
    }
