    :root {
      --bg: #efefef;
      --surface: #ffffff;
      --surface-soft: #f9fafb;
      --text: #182230;
      --muted: #667085;
      --line: #e4e7ec;
      --nav: #ffffff;
      --primary: #356FD1;
      --primary-dark: #2457AD;
      --primary-contrast: #ffffff;
      --field-label: #344054;
      --green: #2f8f46;
      --green-text: #28723b;
      --green-soft: #eaf7ed;
      --red: #d64535;
      --red-soft: #fff0ee;
      --orange: #e68a1f;
      --orange-text: #a75a00;
      --orange-soft: #fff5e8;
      --blue: #356FD1;
      --blue-soft: #f5f8ff;
      --danger: #b42318;
      --toast-bg: #182230;
      --toast-fg: #ffffff;
      --shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
      --radius: 12px;
      --sidebar-width: 245px;
      --desktop-header-height: 64px;
      --desktop-page-gutter: 24px;
      --desktop-card-padding: 13px;
      --desktop-compact-card-padding: 11px;
      --desktop-panel-radius: 16px;
      --desktop-inner-radius: 12px;
      --desktop-control-height: 38px;
      --desktop-control-compact-height: 35px;
      --desktop-control-icon-height: 32px;
      --desktop-section-gap: 10px;
      --desktop-workspace-gap: 10px;
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.5;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    .sr-only {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      white-space: nowrap !important;
      border: 0 !important;
    }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(23, 59, 103, 0.18);
      outline-offset: 2px;
    }

    .app { min-height: 100vh; }

    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 50;
      width: var(--sidebar-width);
      padding: 22px 16px;
      background: var(--nav);
      color: var(--text);
      display: flex;
      flex-direction: column;
      transform: translateX(-100%);
      box-shadow: 18px 0 45px rgba(16, 24, 40, 0.18);
      transition: transform 0.25s ease;
    }

    .sidebar.desktop-open,
    .sidebar.open { transform: translateX(0); }

    .sidebar-close-button {
      position: absolute;
      top: 13px;
      right: 11px;
      width: 32px;
      height: 32px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface-soft);
      color: var(--text);
      display: grid;
      place-items: center;
      font-size: 1rem;
    }

    .sidebar-close-button:hover { background: var(--line); }

    .sidebar-edge-trigger {
      display: none;
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 49;
      width: 15px;
      background: linear-gradient(90deg, var(--primary) 0 4px, transparent 4px);
      cursor: pointer;
    }

    .sidebar-edge-trigger::after {
      content: "Menu";
      position: absolute;
      top: 50%;
      left: 5px;
      transform: translateY(-50%) rotate(-90deg);
      transform-origin: left top;
      padding: 4px 7px;
      border-radius: 0 0 var(--talaan-control-radius) var(--talaan-control-radius);
      background: var(--primary);
      color: #fff;
      font-size: 0.62rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      opacity: 0;
      transition: opacity 0.18s ease;
    }

    .sidebar-edge-trigger:hover::after { opacity: 1; }

    .brand {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 4px 7px 25px;
    }

    .brand-mark {
      width: 42px;
      height: 42px;
      border-radius: var(--talaan-control-radius);
      display: grid;
      place-items: center;
      background: var(--blue-soft);
      color: var(--primary-dark);
      font-weight: 900;
      letter-spacing: -0.04em;
    }

    .brand strong { display: block; font-size: 0.98rem; }
    .brand small { color: var(--muted); font-size: 0.78rem; }

    .nav-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: grid;
      gap: 5px;
    }

    .nav-button {
      width: 100%;
      border: 0;
      border-radius: var(--talaan-control-radius);
      padding: 11px 12px;
      color: var(--muted);
      background: transparent;
      display: flex;
      gap: 11px;
      align-items: center;
      text-align: left;
    }

    .nav-button:hover, .nav-button.active {
      color: var(--text);
      background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    }

    .nav-icon {
      width: 23px;
      height: 23px;
      border-radius: var(--talaan-control-radius);
      display: grid;
      place-items: center;
      background: var(--surface-soft);
      font-size: 0.78rem;
      font-weight: 800;
    }

    .sidebar-note {
      margin-top: auto;
      padding: 17px 8px 2px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 0.75rem;
    }

    .main { margin-left: 0; min-height: 100vh; }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 35;
      min-height: var(--desktop-header-height);
      padding: 12px 26px;
      background: color-mix(in srgb, var(--bg) 92%, transparent);
      backdrop-filter: blur(12px);
      border-block-end: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }

    .topbar-left, .topbar-actions { display: flex; align-items: center; gap: 11px; }
    .topbar h1 { margin: 0; font-size: 1.16rem; }
    .topbar p { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }

    .menu-button {
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface);
    }

    .month-control {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      padding: 6px 9px;
    }

    .month-control label { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
    .month-control input { border: 0; outline: 0; color: var(--text); background: transparent; }
    .month-navigator { display: flex; align-items: center; gap: 6px; }
    .month-nav-button {
      width: 34px;
      height: 34px;
      padding: 0;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface);
      color: var(--text);
      font-size: 1.2rem;
      font-weight: 850;
      line-height: 1;
    }
    .month-nav-button:hover { background: var(--surface-soft); }
    .month-status-chip {
      min-height: 28px;
      display: inline-flex;
      align-items: center;
      padding: 4px 9px;
      border-radius: 999px;
      background: var(--surface-soft);
      color: var(--muted);
      font-size: 0.68rem;
      font-weight: 850;
      white-space: nowrap;
    }
    .month-status-chip.current { background: var(--green-soft); color: var(--green-text); }
    .month-status-chip.upcoming { background: var(--orange-soft); color: var(--orange-text); }
    .month-status-chip.ended { background: var(--surface-soft); color: var(--muted); }
    .month-status-chip.complete { background: var(--green-soft); color: var(--green-text); }

    .month-insights-card { margin-top: 10px; padding: 10px 12px !important; }
    .month-insights-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }
    .month-insights-header strong { font-size: 0.78rem; }
    .month-insights-header small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.64rem; }
    .month-progress-chip { font-size: 0.66rem; font-weight: 850; color: var(--primary); }
    .month-comparison-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .month-comparison-item {
      min-width: 0;
      padding: 7px 8px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-card-radius);
      background: var(--surface-soft);
    }
    .month-comparison-item span { display: block; color: var(--muted); font-size: 0.61rem; font-weight: 750; }
    .month-comparison-item strong { display: block; margin-top: 2px; font-size: 0.72rem; }
    .comparison-good { color: var(--green-text); }
    .comparison-bad { color: var(--danger); }
    .comparison-neutral { color: var(--muted); }
    .monthly-checklist-wrap { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
    .monthly-checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
    .monthly-checklist-head strong { font-size: 0.72rem; }
    .checklist-reset {
      border: 0;
      background: transparent;
      color: var(--muted);
      padding: 2px 4px;
      font-size: 0.64rem;
      font-weight: 750;
    }
    .monthly-checklist-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
    .monthly-check-item {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 7px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface);
      font-size: 0.64rem;
      font-weight: 700;
      line-height: 1.2;
    }
    .monthly-check-item input { accent-color: var(--primary); flex: 0 0 auto; }
    .monthly-check-item.is-done { color: var(--muted); background: var(--surface-soft); text-decoration: line-through; }

    .content { padding: 18px var(--desktop-page-gutter) 34px; }
    .page { display: none; animation: fade 0.18s ease; }
    .page.active { display: block; }

    @keyframes fade {
      from { opacity: 0; transform: translateY(3px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .page-heading {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 18px;
      margin-bottom: 19px;
    }

    .page-heading h2 { margin: 0 0 4px; font-size: 1.34rem; letter-spacing: -0.03em; }
    .page-heading p { margin: 0; color: var(--muted); max-width: 760px; }

    .button {
      border: 1px solid transparent;
      border-radius: var(--talaan-control-radius);
      padding: 9px 13px;
      font-weight: 750;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: var(--desktop-control-height);
    }

    .button-primary { background: var(--primary); color: var(--primary-contrast); }
    .button-primary:hover { background: var(--primary-dark); }
    .button-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
    .button-danger { background: var(--red-soft); color: var(--danger); border-color: color-mix(in srgb, var(--red) 34%, var(--line)); }
    .button-small { min-height: var(--desktop-control-icon-height); padding: 6px 9px; font-size: 0.76rem; }
    .button:disabled { opacity: 0.48; cursor: not-allowed; }

    .budget-preview {
      border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
      background: var(--green-soft);
      border-radius: var(--talaan-card-radius);
      padding: 11px 12px;
      color: var(--text);
      font-size: 0.8rem;
    }
    .budget-preview strong { display: block; margin-top: 2px; color: var(--green-text); font-size: 0.95rem; }

    .grid { display: grid; gap: 16px; }
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .two-column { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr); }
    .equal-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: var(--desktop-card-padding);
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 14px;
    }

    .card-header h3 { margin: 0; font-size: 0.88rem; }
    .card-header p { margin: 3px 0 0; color: var(--muted); font-size: 0.78rem; }

    .kpi-card { position: relative; overflow: hidden; }
    .kpi-card::after {
      content: "";
      position: absolute;
      width: 78px;
      height: 78px;
      right: -28px;
      top: -31px;
      border-radius: 999px;
      background: currentColor;
      opacity: 0.06;
    }

    .kpi-label { color: var(--muted); font-size: 0.78rem; margin-bottom: 8px; }
    .kpi-value { font-size: 1.55rem; line-height: 1.2; font-weight: 850; letter-spacing: -0.04em; }
    .kpi-meta { color: var(--muted); font-size: 0.73rem; margin-top: 7px; }
    .text-green { color: var(--green-text); }
    .text-red { color: var(--danger); }
    .text-orange { color: var(--orange-text); }
    .text-blue { color: var(--blue); }
    .text-danger { color: var(--danger); }

    .legend {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 9px;
      margin-bottom: 16px;
    }

    .legend-item {
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      min-height: 62px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-card-radius);
      background: var(--surface);
      font-size: 0.77rem;
    }

    .legend-copy {
      display: flex;
      gap: 9px;
      align-items: center;
      min-width: 0;
    }

    .legend-text { min-width: 0; }
    .legend-text strong { display: block; color: var(--text); font-size: 0.78rem; }
    .legend-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.67rem; line-height: 1.25; }
    .legend-total { margin-left: auto; font-size: 0.96rem; font-weight: 850; white-space: nowrap; }

    .legend-item.legend-live-update {
      animation: legendLiveUpdate 0.9s ease;
    }

    @keyframes legendLiveUpdate {
      0% { transform: translateY(0); box-shadow: none; }
      35% { transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(23, 107, 85, 0.12); }
      100% { transform: translateY(0); box-shadow: none; }
    }

    .legend-dot { width: 11px; height: 11px; border-radius: 999px; flex: 0 0 auto; }
    .bg-green { background: var(--green); }
    .bg-red { background: var(--red); }
    .bg-orange { background: var(--orange); }
    .bg-blue { background: var(--blue); }

    .money-flow {
      display: grid;
      grid-template-columns: 1fr auto 1fr auto 1fr;
      align-items: stretch;
      gap: 10px;
    }

    .flow-box {
      border: 1px solid var(--line);
      border-radius: var(--talaan-card-radius);
      padding: 14px;
      background: var(--surface-soft);
    }

    .flow-box span { display: block; color: var(--muted); font-size: 0.75rem; }
    .flow-box strong { display: block; margin-top: 4px; font-size: 1.18rem; }
    .flow-symbol { display: grid; place-items: center; color: var(--muted); font-weight: 900; }

    .progress-track {
      height: 9px;
      margin-top: 13px;
      border-radius: 999px;
      background: var(--surface-soft);
      overflow: hidden;
    }

    .progress-fill { height: 100%; border-radius: inherit; background: var(--green); }
    .progress-fill.warning { background: var(--orange); }
    .progress-fill.over { background: var(--red); }

    .account-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .account-card {
      border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
      background: var(--green-soft);
      border-radius: var(--talaan-card-radius);
      padding: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .account-card-main { min-width: 0; }
    .account-card span { display: block; color: var(--muted); font-size: 0.74rem; overflow-wrap: anywhere; }
    .account-card strong { display: block; margin-top: 4px; font-size: 1rem; }
    .account-card-actions { display: flex; gap: 5px; flex: 0 0 auto; }
    .account-card-actions .button { min-height: 30px; padding: 5px 8px; }
    .account-card-empty { color: var(--muted); font-size: 0.82rem; }

    .simple-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
    .simple-list li {
      display: flex;
      justify-content: space-between;
      gap: 13px;
      align-items: center;
      padding-bottom: 10px;
      border-block-end: 1px solid var(--line);
    }
    .simple-list li:last-child { border-block-end: 0; padding-bottom: 0; }
    .simple-list strong { display: block; font-size: 0.84rem; }
    .simple-list small { display: block; color: var(--muted); margin-top: 2px; }
    .amount { font-weight: 800; white-space: nowrap; }

    .period-card { padding: 0; overflow: visible; }
    .period-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 15px 17px;
      border-bottom: 1px solid var(--line);
    }
    .period-header h3 { margin: 0; font-size: 0.98rem; }
    .period-header p { margin: 2px 0 0; font-size: 0.75rem; color: var(--muted); }
    .period-total { font-size: 1.1rem; font-weight: 850; white-space: nowrap; }
    .period-early .period-header { background: var(--red-soft); border-top: 4px solid var(--red); }
    .period-late .period-header { background: var(--orange-soft); border-top: 4px solid var(--orange); }
    .period-other .period-header { background: var(--blue-soft); border-top: 4px solid var(--blue); }

    .record-header, .record-row {
      display: grid;
      grid-template-columns: minmax(150px, 1.6fr) minmax(100px, 0.8fr) minmax(105px, 0.8fr) minmax(95px, 0.7fr) auto;
      gap: 11px;
      align-items: center;
    }

    .record-header {
      padding: 9px 17px;
      background: var(--surface-soft);
      color: var(--muted);
      font-size: 0.69rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .record-row {
      padding: 12px 17px;
      border-top: 1px solid var(--line);
      font-size: 0.82rem;
    }

    .record-row:first-child { border-top: 0; }
    .record-row.due-soon-row {
      background: var(--orange-soft);
      box-shadow: inset 4px 0 0 var(--orange);
    }
    .record-row.overdue-row {
      background: var(--red-soft);
      box-shadow: inset 4px 0 0 var(--red);
    }
    .record-row.newly-duplicated-row {
      outline: 3px solid var(--blue);
      outline-offset: -3px;
      animation: duplicatedExpenseHighlight 2.8s ease-out;
    }
    @keyframes duplicatedExpenseHighlight {
      0%, 34% { transform: translateY(-2px); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 22%, transparent); }
      100% { transform: none; box-shadow: none; }
    }
    @media (prefers-reduced-motion: reduce) {
      .record-row.newly-duplicated-row { animation: none; }
    }
    .record-title strong { display: block; }
    .record-title small { color: var(--muted); }
    .due-cell { display: grid; gap: 5px; justify-items: start; }
    .due-warning { margin-top: 1px; }
    .record-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
    .button-paid { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
    .button-paid:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
    .button-saved {
      width: 34px;
      height: 32px;
      min-height: 32px;
      padding: 0 4px;
      border-radius: 999px;
      background: var(--surface-soft);
      color: var(--muted);
      border-color: var(--line);
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      overflow: hidden;
      white-space: nowrap;
      transition: width 0.3s ease, transform 0.3s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }
    .button-saved:hover { background: var(--line); }
    .button-saved.active {
      background: var(--primary);
      color: var(--primary-contrast);
      border-color: var(--primary);
    }
    .button-saved.active:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
    .saved-icon-container {
      width: 24px;
      height: 24px;
      flex: 0 0 24px;
      border: 1px solid currentColor;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      z-index: 2;
    }
    .saved-icon { line-height: 1; }
    .saved-button-text {
      width: 0;
      height: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      overflow: hidden;
      white-space: nowrap;
      z-index: 1;
      opacity: 0;
      font-size: 0;
      transform: translateX(-5px);
      transition: width 0.3s ease, font-size 0.3s ease, transform 0.3s ease, opacity 0.2s ease;
    }
    .button-saved:hover,
    .button-saved:focus-visible,
    .button-saved:active {
      width: 94px;
    }
    .button-saved:hover .saved-button-text,
    .button-saved:focus-visible .saved-button-text,
    .button-saved:active .saved-button-text {
      width: 58px;
      font-size: 0.76rem;
      opacity: 1;
      transform: translateX(0);
    }
    .button-saved:active { transform: scale(0.95); }

    .status-pill,
    .status-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 23px;
      padding: 3px 8px;
      border: 1px solid transparent;
      border-radius: 999px;
      background: var(--surface-soft);
      color: var(--muted);
      font-size: 0.68rem;
      font-weight: 820;
      line-height: 1.2;
      white-space: nowrap;
    }
    .record-statuses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
    .status-paid, .status-completed { background: var(--green-soft); color: var(--green-text); border-color: color-mix(in srgb, var(--green) 34%, var(--line)); }
    .status-partial, .status-ongoing { background: var(--orange-soft); color: var(--orange-text); border-color: color-mix(in srgb, var(--orange) 34%, var(--line)); }
    .status-unpaid, .status-hold { background: var(--red-soft); color: var(--danger); border-color: color-mix(in srgb, var(--red) 34%, var(--line)); }
    .status-due-soon { color: var(--orange-text); background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 34%, var(--line)); }
    .status-overdue { color: var(--danger); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 34%, var(--line)); }
    .status-saved { color: var(--primary-contrast); background: var(--primary); border-color: var(--primary); }
    .status-one-time { color: var(--muted); background: var(--surface-soft); border-color: var(--line); }
    .status-excluded { color: var(--orange-text); background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 34%, var(--line)); }

    /* Phase 1: shared summary-card structure */
    .summary-card {
      --summary-tone: var(--muted);
      position: relative;
      overflow: hidden;
      border-top: 3px solid var(--summary-tone) !important;
    }
    .summary-card::after {
      content: "";
      position: absolute;
      width: 58px;
      height: 58px;
      right: -24px;
      top: -27px;
      border-radius: 999px;
      background: var(--summary-tone);
      opacity: 0.07;
      pointer-events: none;
    }
    .summary-card-green { --summary-tone: var(--green); }
    .summary-card-red { --summary-tone: var(--red); }
    .summary-card-orange { --summary-tone: var(--orange); }
    .summary-card-blue { --summary-tone: var(--blue); }
    .summary-card-neutral { --summary-tone: var(--muted); }
    .summary-card-danger { --summary-tone: var(--danger); }

    .summary-strip {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 9px;
      margin: 16px 0;
    }
    #moneySummary {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .summary-item {
      min-width: 0;
      min-height: 72px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-card-radius);
      padding: 11px 12px;
      background: var(--surface);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .summary-card-copy { min-width: 0; }
    .summary-card-label { display: block; color: var(--text); font-size: 0.75rem; font-weight: 800; }
    .summary-card-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.66rem; line-height: 1.25; }
    .summary-card-value { display: block; flex: 0 0 auto; font-size: 0.98rem; font-weight: 850; overflow-wrap: anywhere; white-space: nowrap; }

    .section-stack { display: grid; gap: 15px; }

    /* Phase 1: collapsible sections */
    .collapsible-header { position: relative; }
    .collapse-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    .collapse-toggle {
      width: 30px;
      height: 30px;
      min-height: 30px;
      padding: 0;
      border-radius: var(--talaan-control-radius);
      display: inline-grid;
      place-items: center;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--line);
    }
    .collapse-toggle:hover { background: var(--surface-soft); }
    .collapse-icon { display: inline-block; transition: transform 0.2s ease; font-size: 0.9rem; }
    .collapsible-section.is-collapsed > :not(.collapsible-header) { display: none !important; }
    .collapsible-section.is-collapsed .collapse-icon { transform: rotate(180deg); }
    .collapsible-section.is-collapsed .collapsible-header { margin-bottom: 0; border-bottom-color: transparent; }
    .period-card.is-collapsed .period-header { border-bottom: 0; }


    /* Phase 2: expense workflow, compact view, quick editing, and bulk actions */
    .expense-view-toggle {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface-soft);
    }
    .expense-view-toggle .button {
      min-height: 32px;
      padding: 5px 9px;
      border-color: transparent;
      background: transparent;
      color: var(--muted);
    }
    .expense-view-toggle .button.active {
      background: var(--surface);
      color: var(--primary);
      border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
      box-shadow: 0 2px 5px rgba(16, 24, 40, .07);
    }
    .bulk-expense-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin: -3px 0 14px;
      padding: 9px 11px;
      border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
      border-radius: var(--talaan-card-radius);
      background: var(--surface-soft);
    }
    .bulk-select-label {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: .75rem;
      font-weight: 800;
      color: var(--text);
      white-space: nowrap;
    }
    .expense-select-checkbox,
    #selectAllVisibleExpenses { width: 17px; height: 17px; accent-color: var(--primary); }
    .bulk-selected-count {
      min-width: 78px;
      color: var(--muted);
      font-size: .72rem;
      font-weight: 750;
    }
    .bulk-action-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-left: auto; }
    .bulk-action-controls .select { width: auto; min-width: 150px; padding-top: 7px; padding-bottom: 7px; }
    .expense-record-title { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
    .expense-record-title > label { flex: 0 0 auto; padding-top: 2px; }
    .record-title-copy { min-width: 0; }
    .expense-total-choice {
      grid-column: 1 / -1;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 11px 12px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface-soft);
      color: var(--text);
    }
    .expense-total-choice input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
    .expense-total-choice span { min-width: 0; }
    .expense-total-choice strong { display: block; font-size: .78rem; }
    .expense-total-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: .69rem; line-height: 1.35; }
    .expense-total-choice .exclusion-warning { display: block; margin-top: 5px; color: var(--danger); font-size: .69rem; font-style: normal; font-weight: 800; }
    .expense-total-choice.is-excluded { border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); background:var(--orange-soft); }

    .expense-form-mode-note {
      margin: -3px 0 12px;
      padding: 8px 10px;
      border-radius: var(--talaan-control-radius);
      background: var(--surface-soft);
      color: var(--muted);
      font-size: .72rem;
      line-height: 1.4;
    }
    #money.expense-view-compact .period-header { padding: 10px 13px; }
    #money.expense-view-compact .record-header { padding: 6px 13px; font-size: .62rem; }
    #money.expense-view-compact .record-row { padding: 7px 13px; gap: 7px; font-size: .75rem; }
    #money.expense-view-compact .record-title strong { font-size: .78rem; }
    #money.expense-view-compact .record-title small { font-size: .66rem; }
    #money.expense-view-compact .record-statuses { margin-top: 3px; gap: 3px; }
    #money.expense-view-compact .status-badge { min-height: 19px; padding: 2px 6px; font-size: .6rem; }
    #money.expense-view-compact .record-actions { gap: 3px; }
    #money.expense-view-compact .record-actions .button { min-height: var(--desktop-control-icon-height); padding: 4px 7px; font-size: .66rem; }
    #money.expense-view-compact .button-saved { width: var(--desktop-control-icon-height); height: var(--desktop-control-icon-height); min-height: var(--desktop-control-icon-height); }
    #money.expense-view-compact .saved-icon-container { width: 21px; height: 21px; flex-basis: 21px; }
    #money.expense-view-compact .button-saved:hover,
    #money.expense-view-compact .button-saved:focus-visible,
    #money.expense-view-compact .button-saved:active { width: 83px; }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 9px;
      align-items: end;
      margin-bottom: 14px;
    }

    .field { display: grid; gap: 5px; min-width: 0; }
    .toolbar .field { flex: 1 1 170px; }
    .field label { font-size: 0.76rem; font-weight: 750; color: var(--field-label); }
    .required-mark { color: var(--danger); margin-left: 2px; }
    .required-note { margin: 0 0 13px; color: var(--muted); font-size: 0.75rem; }
    .required-note .required-mark { font-weight: 850; }

    .input, .select, .textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: var(--talaan-control-radius);
      background: var(--surface);
      color: var(--text);
      padding: 9px 10px;
      outline: 0;
    }
    .textarea { min-height: 78px; resize: vertical; }
    .input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }

    .empty-state {
      padding: 24px 16px;
      text-align: center;
      color: var(--muted);
      font-size: 0.82rem;
    }
    .empty-state strong { display: block; color: var(--text); margin-bottom: 3px; }

    .bar-list { display: grid; gap: 12px; }
    .bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 0.78rem; }
    .bar { height: 9px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
    .bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

    .setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .setting-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: center; }
    .setting-row + .setting-row { margin-top: 10px; }
    .setting-row label { font-weight: 750; font-size: 0.82rem; }

    dialog {
      width: min(620px, calc(100% - 28px));
      border: 0;
      border-radius: var(--talaan-dialog-radius);
      padding: 0;
      color: var(--text);
      box-shadow: 0 24px 80px rgba(16,24,40,0.24);
    }
    dialog::backdrop { background: rgba(16,24,40,0.55); backdrop-filter: blur(2px); }
    .modal-header, .modal-footer { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .modal-header { border-block-end: 1px solid var(--line); }
    .modal-footer { border-block-start: 1px solid var(--line); justify-content: flex-end; }
    .modal-header h3 { margin: 0; font-size: 1rem; }
    .modal-body { padding: 18px; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .field-full { grid-column: 1 / -1; }

    .toast {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 100;
      min-width: 230px;
      max-width: min(390px, calc(100vw - 36px));
      padding: 11px 14px;
      border: 1px solid rgba(255,255,255,0.16);
      border-radius: var(--talaan-popover-radius);
      background: var(--toast-bg);
      color: var(--toast-fg);
      box-shadow: 0 16px 42px rgba(16,24,40,0.24);
      opacity: 0;
      transform: translateY(12px) scale(0.98);
      pointer-events: none;
      transition: 0.22s ease;
      font-size: 0.82rem;
      display: flex;
      align-items: center;
      gap: 9px;
    }
    .toast.show { opacity: 1; transform: translateY(0) scale(1); pointer-events:auto; }
    .toast-icon {
      width: 23px;
      height: 23px;
      flex: 0 0 23px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: rgba(255,255,255,0.16);
      font-size: 0.74rem;
      font-weight: 900;
    }
    .toast-message { min-width: 0; line-height: 1.35; }
    .toast-dismiss { width:28px; min-width:28px; height:28px; min-height:28px; display:grid; place-items:center; margin-left:auto; padding:0; border:0; border-radius:50%; background:transparent; color:inherit; font:inherit; font-size:1rem; line-height:1; cursor:pointer; }
    .toast-dismiss:hover { background:rgba(255,255,255,.16); }
    .toast.toast-success { background: var(--green-text); color: var(--surface); }
    .toast.toast-info { background: var(--primary); }
    .toast.toast-warning { background: var(--orange-text); color: var(--surface); }
    .toast.toast-error { background: var(--danger); color: var(--surface); }
    .overlay { display: none; }

    @media (max-width: 1120px) {
      .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .monthly-checklist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .two-column { grid-template-columns: 1fr; }
      .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      #moneySummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (min-width: 851px) {
      .sidebar-edge-trigger { display: block; }
    }

    @media (max-width: 850px) {
      .sidebar { transform: translateX(-100%); }
      .sidebar.desktop-open { transform: translateX(-100%); }
      .sidebar.open { transform: translateX(0); }
      .main { margin-left: 0; }
      .sidebar-edge-trigger { display: none; }
      .overlay { position: fixed; inset: 0; z-index: 45; background: rgba(16,24,40,0.45); }
      .overlay.show { display: block; }
      .topbar { padding: 11px 17px; }
      .content { padding: 20px 17px 34px; }
      .topbar-actions .button { display: none; }
      .month-status-chip { display: none; }
      .account-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    }

    @media (max-width: 850px) {
      .bulk-action-controls { width: 100%; margin-left: 0; }
      .bulk-action-controls .select { flex: 1 1 180px; }
    }

    @media (max-width: 700px) {
      .page-heading { display: grid; }
      .page-heading .button { width: 100%; }
      .equal-column, .setting-grid { grid-template-columns: 1fr; }
      .money-flow { grid-template-columns: 1fr; }
      .flow-symbol { transform: rotate(90deg); height: 20px; }
      .record-header { display: none; }
      .record-row {
        grid-template-columns: 1fr auto;
        gap: 8px 12px;
        padding: 13px 15px;
      }
      .record-row > *:not(.record-title):not(.record-actions) { grid-column: 1 / -1; }
      .record-row > *:not(.record-title):not(.record-actions)::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-weight: 650;
      }
      .record-actions { grid-column: 2; grid-row: 1; }
      #money .expense-record-title { grid-column: 1 / -1; }
      #money .record-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
      .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .form-grid { grid-template-columns: 1fr; }
      .field-full { grid-column: auto; }
      .setting-row { grid-template-columns: 1fr; gap: 5px; }
      .month-comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .monthly-checklist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .bar-row { grid-template-columns: 90px 1fr; }
      .bar-row strong { grid-column: 1 / -1; }
    }

    @media (max-width: 520px) {
      .kpi-grid, .legend, .account-grid { grid-template-columns: 1fr; }
      .summary-strip { grid-template-columns: 1fr 1fr; }
      #moneySummary { grid-template-columns: 1fr; }
      .card { padding: 15px; border-radius: var(--talaan-card-radius); }
      .month-control label { display: none; }
      .month-control { padding: 5px 7px; }
      .month-nav-button { width: 30px; height: 30px; }
      .month-comparison-grid, .monthly-checklist-grid { grid-template-columns: 1fr; }
      .topbar h1 { font-size: 1rem; }
      .topbar p { display: none; }
    }

    @media print {
      .sidebar, .sidebar-edge-trigger, .topbar, .page-heading .button, .toolbar, .record-actions, .report-status-actions, .no-print { display: none !important; }
      .main { margin: 0; }
      .content { padding: 0; }
      .page { display: none !important; }
      #reports.page { display: block !important; }
      .card { box-shadow: none; break-inside: avoid; }
    }



    .dashboard-view .topbar { min-height: var(--desktop-header-height); padding-top: 8px; padding-bottom: 8px; }
    .dashboard-view .content { padding: 18px var(--desktop-page-gutter) 34px; }

    /* Compact dashboard: keeps the monthly overview visible on one desktop screen. */
    #dashboard .page-heading { margin-bottom: 10px; }
    #dashboard .page-heading h2 { font-size: 1.28rem; }
    #dashboard .page-heading p { font-size: 0.78rem; }
    #dashboard .grid { gap: 10px; }
    #dashboard .card {
      padding: var(--workspace-card-padding);
      border-radius: var(--workspace-card-radius);
      box-shadow: var(--workspace-soft-shadow);
    }
    #dashboard .kpi-card { min-height: 82px; }
    #dashboard .kpi-label { margin-bottom: 4px; font-size: 0.7rem; }
    #dashboard .kpi-value { font-size: 1.3rem; }
    #dashboard .kpi-meta { margin-top: 4px; font-size: 0.67rem; }
    #dashboard .card-header { margin-bottom: 8px; }
    #dashboard .card-header h3 { font-size: 0.88rem; }
    #dashboard .card-header p { font-size: 0.68rem; }
    #dashboard .money-flow { gap: 7px; }
    #dashboard .flow-box { padding: 9px 10px; border-radius: var(--talaan-card-radius); }
    #dashboard .flow-box span { font-size: 0.66rem; }
    #dashboard .flow-box strong { font-size: 0.98rem; }
    #dashboard .progress-track { margin-top: 8px; height: 7px; }
    #dashboard .simple-list { gap: 5px; }
    #dashboard .simple-list li { padding-bottom: 5px; }
    #dashboard .simple-list strong { font-size: 0.76rem; }
    #dashboard .simple-list small { font-size: 0.66rem; }
    #dashboard .account-grid { gap: 7px; }
    #dashboard .account-card { padding: 8px 9px; border-radius: var(--talaan-card-radius); }
    #dashboard .account-card span { font-size: 0.65rem; }
    #dashboard .account-card strong { margin-top: 2px; font-size: 0.82rem; }
    #dashboard .two-column,
    #dashboard .equal-column { margin-top: 10px !important; }

    .report-status-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 14px;
      padding: 11px 13px;
      border: 1px solid var(--line);
      border-radius: var(--talaan-card-radius);
      background: var(--surface);
    }
    .report-status-copy { display: grid; gap: 2px; }
    .report-status-copy strong { font-size: 0.84rem; }
    .report-status-copy small { color: var(--muted); }
    .report-status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .report-detail-stack { display: grid; gap: 14px; margin-top: 16px; }
    .report-table-header,
    .report-table-row {
      display: grid;
      grid-template-columns: minmax(150px, 1.6fr) minmax(100px, .8fr) minmax(100px, .8fr) minmax(100px, .8fr) minmax(90px, .7fr);
      gap: 10px;
      align-items: center;
    }
    .report-table-header {
      padding: 8px 12px;
      color: var(--muted);
      background: var(--surface-soft);
      border-radius: var(--talaan-control-radius);
      font-size: 0.68rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .report-table-row {
      padding: 10px 12px;
      border-top: 1px solid var(--line);
      font-size: 0.78rem;
    }
    .report-table-row:first-child { border-top: 0; }
    .report-table-row strong { display: block; }
    .report-table-row small { display: block; color: var(--muted); }
    .report-four-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    @media (min-width: 1050px) and (min-height: 680px) {
      #dashboard { margin-top: -4px; }
      #dashboard .page-heading p { display: none; }
    }

    @media (max-width: 850px) {
      .report-four-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 700px) {
      .report-table-header { display: none; }
      .report-table-row { grid-template-columns: 1fr; gap: 5px; }
      .report-table-row > *::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-weight: 700;
      }
      .report-table-row > :first-child::before { content: ""; }
    }


    /* Compact Monthly Reports desktop layout */
    #reports { margin-top: -4px; }
    #reports .page-heading { margin-bottom: 10px; align-items: center; }
    #reports .page-heading h2 { margin-bottom: 2px; font-size: 1.28rem; }
    #reports .page-heading p { font-size: 0.76rem; }
    #reports .report-status-row {
      margin-bottom: 10px;
      padding: 8px 10px;
      border-radius: var(--talaan-card-radius);
    }
    #reports .report-status-copy strong { font-size: 0.78rem; }
    #reports .report-status-copy small { font-size: 0.67rem; }
    #reports .report-status-actions { gap: 6px; }
    #reports .report-status-actions .button {
      min-height: 32px;
      padding: 5px 9px;
      font-size: 0.72rem;
    }
    #reports .kpi-grid { gap: 9px; }
    #reports .kpi-grid .card {
      padding: var(--workspace-card-padding);
      border-radius: var(--workspace-card-radius);
      box-shadow: var(--workspace-soft-shadow);
    }
    #reports .kpi-label { margin-bottom: 4px; font-size: 0.67rem; }
    #reports .kpi-value { font-size: 1.12rem; }
    #reports .kpi-meta { margin-top: 3px; font-size: 0.64rem; }
    #reports .summary-strip {
      margin: 9px 0 0;
      gap: 8px;
    }
    #reports .summary-item {
      padding: 7px 9px;
      border-radius: var(--talaan-card-radius);
    }
    #reports .summary-item span { font-size: 0.63rem; }
    #reports .summary-item strong { margin-top: 2px; font-size: 0.82rem; }
    #reports > .equal-column {
      gap: 10px;
      margin-top: 10px !important;
    }
    #reports > .equal-column .card,
    #reports .report-detail-stack .card,
    #reports > article.card {
      padding: 10px 11px;
      border-radius: var(--talaan-card-radius);
      box-shadow: 0 5px 14px rgba(16, 24, 40, 0.05);
    }
    #reports .card-header { margin-bottom: 7px; }
    #reports .card-header h3 { font-size: 0.82rem; }
    #reports .card-header p { margin-top: 1px; font-size: 0.64rem; }
    #reports .bar-list { gap: 6px; }
    #reports .bar-row {
      grid-template-columns: 88px 1fr auto;
      gap: 7px;
      font-size: 0.67rem;
    }
    #reports .bar { height: 6px; }
    #reports .report-detail-stack {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin-top: 10px;
    }
    #reports .report-table-header,
    #reports .report-table-row {
      grid-template-columns: minmax(105px, 1.35fr) minmax(68px, .75fr) minmax(72px, .75fr) minmax(68px, .75fr) minmax(68px, .72fr);
      gap: 6px;
    }
    #reports .report-table-header {
      padding: 5px 7px;
      border-radius: var(--talaan-control-radius);
      font-size: 0.58rem;
    }
    #reports .report-table-row {
      padding: 6px 7px;
      font-size: 0.67rem;
    }
    #reports .report-table-row small { font-size: 0.6rem; }
    #reportExpenseList,
    #reportPaidExpenseList,
    #reportProjectList,
    #reportPaymentList {
      max-height: 138px;
      overflow-y: auto;
      scrollbar-width: thin;
    }
    #reports > article.card[style*="margin-top"] { margin-top: 10px !important; }
    #reports > article.card .toolbar { gap: 6px; }
    #reports > article.card .toolbar .button {
      min-height: 32px;
      padding: 5px 9px;
      font-size: 0.7rem;
    }

    @media (max-width: 1120px) {
      #reports .report-detail-stack { grid-template-columns: 1fr; }
      #reportExpenseList,
      #reportPaidExpenseList,
      #reportProjectList,
      #reportPaymentList { max-height: 190px; }
    }



    /* App, device, sync, storage, and recovery controls */
    .system-section-heading {
      margin: 20px 0 10px;
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 12px;
    }
    .system-section-heading h3 { margin: 0; font-size: 1rem; }
    .system-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
    .system-grid { margin-top: 10px !important; align-items: stretch; }
    .system-card { min-width: 0; }
    .system-status-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid var(--line);
      font-size: .78rem;
    }
    .system-status-row:last-child { border-bottom: 0; }
    .system-status-value { font-weight: 800; text-align: right; overflow-wrap: anywhere; }
    .status-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 23px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: .66rem;
      font-weight: 800;
      line-height: 1;
      background: var(--surface-soft);
      color: var(--text);
      border: 1px solid var(--line);
    }
    .status-chip.success { background: var(--green-soft); color: var(--green-text); border-color: color-mix(in srgb,var(--green) 34%,var(--line)); }
    .status-chip.warning { background: var(--orange-soft); color: var(--orange-text); border-color: color-mix(in srgb,var(--orange) 34%,var(--line)); }
    .status-chip.danger { background: var(--red-soft); color: var(--danger); border-color: color-mix(in srgb,var(--red) 34%,var(--line)); }
    .status-chip.info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb,var(--blue) 34%,var(--line)); }
    .system-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
    .system-actions .button { min-height: 34px; padding: 6px 10px; font-size: .72rem; }
    .system-help { margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
    .system-table-wrap { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: var(--talaan-card-radius); margin-top: 9px; }
    .system-table { width: 100%; border-collapse: collapse; font-size: .69rem; }
    .system-table th, .system-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
    .system-table th { position: sticky; top: 0; background: var(--surface-soft); z-index: 1; color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .04em; }
    .system-table tr:last-child td { border-bottom: 0; }
    .system-empty { padding: 14px; text-align: center; color: var(--muted); font-size: .73rem; }
    .system-inline-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: end; }
    .recovery-pack-form { display: grid; grid-template-columns: 1fr 145px; gap: 7px; }
    .recovery-pack-form .field-full { grid-column: 1 / -1; }
    .migration-progress { width: 100%; height: 9px; border-radius: 999px; overflow: hidden; background: var(--surface-soft); margin-top: 9px; }
    .migration-progress > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s ease; }
    .recovery-guidance { margin: 0; padding-left: 18px; color: var(--muted); font-size: .75rem; }
    .recovery-guidance li + li { margin-top: 5px; }
    .system-check-list { display: grid; gap: 7px; margin-top: 9px; }
    .system-check-item { display: flex; align-items: flex-start; gap: 7px; font-size: .75rem; color: var(--muted); }
    .system-check-item strong { color: var(--text); }
    #pwaUpdateBanner {
      position: fixed;
      left: 50%;
      bottom: 18px;
      z-index: 120;
      width: min(560px, calc(100vw - 24px));
      transform: translateX(-50%);
      padding: 12px;
      border-radius: var(--talaan-popover-radius);
      background: var(--primary-dark);
      color: var(--primary-contrast);
      box-shadow: 0 18px 50px rgba(16, 24, 40, .26);
    }
    #pwaUpdateBanner[hidden] { display: none; }
    .pwa-update-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .pwa-update-inner strong { display: block; font-size: .84rem; }
    .pwa-update-inner p { margin: 2px 0 0; font-size: .71rem; color: color-mix(in srgb, var(--primary-contrast) 78%, transparent); }
    .pwa-update-actions { display: flex; gap: 7px; flex: 0 0 auto; }
    .pwa-update-actions .button { min-height: 32px; padding: 5px 9px; font-size: .68rem; }
    .sync-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
    .sync-summary > div { padding: 8px; border-radius: var(--talaan-control-radius); background: var(--surface-soft); border: 1px solid var(--line); }
    .sync-summary span { display: block; color: var(--muted); font-size: .61rem; }
    .sync-summary strong { display: block; margin-top: 2px; font-size: .82rem; }
    .warning-box { padding:10px; border-radius:var(--talaan-control-radius); background:var(--orange-soft); border:1px solid color-mix(in srgb,var(--orange) 34%,var(--line)); color:var(--orange-text); font-size:.73rem; }
    .success-box { padding: 10px; border-radius: var(--talaan-control-radius); background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 34%,var(--line)); color: var(--green-text); font-size: .73rem; }
    .sample-data-notice {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 0 0 14px;
      padding: 11px 13px;
      border: 1px solid color-mix(in srgb, var(--orange) 38%, var(--line));
      border-radius: var(--radius);
      background: var(--orange-soft);
      color: var(--text);
    }
    .sample-data-notice[hidden] { display: none; }
    body.finance-signed-out .sample-data-notice,
    body.finance-auth-pending .sample-data-notice { display: none !important; }
    .sample-data-notice-copy { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
    .sample-data-notice-copy > div { min-width: 0; }
    .sample-data-notice-copy strong { display: block; font-size: .78rem; line-height: 1.25; }
    .sample-data-notice-copy p { margin: 3px 0 0; color: var(--muted); font-size: .71rem; line-height: 1.4; }
    .sample-data-notice .button { flex: 0 0 auto; }
    .file-label { display: inline-flex; align-items: center; justify-content: center; }
    @media (max-width: 850px) {
      .recovery-pack-form, .system-inline-form { grid-template-columns: 1fr; }
      .sync-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .pwa-update-inner { align-items: flex-start; flex-direction: column; }
      .pwa-update-actions { width: 100%; }
      .pwa-update-actions .button { flex: 1; }
      .sample-data-notice { align-items: stretch; flex-direction: column; }
      .sample-data-notice .button { width: 100%; }
    }



    /* V12.7 Phase 8 expense-total choice, Phase 7 secure reset, Phase 6 savings, Phase 5 visual system, Phase 4 dashboard, and Apple Calendar */
    .dashboard-heading-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
    .dashboard-card-grid {
      display:grid;
      grid-template-columns:repeat(12,minmax(0,1fr));
      grid-auto-flow:dense;
      gap:10px;
      margin-top:10px;
    }
    .dashboard-detail-card {
      position:relative;
      min-width:0;
      min-height:168px;
      grid-column:span 3;
    }
    .dashboard-detail-card[data-size="small"] { grid-column:span 3; }
    .dashboard-detail-card[data-size="large"] { grid-column:span 4; }
    .dashboard-detail-card[data-size="wide"] { grid-column:span 6; }
    .dashboard-resize-handle {
      position:absolute;
      right:8px;
      bottom:8px;
      width:28px;
      height:28px;
      border:1px dashed var(--line);
      border-radius:999px;
      background:color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
      color:var(--muted);
      display:none;
      align-items:center;
      justify-content:center;
      cursor:ew-resize;
      font-size:.82rem;
      font-weight:900;
      z-index:2;
    }
    #dashboard.dashboard-customizing .dashboard-resize-handle { display:inline-flex; }
    .dashboard-resize-handle:hover,
    .dashboard-resize-handle:focus-visible { color:var(--text); border-color:var(--primary); outline:none; }
    .dashboard-detail-card.is-dashboard-resizing {
      outline:2px solid var(--primary);
      outline-offset:2px;
      box-shadow:0 14px 36px color-mix(in srgb, var(--primary) 16%, transparent);
    }
    .dashboard-customize-toolbar {
      position:sticky;
      top:var(--desktop-header-height);
      z-index:48;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin:0 0 10px;
      padding:9px 10px;
      border:1px solid color-mix(in srgb, var(--primary) 36%, var(--line));
      border-radius:var(--talaan-card-radius);
      background:color-mix(in srgb, var(--surface) 94%, var(--green-soft));
      box-shadow:0 12px 28px rgba(16,24,40,.12);
      backdrop-filter:blur(12px);
    }
    .dashboard-customize-toolbar[hidden] { display:none !important; }
    .dashboard-customize-toolbar-copy { min-width:0; }
    .dashboard-customize-toolbar-copy strong,
    .dashboard-customize-toolbar-copy small { display:block; }
    .dashboard-customize-toolbar-copy strong { font-size:.8rem; }
    .dashboard-customize-toolbar-copy small { margin-top:2px; color:var(--muted); font-size:.64rem; }
    .dashboard-customize-toolbar-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
    #dashboard.dashboard-customizing .dashboard-detail-card:not(.is-dashboard-hidden) {
      border-color:color-mix(in srgb, var(--primary) 24%, var(--line));
    }
    body.dashboard-pointer-resizing { cursor:ew-resize; user-select:none; }
    .dashboard-detail-card.is-dashboard-hidden { display:none !important; }
    .dashboard-stat-line { display:flex; align-items:center; justify-content:space-between; gap:9px; padding:5px 0; border-bottom:1px solid var(--line); }
    .dashboard-stat-line:last-child { border-bottom:0; }
    .dashboard-stat-line span { color:var(--muted); font-size:.68rem; }
    .dashboard-stat-line strong { font-size:.78rem; }
    .dashboard-empty { color:var(--muted); font-size:.72rem; padding:8px 0; }
    .dashboard-privacy .kpi-value,
    .dashboard-privacy .amount,
    .dashboard-privacy .account-card strong,
    .dashboard-privacy .dashboard-stat-line strong,
    .dashboard-privacy .comparison-value,
    .dashboard-privacy .month-comparison-item strong {
      color:transparent !important;
      text-shadow:0 0 9px rgba(23,59,103,.72);
      user-select:none;
    }
    .dashboard-customize-list { display:grid; gap:8px; }
    .dashboard-customize-row {
      display:grid;
      grid-template-columns:minmax(0,1fr) auto auto;
      align-items:center;
      gap:10px;
      padding:10px 11px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface-soft);
    }
    .dashboard-size-field { display:grid; gap:4px; min-width:160px; }
    .dashboard-size-field span { font-size:.64rem; color:var(--muted); font-weight:800; }
    .dashboard-size-field .select { min-height:34px; padding:5px 8px; font-size:.72rem; }
    .dashboard-customize-main { display:flex; align-items:center; gap:9px; min-width:0; }
    .dashboard-customize-main input { width:17px; height:17px; }
    .dashboard-customize-main strong { font-size:.78rem; }
    .dashboard-customize-actions { display:flex; gap:5px; }
    .dashboard-customize-actions .button { min-width:31px; padding:5px 8px; }
    .project-calendar-options {
      grid-column:1/-1;
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(180px,.65fr);
      gap:10px;
      padding:11px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface-soft);
    }
    .project-calendar-options[hidden] { display:none !important; }
    .project-calendar-check { display:flex; align-items:flex-start; gap:9px; font-size:.76rem; font-weight:750; color:var(--text); }
    .project-calendar-check input { width:18px; height:18px; margin-top:1px; }
    .project-calendar-help { grid-column:1/-1; margin:0; color:var(--muted); font-size:.68rem; line-height:1.45; }
    .calendar-status { display:inline-flex; align-items:center; padding:3px 7px; border-radius:999px; font-size:.62rem; font-weight:800; }
    .calendar-status.ready { background:var(--green-soft); color:var(--green-text); }
    .calendar-status.update { background:var(--orange-soft); color:var(--orange-text); }
    .calendar-status.none { background:var(--surface-soft); color:var(--muted); }
    .calendar-status.missing { background:var(--blue-soft); color:var(--blue); }
    .calendar-settings-grid { display:grid; gap:10px; }
    .calendar-setting-check { display:flex; align-items:flex-start; gap:9px; color:var(--text); font-size:.76rem; font-weight:700; }
    .calendar-setting-check input { width:17px; height:17px; margin-top:1px; }

    @media (max-width:1120px) {
      .dashboard-card-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
      .dashboard-detail-card[data-size="small"],
      .dashboard-detail-card[data-size="large"] { grid-column:span 3; }
      .dashboard-detail-card[data-size="wide"] { grid-column:1 / -1; }
    }
    @media (max-width:700px) {
      .dashboard-heading-actions { width:100%; }
      .dashboard-heading-actions .button { flex:1 1 150px; }
      .dashboard-card-grid { grid-template-columns:1fr; }
      .dashboard-detail-card[data-size="small"],
      .dashboard-detail-card[data-size="large"],
      .dashboard-detail-card[data-size="wide"] { grid-column:1; }
      #dashboard.dashboard-customizing .dashboard-resize-handle { display:none; }
      .dashboard-customize-toolbar { top:65px; align-items:flex-start; flex-direction:column; }
      .dashboard-customize-toolbar-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; }
      .dashboard-customize-toolbar-actions .button:last-child { grid-column:1/-1; }
      .dashboard-customize-row { grid-template-columns:1fr; }
      .dashboard-size-field { min-width:0; }
      .project-calendar-options { grid-template-columns:1fr; }
    }


    @media (max-width:520px) {
      .topbar { flex-wrap:wrap; align-items:flex-start; overflow:hidden; }
      .topbar-left { flex:1 1 100%; min-width:0; }
      .topbar-actions { width:100%; min-width:0; justify-content:flex-end; }
      .month-navigator { width:100%; max-width:100%; min-width:0; }
      .month-control { flex:1 1 auto; min-width:0; }
      .month-control input { width:100%; min-width:0; }
      #dashboard .kpi-card { overflow:hidden; }
    }



    /* V12.4 · Phase 5 visual system, dark mode, flatter corners, and filled bento cards */
    :root { --radius: 12px; --control-radius: 8px; color-scheme: light; }
    html[data-theme="dark"] {
      color-scheme: dark;
      --bg: #000000; --surface: #080b10; --surface-soft: #0e131b; --text: #f4f7fb; --muted: #9ca8b8; --line: #202938;
      --nav: #080b10; --primary: #356FD1; --primary-dark: #2457AD; --primary-contrast:#ffffff; --field-label:#dbe3ef; --green: #2f8f46; --green-text: #78d695; --green-soft: #10271a;
      --red: #d64535; --red-soft: #2a1412; --orange: #e68a1f; --orange-text: #e68a1f; --orange-soft: #2b1d0d; --blue: #7daaff; --blue-soft: #111d33;
      --danger: #ff8a7f; --toast-bg: #080b10; --toast-fg: #f4f7fb; --shadow: 0 10px 28px rgba(0,0,0,.24);
    }
    body { transition: background-color .18s ease, color .18s ease; }
    .card, dialog, .legend-item, .summary-item, .period-card, .flow-box, .account-card, .month-insights-card, .dashboard-detail-card { border-radius: var(--talaan-card-radius); }
    .button, .input, .select, .textarea, .menu-button, .month-nav-button, .month-control, .nav-button, .collapse-toggle, .expense-view-toggle, .setting-row { border-radius: var(--talaan-control-radius); }
    .brand-mark { border-radius: var(--talaan-control-radius); }
    .summary-card { border-top: 0 !important; }
    .summary-card::after { display: none !important; }
    .period-early .period-header, .period-late .period-header, .period-other .period-header { border-top: 0 !important; }
    .legend-item.summary-card-green, .summary-card-green, .bento-tone-green { background: var(--green-soft) !important; border-color: color-mix(in srgb, var(--green) 26%, var(--line)) !important; }
    .legend-item.summary-card-red, .summary-card-red, .bento-tone-red { background: var(--red-soft) !important; border-color: color-mix(in srgb, var(--red) 26%, var(--line)) !important; }
    .legend-item.summary-card-orange, .summary-card-orange, .bento-tone-orange { background: var(--orange-soft) !important; border-color: color-mix(in srgb, var(--orange) 28%, var(--line)) !important; }
    .legend-item.summary-card-blue, .summary-card-blue, .bento-tone-blue { background: var(--blue-soft) !important; border-color: color-mix(in srgb, var(--blue) 26%, var(--line)) !important; }
    .summary-card-neutral, .bento-tone-neutral { background: var(--surface-soft) !important; border-color: var(--line) !important; }
    .summary-card-danger, .bento-tone-danger { background: var(--red-soft) !important; border-color: color-mix(in srgb, var(--danger) 30%, var(--line)) !important; }
    .period-early { background: color-mix(in srgb, var(--red-soft) 55%, var(--surface)); }
    .period-late { background: color-mix(in srgb, var(--orange-soft) 55%, var(--surface)); }
    .period-other { background: color-mix(in srgb, var(--blue-soft) 55%, var(--surface)); }
    .period-card .record-header, .period-card .record-row { background: var(--surface); }
    .theme-toggle-button { min-height: 38px; display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); font-weight:780; }
    .theme-toggle-button:hover { background:var(--surface-soft); }
    .theme-toggle-text { font-size:.72rem; }
    .appearance-settings-card { margin-bottom: 0; }
    .appearance-preview { padding:4px 8px; border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.7rem; font-weight:800; }
    .appearance-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .appearance-choice { min-height:76px; padding:10px; display:grid; justify-items:start; gap:2px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text); text-align:left; }
    .appearance-choice > span { font-size:1.1rem; }
    .appearance-choice strong { font-size:.78rem; }
    .appearance-choice small { color:var(--muted); font-size:.65rem; }
    .appearance-choice[aria-checked="true"] { background:var(--green-soft); border-color:var(--green); box-shadow:inset 0 0 0 1px var(--green); }
    .report-section-heading { display:flex; align-items:center; gap:9px; margin:14px 0 8px; }
    .report-section-heading > span { width:26px; height:26px; display:grid; place-items:center; border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--primary); font-size:.65rem; font-weight:900; border:1px solid var(--line); }
    .report-section-heading strong, .report-section-heading small { display:block; }
    .report-section-heading strong { font-size:.8rem; }
    .report-section-heading small { margin-top:1px; color:var(--muted); font-size:.65rem; }
    .report-stack-heading { grid-column:1/-1; margin:2px 0 0; }
    .report-status-title-line { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
    .report-lifecycle-chip { padding:3px 7px; border-radius:999px; border:1px solid var(--line); background:var(--surface-soft); color:var(--muted); font-size:.62rem; font-weight:850; }
    .report-lifecycle-chip.active, .report-lifecycle-chip.draft { background:var(--orange-soft); color:var(--orange-text); border-color:color-mix(in srgb,var(--orange) 35%,var(--line)); }
    .report-lifecycle-chip.final, .report-lifecycle-chip.regenerated { background:var(--green-soft); color:var(--green-text); border-color:color-mix(in srgb,var(--green) 35%,var(--line)); }
    .report-comparison-card { margin-top:10px; }
    .report-comparison-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
    .report-comparison-item { min-width:0; padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .report-comparison-item span, .report-comparison-item strong, .report-comparison-item small { display:block; }
    .report-comparison-item span { color:var(--muted); font-size:.62rem; font-weight:750; }
    .report-comparison-item strong { margin-top:3px; font-size:.78rem; }
    .report-comparison-item small { margin-top:2px; font-size:.6rem; }
    .report-analysis-grid { margin-top:0 !important; }
    .report-export-card { margin-top:0; }
    html[data-theme="dark"] body, html[data-theme="dark"] .topbar { background:var(--bg); color:var(--text); }
    html[data-theme="dark"] .topbar { border-bottom-color:var(--line); }
    html[data-theme="dark"] .card, html[data-theme="dark"] dialog, html[data-theme="dark"] .legend-item, html[data-theme="dark"] .summary-item, html[data-theme="dark"] .record-row, html[data-theme="dark"] .record-header, html[data-theme="dark"] .report-table-row, html[data-theme="dark"] .report-table-header, html[data-theme="dark"] .setting-row, html[data-theme="dark"] .month-control, html[data-theme="dark"] .month-nav-button, html[data-theme="dark"] .input, html[data-theme="dark"] .select, html[data-theme="dark"] .textarea, html[data-theme="dark"] .collapse-toggle, html[data-theme="dark"] .button-secondary { background-color:var(--surface); color:var(--text); border-color:var(--line); }
    html[data-theme="dark"] .button-secondary:hover, html[data-theme="dark"] .collapse-toggle:hover { background:var(--surface-soft); }
    html[data-theme="dark"] .button-danger { background:var(--red-soft); color:var(--danger); border-color:color-mix(in srgb,var(--danger) 42%,var(--line)); }
    html[data-theme="dark"] .status-chip { background:var(--surface-soft); color:var(--text); border-color:var(--line); }
    html[data-theme="dark"] .status-chip.success { background:var(--green-soft); color:var(--green-text); border-color:color-mix(in srgb,var(--green) 42%,var(--line)); }
    html[data-theme="dark"] .status-chip.warning { background:var(--orange-soft); color:var(--orange-text); border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); }
    html[data-theme="dark"] .status-chip.danger { background:var(--red-soft); color:var(--danger); border-color:color-mix(in srgb,var(--danger) 42%,var(--line)); }
    html[data-theme="dark"] .status-chip.info { background:var(--blue-soft); color:var(--blue); border-color:color-mix(in srgb,var(--blue) 42%,var(--line)); }
    html[data-theme="dark"] .sidebar { background:var(--nav); }
    html[data-theme="dark"] .sidebar-note { color:var(--muted); }
    html[data-theme="dark"] .nav-button { color:var(--muted); }
    html[data-theme="dark"] .nav-button.active, html[data-theme="dark"] .nav-button:hover { background:rgba(255,255,255,.09); }
    html[data-theme="dark"] .empty-state, html[data-theme="dark"] .expense-form-mode-note, html[data-theme="dark"] .bulk-expense-bar, html[data-theme="dark"] .month-insights-card { background:var(--surface-soft); border-color:var(--line); color:var(--text); }
    html[data-theme="dark"] .expense-total-choice.is-excluded { background:var(--orange-soft); border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); }
    html[data-theme="dark"] .status-excluded { color:var(--orange-text); background:var(--orange-soft); border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); }
    html[data-theme="dark"] .record-row.due-soon-row { background:var(--orange-soft); }
    html[data-theme="dark"] .record-row.overdue-row { background:var(--red-soft); }
    html[data-theme="dark"] dialog::backdrop { background:rgba(0,0,0,.68); }
    .cloud-conflict-review-dialog { width:min(780px,calc(100vw - 28px)) !important; }
    .cloud-conflict-review-dialog .modal-header > div { min-width:0; }
    .cloud-conflict-review-dialog .modal-header small { display:block; margin-top:2px; color:var(--muted); font-size:.61rem; overflow-wrap:anywhere; }
    .cloud-conflict-comparison { overflow:visible; border:1px solid var(--line); border-radius:var(--talaan-card-radius); }
    .cloud-conflict-comparison-head,.cloud-conflict-comparison-row { display:grid; grid-template-columns:minmax(110px,.7fr) minmax(0,1fr) minmax(0,1fr); }
    .cloud-conflict-comparison-head { background:var(--surface-soft); }
    .cloud-conflict-comparison-head > *, .cloud-conflict-comparison-row > * { min-width:0; margin:0; padding:8px 9px; border-right:1px solid var(--line); overflow-wrap:anywhere; }
    .cloud-conflict-comparison-head > *:last-child, .cloud-conflict-comparison-row > *:last-child { border-right:0; }
    .cloud-conflict-comparison-head strong { color:var(--muted); font-size:.62rem; }
    .cloud-conflict-comparison-row { border-top:1px solid var(--line); }
    .cloud-conflict-comparison-row strong { background:var(--surface-soft); font-size:.64rem; }
    .cloud-conflict-comparison-row span { font-size:.62rem; white-space:pre-wrap; }
    .cloud-conflict-warning { margin:9px 0 0; padding:8px 9px; border:1px solid color-mix(in srgb,var(--orange) 35%,var(--line)); border-radius:var(--talaan-control-radius); background:var(--orange-soft); color:var(--text); font-size:.62rem; line-height:1.45; }
    .cloud-conflict-review-dialog .dialog-action-status { margin:9px 0 0; padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--muted); font-size:.65rem; line-height:1.45; }
    .cloud-conflict-review-dialog .dialog-action-status.danger { border-color:color-mix(in srgb,var(--red) 42%,var(--line)); background:var(--red-soft); color:var(--danger); }
    .cloud-conflict-review-dialog [aria-busy="true"] { cursor:progress; }
    .cloud-conflict-review-footer .dialog-secondary-leading { margin-right:auto; }
    @media(max-width:700px){.cloud-conflict-comparison{overflow:auto}.cloud-conflict-comparison-head,.cloud-conflict-comparison-row{min-width:610px}.cloud-conflict-review-footer{display:grid!important;grid-template-columns:1fr 1fr}.cloud-conflict-review-footer .dialog-secondary-leading{margin:0}.cloud-conflict-review-footer .button{width:100%;min-height:44px}}
    html[data-theme="dark"] #buildBadge { background:var(--green-soft) !important; color:var(--green-text) !important; }
    @media (max-width: 900px) { .report-comparison-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width: 680px) { .theme-toggle-text { display:none; } .theme-toggle-button { width:38px; justify-content:center; padding:0; } .appearance-choice-grid { grid-template-columns:1fr; } .report-comparison-grid { grid-template-columns:1fr; } }
    @media print { html, html[data-theme="dark"] { color-scheme:light; } body, html[data-theme="dark"] body, html[data-theme="dark"] .card, html[data-theme="dark"] .report-table-row, html[data-theme="dark"] .report-table-header { background:#fff !important; color:#111 !important; } .theme-toggle-button, .report-status-actions { display:none !important; } }

    /* V12.8.0 · Phase 9 UI/UX stabilization */
    .dashboard-chart-card { grid-column: 1 / -1; min-height: 280px; }
    .dashboard-chart-card .card-header { margin-bottom: 8px; }
    .chart-period-chip { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border:1px solid var(--line); border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.64rem; font-weight:850; }
    .chart-shell { min-width:0; display:grid; gap:8px; }
    .chart-svg { display:block; width:100%; height:auto; min-height:190px; overflow:visible; }
    .chart-grid-line { stroke:var(--line); stroke-width:1; vector-effect:non-scaling-stroke; }
    .chart-axis-label { fill:var(--muted); font-size:10px; font-weight:700; }
    .chart-line { fill:none; stroke:var(--green); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
    .chart-point { fill:var(--surface); stroke:var(--green); stroke-width:3; vector-effect:non-scaling-stroke; }
    .chart-income-bar { fill:var(--green); }
    .chart-expense-bar { fill:var(--red); }
    .chart-zero-line { stroke:var(--muted); stroke-width:1; stroke-dasharray:4 4; vector-effect:non-scaling-stroke; }
    .chart-legend { display:flex; align-items:center; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:.67rem; }
    .chart-legend span { display:inline-flex; align-items:center; gap:6px; }
    .chart-legend i { width:10px; height:10px; border-radius:999px; display:inline-block; }
    .chart-legend .income { background:var(--green); }
    .chart-legend .expense { background:var(--red); }
    .chart-note { margin:0; color:var(--muted); font-size:.68rem; }
    .chart-empty { min-height:190px; display:grid; place-items:center; padding:18px; border:1px dashed var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); color:var(--muted); text-align:center; font-size:.74rem; }
    .savings-detail-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; margin-top:8px; }
    .savings-detail-grid > div { min-width:0; padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .savings-detail-grid span, .savings-detail-grid strong { display:block; }
    .savings-detail-grid span { color:var(--muted); font-size:.61rem; font-weight:750; }
    .savings-detail-grid strong { margin-top:2px; font-size:.76rem; overflow-wrap:anywhere; }
    .cash-flow-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-top:8px; }
    .cash-flow-summary > div { padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .cash-flow-summary span, .cash-flow-summary strong { display:block; }
    .cash-flow-summary span { color:var(--muted); font-size:.61rem; }
    .cash-flow-summary strong { margin-top:2px; font-size:.76rem; }
    .account-card-label small { display:block; margin-top:2px; color:var(--muted); font-size:.61rem; font-weight:750; }
    .account-setting-row { display:grid; grid-template-columns:minmax(110px,1fr) 150px 135px; gap:8px; align-items:center; }
    .account-setting-row + .account-setting-row { margin-top:8px; }
    .account-setting-row > label { font-weight:750; font-size:.78rem; overflow-wrap:anywhere; }
    .savings-settings-card { margin-top:12px; }
    .savings-settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:end; }
    .savings-setting-check { min-height:40px; display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text); font-size:.72rem; font-weight:700; }
    .savings-setting-check input { width:17px; height:17px; }
    .savings-settings-actions { grid-column:1/-1; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .savings-help { margin:0; color:var(--muted); font-size:.7rem; }
    .report-five-summary { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .month-comparison-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .report-comparison-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
    .report-savings-card { margin-bottom:10px; }
    .dashboard-privacy .chart-sensitive { filter:blur(8px); opacity:.3; pointer-events:none; user-select:none; }
    @media (max-width:1120px) { .report-five-summary { grid-template-columns:repeat(3,minmax(0,1fr)); } .report-comparison-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
    @media (max-width:900px) { .month-comparison-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:800px) { .savings-settings-grid { grid-template-columns:1fr; } .savings-settings-actions { grid-column:auto; } .account-setting-row { grid-template-columns:1fr; gap:5px; padding:9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); } }
    @media (max-width:700px) { .savings-detail-grid, .cash-flow-summary, .report-five-summary, .month-comparison-grid, .report-comparison-grid { grid-template-columns:1fr; } .dashboard-chart-card { min-height:0; } .chart-svg { min-height:170px; } }



    /* Phase 7: secure typed confirmation for destructive sample-data reset */
    .reset-warning {
      margin: 0 0 14px;
      padding: 12px;
      border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
      border-radius: var(--talaan-control-radius);
      background: color-mix(in srgb, var(--red-soft) 78%, var(--surface));
      color: var(--text);
    }
    .reset-warning strong { display: block; margin-bottom: 5px; color: var(--danger); }
    .reset-warning p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
    .reset-confirm-phrase {
      display: inline-block;
      margin-top: 5px;
      padding: 2px 5px;
      border-radius: var(--talaan-control-radius);
      background: var(--surface-soft);
      color: var(--text);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-weight: 800;
    }
    .reset-confirm-status { margin: 7px 0 0; min-height: 1.2em; color: var(--muted); font-size: .72rem; }
    .reset-confirm-status.ready { color: var(--green-text); font-weight: 750; }
    .reset-confirm-status.invalid { color: var(--danger); }
    #confirmSampleResetButton[disabled] { opacity: .5; cursor: not-allowed; }


    /* V12.8.0 · Phase 9 UI/UX stabilization */
    :root { --touch-target: 40px; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [role="tab"]:focus-visible {
      outline: 3px solid color-mix(in srgb, var(--primary) 70%, #ffffff);
      outline-offset: 2px;
    }
    .button-small { min-height: 38px; padding: 7px 10px; font-size: .78rem; }
    .month-nav-button { width: 40px; height: 40px; border-radius: var(--control-radius); }
    .checklist-reset { min-height: 38px; padding: 7px 9px; font-size: .75rem; border-radius: var(--control-radius); }
    .monthly-check-item { min-height: 42px; background: var(--surface); color: var(--text); font-size: .75rem; padding: 8px 9px; }
    .monthly-check-item.is-done { background: var(--surface-soft); color: var(--muted); }
    html[data-theme="dark"] .monthly-check-item { background: var(--surface); color: var(--text); border-color: var(--line); }
    html[data-theme="dark"] .monthly-check-item.is-done { background: var(--surface-soft); color: var(--muted); }
    .month-comparison-item span, .savings-detail-grid span, .cash-flow-summary span, .report-comparison-item span { font-size: .72rem; }
    .month-comparison-item strong, .savings-detail-grid strong, .cash-flow-summary strong { font-size: .82rem; }
    .chart-axis-label { font-size: 12px; }
    .chart-note, .system-help, .savings-help, .project-calendar-help, .field-help { font-size: .75rem; }
    .calculation-help { margin:0; color:var(--muted); font-size:.82rem; line-height:1.55; }
    .calculation-help strong { color:var(--text); }
    #buildBadge { display:inline-block; margin-top:4px; padding:2px 7px; border-radius:999px; background:var(--green-soft); color:var(--green-text); font-weight:800; font-size:.7rem; }

    .mobile-add-expense-fab { display:none; }
    .mobile-record-actions { display:none; }

    .project-record-header { grid-template-columns:minmax(200px,1.8fr) minmax(90px,.8fr) minmax(102px,.88fr) minmax(96px,.82fr) minmax(102px,.88fr) minmax(102px,.88fr) minmax(145px,1fr) minmax(170px,auto); }
    .payment-record-header { grid-template-columns:minmax(170px,1.15fr) repeat(4,minmax(90px,1fr)) auto; }
    .responsive-record { grid-template-columns:minmax(170px,1.15fr) minmax(0,2.5fr) auto; gap:12px; }
    .record-meta-grid { min-width:0; display:grid; grid-template-columns:repeat(5,minmax(80px,1fr)); gap:8px; align-items:center; }
    .payment-record .record-meta-grid { grid-template-columns:repeat(4,minmax(90px,1fr)); }
    .record-meta-grid > div { min-width:0; }
    .record-meta-grid > div > span { display:block; color:var(--muted); font-size:.68rem; font-weight:750; }
    .record-meta-grid > div > strong { display:block; margin-top:2px; font-size:.78rem; overflow-wrap:anywhere; }
    .project-record {
      grid-template-columns:minmax(200px,1.8fr) minmax(90px,.8fr) minmax(102px,.88fr) minmax(96px,.82fr) minmax(102px,.88fr) minmax(102px,.88fr) minmax(145px,1fr) minmax(170px,auto);
      gap:12px;
      align-items:center;
    }
    .project-record > * { min-width:0; }
    .project-record > :not(.record-title):not(.record-actions):not(.mobile-record-actions) { text-align:center; }
    .project-record .record-title { position:relative; }
    .project-record .record-title strong { display:flex; align-items:center; gap:6px; min-width:0; }
    .project-record .record-title .project-title-text,
    .project-title-note-trigger {
      display:inline;
      max-width:100%;
      font:inherit;
      font-weight:inherit;
      color:inherit;
      text-align:left;
      background:transparent;
      border:0;
      padding:0;
      margin:0;
    }
    .project-title-note { position:relative; display:inline-block; max-width:100%; }
    .project-title-note-trigger { cursor:help; }
    .project-note-tooltip {
      position:absolute;
      left:0;
      top:calc(100% + 6px);
      z-index:32;
      width:min(280px,calc(100vw - 48px));
      padding:8px 10px;
      border:1px solid var(--line);
      border-radius:var(--talaan-popover-radius);
      background:var(--surface);
      box-shadow:var(--shadow);
      color:var(--text);
      font-size:.72rem;
      line-height:1.5;
      text-transform:none;
      letter-spacing:normal;
      display:none;
    }
    .project-title-note:hover .project-note-tooltip,
    .project-title-note:focus-within .project-note-tooltip,
    .project-title-note.is-open .project-note-tooltip { display:block; }
    .project-deadline-state { margin-top:5px; }
    .project-cell { text-align:center; }
    .project-value-cell strong { font-variant-numeric:tabular-nums; }
    .project-calendar-cell { display:flex; justify-content:center; }
    .project-calendar-button { min-width:136px; justify-content:center; }
    .project-calendar-button.is-added {
      background:var(--surface-soft);
      color:var(--muted);
      border-color:var(--line);
    }
    .project-calendar-button.needs-update {
      background:var(--orange-soft);
      color:var(--orange-text);
      border-color:color-mix(in srgb,var(--orange) 26%,var(--line));
    }
    .project-calendar-button.no-deadline {
      background:var(--surface-soft);
      color:var(--muted);
      border-style:dashed;
    }
    .project-row-actions { width:100%; justify-content:center; flex-wrap:wrap; }
    .project-row-actions .button { min-width:0; }
    .record-more-menu { position:relative; min-width:0; }
    .record-more-menu > summary { list-style:none; display:flex; align-items:center; justify-content:center; cursor:pointer; }
    .record-more-menu > summary::-webkit-details-marker { display:none; }
    .record-more-panel { position:absolute; right:0; bottom:calc(100% + 7px); z-index:20; width:min(250px,calc(100vw - 44px)); display:grid; gap:6px; padding:8px; border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:var(--shadow); }
    .record-more-panel .button { width:100%; justify-content:flex-start; }
    html[data-theme="dark"] .record-more-panel { background:var(--surface); border-color:var(--line); }

    dialog { width:min(680px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); border-radius:var(--talaan-dialog-radius); overflow:visible; }
    dialog > form, #dashboardCustomizeDialog[open], #syncReviewDialog[open] { max-height:calc(100dvh - 28px); display:flex; flex-direction:column; }
    .modal-header, .modal-footer { flex:0 0 auto; background:var(--surface); }
    .modal-body { min-height:0; overflow:auto; overscroll-behavior:contain; }
    .modal-footer { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
    .form-disclosure { border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .form-disclosure > summary { min-height:42px; display:flex; align-items:center; padding:9px 11px; cursor:pointer; font-weight:750; }
    .form-disclosure > .field { padding:0 11px 11px; }

    .report-section-nav { position:sticky; top:73px; z-index:24; display:flex; gap:6px; overflow-x:auto; padding:7px; margin:0 0 10px; border:1px solid var(--line); border-radius:var(--talaan-section-radius); background:color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter:blur(10px); scrollbar-width:thin; }
    .report-section-nav button { flex:0 0 auto; min-height:36px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); padding:6px 10px; background:var(--surface); color:var(--text); font-weight:750; font-size:.74rem; }
    .report-section-heading { scroll-margin-top:130px; }

    .chart-data-details { margin-top:7px; border-top:1px solid var(--line); padding-top:7px; }
    .chart-data-details > summary { min-height:36px; display:flex; align-items:center; cursor:pointer; color:var(--primary); font-size:.76rem; font-weight:800; }
    .chart-data-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:var(--talaan-card-radius); }
    .chart-data-table-wrap table { width:100%; border-collapse:collapse; font-size:.75rem; }
    .chart-data-table-wrap th, .chart-data-table-wrap td { padding:7px 8px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
    .chart-data-table-wrap th:first-child, .chart-data-table-wrap td:first-child { text-align:left; }
    .chart-zero-state { min-height:170px; display:grid; place-content:center; gap:4px; padding:18px; border:1px dashed var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); text-align:center; }
    .chart-zero-state strong { font-size:.9rem; }
    .chart-zero-state span { color:var(--muted); font-size:.76rem; }

    .settings-navigation { position:sticky; top:72px; z-index:26; margin-bottom:12px; }
    .settings-tablist { display:flex; gap:6px; overflow-x:auto; padding:7px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter:blur(10px); scrollbar-width:thin; }
    .settings-tablist button { flex:0 0 auto; min-height:40px; border:1px solid transparent; border-radius:var(--talaan-control-radius); padding:7px 11px; background:transparent; color:var(--muted); font-weight:800; font-size:.76rem; }
    .settings-tablist button[aria-selected="true"] { background:var(--primary); color:var(--primary-contrast); }
    .settings-panel { display:grid; gap:12px; }
    .settings-panel[hidden] { display:none !important; }
    .settings-panel > .card, .settings-panel > .grid { margin-top:0 !important; }
    .settings-about-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .settings-about-grid > div { padding:9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .settings-about-grid span, .settings-about-grid strong { display:block; }
    .settings-about-grid span { color:var(--muted); font-size:.72rem; }
    .settings-about-grid strong { margin-top:2px; font-size:.82rem; }

    .topbar { padding-top:max(12px,env(safe-area-inset-top)); }
    .sidebar { padding-top:max(22px,calc(env(safe-area-inset-top) + 12px)); padding-bottom:max(22px,env(safe-area-inset-bottom)); }
    .toast { bottom:max(18px,calc(env(safe-area-inset-bottom) + 10px)); }

    @media (max-width:850px) {
      .topbar-actions .button { display:none; }
      .mobile-add-expense-fab { position:fixed; right:max(16px,env(safe-area-inset-right)); bottom:max(16px,calc(env(safe-area-inset-bottom) + 10px)); z-index:80; min-height:48px; display:inline-flex; align-items:center; gap:7px; padding:10px 15px; border:0; border-radius:var(--talaan-control-radius); background:var(--primary); color:var(--primary-contrast); box-shadow:0 14px 34px rgba(16,24,40,.25); font-weight:850; }
      .mobile-add-expense-fab span:first-child { font-size:1.25rem; line-height:1; }
      #buildBadge { display:none; }
      .settings-navigation { top:67px; }
      .report-section-nav { top:67px; }
      .content { padding-bottom:max(82px,calc(env(safe-area-inset-bottom) + 74px)); }
    }

    @media (max-width:700px) {
      .button, .button-small, .menu-button, .month-nav-button, .collapse-toggle, .theme-toggle-button { min-height:44px; }
      .button-small { padding:8px 11px; font-size:.8rem; }
      .month-nav-button { width:44px; height:44px; }
      .monthly-check-item { min-height:44px; font-size:.78rem; }
      .checklist-reset { min-height:44px; }
      .card, #dashboard .card, #reports .kpi-grid .card, #reports .report-detail-stack .card, #reports > article.card { border-radius:var(--talaan-card-radius); }
      dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
      dialog > form, #dashboardCustomizeDialog[open], #syncReviewDialog[open] { max-height:calc(100dvh - 16px); }
      .modal-header, .modal-footer { padding:12px; }
      .modal-body { padding:14px 12px; }
      .modal-footer .button { flex:1; }
      .desktop-record-actions { display:none !important; }
      .mobile-record-actions { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
      .responsive-record, .project-record, .payment-record { display:grid; grid-template-columns:1fr; gap:10px; padding:13px; overflow:visible; }
      .responsive-record .record-title { grid-column:1; }
      .responsive-record > .record-meta-grid::before, .responsive-record > .mobile-record-actions::before, .responsive-record > .record-actions::before { content:none !important; }
      .record-meta-grid, .payment-record .record-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
      .record-meta-grid > div { padding:8px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
      .responsive-record > .record-actions { grid-column:1; grid-row:auto; width:100%; }
      .responsive-record > .record-actions .button { width:100%; }
      #reports .report-detail-stack { display:grid; grid-template-columns:1fr; min-width:0; }
      #reports .report-table-header { display:none; }
      #reports .report-table-row { display:grid; grid-template-columns:1fr !important; gap:7px; min-width:0; padding:11px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); margin-bottom:7px; background:var(--surface); }
      #reports .report-table-row > * { min-width:0; overflow-wrap:anywhere; }
      #reports .report-table-row > *::before { content:attr(data-label) ": "; color:var(--muted); font-weight:700; }
      #reports .report-table-row > :first-child::before { content:""; }
      #reportExpenseList, #reportPaidExpenseList, #reportProjectList, #reportPaymentList { max-height:none; overflow:visible; min-width:0; }
      #reports .toolbar .button { width:100%; }
      .report-section-nav, .settings-navigation { margin-left:-4px; margin-right:-4px; }
      .chart-svg { min-height:210px; }
      .chart-axis-label { font-size:13px; }
      .settings-about-grid { grid-template-columns:1fr; }
      .dashboard-default-layout [data-dashboard-card="cash-flow"] { order:1; }
      .dashboard-default-layout [data-dashboard-card="calendar"] { order:2; }
      .dashboard-default-layout [data-dashboard-card="due-soon"] { order:3; }
      .dashboard-default-layout [data-dashboard-card="expense-schedule"] { order:4; }
      .dashboard-default-layout [data-dashboard-card="savings-goals"] { order:5; }
      .dashboard-default-layout [data-dashboard-card="savings-trend"] { order:6; }
      .dashboard-default-layout [data-dashboard-card="payment-progress"] { order:7; }
      .dashboard-default-layout [data-dashboard-card="accounts"] { order:8; }
      .dashboard-default-layout [data-dashboard-card="projects"] { order:9; }
      .dashboard-default-layout [data-dashboard-card="activity"] { order:10; }
    }

    @media (max-width:520px) {
      .card { padding:15px; border-radius:var(--talaan-card-radius); }
      .month-nav-button { width:42px; height:42px; }
      .month-control { max-width:136px; }
      .month-control input { min-width:0; width:112px; }
      .record-meta-grid, .payment-record .record-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .mobile-record-actions { grid-template-columns:1fr; }
      .record-more-panel { position:fixed; left:12px; right:12px; bottom:max(74px,calc(env(safe-area-inset-bottom) + 68px)); width:auto; }
      .chart-svg { min-height:230px; }
      .chart-legend, .chart-note { font-size:.75rem; }
      .settings-tablist button, .report-section-nav button { min-height:44px; }
      .topbar { padding-left:10px; padding-right:10px; gap:8px; }
      .topbar-left, .topbar-actions { gap:7px; }
      .mobile-add-expense-fab { width:52px; min-width:52px; padding:0; justify-content:center; }
      .mobile-add-expense-fab span:last-child { display:none; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior:auto; }
      *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
    }

    @media print {
      .mobile-add-expense-fab, .settings-navigation, .report-section-nav, .mobile-record-actions, .chart-data-details, .calculator-operator-row, .calculation-preview { display:none !important; }
      #reports .report-table-row { break-inside:avoid; }
    }



    /* V12.9.0 · Phase 10 projects, savings goals, and safer number entry */
    .money-input-shell { position:relative; display:block; }
    .money-input-shell .money-prefix { position:absolute; left:12px; top:50%; transform:translateY(-50%); z-index:1; color:var(--muted); font-weight:800; pointer-events:none; }
    .money-input-shell .input { padding-left:31px; font-variant-numeric:tabular-nums; }
    .field-error { display:block; margin-top:5px; color:var(--danger); font-size:.75rem; font-weight:750; }
    .input.input-error { border-color:var(--danger) !important; box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 14%,transparent); }
    .optional-label { color:var(--muted); font-size:.72rem; font-weight:600; }

    /* V12.9.1 · safe calculator entry for every numeric field */
    .calculator-input-shell { position:relative; display:grid; min-width:0; width:100%; }
    .calculator-input-shell .input { width:100%; min-width:0; font-variant-numeric:tabular-nums; }
    .money-input-shell .money-prefix { top:21px; transform:translateY(-50%); }
    .calculation-preview { display:none; min-height:1.2em; margin-top:5px; font-size:.72rem; font-weight:700; }
    .calculation-preview.show { display:block; }
    .calculation-preview.result { color:var(--green-text); }
    .calculation-preview.pending, .calculation-preview.hint { color:var(--muted); font-weight:650; }
    .calculator-operator-row { display:none; grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; margin-top:7px; }
    .calculator-operator-row button { min-width:0; min-height:38px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text); font:inherit; font-size:1rem; font-weight:850; }
    .calculator-operator-row button:active { background:var(--green-soft); border-color:var(--primary); }
    html[data-theme="dark"] .calculator-operator-row button { background:var(--surface-soft); color:var(--text); border-color:var(--line); }

    .project-section-header { align-items:flex-start; }
    .project-section-summary { min-width:160px; text-align:right; }
    .project-section-summary strong, .project-section-summary small { display:block; }
    .project-section-summary strong { font-size:.82rem; }
    .project-section-summary small { margin-top:2px; color:var(--muted); font-size:.72rem; }
    .project-deadline-state { display:inline-flex; margin-top:4px; padding:3px 7px; border:1px solid var(--line); border-radius:999px; font-size:.68rem; font-weight:800; }
    .project-deadline-state.overdue { color:var(--danger); background:var(--red-soft); border-color:color-mix(in srgb,var(--danger) 28%,var(--line)); }
    .project-deadline-state.today { color:var(--orange-text); background:var(--orange-soft); }
    .project-deadline-state.upcoming { color:var(--primary); background:var(--green-soft); }
    .project-deadline-state.none { color:var(--muted); background:var(--surface-soft); }
    .payment-confirm-summary { display:grid; gap:8px; padding:12px; margin-bottom:14px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .payment-confirm-summary > div { display:flex; justify-content:space-between; gap:16px; }
    .payment-confirm-summary span { color:var(--muted); }

    .savings-goal-list { display:grid; gap:10px; }
    .savings-goal-item { padding:12px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .savings-goal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
    .savings-goal-head strong { display:block; font-size:.9rem; }
    .savings-goal-head small { display:block; margin-top:2px; color:var(--muted); }
    .savings-goal-amounts { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-top:10px; }
    .savings-goal-amounts strong { font-size:1rem; }
    .savings-goal-amounts small { color:var(--muted); text-align:right; }
    .savings-goal-progress { height:9px; margin-top:8px; overflow:hidden; border-radius:999px; background:var(--line); }
    .savings-goal-progress > span { display:block; height:100%; width:0; background:var(--primary); border-radius:inherit; }
    .savings-goal-meta { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:8px; color:var(--muted); font-size:.72rem; }
    .savings-goal-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
    .goal-suggestion-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; }
    .goal-suggestion-chips button { min-height:34px; padding:5px 9px; border:1px solid var(--line); border-radius:999px; background:var(--surface-soft); color:var(--text); font-size:.72rem; font-weight:750; }
    .report-goal-list { display:grid; gap:8px; }
    .report-goal-row { display:grid; grid-template-columns:minmax(150px,1.4fr) repeat(3,minmax(100px,1fr)); gap:8px; padding:9px 0; border-top:1px solid var(--line); align-items:center; }
    .report-goal-row:first-child { border-top:0; }
    .report-goal-row small { display:block; color:var(--muted); }

    @media (max-width:700px) {
      .calculator-input-shell.calculator-active .calculator-operator-row { display:grid; }
      .calculator-operator-row button { min-height:44px; }
      .project-section-summary { min-width:0; text-align:left; }
      .project-section-header { display:grid; grid-template-columns:1fr; }
      .project-section-header .collapse-actions { width:100%; justify-content:space-between; }
      .savings-goal-head, .savings-goal-amounts { display:grid; grid-template-columns:1fr; }
      .savings-goal-amounts small { text-align:left; }
      .savings-goal-actions .button { flex:1 1 130px; }
      .dashboard-default-layout [data-dashboard-card="cash-flow"] { order:1; }
      .dashboard-default-layout [data-dashboard-card="calendar"] { order:2; }
      .dashboard-default-layout [data-dashboard-card="due-soon"] { order:3; }
      .dashboard-default-layout [data-dashboard-card="expense-schedule"] { order:4; }
      .dashboard-default-layout [data-dashboard-card="savings-goals"] { order:5; }
      .dashboard-default-layout [data-dashboard-card="savings-trend"] { order:6; }
      .dashboard-default-layout [data-dashboard-card="payment-progress"] { order:7; }
      .dashboard-default-layout [data-dashboard-card="accounts"] { order:8; }
      .dashboard-default-layout [data-dashboard-card="projects"] { order:9; }
      .dashboard-default-layout [data-dashboard-card="activity"] { order:10; }
      .report-goal-row { grid-template-columns:1fr; padding:11px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); }
    }


    /* V12.10.0 · Phase 11 interface refinement */
    .topbar {
      min-height: 64px;
      padding: max(8px, env(safe-area-inset-top)) 20px 8px;
      gap: 12px;
      border-bottom: 1px solid var(--line);
      box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 72%, transparent);
    }
    .topbar-left, .topbar-actions { gap: 8px; }
    .topbar-left > div { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 7px; }
    .topbar h1 { grid-column: 1 / -1; font-size: 1.08rem; line-height: 1.2; }
    .topbar p { grid-column: 1; margin: 1px 0 0; font-size: .72rem; line-height: 1.2; }
    #buildBadge { grid-column: 2; margin: 1px 0 0; padding: 1px 6px; font-size: .63rem; line-height: 1.2; }
    .month-navigator { gap: 4px; }
    .month-control { min-height: 38px; padding: 4px 7px; gap: 6px; }
    .month-control label { font-size: .69rem; }
    .month-nav-button { width: 38px; height: 38px; min-height: 38px; }
    .month-status-chip { min-height: 26px; padding: 3px 8px; font-size: .65rem; }
    .theme-toggle-button { min-height: 38px; padding: 6px 9px; }
    .content { padding-top: 20px; }
    #money .page-heading { margin-bottom: 12px; }

    #money .legend { gap: 8px; margin-bottom: 8px; }
    #money .legend-item { min-height: 54px; padding: 8px 10px; gap: 8px; }
    #money .legend-copy { gap: 7px; }
    #money .legend-text strong { font-size: .75rem; }
    #money .legend-text small { margin-top: 1px; font-size: .63rem; max-width: 190px; }
    #money .legend-total { font-size: .91rem; }
    #moneySummary { gap: 8px; margin: 8px 0 12px; }
    #moneySummary .summary-item { min-height: 58px; padding: 8px 10px; gap: 8px; }
    #moneySummary .summary-card-label { font-size: .72rem; }
    #moneySummary .summary-card-copy small { margin-top: 2px; font-size: .61rem; max-width: 190px; }
    #moneySummary .summary-card-value { font-size: .91rem; }

    #availableMoneySection .card-header { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
    #availableMoneySection .account-grid { gap: 8px; }
    #availableMoneySection .account-card { min-height: 74px; padding: 8px 9px; gap: 8px; position: relative; }
    #availableMoneySection .account-card-main { padding-left: 22px; }
    #availableMoneySection .account-card-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; }
    #availableMoneySection .account-card-label span { font-size: .72rem; }
    #availableMoneySection .account-card-label small { margin: 0; font-size: .59rem; }
    #availableMoneySection .account-card strong { margin-top: 3px; font-size: .94rem; }
    #availableMoneySection .account-card-actions { align-items: center; gap: 4px; }
    #availableMoneySection .account-card-actions .button { min-height: 32px; padding: 5px 7px; font-size: .7rem; }
    .account-drag-handle {
      position: absolute;
      left: 5px;
      top: 50%;
      transform: translateY(-50%);
      width: 22px;
      height: 36px;
      border: 0;
      background: transparent;
      color: var(--muted);
      cursor: grab;
      font-size: 1rem;
      font-weight: 900;
      letter-spacing: 0;
    }
    .account-drag-handle:active { cursor: grabbing; }
    .account-order-buttons { display: none; gap: 3px; }
    .account-order-button { width: 30px; height: 30px; min-height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--talaan-control-radius); background: var(--surface); color: var(--text); font-weight: 900; }
    .account-order-button:disabled { opacity: .32; cursor: not-allowed; }
    .account-card.account-dragging { opacity: .48; }
    .account-card.account-drop-before { box-shadow: inset 0 3px 0 var(--primary); }
    .account-card.account-drop-after { box-shadow: inset 0 -3px 0 var(--primary); }

    .expense-filters-panel { margin: 0 0 7px; }
    .expense-filters-panel > summary { display: none; }
    .expense-toolbar-compact {
      display: grid;
      grid-template-columns: minmax(190px, 1.15fr) minmax(145px, .8fr) minmax(170px, .95fr) minmax(185px, .9fr) auto;
      gap: 7px;
      margin: 0;
      align-items: end;
    }
    .expense-toolbar-compact .field { min-width: 0; }
    .expense-toolbar-compact .field label { font-size: .68rem; }
    .expense-toolbar-compact .input, .expense-toolbar-compact .select { min-height: 38px; padding: 7px 9px; }
    .expense-toolbar-compact .expense-view-toggle { min-height: 38px; padding: 2px; }
    .expense-toolbar-compact .expense-view-toggle .button { min-height: 32px; padding: 4px 8px; }
    .expense-clear-filters { min-height: 38px; padding: 7px 10px; }
    .bulk-expense-bar { min-height: 44px; margin: 0 0 8px; padding: 6px 9px; border-radius: var(--talaan-control-radius); }
    .bulk-action-controls[hidden] { display: none !important; }
    .bulk-action-controls .select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; }

    .section-title-row { display: flex; align-items: center; gap: 7px; }
    .section-title-row h3 { margin: 0; }
    .section-help-button {
      width: 25px;
      height: 25px;
      min-height: 25px;
      padding: 0;
      border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line));
      border-radius: 999px;
      background: var(--surface);
      color: var(--primary);
      display: inline-grid;
      place-items: center;
      font-weight: 900;
      line-height: 1;
    }
    .section-help-button:hover { background: var(--green-soft); }
    .section-help-copy { margin: 0; color: var(--text); line-height: 1.65; }

    #money .record-header, #money .record-row,
    #paid-expenses .record-header, #paid-expenses .record-row {
      grid-template-columns: minmax(270px, 1.8fr) minmax(108px, .72fr) minmax(122px, .78fr) minmax(105px, .66fr) minmax(255px, auto);
      gap: 12px;
      align-items: center;
    }
    #money .record-header > :nth-child(4), #money .record-row > :nth-child(4),
    #paid-expenses .record-header > :nth-child(4), #paid-expenses .record-row > :nth-child(4) { text-align: right; justify-self: end; }
    #money .record-header > :nth-child(5), #money .record-row > :nth-child(5),
    #paid-expenses .record-header > :nth-child(5), #paid-expenses .record-row > :nth-child(5) { text-align: right; justify-self: end; }
    #money .record-actions, #paid-expenses .record-actions { width: 100%; justify-content: flex-end; flex-wrap: nowrap; }
    #money .amount, #paid-expenses .amount { font-variant-numeric: tabular-nums; }
    .payment-record { grid-template-columns: minmax(170px, 1.15fr) minmax(0, 4fr) auto; }
    #reports .report-table-header > :nth-child(n+3), #reports .report-table-row > :nth-child(n+3) { text-align: right; }

    .button-saved, #money.expense-view-compact .button-saved {
      width: 34px !important;
      min-width: 34px;
      height: 34px;
      min-height: 34px;
      padding: 0;
      justify-content: center;
      overflow: visible;
      transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
    }
    .button-saved:hover, .button-saved:focus-visible, .button-saved:active,
    #money.expense-view-compact .button-saved:hover, #money.expense-view-compact .button-saved:focus-visible, #money.expense-view-compact .button-saved:active { width: 34px !important; }
    .button-saved .saved-icon-container { width: 26px; height: 26px; flex: 0 0 26px; border: 0; display: grid; place-items: center; }
    .button-saved .saved-icon { display: block; line-height: 1; transform: translateY(-.5px); }
    .button-saved .saved-button-text { display: none !important; }

    .month-comparison-only { padding-bottom: 11px; }
    .month-comparison-only .month-insights-header { margin-bottom: 7px; }

    @media (max-width: 1180px) {
      .topbar { padding-left: 16px; padding-right: 16px; }
      .month-status-chip.current { font-size: 0; }
      .month-status-chip.current::after { content: "Current"; font-size: .65rem; }
      .theme-toggle-text { display: none; }
      .theme-toggle-button { width: 38px; justify-content: center; padding: 0; }
      #money .record-header, #money .record-row,
      #paid-expenses .record-header, #paid-expenses .record-row {
        grid-template-columns: minmax(220px, 1.5fr) 95px 105px 92px minmax(228px, auto);
        gap: 8px;
      }
      #money .record-actions .button, #paid-expenses .record-actions .button { padding-left: 6px; padding-right: 6px; font-size: .69rem; }
      .project-record-header, .project-record {
        grid-template-columns:minmax(180px,1.5fr) 85px 92px 90px 90px 90px 132px minmax(150px,auto);
        gap:8px;
      }
      .project-calendar-button, .project-row-actions .button { padding-left:7px; padding-right:7px; font-size:.69rem; }
    }

    @media (max-width: 900px) {
      .expense-toolbar-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .expense-clear-filters { width: 100%; }
      .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 850px) {
      #money .record-header, #paid-expenses .record-header { display: none; }
      #projects .project-record-header { display:none; }
      #projects .project-record {
        grid-template-columns:1fr;
        gap:8px;
        padding:12px;
      }
      #projects .project-record > * {
        grid-column:1;
        justify-self:stretch;
        text-align:left;
      }
      #projects .project-record .record-title strong { display:block; }
      #projects .project-record .project-cell::before,
      #projects .project-record .project-calendar-cell::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-weight:700;
      }
      #projects .project-record .project-calendar-cell { display:block; }
      #projects .project-record .project-calendar-cell .button { width:100%; }
      #projects .desktop-record-actions { display:none !important; }
      #projects .mobile-record-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
      #money .record-row, #paid-expenses .record-row { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
      #money .record-row > *, #paid-expenses .record-row > * { grid-column: 1; justify-self: stretch; text-align: left; }
      #money .record-row > *:not(.record-title):not(.record-actions):not(.mobile-record-actions)::before,
      #paid-expenses .record-row > *:not(.record-title):not(.record-actions):not(.mobile-record-actions)::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 700; }
      #money .desktop-record-actions, #paid-expenses .desktop-record-actions { display: none !important; }
      #money .mobile-record-actions, #paid-expenses .mobile-record-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
      .account-drag-handle { display: none; }
      .account-order-buttons { display: inline-flex; }
      .account-order-button { width: 40px; height: 40px; min-height: 40px; }
      #availableMoneySection .account-card-actions .button { min-height: 40px; }
    }

    @media (max-width: 700px) {
      .expense-filters-panel { border: 1px solid var(--line); border-radius: var(--talaan-card-radius); background: var(--surface); overflow: visible; }
      .expense-filters-panel > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; cursor: pointer; font-weight: 800; }
      .expense-filters-panel > summary small { color: var(--muted); font-size: .68rem; font-weight: 650; text-align: right; }
      .expense-toolbar-compact { grid-template-columns: 1fr; padding: 0 10px 10px; }
      .bulk-expense-bar { margin-top: 7px; }
      #availableMoneySection .account-card-main { padding-left: 0; }
      #availableMoneySection .account-card { align-items: flex-start; }
      #availableMoneySection .account-card-actions { flex-wrap: wrap; justify-content: flex-end; }
      #money .mobile-record-actions, #paid-expenses .mobile-record-actions { grid-template-columns: 1fr 1fr; }
    }

    @media (max-width: 520px) {
      .topbar { padding-left: 9px; padding-right: 9px; }
      .month-control { max-width: 130px; }
      .account-grid { grid-template-columns: 1fr; }
      #money .mobile-record-actions, #paid-expenses .mobile-record-actions { grid-template-columns: 1fr; }
      .section-help-button { width: 30px; height: 30px; min-height: 30px; }
    }

    @media print {
      .account-drag-handle, .account-order-buttons, .section-help-button, .expense-filters-panel > summary { display: none !important; }
      .expense-filters-panel .toolbar { display: none !important; }
    }


    /* V12.11.0 · Phase 12 application-wide compact accessible help */
    .help-inline-title {
      display: inline-flex !important;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
    }
    .context-help-button,
    .section-help-button {
      position: relative;
      width: 19px !important;
      min-width: 19px !important;
      height: 19px !important;
      min-height: 19px !important;
      padding: 0 !important;
      border: 1px solid color-mix(in srgb, var(--muted) 42%, var(--line)) !important;
      border-radius: 999px !important;
      background: transparent !important;
      color: var(--muted) !important;
      display: inline-grid !important;
      place-items: center;
      flex: 0 0 19px;
      font-size: .65rem !important;
      font-weight: 850;
      line-height: 1;
      vertical-align: middle;
      box-shadow: none !important;
      opacity: .78;
    }
    .context-help-button::after,
    .section-help-button::after {
      content: "";
      position: absolute;
      inset: -11px;
      border-radius: 999px;
    }
    .context-help-button:hover,
    .section-help-button:hover,
    .context-help-button:focus-visible,
    .section-help-button:focus-visible {
      color: var(--primary) !important;
      border-color: color-mix(in srgb, var(--primary) 56%, var(--line)) !important;
      background: color-mix(in srgb, var(--green-soft) 58%, transparent) !important;
      opacity: 1;
    }
    .field-label-help-row {
      display: flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
    }
    .field-label-help-row > label { min-width: 0; }
    .help-generated-section-heading {
      display: flex;
      align-items: center;
      gap: 5px;
      margin: 0 0 9px;
      font-size: .9rem;
      font-weight: 820;
    }
    #sectionHelpDialog.compact-help-dialog {
      width: min(390px, calc(100vw - 24px));
      max-height: min(70dvh, 520px);
      padding: 0;
      border: 1px solid var(--line);
      border-radius: var(--talaan-dialog-radius);
      background: var(--surface);
      color: var(--text);
      box-shadow: 0 18px 55px rgba(16, 24, 40, .18);
      overflow: hidden;
    }
    #sectionHelpDialog::backdrop { background: rgba(16, 24, 40, .28); }
    .compact-help-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 11px 12px 9px;
      border-bottom: 1px solid var(--line);
      background: var(--surface);
    }
    .compact-help-header h3 { margin: 0; font-size: .93rem; line-height: 1.25; }
    .compact-help-close {
      width: 30px;
      min-width: 30px;
      height: 30px;
      min-height: 30px;
      padding: 0;
      border: 0;
      border-radius: var(--talaan-control-radius);
      background: transparent;
      color: var(--muted);
      font-size: 1.1rem;
      line-height: 1;
    }
    .compact-help-close:hover { background: var(--surface-soft); color: var(--text); }
    .compact-help-body {
      max-height: calc(min(70dvh, 520px) - 52px);
      overflow: auto;
      padding: 11px 12px 13px;
      overscroll-behavior: contain;
    }
    .compact-help-summary { margin: 0; color: var(--text); font-size: .78rem; line-height: 1.5; }
    .compact-help-detail { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
    .compact-help-detail strong { display: block; margin-bottom: 2px; color: var(--muted); font-size: .66rem; letter-spacing: .03em; text-transform: uppercase; }
    .compact-help-detail p { margin: 0; color: var(--text); font-size: .75rem; line-height: 1.48; }
    .compact-help-note { background: var(--surface-soft); border-radius: var(--talaan-control-radius); padding: 7px 8px; border-top: 0; }
    html[data-theme="dark"] #sectionHelpDialog.compact-help-dialog,
    html[data-theme="dark"] .compact-help-header { background: var(--surface); color: var(--text); border-color: var(--line); }
    @media (max-width: 700px) {
      .context-help-button,
      .section-help-button {
        width: 20px !important;
        min-width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        flex-basis: 20px;
      }
      #sectionHelpDialog.compact-help-dialog { width: calc(100vw - 24px); max-height: 64dvh; }
      .compact-help-body { max-height: calc(64dvh - 52px); }
    }
    @media print {
      .context-help-button, .section-help-button, #sectionHelpDialog { display: none !important; }
    }

    /* V12.12.0 · project sorting, calendar states, and project-row alignment */
    .context-help-button,
    .section-help-button {
      width: 16px !important;
      min-width: 16px !important;
      height: 16px !important;
      min-height: 16px !important;
      flex: 0 0 16px;
      font-size: .57rem !important;
      border-color: transparent !important;
      background: transparent !important;
      opacity: 0;
      pointer-events: none;
      transition: opacity .12s ease, color .12s ease, border-color .12s ease, background-color .12s ease;
    }
    .context-help-button::after,
    .section-help-button::after { inset: -9px; }

    .help-inline-title:hover > .context-help-button,
    .help-inline-title:hover > .section-help-button,
    .help-inline-title:focus-within > .context-help-button,
    .help-inline-title:focus-within > .section-help-button,
    .section-title-row:hover > .context-help-button,
    .section-title-row:hover > .section-help-button,
    .section-title-row:focus-within > .context-help-button,
    .section-title-row:focus-within > .section-help-button,
    .field-label-help-row:hover > .context-help-button,
    .field-label-help-row:hover > .section-help-button,
    .field-label-help-row:focus-within > .context-help-button,
    .field-label-help-row:focus-within > .section-help-button,
    .help-generated-section-heading:hover > .context-help-button,
    .help-generated-section-heading:hover > .section-help-button,
    .help-generated-section-heading:focus-within > .context-help-button,
    .help-generated-section-heading:focus-within > .section-help-button,
    .context-help-button:hover,
    .section-help-button:hover,
    .context-help-button:focus-visible,
    .section-help-button:focus-visible {
      opacity: 1;
      pointer-events: auto;
    }

    @media (hover: none) and (pointer: coarse) {
      .context-help-button,
      .section-help-button {
        width: 18px !important;
        min-width: 18px !important;
        height: 18px !important;
        min-height: 18px !important;
        flex-basis: 18px;
        opacity: .24;
        pointer-events: auto;
      }
      .context-help-button:focus-visible,
      .section-help-button:focus-visible,
      .context-help-button:active,
      .section-help-button:active { opacity: 1; }
    }

    /* Restore one continuous, slightly stronger border around every colored summary card. */
    .summary-card {
      border: 1px solid color-mix(in srgb, var(--summary-tone) 42%, var(--line)) !important;
    }

    /* Keep Budget descriptions readable without disturbing the amount column. */
    #money .legend-item {
      min-width: 0;
      padding: 8px 9px;
      gap: 7px;
    }
    #money .legend-copy { flex: 1 1 auto; min-width: 0; gap: 6px; }
    #money .legend-text { flex: 1 1 auto; min-width: 0; }
    #money .legend-text strong { font-size: .71rem; line-height: 1.16; }
    #money .legend-text small {
      max-width: none;
      font-size: .59rem;
      line-height: 1.16;
      text-wrap: balance;
      overflow-wrap: anywhere;
    }
    #money .legend-total { flex: 0 0 auto; font-size: .87rem; }
    #moneySummary .summary-item { min-width: 0; }
    #moneySummary .summary-card-copy { flex: 1 1 auto; min-width: 0; }
    #moneySummary .summary-card-label { font-size: .69rem; line-height: 1.16; }
    #moneySummary .summary-card-copy small {
      max-width: none;
      font-size: .58rem;
      line-height: 1.16;
      text-wrap: balance;
      overflow-wrap: anywhere;
    }
    #moneySummary .summary-card-value { flex: 0 0 auto; font-size: .87rem; }

    .account-dialog-footer .dialog-danger-leading { margin-right: auto; }

    @media (max-width: 1180px) and (min-width: 701px) {
      #money .legend-text strong { font-size: .67rem; }
      #money .legend-text small,
      #moneySummary .summary-card-copy small { font-size: .55rem; }
      #money .legend-total,
      #moneySummary .summary-card-value { font-size: .8rem; }
    }

    @media (max-width: 700px) {
      .account-dialog-footer { display: grid; grid-template-columns: 1fr 1fr; }
      .account-dialog-footer .dialog-danger-leading { grid-column: 1 / -1; margin-right: 0; }
    }




    /* V12.12.0 · salary work and project workflow */
    .project-filters-panel { margin:0 0 8px; }
    .project-filters-panel > summary { display:none; }
    .project-toolbar-compact {
      display:grid;
      grid-template-columns:minmax(190px,1.3fr) minmax(125px,.72fr) minmax(135px,.78fr) minmax(145px,.82fr) auto;
      gap:7px;
      align-items:end;
    }
    .project-toolbar-compact .field { min-width:0; }
    .project-toolbar-compact label { font-size:.67rem; }
    .project-toolbar-compact .input, .project-toolbar-compact .select { min-height:36px; padding:6px 8px; }
    .project-clear-filters { min-height:36px; padding:6px 9px; }
    .project-clear-filters[hidden], .project-delete-footer[hidden], .salary-work-notice[hidden] { display:none !important; }
    .project-source-line { display:block; margin-top:3px; color:var(--muted); font-size:.66rem; font-weight:700; }
    .project-source-line.salary { color:var(--blue); }
    .project-source-line.freelance { color:var(--primary); }
    .project-work-section {
      grid-column:1/-1;
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:10px;
      padding:11px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface-soft);
    }
    .project-work-section[hidden], .project-financial-section[hidden] { display:none !important; }
    .project-work-section .field-full { grid-column:1/-1; }
    .salary-work-summary { grid-column:1/-1; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); }
    .salary-work-summary strong, .salary-work-summary small { display:block; }
    .salary-work-summary small { margin-top:2px; color:var(--muted); font-size:.7rem; }
    .salary-work-notice { grid-column:1/-1; margin:0; padding:8px 9px; border-radius:var(--talaan-control-radius); background:var(--orange-soft); color:var(--text); font-size:.72rem; line-height:1.45; }
    .salary-schedule-note { grid-column:1/-1; margin:0; color:var(--muted); font-size:.7rem; line-height:1.45; }
    .project-financial-section { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .project-financial-section .field:last-child { grid-column:1/-1; max-width:50%; }
    .project-delete-footer { margin-right:auto; }
    .status-fixed-salary { color:var(--blue); background:var(--blue-soft); border-color:color-mix(in srgb,var(--blue) 34%,var(--line)); }
    .salary-work-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .salary-work-settings-grid .field-full { grid-column:1/-1; }
    .salary-work-preview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:10px; }
    .salary-work-preview > div { padding:9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .salary-work-preview span, .salary-work-preview strong { display:block; }
    .salary-work-preview span { color:var(--muted); font-size:.68rem; }
    .salary-work-preview strong { margin-top:2px; font-size:.78rem; }
    .report-project-work-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
    .report-project-work-summary > div { padding:9px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .report-project-work-summary span, .report-project-work-summary strong { display:block; }
    .report-project-work-summary span { color:var(--muted); font-size:.68rem; }
    .report-project-work-summary strong { margin-top:2px; }
    @media (max-width:1100px) and (min-width:851px) {
      #projects .project-record-header { display:none; }
      #projects .project-record { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 14px; padding:12px; }
      #projects .project-record .record-title { grid-column:1/-1; }
      #projects .project-record .project-cell, #projects .project-record .project-calendar-cell { text-align:left; display:block; }
      #projects .project-record .project-cell::before, #projects .project-record .project-calendar-cell::before { content:attr(data-label) ": "; color:var(--muted); font-weight:700; }
      #projects .project-record .project-calendar-cell .button { margin-top:5px; }
      #projects .project-record .desktop-record-actions { grid-column:1/-1; justify-content:flex-end; }
    }
    @media (max-width:900px) {
      .project-toolbar-compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .project-clear-filters { width:100%; }
    }
    @media (max-width:700px) {
      .project-filters-panel { border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); overflow:visible; }
      .project-filters-panel > summary { min-height:44px; display:flex; align-items:center; justify-content:space-between; padding:9px 11px; cursor:pointer; font-weight:800; }
      .project-toolbar-compact { grid-template-columns:1fr; padding:0 10px 10px; }
      .project-work-section, .project-financial-section { grid-template-columns:1fr; }
      .project-financial-section .field:last-child { grid-column:auto; max-width:none; }
      .salary-work-settings-grid, .salary-work-preview, .report-project-work-summary { grid-template-columns:1fr; }
      .project-delete-footer { width:100%; margin:0 0 4px; }
    }



    /* V12.13.0 · dashboard charts and action consistency */
    #quickAddExpense[hidden], #mobileAddExpenseButton[hidden] { display:none !important; }

    /* One height system for every top-bar control. */
    .topbar-actions .month-nav-button,
    .topbar-actions .month-control,
    .topbar-actions .month-status-chip,
    .topbar-actions .theme-toggle-button,
    .topbar-actions #quickAddExpense {
      height:38px;
      min-height:38px;
      max-height:38px;
      box-sizing:border-box;
      align-items:center;
    }
    .topbar-actions #quickAddExpense { padding:6px 12px; }
    .topbar-actions .month-status-chip { display:inline-flex; }
    .topbar-actions .month-control input { min-height:26px; }

    /* More compact Dashboard summary and Savings card. */
    #dashboard > .kpi-grid { gap:8px; }
    #dashboard > .kpi-grid .kpi-card { min-height:68px; padding:9px 10px; }
    #dashboard > .kpi-grid .kpi-label { font-size:.67rem; line-height:1.15; }
    #dashboard > .kpi-grid .kpi-value { margin-top:3px; font-size:1.08rem; line-height:1.1; }
    #dashboard > .kpi-grid .kpi-meta { margin-top:3px; font-size:.61rem; line-height:1.2; }
    #dashboard [data-dashboard-card="savings-trend"] { min-height:0; padding-top:12px; padding-bottom:12px; }
    #dashboard [data-dashboard-card="savings-trend"] .card-header { margin-bottom:5px; }
    #dashSavingsTrendChart .chart-svg { min-height:140px; }
    #dashSavingsTrendChart .chart-empty,
    #dashSavingsTrendChart .chart-zero-state,
    #dashSavingsTrendChart .compact-savings-empty { min-height:76px; padding:12px; }
    #dashSavingsTrendChart .chart-zero-state strong { font-size:.82rem; }
    #dashSavingsTrendChart .chart-zero-state span { font-size:.68rem; }
    #dashboard [data-dashboard-card="savings-trend"] .savings-detail-grid { gap:5px; margin-top:6px; }
    #dashboard [data-dashboard-card="savings-trend"] .savings-detail-grid > div { padding:6px 7px; }
    #dashboard [data-dashboard-card="savings-trend"] .savings-detail-grid span { font-size:.57rem; }
    #dashboard [data-dashboard-card="savings-trend"] .savings-detail-grid strong { font-size:.72rem; }

    /* Two coordinated cash-flow views. */
    .cash-flow-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; align-items:start; }
    .cash-flow-chart-panel { min-width:0; padding:9px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .cash-flow-chart-panel h4 { margin:0 0 5px; color:var(--text); font-size:.72rem; line-height:1.25; }
    .cash-flow-chart-panel .chart-svg { min-height:150px; }
    .chart-balance-line { fill:none; stroke:var(--blue); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
    .chart-balance-point { fill:var(--surface); stroke:var(--blue); stroke-width:3; vector-effect:non-scaling-stroke; }
    .chart-balance-bar { fill:var(--blue); }
    .chart-legend .balance { background:var(--blue); }
    .cash-flow-chart-grid + .chart-legend { margin-top:7px; }
    .cash-flow-chart-grid + .chart-legend + .chart-note { margin-top:4px; }

    /* Compact project calendar actions and exact header/value centering. */
    #projects .project-record-header,
    #projects .project-record {
      grid-template-columns:minmax(190px,1.75fr) minmax(82px,.78fr) minmax(96px,.88fr) minmax(82px,.72fr) minmax(92px,.82fr) minmax(92px,.82fr) minmax(88px,.75fr) minmax(72px,.64fr);
      gap:9px;
    }
    #projects .project-record-header > span:first-child { text-align:left; justify-self:stretch; }
    #projects .project-record-header > span:not(:first-child) { text-align:center; justify-self:stretch; }
    #projects .project-record .project-cell,
    #projects .project-record .project-calendar-cell,
    #projects .project-record .project-row-actions { min-height:32px; display:flex; align-items:center; justify-content:center; text-align:center; }
    #projects .project-record .project-cell > strong { display:flex; align-items:center; justify-content:center; width:100%; min-height:28px; }
    #projects .project-record .record-title { align-self:center; }
    #projects .project-record .project-calendar-button {
      width:auto;
      min-width:0;
      min-height:29px;
      height:29px;
      padding:3px 9px;
      border-radius:999px;
      font-size:.66rem;
      line-height:1;
      white-space:nowrap;
    }
    #projects .project-record .project-row-actions .button { min-height:30px; height:30px; padding:4px 9px; }

    .expense-dialog-footer .dialog-danger-leading { margin-right:auto; }
    @media (max-width:900px) {
      .cash-flow-chart-grid { grid-template-columns:1fr; }
    }
    @media (max-width:700px) {
      .topbar-actions .month-nav-button,
      .topbar-actions .month-control,
      .topbar-actions .month-status-chip,
      .topbar-actions .theme-toggle-button,
      .topbar-actions #quickAddExpense { height:44px; min-height:44px; max-height:44px; }
      .expense-dialog-footer { display:grid; grid-template-columns:1fr 1fr; }
      .expense-dialog-footer .dialog-danger-leading { grid-column:1/-1; margin-right:0; }
      #projects .project-record .project-cell,
      #projects .project-record .project-calendar-cell { min-height:0; display:block; text-align:left; }
      #projects .project-record .project-cell > strong { display:inline-flex; width:auto; min-height:0; }
      #projects .project-record .project-calendar-button { margin-top:5px; width:100%; border-radius:var(--talaan-control-radius); }
    }


    /* V12.13.1 · compact filter toolbars */
    .filter-label-visually-hidden {
      position:absolute !important;
      width:1px !important;
      height:1px !important;
      padding:0 !important;
      margin:-1px !important;
      overflow:hidden !important;
      clip:rect(0,0,0,0) !important;
      white-space:nowrap !important;
      border:0 !important;
    }
    .expense-toolbar-compact,
    .paid-toolbar-compact,
    .project-toolbar-compact {
      align-items:center;
      gap:6px;
    }
    .expense-toolbar-compact .field,
    .paid-toolbar-compact .field,
    .project-toolbar-compact .field {
      position:relative;
      margin:0;
      min-width:0;
    }
    .expense-toolbar-compact .input,
    .expense-toolbar-compact .select,
    .paid-toolbar-compact .input,
    .paid-toolbar-compact .select,
    .project-toolbar-compact .input,
    .project-toolbar-compact .select {
      min-height:var(--workspace-compact-control-height);
      height:var(--workspace-compact-control-height);
      padding:5px 9px;
      color:color-mix(in srgb,var(--muted) 86%,var(--text));
      font-size:.76rem;
      font-weight:500;
      line-height:1.2;
    }
    .expense-toolbar-compact .input::placeholder,
    .paid-toolbar-compact .input::placeholder,
    .project-toolbar-compact .input::placeholder {
      color:color-mix(in srgb,var(--muted) 72%,transparent);
      opacity:1;
    }
    .expense-toolbar-compact .expense-view-toggle {
      min-height:var(--workspace-compact-control-height);
      height:var(--workspace-compact-control-height);
      padding:2px;
      border-color:var(--line);
    }
    .expense-toolbar-compact .expense-view-toggle .button {
      min-height:29px;
      height:29px;
      padding:3px 8px;
      color:var(--muted);
      font-size:.71rem;
      font-weight:700;
    }
    .expense-toolbar-compact .expense-view-toggle .button.active {
      color:var(--primary);
    }
    .expense-clear-filters,
    .paid-clear-filters,
    .project-clear-filters {
      min-height:var(--workspace-compact-control-height);
      height:var(--workspace-compact-control-height);
      padding:5px 9px;
      color:var(--muted);
      font-size:.73rem;
      font-weight:700;
      white-space:nowrap;
    }
    .paid-toolbar-compact {
      display:grid;
      grid-template-columns:minmax(220px,1.35fr) minmax(180px,.9fr) auto auto;
      margin:0 0 8px;
    }
    .paid-filters-panel { margin:0 0 8px; }
    .paid-filters-panel > summary { display:none; }
    #paidExpensesSection .paid-toolbar-compact {
      padding:0;
    }
    .project-toolbar-compact {
      grid-template-columns:minmax(190px,1.3fr) minmax(125px,.72fr) minmax(135px,.78fr) minmax(145px,.82fr) auto;
    }
    .expense-filters-panel,
    .project-filters-panel {
      margin-bottom:6px;
    }
    @media (max-width:900px) and (min-width:701px) {
      .expense-toolbar-compact,
      .paid-toolbar-compact,
      .project-toolbar-compact {
        grid-template-columns:repeat(2,minmax(0,1fr));
      }
      .expense-clear-filters,
      .paid-clear-filters,
      .project-clear-filters { width:100%; }
    }
    @media (max-width:700px) {
      .paid-filters-panel { border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); overflow:visible; }
      .paid-filters-panel > summary { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; cursor:pointer; font-weight:800; }
      .paid-filters-panel > summary small { color:var(--muted); font-size:.68rem; font-weight:650; text-align:right; }
      .paid-toolbar-compact { padding:0 10px 10px !important; }
      .expense-toolbar-compact,
      .paid-toolbar-compact,
      .project-toolbar-compact {
        grid-template-columns:1fr;
        gap:8px;
      }
      .expense-toolbar-compact .input,
      .expense-toolbar-compact .select,
      .paid-toolbar-compact .input,
      .paid-toolbar-compact .select,
      .project-toolbar-compact .input,
      .project-toolbar-compact .select,
      .expense-clear-filters,
      .paid-clear-filters,
      .project-clear-filters {
        min-height:44px;
        height:44px;
        font-size:.8rem;
      }
      .expense-toolbar-compact .expense-view-toggle {
        min-height:44px;
        height:44px;
      }
      .expense-toolbar-compact .expense-view-toggle .button {
        min-height:38px;
        height:38px;
        font-size:.78rem;
      }
      #paidExpensesSection .paid-toolbar-compact { padding:0; }
    }


    /* V12.13.2 · permanent Compact rows and single-line filter actions */
    #money { --expense-filter-height: var(--workspace-compact-control-height); }
    #money #availableMoneySection { margin-bottom: 11px; }
    #money .expense-filters-panel { margin: 0 0 8px; }
    .expense-toolbar-single-line {
      display:grid;
      grid-template-columns:max-content minmax(180px,1.35fr) minmax(128px,.72fr) minmax(145px,.86fr) auto minmax(0,auto);
      align-items:center;
      gap:6px;
      width:100%;
      min-height:var(--expense-filter-height);
      margin:0;
    }
    .bulk-expense-inline {
      min-height:var(--expense-filter-height);
      display:inline-flex;
      align-items:center;
      gap:5px;
      padding:0 8px;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      background:var(--surface-soft);
      color:var(--muted);
      white-space:nowrap;
    }
    .bulk-expense-inline .bulk-select-label {
      display:inline-flex;
      align-items:center;
      gap:5px;
      margin:0;
      font-size:.72rem;
      font-weight:750;
      cursor:pointer;
    }
    .bulk-expense-inline .bulk-selected-count { font-size:.66rem; font-weight:650; }
    .expense-toolbar-single-line .input,
    .expense-toolbar-single-line .select,
    .expense-toolbar-single-line .button {
      height:var(--expense-filter-height);
      min-height:var(--expense-filter-height);
    }
    .expense-toolbar-single-line .bulk-action-controls:not([hidden]) {
      display:flex;
      align-items:center;
      gap:4px;
      min-width:0;
    }
    .expense-toolbar-single-line #bulkExpenseAction { width:126px; min-width:0; }
    .expense-toolbar-single-line #bulkExpenseValue { width:110px; min-width:0; }
    .expense-toolbar-single-line #applyBulkExpenseAction { padding-inline:9px; }
    .expense-toolbar-single-line #clearExpenseSelection { padding-inline:9px; white-space:nowrap; }
    .expense-toolbar-single-line .expense-clear-filters { min-width:54px; }
    .paid-toolbar-compact,
    .project-toolbar-compact { margin-bottom:8px; }
    #paidExpensesSection .paid-filters-panel,
    #activeProjectsCard .project-filters-panel { margin-bottom:8px; }
    @media (max-width:1180px) and (min-width:701px) {
      .expense-toolbar-single-line {
        grid-template-columns:max-content minmax(165px,1.15fr) minmax(120px,.72fr) minmax(135px,.82fr) auto minmax(0,auto);
      }
      .expense-toolbar-single-line .bulk-action-controls:not([hidden]) {
        display:grid;
        grid-column:1/-1;
        grid-template-columns:minmax(150px,1fr) minmax(130px,.8fr) auto auto;
        gap:6px;
      }
    }
    @media (max-width:900px) and (min-width:701px) {
      #money #availableMoneySection { margin-bottom:9px; }
      .expense-toolbar-single-line { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .expense-toolbar-single-line .bulk-expense-inline { width:100%; }
      .expense-toolbar-single-line .bulk-action-controls:not([hidden]) {
        display:grid;
        grid-column:1/-1;
        grid-template-columns:repeat(2,minmax(0,1fr));
      }
      .expense-toolbar-single-line .expense-clear-filters { width:100%; }
    }
    @media (max-width:700px) {
      #money { --expense-filter-height:44px; }
      #money #availableMoneySection { margin-bottom:8px; }
      #money .expense-filters-panel { margin-bottom:8px; }
      .expense-toolbar-single-line {
        grid-template-columns:1fr;
        padding:0 10px 10px;
        gap:8px;
      }
      .bulk-expense-inline { width:100%; justify-content:space-between; }
      .expense-toolbar-single-line .bulk-action-controls:not([hidden]) {
        display:grid;
        grid-column:1;
        grid-template-columns:1fr;
        gap:8px;
      }
      .expense-toolbar-single-line #bulkExpenseAction,
      .expense-toolbar-single-line #bulkExpenseValue,
      .expense-toolbar-single-line #applyBulkExpenseAction,
      .expense-toolbar-single-line #clearExpenseSelection { width:100%; min-width:0; }
      .paid-toolbar-compact,
      .project-toolbar-compact { margin-bottom:0; }
    }



    /* V12.15.0 · grouped navigation, neutral filters, compact top bar, and custom categories */
    .brand { align-items:flex-start; gap:0; padding:4px 8px 15px; }
    .brand > div { min-width:0; }
    .brand strong { font-size:1rem; line-height:1.2; }
    .brand small { display:block; margin-top:3px; }
    .brand-mark, .sidebar-note { display:none !important; }
    .sidebar-navigation { display:grid; gap:11px; }
    .nav-group { min-width:0; }
    .nav-group .nav-list { gap:3px; }
    .nav-group-related .nav-list { position:relative; margin-left:10px; padding-left:8px; }
    .nav-group-related .nav-list::before { content:""; position:absolute; left:0; top:8px; bottom:8px; width:1px; background:rgba(255,255,255,.17); }
    .nav-group-related .nav-button { padding-left:9px; }
    .nav-button { min-height:39px; padding-top:8px; padding-bottom:8px; border-radius:var(--talaan-control-radius); }
    .nav-icon { width:22px; height:22px; border-radius:var(--talaan-control-radius); font-size:.7rem; }
    .page-heading-actions, .page-heading > .related-page-link { display:flex; align-items:center; gap:7px; }
    .related-page-link { color:var(--muted); white-space:nowrap; }
    .related-page-link:hover { color:var(--text); }

    .month-control { min-width:205px; justify-content:center; padding:4px 9px; gap:5px; }
    .month-control label { flex:0 0 auto; color:var(--muted); font-size:.6rem; font-weight:700; letter-spacing:.02em; }
    .month-control input { flex:1 1 auto; min-width:0; color:var(--muted); font-size:.8rem; font-weight:650; text-align:center; }
    .theme-toggle-button { width:38px; min-width:38px; padding:0; justify-content:center; }
    .theme-toggle-text { display:none !important; }
    #themeToggleIcon { display:grid; place-items:center; font-size:1rem; line-height:1; }

    .expense-toolbar-single-line .input:focus,
    .expense-toolbar-single-line .select:focus,
    .paid-toolbar-compact .input:focus,
    .paid-toolbar-compact .select:focus,
    .project-toolbar-compact .input:focus,
    .project-toolbar-compact .select:focus,
    .expense-toolbar-single-line .filter-control-active,
    .paid-toolbar-compact .filter-control-active,
    .project-toolbar-compact .filter-control-active {
      border-color:var(--muted) !important;
      background:var(--surface-soft) !important;
      color:var(--text);
      box-shadow:none !important;
      outline:2px solid color-mix(in srgb,var(--muted) 55%,transparent) !important;
      outline-offset:1px;
    }
    html[data-theme="dark"] .expense-toolbar-single-line .input:focus,
    html[data-theme="dark"] .expense-toolbar-single-line .select:focus,
    html[data-theme="dark"] .paid-toolbar-compact .input:focus,
    html[data-theme="dark"] .paid-toolbar-compact .select:focus,
    html[data-theme="dark"] .project-toolbar-compact .input:focus,
    html[data-theme="dark"] .project-toolbar-compact .select:focus,
    html[data-theme="dark"] .expense-toolbar-single-line .filter-control-active,
    html[data-theme="dark"] .paid-toolbar-compact .filter-control-active,
    html[data-theme="dark"] .project-toolbar-compact .filter-control-active { background:var(--surface-soft) !important; }
    .expense-toolbar-single-line .input.input-error,
    .expense-toolbar-single-line .select.input-error,
    .paid-toolbar-compact .input.input-error,
    .paid-toolbar-compact .select.input-error,
    .project-toolbar-compact .input.input-error,
    .project-toolbar-compact .select.input-error { border-color:var(--danger) !important; outline-color:color-mix(in srgb,var(--danger) 50%,transparent) !important; }
    #expenseCustomCategoryField[hidden] { display:none !important; }
    #expenseCustomCategoryField .field-help { display:block; margin-top:4px; }

    @media (max-width:850px) {
      .page-heading-actions { width:100%; flex-wrap:wrap; }
      .page-heading-actions .button, .page-heading > .related-page-link { flex:1 1 150px; }
    }
    @media (max-width:700px) {
      .month-control { min-width:0; }
      .month-control input { font-size:.78rem; }
      .theme-toggle-button { width:44px; min-width:44px; }
      .related-page-link { min-height:44px; }
    }


    /* V12.16.1 · calendar deduplication and compact view */
    :root { --primary:#356FD1; --primary-dark:#2457AD; --nav:#FFFFFF; }
    .sidebar-navigation { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; }
    .sidebar-settings-bottom { margin-top:auto; padding-top:12px; border-block-start:1px solid rgba(255,255,255,.13); }
    .settings-nav-button { justify-content:flex-start; }
    .nav-button { white-space:nowrap; gap:8px; padding-left:9px; padding-right:9px; font-size:.87rem; }
    .nav-button > span:last-child { overflow:hidden; text-overflow:ellipsis; }
    .nav-icon { flex:0 0 22px; width:22px; height:22px; font-size:.7rem; }
    .nav-group-related .nav-list { margin-left:5px; padding-left:7px; }
    .kpi-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .report-kpi-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
    .income-kpi-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
    .income-records-card, .annual-income-card { margin-top:14px; }
    .income-toolbar { display:grid; grid-template-columns:minmax(220px,1.4fr) minmax(190px,.9fr) auto; gap:8px; margin-bottom:8px; }
    .income-record-header, .income-record-row { grid-template-columns:minmax(220px,1.5fr) minmax(140px,.9fr) minmax(115px,.7fr) minmax(115px,.75fr) minmax(105px,.65fr) auto; }
    .income-record-row > :nth-child(5), .income-record-header > :nth-child(5) { text-align:right; }
    .annual-income-actions { display:flex; gap:7px; align-items:center; }
    .annual-income-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:var(--talaan-card-radius); }
    .annual-income-table { width:100%; min-width:1420px; border-collapse:collapse; font-size:.74rem; }
    .annual-income-table th, .annual-income-table td { padding:8px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); white-space:nowrap; text-align:right; }
    .annual-income-table th:first-child, .annual-income-table td:first-child { position:sticky; left:0; z-index:2; text-align:left; background:var(--surface); min-width:190px; }
    .annual-income-table thead th { background:var(--surface-soft); color:var(--muted); font-weight:850; }
    .annual-income-table .income-group-row th { background:color-mix(in srgb,var(--primary) 9%,var(--surface)); color:var(--primary); }
    .annual-income-table .income-total-row th, .annual-income-table .income-total-row td { background:color-mix(in srgb,var(--primary) 78%,var(--surface)); color:var(--primary-contrast); font-weight:850; }
    .income-report-header, #reportIncomeList .report-table-row { grid-template-columns:minmax(180px,1.3fr) minmax(120px,.8fr) minmax(110px,.7fr) minmax(110px,.7fr) minmax(105px,.65fr); }
    .dashboard-calendar-card { grid-column:span 6; }
    .calendar-card-controls { display:flex; align-items:center; gap:4px; }
    .calendar-card-controls strong { min-width:100px; text-align:center; font-size:.75rem; }
    .dashboard-calendar-layout { display:grid; grid-template-columns:minmax(300px,1.32fr) minmax(220px,.68fr); gap:9px; align-items:start; }
    .dashboard-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
    .calendar-weekday { padding:2px 3px; color:var(--muted); font-size:.61rem; font-weight:850; text-align:center; text-transform:uppercase; }
    .calendar-day { min-height:46px; border:0; border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text); display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; padding:4px 5px; }
    .calendar-day:hover { background:color-mix(in srgb,var(--primary) 8%,var(--surface)); }
    .calendar-day.is-outside { opacity:.34; }
    .calendar-day.is-today .calendar-day-number { background:var(--primary); color:var(--primary-contrast); }
    .calendar-day.is-selected { background:color-mix(in srgb,var(--primary) 13%,var(--surface)); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 38%,transparent); }
    .calendar-day-number { width:21px; height:21px; border-radius:999px; display:grid; place-items:center; font-size:.68rem; font-weight:850; }
    .calendar-markers { display:flex; flex-wrap:wrap; gap:2px; }
    .calendar-marker, .calendar-dot { width:5px; height:5px; border-radius:999px; display:inline-block; }
    .calendar-marker.income, .calendar-dot.income { background:var(--green); }
    .calendar-marker.expense, .calendar-dot.expense { background:var(--red); }
    .calendar-marker.project, .calendar-dot.project { background:var(--primary); }
    .calendar-marker.payment, .calendar-dot.payment { background:var(--muted); }
    .calendar-marker.schedule, .calendar-dot.schedule { background:var(--primary); }
    .calendar-marker.schedule.agenda-overdue { background:var(--red); }
    .calendar-marker.schedule.agenda-near { background:var(--orange); }
    .calendar-marker.schedule.agenda-soon { background:var(--orange); }
    .calendar-marker.schedule.agenda-completed { background:var(--green); }
    .dashboard-calendar-events { min-height:224px; max-height:286px; overflow:visible; border:1px solid var(--line); border-radius:var(--talaan-card-radius); padding:8px; background:var(--surface-soft); }
    .calendar-selected-heading { display:flex; justify-content:space-between; align-items:center; gap:7px; margin-bottom:5px; }
    .calendar-selected-heading > strong { font-size:.84rem; }
    .calendar-event-list { display:grid; gap:4px; max-height:232px; overflow:auto; padding-right:2px; scrollbar-gutter:stable; }
    .calendar-event { width:100%; display:grid; grid-template-columns:4px minmax(0,1fr) auto; align-items:center; gap:7px; min-height:42px; padding:5px 7px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); text-align:left; }
    .calendar-event.has-record-icon { grid-template-columns:4px auto minmax(0,1fr) auto; }
    .calendar-event:hover { background:color-mix(in srgb,var(--primary) 5%,var(--surface)); }
    .calendar-event .event-bar { align-self:stretch; min-height:28px; border-radius:99px; background:var(--primary); }
    .calendar-event.income .event-bar { background:var(--green); }
    .calendar-event.expense .event-bar { background:var(--red); }
    .calendar-event.payment .event-bar { background:var(--muted); }
    .calendar-event.schedule .event-bar { background:var(--primary); }
    .calendar-event.schedule.agenda-overdue { background:color-mix(in srgb,var(--red-soft) 55%,var(--surface)); }
    .calendar-event.schedule.agenda-overdue .event-bar { background:var(--red); }
    .calendar-event.schedule.agenda-near { background:color-mix(in srgb,var(--orange-soft) 52%,var(--surface)); }
    .calendar-event.schedule.agenda-near .event-bar { background:var(--orange); }
    .calendar-event.schedule.agenda-soon { background:color-mix(in srgb,var(--orange-soft) 40%,var(--surface)); }
    .calendar-event.schedule.agenda-soon .event-bar { background:var(--orange); }
    .calendar-event.schedule.agenda-completed { background:color-mix(in srgb,var(--green-soft) 55%,var(--surface)); }
    .calendar-event.schedule.agenda-completed .event-bar { background:var(--green); }
    .calendar-event.schedule.agenda-completed strong { color:var(--muted); text-decoration:line-through; }
    .calendar-event-copy { min-width:0; }
    .calendar-event strong, .calendar-event small { display:block; }
    .calendar-event strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.75rem; }
    .calendar-event small { color:var(--muted); font-size:.63rem; line-height:1.35; }
    .calendar-event-amount { color:var(--text); font-size:.7rem; font-weight:800; white-space:nowrap; font-variant-numeric:tabular-nums; }
    .dashboard-calendar-events .empty-state { min-height:150px; padding:14px 10px; }
    .calendar-legend { display:flex; gap:10px; flex-wrap:wrap; margin-top:7px; color:var(--muted); font-size:.64rem; }
    .calendar-legend span { display:inline-flex; align-items:center; gap:4px; }
    .filter-control-active, .topbar .month-control:focus-within, .topbar button:focus-visible,
    .expense-toolbar-compact .input:focus, .expense-toolbar-compact .select:focus,
    .paid-toolbar-compact .input:focus, .paid-toolbar-compact .select:focus,
    .project-toolbar-compact .input:focus, .project-toolbar-compact .select:focus,
    .income-toolbar .input:focus, .income-toolbar .select:focus {
      outline:none !important; border-color:transparent !important; background:color-mix(in srgb,var(--primary) 7%,var(--surface)) !important; box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 18%,transparent) !important;
    }
    .input-error:focus, .select.input-error:focus { border-color:var(--danger) !important; box-shadow:inset 0 0 0 1px var(--danger) !important; }
    @media (max-width:1180px) { .kpi-grid, .report-kpi-grid, .income-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .dashboard-calendar-card { grid-column:1/-1; } }
    @media (max-width:850px) { .kpi-grid, .report-kpi-grid, .income-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .income-toolbar { grid-template-columns:1fr 1fr; } .dashboard-calendar-layout { grid-template-columns:1fr; } .income-record-header { display:none; } .income-record-row { grid-template-columns:1fr; gap:7px; } .income-record-row > * { text-align:left !important; } .income-record-row > :not(.record-title):not(.record-actions)::before { content:attr(data-label) ": "; color:var(--muted); font-weight:700; } }
    @media (max-width:520px) { .kpi-grid, .report-kpi-grid, .income-kpi-grid { grid-template-columns:1fr; } .income-toolbar { grid-template-columns:1fr; } .calendar-day { min-height:42px; padding:3px; } .dashboard-calendar-events { min-height:190px; max-height:250px; } .calendar-event-list { max-height:196px; } }



    /* V12.16.1 · calendar deduplication and compact view */
    .icon-field { min-width:0; }
    .icon-name-control { display:grid; grid-template-columns:42px minmax(0,1fr); gap:8px; align-items:center; }
    .record-icon-preview {
      width:42px; height:42px; min-width:42px; padding:0; border:1px solid var(--line); border-radius:var(--talaan-control-radius);
      background:var(--surface-soft); color:var(--muted); display:grid; place-items:center; overflow:hidden;
      font:inherit; cursor:default;
    }
    .record-icon-preview.has-icon { background:var(--surface); color:var(--text); }
    .record-icon-preview .record-icon { width:100%; height:100%; border-radius:0; }
    .record-icon-picker-controls { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:7px; }
    .record-icon-picker-controls .button, .emoji-picker > summary { min-height:30px; padding:5px 9px; font-size:.7rem; }
    .emoji-picker { position:relative; }
    .emoji-picker > summary { list-style:none; cursor:pointer; }
    .emoji-picker > summary::-webkit-details-marker { display:none; }
    .emoji-picker-panel {
      position:absolute; z-index:75; left:0; top:calc(100% + 5px); width:230px; padding:9px;
      border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:var(--shadow);
    }
    .emoji-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:5px; }
    .emoji-option { width:30px; height:30px; padding:0; border:1px solid transparent; border-radius:var(--talaan-control-radius); background:var(--surface-soft); font-size:1.05rem; cursor:pointer; }
    .emoji-option:hover, .emoji-option:focus-visible { background:var(--primary-soft); border-color:color-mix(in srgb,var(--primary) 26%,var(--line)); }
    .emoji-custom-button { grid-column:1/-1; width:100%; margin-top:3px; min-height:30px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); font-size:.7rem; cursor:pointer; }
    .record-icon-help { display:block; margin-top:5px; color:var(--muted); font-size:.66rem; }
    .record-icon {
      width:30px; height:30px; flex:0 0 30px; border-radius:var(--talaan-control-radius); background:var(--surface-soft);
      display:inline-grid; place-items:center; overflow:hidden; font-size:1.05rem; line-height:1;
    }
    .record-icon img { width:100%; height:100%; object-fit:contain; display:block; }
    .record-title-with-icon { display:flex; align-items:flex-start; gap:8px; min-width:0; }
    .record-title-with-icon > .record-title-copy, .record-title-with-icon > div { min-width:0; }
    .account-card-main { display:flex; align-items:center; gap:9px; min-width:0; }
    .account-card-icon { width:32px; height:32px; flex-basis:32px; }
    .account-setting-label { display:flex; align-items:center; gap:7px; min-width:0; }
    .account-setting-label .record-icon { width:26px; height:26px; flex-basis:26px; font-size:.92rem; }
    .savings-goal-title { display:flex; gap:8px; align-items:center; min-width:0; }
    .savings-goal-title > div { min-width:0; }
    .calendar-event .record-icon { width:25px; height:25px; flex-basis:25px; }
    .report-record-title { display:flex; gap:7px; align-items:flex-start; min-width:0; }
    .report-record-title > div { min-width:0; }
    #quickAddExpense[data-action-kind="project"] { background:var(--primary); border-color:var(--primary); }
    @media (max-width:520px) {
      .icon-name-control { grid-template-columns:40px minmax(0,1fr); }
      .record-icon-preview { width:40px; height:40px; min-width:40px; }
      .emoji-picker-panel { position:fixed; left:12px; right:12px; top:auto; bottom:12px; width:auto; }
      #quickAddExpense[data-action-kind="project"] { width:44px; min-width:44px; padding:0; font-size:0; }
      #quickAddExpense[data-action-kind="project"]::before { content:"+"; font-size:1.2rem; }
    }
    @media print { .record-icon-picker-controls { display:none !important; } }



    /* V12.16.3 · compact forms, icon picker, annual income, and expense duplication */
    #income .page-heading { margin-bottom:12px; }
    #income .page-heading > div:first-child p { max-width:620px; }
    .income-kpi-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
    .income-kpi-card { min-height:104px; padding:12px; display:flex; flex-direction:column; justify-content:space-between; }
    .income-kpi-card .kpi-label { font-size:.72rem; }
    .income-kpi-card .kpi-value { margin-top:4px; font-size:1.12rem; }
    .income-kpi-card .kpi-meta { margin-top:5px; font-size:.66rem; line-height:1.35; }
    .income-kpi-card.transfer-card { color:var(--text); background:var(--surface-soft); }
    .income-records-card, .annual-income-card { margin-top:12px; }
    .income-records-card .card-header, .annual-income-card .card-header { padding-bottom:9px; }
    .income-records-card .card-header p, .annual-income-card .card-header p { margin-top:2px; }
    .income-filters-panel { margin:0 0 8px; }
    .income-filters-panel > summary { display:none; }
    .income-toolbar { display:grid; grid-template-columns:minmax(240px,1.35fr) minmax(190px,.85fr) auto; gap:6px; margin:0; align-items:center; }
    .income-toolbar .input, .income-toolbar .select, .income-clear-filters { min-height:35px; height:35px; padding:5px 9px; color:color-mix(in srgb,var(--muted) 86%,var(--text)); font-size:.76rem; font-weight:500; }
    .income-toolbar .input::placeholder { color:color-mix(in srgb,var(--muted) 72%,transparent); opacity:1; }
    .income-toolbar .input:focus, .income-toolbar .select:focus, .income-toolbar .filter-control-active { border-color:transparent !important; outline:none !important; background:color-mix(in srgb,var(--primary) 7%,var(--surface)) !important; box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 18%,transparent) !important; }
    .income-clear-filters { color:var(--muted); white-space:nowrap; }
    .income-clear-filters[hidden] { display:none !important; }
    .income-record-header, .income-record-row { grid-template-columns:minmax(230px,1.55fr) minmax(135px,.85fr) minmax(118px,.72fr) minmax(125px,.78fr) minmax(108px,.66fr) minmax(70px,auto); align-items:center; }
    .income-record-header > :nth-child(n+2), .income-record-row > :nth-child(n+2):not(:nth-child(5)) { text-align:center; }
    .income-record-header > :nth-child(5), .income-record-row > :nth-child(5) { text-align:right; font-variant-numeric:tabular-nums; }
    .income-record-row { min-height:0; padding:8px 13px; }
    .income-record-row .record-statuses { margin-top:4px; }
    .income-record-row .record-title-copy > small { margin-top:2px; color:var(--muted); }
    .income-record-row .record-actions { justify-content:center; }
    .income-form-mode-note { margin:0 0 10px; padding:8px 10px; border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--muted); font-size:.7rem; line-height:1.4; }
    .income-account-helper { margin-top:5px; }
    .income-total-choice { grid-column:1/-1; }
    .income-total-choice.is-transfer { background:var(--surface-soft); border-color:var(--line); }
    .income-form-footer { display:flex; align-items:center; }
    .income-form-footer .footer-spacer { flex:1; }
    .annual-income-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0 0 8px; }
    .annual-income-summary > div { min-width:0; padding:8px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .annual-income-summary span { display:block; color:var(--muted); font-size:.63rem; font-weight:750; }
    .annual-income-summary strong { display:block; margin-top:3px; font-size:.84rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
    .annual-income-actions { gap:6px; flex-wrap:wrap; justify-content:flex-end; }
    .annual-income-actions .select, .annual-income-actions .button { min-height:34px; height:34px; }
    .annual-income-actions .select { width:92px; flex:0 0 92px; }
    .annual-show-all { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:5px 8px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); color:var(--muted); font-size:.69rem; font-weight:700; white-space:nowrap; }
    .annual-show-all input { width:15px; height:15px; margin:0; }
    .annual-income-scroll-hint { margin:0 0 6px; color:var(--muted); font-size:.65rem; }
    .annual-income-table-wrap { position:relative; overflow:auto; border:1px solid var(--line); border-radius:var(--talaan-card-radius); overscroll-behavior-inline:contain; }
    .annual-income-table { width:max-content; min-width:1120px; border-collapse:separate; border-spacing:0; font-size:.69rem; font-variant-numeric:tabular-nums; }
    .annual-income-table th, .annual-income-table td { min-width:62px; padding:5px 6px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); white-space:nowrap; text-align:right; }
    .annual-income-table th:first-child, .annual-income-table td:first-child { position:sticky; left:0; z-index:4; min-width:155px; max-width:175px; text-align:left; background:var(--surface); }
    .annual-income-table th:nth-last-child(2), .annual-income-table td:nth-last-child(2) { position:sticky; right:76px; z-index:3; min-width:82px; background:var(--surface); }
    .annual-income-table th:last-child, .annual-income-table td:last-child { position:sticky; right:0; z-index:3; min-width:76px; background:var(--surface); }
    .annual-income-table thead th { position:sticky; top:0; z-index:5; background:var(--surface-soft); color:var(--muted); font-size:.64rem; font-weight:850; }
    .annual-income-table thead th:first-child { z-index:7; background:var(--surface-soft); }
    .annual-income-table thead th:nth-last-child(-n+2) { z-index:6; background:var(--surface-soft); }
    .annual-income-table .income-group-row th { padding:5px 7px; background:color-mix(in srgb,var(--primary) 8%,var(--surface)); color:var(--primary); font-size:.66rem; letter-spacing:.03em; text-transform:uppercase; }
    .annual-income-table .income-total-row th, .annual-income-table .income-total-row td { background:color-mix(in srgb,var(--primary) 16%,var(--surface)); color:var(--text); font-weight:850; }
    .annual-income-table .income-total-row th:nth-last-child(-n+2), .annual-income-table .income-total-row td:nth-last-child(-n+2) { background:color-mix(in srgb,var(--primary) 16%,var(--surface)); }
    .annual-income-table tbody tr:last-child th, .annual-income-table tbody tr:last-child td { border-bottom:0; }
    .annual-income-table tr > *:last-child { border-right:0; }
    #quickAddExpense[data-action-kind="income"] { background:var(--primary); border-color:var(--primary); }
    @media (max-width:1180px) {
      .income-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .annual-income-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }
    @media (max-width:850px) {
      .income-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .income-record-header { display:none; }
      .income-record-row { grid-template-columns:1fr; gap:6px; }
      .income-record-row > * { text-align:left !important; }
      .income-record-row > :not(.record-title):not(.record-actions)::before { content:attr(data-label) ": "; color:var(--muted); font-weight:700; }
      .income-record-row .record-actions { justify-content:flex-start; }
    }
    @media (max-width:850px) {
      .topbar-actions #quickAddExpense:not([hidden]) { display:inline-flex !important; }
    }
    @media (max-width:700px) {
      .topbar-actions .month-status-chip { display:none !important; }
    }
    @media (max-width:700px) {
      .income-filters-panel { border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); overflow:visible; }
      .income-filters-panel > summary { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; cursor:pointer; font-weight:800; }
      .income-filters-panel > summary small { color:var(--muted); font-size:.68rem; font-weight:650; text-align:right; }
      .income-toolbar { grid-template-columns:1fr; gap:8px; padding:0 10px 10px; }
      .income-toolbar .input, .income-toolbar .select, .income-clear-filters { min-height:44px; height:44px; font-size:.8rem; }
      .annual-income-actions { width:100%; justify-content:flex-start; }
      .annual-income-scroll-hint { display:block; }
      #quickAddExpense[data-action-kind="income"] { width:44px; min-width:44px; padding:0; font-size:0; }
      #quickAddExpense[data-action-kind="income"]::before { content:"+"; font-size:1.2rem; }
    }
    @media (max-width:520px) {
      .income-kpi-grid, .annual-income-summary { grid-template-columns:1fr; }
      .income-kpi-card { min-height:90px; }
      .income-form-footer { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
      .income-form-footer .dialog-danger-leading { grid-column:1/-1; }
      .income-form-footer .footer-spacer { display:none; }
    }



    /* V12.16.3 · compact forms, icon picker, annual income, and expense duplication */
    [hidden] { display:none !important; }
    #incomeDialog { width:min(638px,calc(100vw - 28px)); }
    #incomeDialog .modal-header, #incomeDialog .modal-footer { padding:9px 12px; }
    #incomeDialog .modal-body { padding:10px 12px; }
    #incomeDialog .form-grid.two-column { gap:9px 10px; }
    #incomeDialog .required-note { margin-bottom:7px; }
    #incomeDialog .income-form-mode-note { margin-bottom:8px; padding:6px 8px; font-size:.67rem; }
    #incomeDialog .field { gap:4px; }
    #incomeDialog .field label { font-size:.7rem; }
    #incomeDialog .input, #incomeDialog .select, #incomeDialog .textarea { min-height:39px; }
    #incomeDialog .textarea { min-height:64px; resize:vertical; }
    #incomeDialog .expense-total-choice { padding:9px 10px; }
    #incomeDialog .form-disclosure summary { padding:9px 10px; }
    #incomeDialog .income-account-helper { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.64rem; }
    #incomeDialog .calculator-input-shell > .currency-prefix {
      position:absolute; left:12px; top:20px; z-index:2; color:var(--muted); font-weight:800; pointer-events:none;
    }
    #incomeDialog .calculator-input-shell > .currency-prefix + .input { padding-left:31px; }
    #incomeDialog .income-form-footer { gap:8px; }
    #incomeDialog .income-form-footer .dialog-danger-leading { margin-right:auto; }

    .icon-field { position:relative; }
    .record-icon-trigger { cursor:pointer; }
    .record-icon-trigger:hover, .record-icon-trigger:focus-visible {
      outline:none; border-color:transparent; background:color-mix(in srgb,var(--primary) 9%,var(--surface));
      box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 20%,transparent);
    }
    .record-icon-picker-controls.compact-icon-popover {
      position:absolute; z-index:90; top:calc(100% + 5px); left:0; width:min(290px,calc(100vw - 42px));
      display:flex; gap:6px; padding:9px; margin:0; align-items:center; flex-wrap:wrap;
      border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:var(--shadow);
    }
    .record-icon-picker-controls.compact-icon-popover .record-icon-help { flex-basis:100%; margin:2px 0 0; }
    .record-icon-picker-controls.compact-icon-popover .emoji-picker-panel { left:-1px; width:238px; }
    .record-icon-picker-controls.compact-icon-popover [data-icon-remove-target][hidden] { display:none !important; }

    .expense-dialog-footer { display:flex; align-items:center; gap:8px; }
    .expense-dialog-footer .footer-spacer { flex:1; }
    .expense-dialog-footer #duplicateExpenseFromDialog { margin-left:0; }

    .annual-income-card .card-header { padding-bottom:7px; align-items:center; }
    .annual-income-card .card-header h3 { font-size:.9rem; }
    .annual-income-card .card-header p { margin-top:2px; font-size:.66rem; }
    .annual-income-actions { gap:6px; flex-wrap:wrap; justify-content:flex-end; }
    .annual-income-actions .select, .annual-income-actions .button, .annual-show-all { min-height:34px; height:34px; }
    .annual-income-actions .select { width:88px; padding-top:0; padding-bottom:0; line-height:34px; }
    .annual-show-all { padding:0 9px; display:inline-flex; align-items:center; gap:6px; font-size:.68rem; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); white-space:nowrap; }
    .annual-income-summary { gap:6px; margin:7px 0; }
    .annual-income-summary > div { min-height:52px; padding:7px 9px; }
    .annual-income-summary span { font-size:.61rem; }
    .annual-income-summary strong { margin-top:3px; font-size:.75rem; }
    .annual-income-scroll-hint { margin:5px 0; font-size:.62rem; }
    .annual-income-table { min-width:1040px; font-size:.68rem; }
    .annual-income-table th, .annual-income-table td { padding:5px 6px; }
    .annual-income-table th:first-child, .annual-income-table td:first-child { min-width:154px; }
    .annual-income-table th:nth-last-child(2), .annual-income-table td:nth-last-child(2) { position:sticky; right:70px; z-index:2; min-width:78px; background:var(--surface); }
    .annual-income-table th:last-child, .annual-income-table td:last-child { position:sticky; right:0; z-index:2; min-width:70px; background:var(--surface); }
    .annual-income-table thead th:nth-last-child(-n+2) { background:var(--surface-soft); z-index:4; }
    .annual-income-table .income-group-row th { padding-top:5px; padding-bottom:5px; }
    .annual-income-table .income-total-row th, .annual-income-table .income-total-row td { padding-top:6px; padding-bottom:6px; }
    .annual-income-empty { padding:18px !important; text-align:center !important; color:var(--muted); background:var(--surface) !important; font-weight:700; }
    .annual-income-table-wrap.is-empty { overflow:hidden; }

    @media (max-width:850px) {
      #incomeDialog { width:calc(100vw - 16px); }
      #incomeDialog .income-account-helper { white-space:normal; }
      .annual-income-card .card-header { align-items:flex-start; }
      .annual-income-actions { width:100%; justify-content:flex-start; }
      .annual-income-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .expense-dialog-footer { display:grid; grid-template-columns:1fr 1fr; }
      .expense-dialog-footer .dialog-danger-leading, .expense-dialog-footer #duplicateExpenseFromDialog { grid-column:auto; margin:0; }
      .expense-dialog-footer .footer-spacer { display:none; }
    }
    @media (max-width:520px) {
      #incomeDialog .modal-header, #incomeDialog .modal-footer { padding:10px 12px; }
      #incomeDialog .modal-body { padding:11px 12px; }
      .annual-income-summary { grid-template-columns:1fr; }
      .annual-income-actions .select { width:82px; }
    }

    /* Phone annual income reads vertically instead of requiring a wide table swipe. */
    @media (max-width:700px) {
      .annual-income-table-wrap:not(.is-empty) { overflow:visible; border:0; border-radius:0; }
      .annual-income-table { display:block; width:100%; min-width:0; }
      .annual-income-table thead { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
      .annual-income-table tbody { display:grid; width:100%; gap:8px; }
      .annual-income-table tbody tr { display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:hidden; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); }
      .annual-income-table tbody tr > th:first-child { position:static; grid-column:1/-1; min-width:0; max-width:none; padding:8px 10px; border-right:0; border-bottom:1px solid var(--line); background:var(--surface-soft); white-space:normal; }
      .annual-income-table tbody tr > td { position:static; min-width:0; padding:7px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--surface); white-space:normal; text-align:left; overflow-wrap:anywhere; }
      .annual-income-table tbody tr > td:nth-child(odd) { border-right:0; }
      .annual-income-table tbody tr > td::before { content:attr(data-label); display:block; margin-bottom:2px; color:var(--muted); font-size:.61rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
      .annual-income-table tbody .income-group-row { display:block; margin-top:4px; border:0; background:transparent; }
      .annual-income-table tbody .income-group-row:first-child { margin-top:0; }
      .annual-income-table tbody .income-group-row > th:first-child { padding:5px 2px; border:0; background:transparent; }
      .annual-income-table tbody .income-total-row > :is(th,td) { background:color-mix(in srgb,var(--primary) 16%,var(--surface)); }
      .annual-income-table tbody .annual-income-empty { grid-column:1/-1; }
    }

    /* V12.17.0 · compact and reliable Expense dialog */
    #expenseDialog { width:min(638px,calc(100vw - 28px)); }
    #expenseDialog .modal-header, #expenseDialog .modal-footer { padding:9px 12px; }
    #expenseDialog .modal-body { padding:10px 12px; }
    #expenseDialog .form-grid { gap:9px 10px; }
    #expenseDialog .required-note { margin-bottom:7px; }
    #expenseDialog .expense-form-mode-note { margin-bottom:8px; padding:6px 8px; font-size:.67rem; }
    #expenseDialog .field { gap:4px; }
    #expenseDialog .field label { font-size:.7rem; }
    #expenseDialog .input, #expenseDialog .select, #expenseDialog .textarea { min-height:39px; }
    #expenseDialog .expense-total-choice { padding:9px 10px; }
    #expenseDialog .expense-total-choice small, #expenseDialog .expense-total-choice em { font-size:.63rem; line-height:1.3; }
    #expenseDialog .form-disclosure summary { padding:9px 10px; }
    #expenseDialog .calculator-input-shell > .currency-prefix {
      position:absolute; left:12px; top:50%; transform:translateY(-50%); z-index:2; color:var(--muted); font-weight:800; pointer-events:none;
    }
    #expenseDialog .calculator-input-shell > .currency-prefix + .input { padding-left:31px; }
    #expenseDialog .record-icon-picker-controls.compact-icon-popover { width:min(270px,calc(100vw - 42px)); }
    #expenseDialog .budget-preview { padding:8px 10px; min-height:0; }

    #expenseActionConfirmDialog { width:min(420px,calc(100vw - 28px)); }
    #expenseActionConfirmDialog .modal-header, #expenseActionConfirmDialog .modal-footer { padding:12px 14px; }
    #expenseActionConfirmDialog .modal-body { padding:14px; }
    .expense-confirm-message { margin:0; color:var(--text); font-size:.82rem; line-height:1.45; }
    .expense-confirm-details { margin-top:10px; padding:9px 10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); color:var(--muted); font-size:.72rem; line-height:1.45; }
    .expense-confirm-footer { display:flex; justify-content:flex-end; gap:8px; }

    @media (max-width:700px) {
      #expenseDialog { width:calc(100vw - 16px); }
      #expenseDialog .expense-dialog-footer { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
      #expenseDialog .expense-dialog-footer .footer-spacer { display:none; }
      #expenseDialog .expense-dialog-footer .dialog-danger-leading { grid-column:1; margin:0; }
      #expenseDialog .expense-dialog-footer #duplicateExpenseFromDialog { grid-column:2; margin:0; }
      #expenseDialog .expense-dialog-footer [data-close="expenseDialog"] { grid-column:1; }
      #expenseDialog .expense-dialog-footer #saveExpenseButton { grid-column:2; }
      #expenseDialog .expense-dialog-footer > button { width:100%; }
    }
    @media (max-width:520px) {
      #expenseDialog .modal-header, #expenseDialog .modal-footer,
      #expenseActionConfirmDialog .modal-header, #expenseActionConfirmDialog .modal-footer { padding:10px 12px; }
      #expenseDialog .modal-body, #expenseActionConfirmDialog .modal-body { padding:11px 12px; }
    }



    /* V12.17.0 · unified popup forms */
    .app-dialog {
      max-height:calc(100dvh - 28px);
      border:0;
      border-radius:var(--talaan-dialog-radius);
      padding:0;
      overflow:visible;
      color:var(--text);
      background:var(--surface);
      box-shadow:0 24px 80px rgba(16,24,40,.24);
    }
    .app-dialog.dialog-standard { width:min(638px,calc(100vw - 28px)); }
    .app-dialog.dialog-extended { width:min(710px,calc(100vw - 28px)); }
    .app-dialog.dialog-confirm, .app-dialog.dialog-help { width:min(420px,calc(100vw - 28px)); }
    .app-dialog.dialog-reset { width:min(510px,calc(100vw - 28px)); }
    .app-dialog > form,
    .app-dialog.dialog-utility[open],
    .app-dialog.dialog-confirm[open] {
      max-height:calc(100dvh - 28px);
      display:flex;
      flex-direction:column;
    }
    .app-dialog .modal-header,
    .app-dialog .modal-footer {
      flex:0 0 auto;
      min-height:54px;
      padding:12px 14px;
      background:var(--surface);
      gap:8px;
    }
    .app-dialog .modal-header { border-block-end:1px solid var(--line); }
    .app-dialog .modal-footer { border-block-start:1px solid var(--line); padding-bottom:max(12px,env(safe-area-inset-bottom)); }
    .app-dialog .modal-header h3 { margin:0; font-size:.94rem; line-height:1.25; }
    .app-dialog .modal-header .button-small { min-height:34px; padding:6px 10px; }
    .app-dialog .modal-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:13px 14px; }
    .dialog-context-note,
    .dialog-form .income-form-mode-note,
    .dialog-form .expense-form-mode-note {
      margin:0 0 8px;
      padding:6px 8px;
      border:0;
      border-radius:var(--talaan-control-radius);
      background:var(--surface-soft);
      color:var(--muted);
      font-size:.67rem;
      line-height:1.4;
    }
    .dialog-form .required-note { margin:0 0 7px; font-size:.68rem; }
    .dialog-form .form-grid { gap:9px 10px; }
    .dialog-form .field { gap:4px; }
    .dialog-form .field label { font-size:.7rem; }
    .dialog-form .input,
    .dialog-form .select,
    .dialog-form .textarea { min-height:39px; border-radius:var(--talaan-control-radius); }
    .dialog-form .textarea { min-height:64px; }
    .dialog-form .form-disclosure > summary { min-height:39px; padding:8px 10px; }
    .dialog-form .form-disclosure > .field { padding:0 10px 10px; }
    .dialog-form .expense-total-choice { padding:9px 10px; }
    .dialog-form .record-icon-picker-controls.compact-icon-popover { width:min(270px,calc(100vw - 42px)); }

    /* V13.0.2 · Edit Account balance and type alignment correction */
    #accountDialog .account-balance-type-row {
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:10px;
      align-items:start;
      min-width:0;
    }
    #accountDialog .account-balance-type-row > .field {
      align-content:start;
      min-width:0;
    }
    #accountDialog .account-balance-type-row .field-label-help-row {
      min-height:18px;
      align-items:center;
    }
    #accountDialog .account-balance-type-row label {
      color:var(--text);
      font-size:.72rem;
      font-weight:780;
      line-height:1.3;
    }
    #accountDialog .account-balance-type-row .input,
    #accountDialog .account-balance-type-row .select {
      box-sizing:border-box;
      height:38px;
      min-height:38px;
      padding:7px 10px;
    }
    #accountDialog .account-reconcile-help {
      display:block;
      margin:2px 0 0;
      color:var(--muted);
      font-size:.68rem;
      line-height:1.4;
    }
    html[data-theme="dark"] #accountDialog .account-balance-type-row label {
      color:color-mix(in srgb,var(--text) 92%,white 8%);
    }

    .form-action-footer,
    .utility-action-footer,
    .confirm-action-footer { display:flex; align-items:center; gap:8px; }
    .form-action-footer .footer-spacer,
    .utility-action-footer .footer-spacer { flex:1; }
    .form-action-footer .dialog-danger-leading,
    .utility-action-footer .dialog-secondary-leading { margin-right:0; }
    .form-action-footer .button,
    .utility-action-footer .button,
    .confirm-action-footer .button,
    .sync-review-footer .button { min-height:38px; }
    .dialog-project-paid { width:min(430px,calc(100vw - 28px)); }
    .dialog-project-paid .payment-confirm-summary { gap:6px; }
    .dialog-project-paid .payment-confirm-summary > div { padding:8px 9px; }
    .dialog-help { width:min(390px,calc(100vw - 24px)); }
    .dialog-help .compact-help-header { min-height:48px; padding:10px 12px; }
    .dialog-help .compact-help-body { padding:12px; }
    .dialog-reset .reset-warning { padding:10px 11px; }
    .dialog-reset .reset-warning p { margin:5px 0 0; }
    .dialog-utility .dashboard-customize-list { gap:7px; }
    .dialog-utility .sync-summary { gap:7px; }
    .sync-review-footer { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .sync-review-footer #cancelSyncImportButton { order:4; }
    .sync-review-footer #mergeKeepCurrentButton { order:1; }
    .sync-review-footer #mergeUseIncomingButton { order:2; }
    .sync-review-footer #replaceWithIncomingButton { order:3; }

    @media (max-width:700px) {
      .app-dialog { width:calc(100vw - 16px) !important; max-height:calc(100dvh - 16px); }
      .app-dialog > form,
      .app-dialog.dialog-utility[open],
      .app-dialog.dialog-confirm[open] { max-height:calc(100dvh - 16px); }
      .app-dialog .modal-header,
      .app-dialog .modal-footer { padding:10px 12px; }
      .app-dialog .modal-body { padding:11px 12px; }
      .dialog-form .form-grid,
      .dialog-form .form-grid.two-column { grid-template-columns:1fr; }
      #accountDialog .account-balance-type-row {
        grid-template-columns:1fr;
        gap:12px;
      }
      #accountDialog .account-balance-type-row .input,
      #accountDialog .account-balance-type-row .select {
        height:44px;
        min-height:44px;
      }
      .form-action-footer { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
      .form-action-footer .footer-spacer { display:none; }
      .form-action-footer .dialog-danger-leading { grid-column:1/-1; }
      #expenseDialog .form-action-footer .dialog-danger-leading { grid-column:1; }
      #expenseDialog .form-action-footer #duplicateExpenseFromDialog { grid-column:2; }
      .form-action-footer .button { width:100%; }
      .utility-action-footer { display:grid; grid-template-columns:1fr 1fr; }
      .utility-action-footer .footer-spacer { display:none; }
      .utility-action-footer .button { width:100%; }
      .confirm-action-footer { display:grid; grid-template-columns:1fr 1fr; }
      .confirm-action-footer .button { width:100%; }
      .sync-review-footer { grid-template-columns:1fr; }
      .sync-review-footer #mergeKeepCurrentButton { order:1; }
      .sync-review-footer #mergeUseIncomingButton { order:2; }
      .sync-review-footer #replaceWithIncomingButton { order:3; }
      .sync-review-footer #cancelSyncImportButton { order:4; }
    }


    /* V12.17.2 · compact popup input values and monthly checkboxes */
    .dialog-form .input,
    .dialog-form .select,
    .dialog-form .textarea {
      font-size:.79rem;
      line-height:1.3;
    }
    .dialog-form .input::placeholder,
    .dialog-form .textarea::placeholder {
      color:color-mix(in srgb,var(--muted) 76%,transparent);
      font-size:.76rem;
      opacity:1;
    }
    .dialog-form .calculator-input-shell > .money-prefix,
    .dialog-form .calculator-input-shell > .currency-prefix { display:none !important; }
    .dialog-form .calculator-input-shell > .money-prefix + .input,
    .dialog-form .calculator-input-shell > .currency-prefix + .input { padding-left:10px; }
    .dialog-form .recurring-choice {
      cursor:pointer;
      min-height:52px;
      align-items:center;
    }
    .dialog-form .recurring-choice input {
      accent-color:var(--primary);
      margin-top:0;
    }
    .dialog-form .recurring-choice strong { font-size:.76rem; }
    .dialog-form .recurring-choice small { font-size:.63rem; line-height:1.3; }

    /* V12.17.3 consolidated workspace navigation */
    .workspace-switcher {
      display:inline-flex;
      align-items:center;
      gap:3px;
      max-width:100%;
      margin:0 0 12px;
      padding:4px;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      background:var(--surface-soft);
      box-shadow:0 1px 2px rgba(15,23,42,.04);
    }
    .workspace-switcher-button {
      min-height:34px;
      padding:7px 12px;
      border:1px solid transparent;
      border-radius:var(--talaan-control-radius);
      background:transparent;
      color:var(--muted);
      font-size:.75rem;
      font-weight:800;
      line-height:1.15;
      white-space:nowrap;
      cursor:pointer;
    }
    .workspace-switcher-button:hover {
      color:var(--text);
      background:color-mix(in srgb,var(--surface) 76%,transparent);
    }
    .workspace-switcher-button.active,
    .workspace-switcher-button[aria-selected="true"] {
      border-color:var(--line-strong,var(--line));
      background:var(--surface);
      color:var(--text);
      box-shadow:0 1px 3px rgba(15,23,42,.08);
    }
    .workspace-switcher-button:focus-visible {
      outline:3px solid color-mix(in srgb,var(--primary) 28%,transparent);
      outline-offset:2px;
    }
    html[data-theme="dark"] .workspace-switcher { background:rgba(255,255,255,.035); }
    html[data-theme="dark"] .workspace-switcher-button.active,
    html[data-theme="dark"] .workspace-switcher-button[aria-selected="true"] { background:rgba(255,255,255,.09); }
    @media (max-width:700px) {
      .workspace-switcher { display:grid; width:100%; grid-template-columns:repeat(var(--workspace-columns,3),minmax(0,1fr)); }
      .workspace-switcher-button { min-width:0; padding:8px 6px; white-space:normal; text-align:center; }
      .project-workspace-switcher { --workspace-columns:2; }
    }


    /* V12.18.0 · compact, consistent workspace UI */
    :root {
      --workspace-section-gap: 10px;
      --workspace-card-padding: 13px;
      --workspace-card-radius: 9px;
      --workspace-control-height: 38px;
      --workspace-compact-control-height: 35px;
      --workspace-soft-shadow: 0 1px 2px rgba(15,23,42,.045);
      --workspace-raised-shadow: 0 7px 22px rgba(15,23,42,.065);
    }

    .content { padding:18px var(--desktop-page-gutter) 34px; }
    .page-heading {
      align-items:center;
      gap:12px;
      margin-bottom:12px;
      padding-bottom:10px;
      border-bottom:1px solid var(--line);
    }
    .page-heading h2 { margin-bottom:2px; font-size:1.34rem; line-height:1.12; }
    .page-heading p { max-width:680px; font-size:.75rem; line-height:1.42; }
    .page-heading-actions,
    .dashboard-heading-actions { gap:6px; }
    .card {
      padding:var(--workspace-card-padding);
      border-radius:var(--workspace-card-radius);
      box-shadow:var(--workspace-soft-shadow);
    }
    .card:hover { box-shadow:var(--workspace-raised-shadow); }
    .card-header { align-items:flex-start; gap:10px; margin-bottom:8px; }
    .card-header h3 { margin-bottom:2px; font-size:.88rem; line-height:1.25; }
    .card-header p { font-size:.66rem; line-height:1.38; }
    .grid,
    .section-stack,
    .dashboard-card-grid,
    .report-detail-stack,
    .settings-panel { gap:var(--workspace-section-gap); }
    .button,
    .input,
    .select,
    .month-control,
    .theme-toggle-button { min-height:var(--workspace-control-height); }
    .button { padding:7px 11px; border-radius:var(--talaan-control-radius); font-size:.76rem; }
    .button-small { min-height:34px; padding:5px 9px; font-size:.71rem; }
    .input,
    .select,
    .textarea { border-radius:var(--talaan-control-radius); font-size:.77rem; }
    .workspace-switcher {
      position:sticky;
      top:var(--desktop-header-height);
      z-index:23;
      margin-bottom:10px;
      padding:3px;
      border-radius:var(--talaan-control-radius);
      background:color-mix(in srgb,var(--surface) 96%,transparent);
      backdrop-filter:blur(12px);
    }
    .workspace-switcher-button { min-height:35px; padding:7px 11px; }
    #money .page-heading .related-page-link,
    #projects .page-heading .related-page-link { display:none !important; }

    /* 01 Dashboard */
    #dashboard > .kpi-grid,
    #reports > .report-compact-group .report-kpi-grid {
      grid-template-columns:repeat(5,minmax(0,1fr));
      gap:8px;
    }
    #dashboard > .kpi-grid .kpi-card,
    #reports .report-kpi-grid .kpi-card {
      min-height:70px;
      padding:10px 11px;
      display:flex;
      flex-direction:column;
      justify-content:center;
    }
    #dashboard .kpi-label,
    #reports .kpi-label { font-size:.66rem; line-height:1.18; }
    #dashboard .kpi-value,
    #reports .kpi-value { margin-top:3px; font-size:1.13rem; line-height:1.08; }
    #dashboard .kpi-meta,
    #reports .kpi-meta { margin-top:3px; font-size:.59rem; line-height:1.25; }
    #dashboard .month-insights-card { margin-top:9px; padding:11px 13px; }
    #dashboard .dashboard-card-grid {
      grid-template-columns:repeat(12,minmax(0,1fr));
      grid-auto-flow:dense;
      gap:10px;
      margin-top:10px;
    }
    #dashboard .dashboard-detail-card { min-height:0; }
    #dashboard .dashboard-detail-card[data-size="small"] { grid-column:span 3; }
    #dashboard .dashboard-detail-card[data-size="large"] { grid-column:span 4; }
    #dashboard .dashboard-detail-card[data-size="wide"] { grid-column:span 6; }
    #dashboard .dashboard-stat-line { padding:5px 0; }
    #dashboard .dashboard-heading-actions .button { min-height:34px; }

    #income .compact-income-grid,
    #paid-expenses .compact-paid-grid {
      gap:8px;
      align-items:stretch;
      margin-bottom:12px;
    }
    #income .compact-income-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
    #paid-expenses .compact-paid-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
    /* V12.18.5 · Match Income and Paid Expenses to the live Budget summary height. */
    :root {
      --compact-summary-height:70px;
      --compact-summary-padding-block:10px;
      --compact-summary-padding-inline:11px;
    }
    #income .compact-summary-grid .kpi-card,
    #paid-expenses .compact-summary-grid .kpi-card {
      height:var(--compact-summary-height);
      min-height:var(--compact-summary-height);
      padding:var(--compact-summary-padding-block) var(--compact-summary-padding-inline);
      display:flex;
      flex-direction:column;
      justify-content:center;
      gap:1px;
    }
    #income .compact-summary-grid .kpi-label,
    #paid-expenses .compact-summary-grid .kpi-label { font-size:.7rem; line-height:1.1; }
    #income .compact-summary-grid .kpi-value,
    #paid-expenses .compact-summary-grid .kpi-value {
      margin-top:1px;
      font-size:.92rem;
      line-height:1.02;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    #income .compact-summary-grid .kpi-meta,
    #paid-expenses .compact-summary-grid .kpi-meta {
      display:block;
      min-width:0;
      margin-top:1px;
      font-size:.59rem;
      line-height:1.08;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    /* 02 Budget & Expenses */
    #money .legend,
    #money .summary-strip {
      display:grid;
      grid-template-columns:repeat(4,minmax(0,1fr));
      gap:8px;
      margin-bottom:9px;
    }
    #money .legend-item,
    #money .summary-item {
      min-height:70px;
      padding:10px 11px;
      border-radius:var(--talaan-card-radius);
      align-content:center;
    }
    #money .legend-text strong,
    #money .summary-card-label { font-size:.7rem; line-height:1.2; }
    #money .legend-text small,
    #money .summary-card-description { font-size:.59rem; line-height:1.28; }
    #money .legend-total,
    #money .summary-card-amount { font-size:.92rem; white-space:nowrap; }
    #availableMoneySection { padding:12px; }
    #availableMoneySection .card-header { align-items:center; }
    #availableMoneySection .account-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    #availableMoneySection .account-card {
      min-height:68px;
      padding:8px 9px;
      gap:8px;
      border-radius:var(--talaan-card-radius);
      align-items:center;
    }
    #availableMoneySection .account-card-main { min-width:0; gap:8px; }
    #availableMoneySection .account-card-icon { width:30px; height:30px; flex-basis:30px; }
    #availableMoneySection .account-card-label { min-width:0; }
    #availableMoneySection .account-card-label span { font-size:.7rem; }
    #availableMoneySection .account-card-label small { font-size:.57rem; }
    #availableMoneySection .account-card strong { margin-top:2px; font-size:.88rem; }
    #availableMoneySection .account-card-actions .button { min-height:32px; }
    #money .period-card { margin-top:8px; }
    #money .period-card .card-header { min-height:0; }
    #money .record-header,
    #money .record-row { min-height:0; }
    #money .record-row { padding:8px 13px; }
    #paid-expenses .record-row { padding:8px 13px; }

    /* 03 Projects */
    #projects .project-section-card { padding:12px; }
    #projects .project-section-card + .project-section-card { margin-top:10px !important; }
    #projects .project-record-header,
    #projects .project-record { gap:6px; }
    #projects .project-record-header { min-height:34px; padding:7px 9px; font-size:.63rem; }
    #projects .project-record { min-height:58px; padding:7px 9px; font-size:.71rem; }
    #projects .project-record .project-cell,
    #projects .project-record .project-calendar-cell,
    #projects .project-record .project-row-actions { min-height:30px; }
    #projects .project-record .record-title strong { font-size:.75rem; }
    #projects .project-record .record-title small { font-size:.59rem; line-height:1.25; }
    #projects .project-toolbar-compact { padding:7px; border-radius:var(--talaan-control-radius); }
    #projects .project-summary-strip { gap:7px; }
    #projects .project-summary-strip > * { min-height:70px; padding:9px 10px; }
    #payments .kpi-grid { gap:8px; }
    #payments .kpi-card { min-height:70px; padding:9px 10px; }

    /* 04 Monthly Reports */
    #reports .page-heading { margin-bottom:8px; }
    #reports .report-status-row {
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      align-items:center;
      gap:10px;
      margin:0 0 8px;
      padding:9px 11px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface);
      box-shadow:var(--workspace-soft-shadow);
    }
    #reports .report-section-nav { top:var(--desktop-header-height); margin-bottom:8px; padding:5px; }
    #reports .report-section-nav button { min-height:35px; padding:5px 9px; }
    .report-compact-group {
      margin:0 0 8px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface);
      box-shadow:var(--workspace-soft-shadow);
      overflow:clip;
    }
    .report-compact-group > summary {
      list-style:none;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      min-height:44px;
      padding:9px 12px;
      cursor:pointer;
      border-bottom:1px solid transparent;
      background:var(--surface-soft);
    }
    .report-compact-group > summary::-webkit-details-marker { display:none; }
    .report-compact-group[open] > summary { border-bottom-color:var(--line); }
    .report-compact-summary-copy { display:grid; gap:2px; }
    .report-compact-summary-copy strong { font-size:.8rem; }
    .report-compact-summary-copy small { color:var(--muted); font-size:.62rem; line-height:1.3; }
    .report-compact-chevron {
      box-sizing:border-box;
      flex:0 0 30px;
      width:30px;
      min-width:30px;
      height:30px;
      min-height:30px;
      display:grid;
      place-items:center;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      background:var(--surface);
      transition:transform .18s ease;
    }
    .report-compact-chevron svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .report-compact-group:not([open]) .report-compact-chevron { transform:rotate(180deg); }
    @media (max-width:850px), (hover:none) and (pointer:coarse) {
      .report-compact-chevron { flex-basis:35px; width:35px; min-width:35px; height:35px; min-height:35px; }
    }
    .report-compact-body { display:grid; gap:8px; padding:10px; }
    .report-compact-body > .report-section-heading { margin:0; padding:0 2px 5px; }
    .report-compact-body > .report-section-heading span { width:26px; height:26px; font-size:.63rem; }
    .report-compact-body > .report-section-heading strong { font-size:.78rem; }
    .report-compact-body > .report-section-heading small { font-size:.6rem; }
    .report-compact-body .card { margin:0 !important; }
    .report-compact-body .report-detail-stack { gap:8px; }
    .report-compact-body .report-table-header,
    .report-compact-body .report-table-row { min-height:0; padding:7px 9px; font-size:.68rem; }
    .report-compact-body .report-analysis-grid { gap:8px; }
    .report-compact-body .report-export-card .toolbar { gap:6px; }
    .report-compact-body .report-export-card .button { flex:1 1 150px; }

    /* Settings */
    #settings.active {
      display:grid;
      grid-template-columns:218px minmax(0,1fr);
      column-gap:12px;
      align-items:start;
    }
    #settings > .page-heading { grid-column:1/-1; }
    #settings > .settings-navigation {
      grid-column:1;
      position:sticky;
      top:var(--desktop-header-height);
      z-index:20;
      margin:0;
    }
    #settings > .settings-panels { grid-column:2; min-width:0; }
    #settings .settings-tablist {
      display:grid;
      gap:4px;
      overflow:visible;
      padding:6px;
      border-radius:var(--talaan-control-radius);
    }
    #settings .settings-tablist button {
      width:100%;
      min-height:38px;
      padding:8px 10px;
      text-align:left;
      justify-content:flex-start;
    }
    #settings .settings-panel { gap:10px; }
    #settings .settings-panel > .card,
    #settings .settings-panel > .grid { margin:0 !important; }
    #settings .settings-panel > .grid { gap:10px; }
    #settings .settings-panel .card { padding:13px; }
    #settings .settings-panel form { gap:9px; }
    #settings .setting-row { min-height:0; padding:9px 10px; }
    #settings .field { gap:4px; }
    #settings .field label { font-size:.69rem; }
    #settings .field-help,
    #settings .system-help { font-size:.63rem; line-height:1.4; }
    #settings .section-stack { gap:7px; }
    #settings .settings-about-grid { gap:7px; }
    #settings .settings-about-grid > div { padding:9px 10px; }

    html[data-theme="dark"] .report-compact-group,
    html[data-theme="dark"] #reports .report-status-row { background:var(--surface); }

    @media (max-width:1100px) {
      #dashboard .dashboard-card-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
      #dashboard .dashboard-detail-card[data-size="small"],
      #dashboard .dashboard-detail-card[data-size="large"] { grid-column:span 3; }
      #dashboard .dashboard-detail-card[data-size="wide"] { grid-column:1 / -1; }
      #availableMoneySection .account-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #settings.active { grid-template-columns:190px minmax(0,1fr); }
    }

    @media (max-width:850px) {
      .content { padding:15px 14px 30px; }
      #income .compact-income-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #paid-expenses .compact-paid-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #income .compact-summary-grid .kpi-card,
      #paid-expenses .compact-summary-grid .kpi-card { height:auto; min-height:var(--compact-summary-height); }
      #income .compact-summary-grid .kpi-meta,
      #paid-expenses .compact-summary-grid .kpi-meta {
        white-space:normal;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2;
      }
      .page-heading { align-items:flex-start; }
      #dashboard > .kpi-grid,
      #reports > .report-compact-group .report-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #dashboard > .kpi-grid .kpi-card:last-child,
      #reports .report-kpi-grid .kpi-card:last-child { grid-column:1/-1; }
      #money .legend,
      #money .summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #settings.active { display:block; }
      #settings > .settings-navigation { position:sticky; top:67px; margin-bottom:8px; }
      #settings .settings-tablist { display:flex; overflow-x:auto; }
      #settings .settings-tablist button { width:auto; min-width:max-content; text-align:center; }
      #reports .report-status-row { grid-template-columns:1fr; }
    }

    @media (max-width:700px) {
      :root { --workspace-card-padding:11px; --workspace-control-height:44px; }
      .content { padding:12px 11px calc(28px + env(safe-area-inset-bottom)); }
      .page-heading { display:grid; gap:8px; padding-bottom:8px; }
      .page-heading h2 { font-size:1.2rem; }
      .page-heading p { font-size:.72rem; }
      .button,
      .button-small,
      .input,
      .select,
      .month-control,
      .theme-toggle-button { min-height:44px; }
      .workspace-switcher { top:65px; }
      #dashboard > .kpi-grid,
      #reports > .report-compact-group .report-kpi-grid,
      #money .legend,
      #money .summary-strip,
      #availableMoneySection .account-grid { grid-template-columns:1fr; }
      #dashboard .dashboard-card-grid { grid-template-columns:1fr; }
      #dashboard .dashboard-detail-card[data-size="small"],
      #dashboard .dashboard-detail-card[data-size="large"],
      #dashboard .dashboard-detail-card[data-size="wide"] { grid-column:1; }
      #income .compact-income-grid,
      #paid-expenses .compact-paid-grid { grid-template-columns:1fr; }
      #dashboard > .kpi-grid .kpi-card:last-child,
      #reports .report-kpi-grid .kpi-card:last-child { grid-column:1; }
      #dashboard > .kpi-grid .kpi-card,
      #reports .report-kpi-grid .kpi-card { min-height:68px; }
      #dashboard .dashboard-heading-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
      #dashboard .dashboard-heading-actions .related-page-link { grid-column:1/-1; }
      #dashboard .dashboard-heading-actions .button { width:100%; min-height:44px; }
      #availableMoneySection .card-header { align-items:flex-start; }
      #availableMoneySection .account-card { min-height:72px; }
      #projects .project-section-card { padding:10px; }
      #projects .project-record { padding:11px; }
      #reports .report-section-nav { top:66px; }
      .report-compact-group > summary { min-height:48px; }
      .report-compact-body { padding:8px; }
      .report-compact-body .report-export-card .toolbar { display:grid; grid-template-columns:1fr; }
      #settings > .settings-navigation { top:66px; }
      #settings .settings-panel .grid { grid-template-columns:1fr; }
    }



    @media (max-width:700px) {
      #projects .project-record .project-calendar-button,
      #projects .project-record .project-row-actions .button,
      #projects .collapse-toggle,
      #reports .report-status-actions .button,
      #reports .page-heading .button,
      #reports .report-section-nav button,
      #money .account-order-button,
      #money .account-card-actions .button {
        min-height:44px !important;
        height:auto !important;
      }
      .workspace-switcher-button,
      #projects .project-title-note-trigger {
        min-height:44px !important;
        height:auto !important;
      }
      #projects .project-title-note-trigger {
        display:inline-flex;
        align-items:center;
      }
      .context-help-button::after,
      .section-help-button::after { inset:-14px; }
    }


    /* V12.18.4 · Dashboard resize grid */
    .month-current-button { min-height:38px; padding-inline:10px; white-space:nowrap; }
    .month-current-button[hidden] { display:none !important; }
    .sr-error-announcer {
      position:fixed !important; width:1px !important; height:1px !important;
      padding:0 !important; margin:-1px !important; overflow:hidden !important;
      clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important;
    }
    .project-duplicate-footer { margin-right:6px; }
    @media (max-width:700px) {
      .menu-button, .month-nav-button, .month-current-button,
      #dashboardCalendarPrevious, #dashboardCalendarNext, #dashboardCalendarToday,
      .calendar-day { min-width:44px !important; min-height:44px !important; }
      .menu-button, .month-nav-button, #dashboardCalendarPrevious, #dashboardCalendarNext {
        width:44px !important; height:44px !important;
      }
      .month-control { min-height:44px !important; padding-block:0 !important; }
      .month-control input[type="month"] {
        width:100% !important; min-width:0 !important; min-height:44px !important; height:44px !important;
      }
      .calendar-day { height:auto !important; }
      .project-dialog-footer .project-duplicate-footer { order:1; width:100%; margin:0; }
      .project-dialog-footer .project-delete-footer { order:2; }
      .project-dialog-footer .footer-spacer { order:3; }
      .project-dialog-footer [data-close="projectDialog"] { order:4; }
      .project-dialog-footer button[type="submit"] { order:5; }
    }


    /* V12.18.6 · Compact Dashboard monthly overview and Project Payments summaries. */
    #dashboard > .kpi-grid .kpi-card,
    #payments > .kpi-grid .kpi-card {
      min-height:54px;
      height:auto;
      padding:6px 9px;
      justify-content:center;
      gap:0;
    }
    #dashboard > .kpi-grid .kpi-label,
    #payments > .kpi-grid .kpi-label {
      font-size:.64rem;
      line-height:1.08;
    }
    #dashboard > .kpi-grid .kpi-value,
    #payments > .kpi-grid .kpi-value {
      margin-top:1px;
      font-size:.94rem;
      line-height:1.02;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    #dashboard > .kpi-grid .kpi-meta {
      margin-top:1px;
      font-size:.55rem;
      line-height:1.05;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    @media (max-width:850px) {
      #dashboard > .kpi-grid .kpi-card,
      #payments > .kpi-grid .kpi-card {
        min-height:54px;
        height:auto;
      }
      #dashboard > .kpi-grid .kpi-meta {
        white-space:normal;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2;
      }
    }

    /* V12.18.8 · Optional Gym Emoji & Settings History */
    #expenseDialog .gym-schedule-field {
      margin:0;
      padding:9px 10px 10px;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface-soft);
    }
    #expenseDialog .gym-schedule-field legend {
      padding:0 4px;
      color:var(--text);
      font-size:.7rem;
      font-weight:800;
    }
    .gym-day-grid {
      display:grid;
      grid-template-columns:repeat(7,minmax(0,1fr));
      gap:6px;
      margin:2px 0 7px;
    }
    .gym-day-grid label { min-width:0; cursor:pointer; }
    .gym-day-grid input {
      position:absolute;
      opacity:0;
      pointer-events:none;
    }
    .gym-day-grid span {
      min-height:38px;
      display:grid;
      place-items:center;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      background:var(--surface);
      color:var(--muted);
      font-size:.68rem;
      font-weight:850;
      transition:border-color .15s ease,background-color .15s ease,color .15s ease;
    }
    .gym-day-grid input:checked + span {
      border-color:var(--primary);
      background:var(--green-soft);
      color:var(--text);
      box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 50%,transparent);
    }
    .gym-day-grid input:focus-visible + span {
      outline:2px solid var(--primary);
      outline-offset:2px;
    }
    .gym-preview {
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:8px;
      align-items:center;
    }
    .gym-preview > span {
      min-width:0;
      display:grid;
      gap:2px;
      padding:6px 8px;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      background:var(--surface);
    }
    .gym-preview small { color:var(--muted); font-size:.58rem; }
    .gym-preview strong { font-size:.78rem; overflow-wrap:anywhere; }
    .gym-override-details summary {
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
    }
    .gym-override-details summary span { font-weight:800; }
    .gym-override-details summary small { color:var(--muted); font-size:.61rem; }
    .gym-override-body { padding:9px 10px 10px; border-top:1px solid var(--line); }
    .gym-override-controls {
      display:grid;
      grid-template-columns:minmax(170px,1fr) auto auto;
      gap:8px;
      align-items:end;
    }
    .gym-override-controls .field { margin:0; }
    .gym-override-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
    .gym-override-chip {
      display:inline-flex;
      align-items:center;
      gap:6px;
      min-height:32px;
      padding:4px 6px 4px 8px;
      border:1px solid var(--line);
      border-radius:999px;
      background:var(--surface);
      color:var(--text);
      font-size:.62rem;
      font-weight:750;
    }
    .gym-override-chip.added { border-color:color-mix(in srgb,var(--green) 45%,var(--line)); }
    .gym-override-chip.removed { border-color:color-mix(in srgb,var(--red) 45%,var(--line)); }
    .gym-override-chip button {
      width:24px;
      height:24px;
      padding:0;
      border:0;
      border-radius:999px;
      background:var(--surface-soft);
      color:var(--muted);
      cursor:pointer;
    }
    .gym-override-empty { margin:0; color:var(--muted); font-size:.64rem; }
    .gym-schedule-summary { color:var(--muted); font-size:.62rem; }
    @media (max-width:700px) {
      .gym-day-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
      .gym-day-grid span { min-height:44px; }
      .gym-preview { grid-template-columns:1fr; }
      .gym-override-controls { grid-template-columns:1fr 1fr; }
      .gym-override-controls .field { grid-column:1/-1; }
    }



    /* V12.18.8 · Optional Gym Emoji and Settings Version History */
    .settings-version-history-card { min-width:0; }
    .version-history-list { display:grid; gap:7px; }
    .version-history-entry { border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); overflow:hidden; }
    .version-history-entry summary { min-height:46px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; cursor:pointer; list-style:none; color:var(--text); }
    .version-history-entry summary::-webkit-details-marker { display:none; }
    .version-history-entry summary > span:first-child { min-width:0; }
    .version-history-entry summary strong, .version-history-entry summary small { display:block; }
    .version-history-entry summary strong { font-size:.75rem; line-height:1.3; }
    .version-history-entry summary small { margin-top:2px; color:var(--muted); font-size:.62rem; }
    .version-history-chevron { flex:0 0 auto; color:var(--muted); transition:transform .16s ease; }
    .version-history-entry[open] .version-history-chevron { transform:rotate(180deg); }
    .version-history-entry ul { margin:0; padding:0 28px 11px 30px; color:var(--muted); font-size:.68rem; line-height:1.45; }
    .version-history-entry li + li { margin-top:4px; }
    .version-history-entry summary:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
    @media (max-width:700px) { .version-history-entry summary { min-height:44px; padding:10px; } .version-history-entry ul { padding:0 22px 11px 28px; } }

    /* V12.18.9 · Split Utility Bills and Recurring-Series Editing */
    #expenseDialog .utility-bill-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; grid-column:1/-1; padding:9px 10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    #expenseDialog .utility-bill-fields[hidden] { display:none !important; }
    #expenseDialog .utility-bill-fields .field { margin:0; }
    #expenseDialog .utility-total-preview { grid-column:1/-1; min-height:38px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); }
    #expenseDialog .utility-total-preview span { color:var(--muted); font-size:.64rem; font-weight:750; }
    #expenseDialog .utility-total-preview strong { font-size:.83rem; }
    #expenseDialog .utility-conversion-note { grid-column:1/-1; margin:0; color:var(--orange-text); font-size:.63rem; line-height:1.35; }
    #expenseDialog .expense-series-scope-field { grid-column:1/-1; padding:9px 10px; border:1px solid color-mix(in srgb,var(--primary) 28%,var(--line)); border-radius:var(--talaan-control-radius); background:color-mix(in srgb,var(--green-soft) 44%,var(--surface)); }
    #expenseDialog .expense-series-scope-field[hidden] { display:none !important; }
    @media (max-width:700px) { #expenseDialog .utility-bill-fields { grid-template-columns:1fr; } #expenseDialog .utility-total-preview { grid-column:1; } }


    /* V12.18.10 · Confirmed payment accounts and Gym month-end auto-pay */
    #expenseDialog .gym-auto-pay-field { grid-column:1/-1; padding:9px 10px; border:1px solid color-mix(in srgb,var(--green) 30%,var(--line)); border-radius:var(--talaan-control-radius); background:color-mix(in srgb,var(--green-soft) 48%,var(--surface)); }
    #expenseDialog .gym-auto-pay-field[hidden], #expenseDialog .gym-auto-pay-account-field[hidden] { display:none !important; }
    #expenseDialog .gym-auto-pay-account-field { grid-column:1/-1; }
    .expense-payment-summary { display:grid; gap:6px; padding:10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .expense-payment-summary-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
    .expense-payment-summary-row span { color:var(--muted); font-size:.68rem; }
    .expense-payment-summary-row strong { font-size:.82rem; text-align:right; }
    .expense-payment-balance { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .expense-payment-balance > div { padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); }
    .expense-payment-balance span, .expense-payment-balance strong { display:block; }
    .expense-payment-balance span { color:var(--muted); font-size:.62rem; }
    .expense-payment-balance strong { margin-top:3px; font-size:.78rem; }
    .expense-payment-warning { margin:0; color:var(--danger); font-size:.66rem; line-height:1.4; }
    .status-auto-paid { border-color:color-mix(in srgb,var(--green) 42%,var(--line)); background:var(--green-soft); color:var(--green-text); }
    .status-auto-pay-warning { border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); background:var(--orange-soft); color:var(--orange-text); }
    @media (max-width:700px) { .expense-payment-balance { grid-template-columns:1fr; } }


    /* V12.19.0 · MacBook and iPhone cloud sync */
    .cloud-sync-toolbar-button { min-height:38px; display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:6px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); font:inherit; font-size:.66rem; font-weight:800; cursor:pointer; white-space:nowrap; }
    .cloud-sync-toolbar-button:hover, .cloud-sync-toolbar-button:focus-visible { border-color:var(--primary); }
    .cloud-sync-toolbar-button[data-state="success"] { color:var(--green-text); border-color:color-mix(in srgb,var(--green) 40%,var(--line)); background:var(--green-soft); }
    .cloud-sync-toolbar-button[data-state="warning"] { color:var(--orange-text); border-color:color-mix(in srgb,var(--orange) 42%,var(--line)); background:var(--orange-soft); }
    .cloud-sync-toolbar-button[data-state="danger"] { color:var(--danger); border-color:color-mix(in srgb,var(--red) 42%,var(--line)); background:var(--red-soft); }
    .cloud-sync-panel { min-width:0; }
    .cloud-sync-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .cloud-sync-status-grid > div { min-width:0; padding:9px 10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .cloud-sync-status-grid span, .cloud-sync-status-grid strong { display:block; overflow-wrap:anywhere; }
    .cloud-sync-status-grid span { color:var(--muted); font-size:.62rem; }
    .cloud-sync-status-grid strong { margin-top:3px; font-size:.72rem; }
    .cloud-config-grid, .cloud-auth-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
    .cloud-password-wrap { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:stretch; min-width:0; }
    .cloud-password-wrap .input { min-width:0; width:100%; }
    .cloud-password-toggle { min-width:68px; min-height:38px; padding:6px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); font:inherit; font-size:.64rem; font-weight:800; cursor:pointer; }
    .cloud-password-toggle:hover, .cloud-password-toggle:focus-visible { border-color:var(--primary); }
    .cloud-auth-feedback { margin-top:9px; padding:9px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--muted); font-size:.64rem; line-height:1.45; }
    .cloud-auth-feedback[data-tone="success"] { border-color:color-mix(in srgb,var(--green) 36%,var(--line)); background:var(--green-soft); color:var(--green-text); }
    .cloud-auth-feedback[data-tone="warning"] { border-color:color-mix(in srgb,var(--orange) 36%,var(--line)); background:var(--orange-soft); color:var(--orange-text); }
    .cloud-auth-feedback[data-tone="danger"] { border-color:color-mix(in srgb,var(--red) 36%,var(--line)); background:var(--red-soft); color:var(--danger); }
    .cloud-auth-secondary-actions { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:7px; }
    .cloud-auth-link-button { min-height:36px; padding:5px 8px; border:0; background:transparent; color:var(--primary); font:inherit; font-size:.64rem; font-weight:800; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
    .cloud-auth-link-button:disabled { opacity:.55; cursor:not-allowed; }
    .cloud-connection-line { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px; padding-top:8px; border-top:1px solid var(--line); font-size:.62rem; }
    .cloud-connection-line span { color:var(--muted); }
    .cloud-connection-line strong { text-align:right; }
    #cloudPasswordRecoveryCard[hidden], #cloudRecoveryHelpCard[hidden] { display:none !important; }
    .cloud-recovery-code-grid { margin-top:10px; }
    #cloudRecoveryHelpCard code { font-size:.68rem; overflow-wrap:anywhere; }
    @media (max-width:700px) { #cloudRecoveryHelpCard .system-actions { display:grid; grid-template-columns:1fr; } #cloudRecoveryHelpCard .button { min-height:44px; width:100%; } }
    .cloud-first-sync-options { display:grid; gap:8px; }
    .cloud-first-sync-options label { display:flex; align-items:flex-start; gap:9px; min-height:54px; padding:10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); cursor:pointer; }
    .cloud-first-sync-options input { margin-top:3px; }
    .cloud-first-sync-options span, .cloud-first-sync-options strong, .cloud-first-sync-options small { display:block; }
    .cloud-first-sync-options strong { font-size:.72rem; }
    .cloud-first-sync-options small { margin-top:2px; color:var(--muted); font-size:.63rem; line-height:1.4; }
    .cloud-connected-stack { display:grid; gap:10px; }
    .cloud-connected-stack[hidden], #cloudDisconnectedSection[hidden], #cloudConfigCard[hidden], #cloudFirstSyncCard[hidden] { display:none !important; }
    .cloud-auto-sync-check { margin-bottom:10px; }
    .cloud-device-table small { color:var(--muted); font-size:.6rem; }
    .cloud-conflict-list { display:grid; gap:8px; }
    .cloud-conflict-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px; border:1px solid color-mix(in srgb,var(--orange) 36%,var(--line)); border-radius:var(--talaan-card-radius); background:var(--orange-soft); }
    .cloud-conflict-item > div:first-child { min-width:0; }
    .cloud-conflict-item strong, .cloud-conflict-item small { display:block; overflow-wrap:anywhere; }
    .cloud-conflict-item strong { font-size:.7rem; }
    .cloud-conflict-item small { margin-top:2px; color:var(--muted); font-size:.6rem; }
    .cloud-conflict-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
    @media (max-width:900px) { .cloud-sync-status-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:700px) {
      .cloud-sync-toolbar-button { width:42px; padding:6px; }
      .cloud-sync-toolbar-button span:last-child { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
      .cloud-sync-status-grid, .cloud-config-grid, .cloud-auth-grid { grid-template-columns:1fr; }
      .cloud-password-wrap { grid-template-columns:minmax(0,1fr) 72px; }
      .cloud-password-toggle { min-height:44px; }
      .cloud-auth-secondary-actions .button, .cloud-auth-link-button { min-height:44px; }
      .cloud-conflict-item { align-items:stretch; flex-direction:column; }
      .cloud-conflict-actions { justify-content:flex-start; }
      .cloud-conflict-actions .button { min-height:44px; }
    }



    /* V13.0.15 · Cloud sign-in recovery and diagnostics */

    /* V13.0.1 · MacBook and iPhone UI stabilization */
    .mobile-topbar-tools { display:none; }
    .workspace-label-mobile { display:none; }
    .mobile-filter-count { display:none; }

    @media (max-width:850px) {
      :root { --mobile-topbar-offset:calc(env(safe-area-inset-top) + 112px); }
      .topbar {
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        grid-template-areas:"title tools" "month month";
        align-items:center;
        gap:8px 9px;
        min-height:0;
        padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));
        overflow:visible;
      }
      .topbar-left { grid-area:title; min-width:0; }
      .topbar-left > div { min-width:0; }
      .topbar h1,
      .topbar p { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      .topbar h1 { font-size:1rem; }
      .topbar p { font-size:.67rem; }
      .topbar-actions { display:contents; }
      .topbar-actions > :not(.month-navigator),
      .topbar-actions #quickAddExpense,
      .topbar-actions #globalSearchButton,
      .topbar-actions #productivityCenterButton,
      .topbar-actions #cloudSyncStatusButton,
      .topbar-actions #themeToggleButton { display:none !important; }
      .topbar-actions .month-navigator {
        grid-area:month;
        display:grid;
        grid-template-columns:44px minmax(0,1fr) 44px;
        align-items:center;
        gap:7px;
        width:100%;
        max-width:none;
        min-width:0;
      }
      .topbar-actions .month-control {
        display:grid;
        grid-template-columns:auto minmax(0,1fr);
        width:100%;
        max-width:none;
        min-width:0;
        height:44px;
        min-height:44px;
        max-height:44px;
        padding:5px 9px;
      }
      .topbar-actions .month-control input { width:100%; min-width:0; font-size:.78rem; }
      .topbar-actions .month-nav-button { width:44px; height:44px; min-height:44px; max-height:44px; }
      .topbar-actions .month-current-button,
      .topbar-actions .month-status-chip { display:none !important; }
      .mobile-topbar-tools { grid-area:tools; display:flex; align-items:center; justify-content:flex-end; gap:6px; }
      .mobile-topbar-action,
      .mobile-utility-menu > summary {
        width:44px;
        min-width:44px;
        height:44px;
        min-height:44px;
        display:grid;
        place-items:center;
        padding:0;
        border:1px solid var(--line);
        border-radius:var(--talaan-control-radius);
        background:var(--surface);
        color:var(--text);
        font-size:1.2rem;
        font-weight:900;
        line-height:1;
        cursor:pointer;
        list-style:none;
      }
      .mobile-topbar-action[hidden] { display:none !important; }
      .mobile-quick-action { border-color:var(--primary); background:var(--primary); color:var(--primary-contrast); }
      .mobile-utility-menu { position:relative; }
      .mobile-utility-menu > summary::-webkit-details-marker { display:none; }
      .mobile-utility-menu[open] > summary { border-color:var(--primary); color:var(--primary); }
    .mobile-utility-panel {
        position:absolute;
        top:calc(100% + 8px);
        right:0;
        z-index:95;
        width:min(238px,calc(100vw - 20px));
        display:grid;
        gap:5px;
        padding:7px;
        border:1px solid var(--line);
        border-radius:var(--talaan-popover-radius);
        background:var(--surface);
        box-shadow:0 16px 42px rgba(15,23,42,.2);
      }
      .mobile-utility-panel button {
        min-height:44px;
        display:flex;
        align-items:center;
        gap:9px;
        width:100%;
        padding:8px 10px;
        border:0;
        border-radius:var(--talaan-control-radius);
        background:transparent;
        color:var(--text);
        text-align:left;
        font-weight:750;
      }
      .mobile-utility-panel button:hover,
      .mobile-utility-panel button:focus-visible { background:var(--surface-soft); }
      .mobile-utility-icon { width:24px; text-align:center; font-size:1rem; }
      .mobile-add-expense-fab { display:none !important; }
      .content { padding-bottom:max(30px,calc(env(safe-area-inset-bottom) + 24px)); }
      .settings-navigation,
      #settings > .settings-navigation,
      .report-section-nav,
      #reports .report-section-nav { top:var(--mobile-topbar-offset); }
      .report-section-heading { scroll-margin-top:calc(var(--mobile-topbar-offset) + 62px); }

      #settings .settings-tablist,
      #reports .report-section-nav {
        scrollbar-width:none;
        -ms-overflow-style:none;
        overscroll-behavior-inline:contain;
        scroll-snap-type:x proximity;
      }
      #settings .settings-tablist::-webkit-scrollbar,
      #reports .report-section-nav::-webkit-scrollbar { display:none; }
      #settings .settings-tablist button,
      #reports .report-section-nav button { scroll-snap-align:center; min-height:44px; }
      #settings > .settings-navigation::before,
      #settings > .settings-navigation::after {
        content:"";
        position:absolute;
        top:1px;
        bottom:1px;
        z-index:3;
        width:18px;
        pointer-events:none;
      }
      #settings > .settings-navigation::before { left:1px; background:linear-gradient(90deg,var(--surface),transparent); }
      #settings > .settings-navigation::after { right:1px; background:linear-gradient(270deg,var(--surface),transparent); }
      #reports .report-section-nav button[aria-current="true"] { border-color:var(--primary); background:color-mix(in srgb,var(--primary) 12%,var(--surface)); color:var(--primary); }

      .workspace-label-desktop { display:none; }
      .workspace-label-mobile { display:inline; }
      .money-workspace-switcher .workspace-switcher-button { white-space:nowrap; }

      #dashboard > .kpi-grid,
      #income .compact-income-grid,
      #paid-expenses .compact-paid-grid,
      #payments > .kpi-grid,
      #reports > .report-compact-group .report-kpi-grid,
      #reports .report-insights-kpis,
      #money .legend,
      #money .summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #dashboard > .kpi-grid .kpi-card:last-child,
      #reports .report-kpi-grid .kpi-card:last-child { grid-column:1/-1; }
      #money .summary-strip .summary-item:first-child,
      #money .summary-strip .summary-item:last-child { grid-column:1/-1; }
      #income .compact-summary-grid .kpi-card,
      #paid-expenses .compact-summary-grid .kpi-card { min-height:72px; }

      .income-filters-panel,
      .expense-filters-panel,
      .paid-filters-panel,
      .project-filters-panel { overflow:hidden; }
      .income-filters-panel > summary,
      .expense-filters-panel > summary,
      .paid-filters-panel > summary,
      .project-filters-panel > summary { gap:8px; }
      .mobile-filter-count {
        flex:0 0 auto;
        min-width:22px;
        height:22px;
        align-items:center;
        justify-content:center;
        padding:0 6px;
        border-radius:999px;
        background:var(--primary);
        color:var(--primary-contrast);
        font-size:.65rem;
        font-weight:900;
      }
      .mobile-filter-count:not([hidden]) { display:inline-flex; }
    }

    @media (max-width:370px) {
      #dashboard > .kpi-grid,
      #income .compact-income-grid,
      #paid-expenses .compact-paid-grid,
      #payments > .kpi-grid,
      #reports > .report-compact-group .report-kpi-grid,
      #reports .report-insights-kpis,
      #money .legend,
      #money .summary-strip { grid-template-columns:1fr; }
      #dashboard > .kpi-grid .kpi-card:last-child,
      #reports .report-kpi-grid .kpi-card:last-child,
      #money .summary-strip .summary-item:first-child,
      #money .summary-strip .summary-item:last-child { grid-column:1; }
      .topbar h1 { font-size:.93rem; }
    }



    /* V13.0.2 · simplified toolbar and paired budget bento controls */
    .toolbar-icon,
    .month-nav-button svg,
    .budget-panel-collapse svg { width:20px; height:20px; display:block; flex:0 0 auto; }
    .toolbar-icon svg,
    .month-nav-button svg,
    .budget-panel-collapse svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .topbar-actions { min-width:0; margin-left:auto; gap:8px; flex-wrap:nowrap; }
    .topbar-actions .cloud-sync-toolbar-button { order:1; }
    .topbar-actions .month-navigator { order:2; }
    .topbar-actions .topbar-add-button { order:3; }
    .topbar-actions .topbar-tools-menu { order:4; }
    .cloud-sync-toolbar-button { min-height:38px; }
    .cloud-sync-toolbar-button .toolbar-icon { width:17px; height:17px; }
    .month-navigator { min-width:0; padding:3px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); }
    .month-navigator .month-nav-button { width:34px; height:34px; border:0; background:transparent; }
    .month-navigator .month-nav-button:hover,
    .month-navigator .month-nav-button:focus-visible { background:var(--surface-soft); }
    .month-navigator .month-control { width:190px; min-height:34px; padding:4px 8px; border:0; border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    .month-navigator .month-current-button,
    .month-navigator .month-status-chip { min-width:66px; min-height:34px; padding-inline:9px; justify-content:center; border-radius:var(--talaan-control-radius); }
    .current-month-mobile { display:none; }
    .topbar-add-button { min-height:38px; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
    .topbar-add-button .toolbar-icon { width:17px; height:17px; }
    .topbar-tools-menu { position:relative; flex:0 0 auto; }
    .topbar-tools-menu > summary {
      width:38px; min-width:38px; height:38px; min-height:38px; display:grid; place-items:center; padding:0;
      border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); cursor:pointer; list-style:none;
    }
    .topbar-tools-menu > summary::-webkit-details-marker { display:none; }
    .topbar-tools-menu[open] > summary { border-color:var(--primary); color:var(--primary); background:color-mix(in srgb,var(--primary) 8%,var(--surface)); }
    .topbar-tools-panel {
      position:absolute; top:calc(100% + 8px); right:0; z-index:100; width:248px; display:grid; gap:4px; padding:7px;
      border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:0 16px 42px rgba(15,23,42,.2);
    }
    .topbar-tools-item,
    .topbar-tools-item.theme-toggle-button {
      width:100%; min-height:48px; display:flex; align-items:center; gap:10px; padding:8px 10px; border:0; border-radius:var(--talaan-control-radius);
      background:transparent; color:var(--text); text-align:left;
    }
    .topbar-tools-item:hover,
    .topbar-tools-item:focus-visible { background:var(--surface-soft); }
    .topbar-tools-item > span:last-child { min-width:0; display:block; }
    .topbar-tools-item strong,
    .topbar-tools-item small { display:block; }
    .topbar-tools-item strong { font-size:.73rem; line-height:1.25; }
    .topbar-tools-item small { margin-top:2px; color:var(--muted); font-size:.62rem; line-height:1.25; }
    .topbar-tools-item .toolbar-icon { width:20px; height:20px; }
    .topbar-actions #themeToggleButton,
    .topbar-actions #globalSearchButton,
    .topbar-actions #productivityCenterButton { display:flex !important; }
    #themeToggleIcon { font-size:0; }
    .budget-planner-grid { align-items:stretch; }
    .budget-category-panel,
    .cash-forecast-panel { display:flex; flex-direction:column; height:100%; }
    .budget-panel-body { min-height:0; flex:1 1 auto; }
    .budget-category-body { display:flex; flex-direction:column; }
    .budget-category-body #budgetCategoryTableWrap { flex:1 1 auto; }
    .cash-forecast-body.budget-panel-body { display:block; }
    .budget-panel-heading-copy { min-width:0; }
    .budget-panel-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex:0 0 auto; }
    .budget-panel-collapse {
      width:30px; min-width:30px; height:30px; min-height:30px; display:grid; place-items:center; padding:0;
      border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text);
    }
    .budget-panel-collapse:hover,
    .budget-panel-collapse:focus-visible { border-color:var(--primary); color:var(--primary); }
    .budget-panel-collapse svg { transition:transform .18s ease; }
    .budget-bento-panel.is-collapsed { align-self:start; height:auto; }
    .budget-bento-panel.is-collapsed .budget-panel-body { display:none !important; }
    .budget-bento-panel.is-collapsed .budget-panel-heading { border-bottom:0; }
    .budget-bento-panel.is-collapsed .budget-panel-collapse svg { transform:rotate(180deg); }

    @media (max-width:1120px) and (min-width:851px) {
      .topbar { padding-inline:18px; gap:12px; }
      .topbar-actions { gap:6px; }
      .cloud-sync-toolbar-button { padding-inline:8px; }
      .month-navigator .month-control { width:166px; }
      .month-navigator .month-current-button,
      .month-navigator .month-status-chip { min-width:86px; }
      .topbar-add-button { padding-inline:10px; }
    }

    @media (max-width:850px) {
      :root { --mobile-topbar-offset:calc(env(safe-area-inset-top) + 112px); }
      .topbar {
        display:grid; grid-template-columns:minmax(0,1fr) 44px 44px 44px;
        grid-template-areas:"title sync add tools" "month month month month";
        align-items:center; gap:8px 6px; min-height:0;
        padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));
        overflow:visible;
      }
      .topbar-left { grid-area:title; min-width:0; }
      .topbar-left > div { min-width:0; }
      .topbar h1,
      .topbar p { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      .topbar h1 { font-size:1rem; }
      .topbar p { font-size:.67rem; }
      .topbar-actions { display:contents; }
      .topbar-actions .cloud-sync-toolbar-button,
      .topbar-actions #cloudSyncStatusButton {
        grid-area:sync; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; display:grid !important; place-items:center;
      }
      .topbar-actions .cloud-sync-label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
      .topbar-actions .month-navigator {
        grid-area:month; display:grid; grid-template-columns:44px minmax(0,1fr) 44px auto; align-items:center;
        gap:7px; width:100%; max-width:none; min-width:0; padding:0; border:0; background:transparent;
      }
      .topbar-actions .month-control {
        display:grid; grid-template-columns:auto minmax(0,1fr); width:100%; max-width:none; min-width:0;
        height:44px; min-height:44px; max-height:44px; padding:5px 9px; border:1px solid var(--line); background:var(--surface);
      }
      .topbar-actions .month-control input { width:100%; min-width:0; font-size:.78rem; }
      .topbar-actions .month-nav-button { width:44px; height:44px; min-height:44px; max-height:44px; border:1px solid var(--line); background:var(--surface); }
      .topbar-actions .month-current-button,
      .topbar-actions .month-status-chip { min-width:78px; height:44px; min-height:44px; max-height:44px; padding:5px 8px; }
      .topbar-actions .month-current-button:not([hidden]),
      .topbar-actions .month-status-chip:not([hidden]) { display:inline-flex !important; }
      .current-month-desktop { display:none; }
      .current-month-mobile { display:inline; }
      .topbar-actions .topbar-add-button:not([hidden]) {
        grid-area:add; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; display:grid !important; place-items:center;
      }
      .topbar-add-label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
      .topbar-actions .topbar-tools-menu { grid-area:tools; display:block !important; }
      .topbar-tools-menu > summary { width:44px; min-width:44px; height:44px; min-height:44px; }
      .topbar-tools-panel { width:min(248px,calc(100vw - 20px)); }
    }

    @media (max-width:700px) {
      .budget-planner-header { display:block; }
      .budget-panel-heading { display:flex; align-items:flex-start; }
      .budget-panel-heading-actions { margin-left:auto; }
    }

    @media (max-width:380px) {
      .topbar { grid-template-columns:minmax(0,1fr) 42px 42px 42px; gap-inline:5px; }
      .topbar-actions .cloud-sync-toolbar-button,
      .topbar-actions .topbar-add-button,
      .topbar-tools-menu > summary { width:42px; min-width:42px; height:42px; min-height:42px; }
      .topbar-actions .month-navigator { grid-template-columns:42px minmax(0,1fr) 42px auto; gap:5px; }
      .topbar-actions .month-nav-button { width:42px; height:42px; min-height:42px; max-height:42px; }
      .topbar-actions .month-control { height:42px; min-height:42px; max-height:42px; padding-inline:7px; }
      .topbar-actions .month-current-button,
      .topbar-actions .month-status-chip { min-width:70px; height:42px; min-height:42px; max-height:42px; padding-inline:6px; font-size:.62rem; }
    }



    /* V13.0.6 · Project revision cycles */
    .status-revision { background:var(--orange-soft); color:var(--orange-text); border-color:color-mix(in srgb,var(--orange) 34%,var(--line)); }
    .project-revision-panel { grid-column:1/-1; display:grid; gap:8px; padding:10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .project-revision-panel[hidden] { display:none !important; }
    .project-revision-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .project-revision-panel-heading strong,.project-revision-panel-heading small { display:block; }
    .project-revision-panel-heading small { margin-top:2px; color:var(--muted); font-size:.68rem; }
    .project-revision-history { display:grid; gap:6px; }
    .project-revision-history-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px 10px; align-items:start; padding:8px 9px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); }
    .project-revision-number { min-width:72px; font-size:.7rem; font-weight:850; color:var(--text); }
    .project-revision-copy { min-width:0; }
    .project-revision-copy strong,.project-revision-copy small { display:block; }
    .project-revision-copy strong { font-size:.72rem; }
    .project-revision-copy small { margin-top:2px; color:var(--muted); font-size:.65rem; line-height:1.35; }
    .project-revision-note { grid-column:2/-1; margin:0; color:var(--muted); font-size:.67rem; line-height:1.4; overflow-wrap:anywhere; }
    .project-revision-form-grid { align-items:start; }
    .project-revision-calendar { display:grid; grid-template-columns:minmax(0,1fr) minmax(170px,.65fr); gap:9px; padding:10px; border:1px solid color-mix(in srgb,var(--orange) 34%,var(--line)); border-radius:var(--talaan-card-radius); background:var(--orange-soft); }
    .project-revision-calendar .project-calendar-help { grid-column:1/-1; }
    .project-revision-footer[hidden] { display:none !important; }
    .project-revision-inline { display:inline-flex; align-items:center; gap:5px; margin-top:5px; padding:3px 7px; border-radius:999px; background:var(--orange-soft); color:var(--orange-text); border:1px solid color-mix(in srgb,var(--orange) 34%,var(--line)); font-size:.66rem; font-weight:800; }
    @media (max-width:700px) {
      .project-revision-history-item { grid-template-columns:1fr auto; }
      .project-revision-number { grid-column:1; }
      .project-revision-copy { grid-column:1/-1; }
      .project-revision-note { grid-column:1/-1; }
      .project-revision-calendar { grid-template-columns:1fr; }
      .project-revision-calendar .project-calendar-help { grid-column:1; }
      .project-dialog-footer .project-revision-footer { width:100%; }
    }



    /* V13.0.8 · calendar paid-state, project completion, and disclosure consistency */
    :root { --ui-disclosure-size:30px; --ui-disclosure-icon-size:20px; }
    .collapse-toggle,
    .budget-panel-collapse {
      width:var(--ui-disclosure-size) !important;
      min-width:var(--ui-disclosure-size) !important;
      height:var(--ui-disclosure-size) !important;
      min-height:var(--ui-disclosure-size) !important;
      padding:0 !important;
      border:1px solid var(--line);
      border-radius:var(--talaan-control-radius);
      display:inline-grid;
      place-items:center;
      background:var(--surface);
      color:var(--text);
      line-height:1;
      flex:0 0 var(--ui-disclosure-size);
    }
    .collapse-toggle:hover,
    .collapse-toggle:focus-visible,
    .budget-panel-collapse:hover,
    .budget-panel-collapse:focus-visible { border-color:var(--primary); color:var(--primary); background:var(--surface-soft); }
    .collapse-icon,
    .budget-panel-collapse > svg {
      width:var(--ui-disclosure-icon-size) !important;
      height:var(--ui-disclosure-icon-size) !important;
      display:block;
      transition:transform .18s ease;
    }
    .collapse-icon svg { width:100%; height:100%; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .collapsible-section.is-collapsed .collapse-icon { transform:rotate(180deg); }
    .budget-bento-panel.is-collapsed .budget-panel-collapse > svg { transform:rotate(180deg); }
    .budget-planner-card.is-planner-collapsed .budget-planner-toggle > svg { transform:rotate(180deg); }
    #projects .project-row-actions { display:flex; align-items:center; justify-content:center; flex-wrap:nowrap; gap:5px; }
    #projects .project-row-actions .project-compact-action { min-width:0; min-height:32px; height:32px; padding:4px 7px; font-size:.65rem; white-space:nowrap; }
    #projects .completed-project-record .status-completed { white-space:normal; text-align:center; line-height:1.15; }
    @media (max-width:850px) {
      :root { --ui-disclosure-size:35px; }
      .collapse-toggle,
      .budget-panel-collapse { border-radius:var(--talaan-control-radius); }
      #projects .project-row-actions { flex-wrap:wrap; }
      #projects .project-row-actions .project-compact-action { min-height:44px; height:auto; padding:8px 10px; font-size:.72rem; }
    }



    /* V13.0.9 · phone UI, account balance refresh, and compact project actions */
    .summary-label-mobile, .summary-desc-mobile, .project-mobile-summary { display:none; }
    .menu-button svg { width:18px; height:18px; display:block; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
    #quickAddExpense::before { content:none !important; display:none !important; }
    #projects .project-record-header,
    #projects .project-record {
      grid-template-columns:minmax(190px,1.65fr) minmax(78px,.72fr) minmax(94px,.86fr) minmax(82px,.72fr) minmax(92px,.82fr) minmax(92px,.82fr) minmax(82px,.72fr) minmax(150px,.95fr);
    }
    #projects .project-row-actions { gap:6px; flex-wrap:nowrap; overflow:visible; }
    #projects .project-row-actions .project-compact-action { min-height:32px; height:32px; padding:4px 8px; font-size:.64rem; line-height:1; white-space:nowrap; }
    .project-action-more, .record-more-menu { position:relative; }
    .project-action-more > summary { list-style:none; cursor:pointer; }
    .project-action-more > summary::-webkit-details-marker { display:none; }
    .project-action-more .record-more-panel { right:0; left:auto; min-width:154px; }
    .project-action-more .record-more-panel .button { width:100%; min-height:38px; justify-content:flex-start; }

    @media (max-width:1180px) and (min-width:701px) {
      #projects .project-record-header,
      #projects .project-record {
        grid-template-columns:minmax(170px,1.5fr) 76px 90px 80px 88px 88px 78px minmax(142px,.9fr);
        gap:7px;
      }
      #projects .project-row-actions .project-compact-action { padding-inline:7px; font-size:.62rem; }
    }

    @media (max-width:850px) {
      .topbar {
        grid-template-columns:minmax(0,1fr) 44px 44px 44px !important;
        grid-template-areas:"title add sync tools" "month month month month" !important;
        gap:8px 6px !important;
      }
      .topbar-actions .topbar-add-button:not([hidden]) { grid-area:add !important; }
      .topbar-actions .cloud-sync-toolbar-button,
      .topbar-actions #cloudSyncStatusButton { grid-area:sync !important; }
      .topbar-actions .topbar-tools-menu { grid-area:tools !important; }
      .topbar-actions .topbar-add-button:not([hidden]),
      .topbar-actions .cloud-sync-toolbar-button,
      .topbar-actions #cloudSyncStatusButton,
      .topbar-tools-menu > summary { width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; max-height:44px !important; }
      .topbar-actions .month-status-chip.current { font-size:0 !important; min-width:78px !important; max-width:84px; white-space:nowrap; }
      .topbar-actions .month-status-chip.current::after { content:"Current" !important; font-size:.65rem !important; }
      .topbar-add-button .toolbar-icon { width:20px; height:20px; }
    }

    @media (max-width:700px) {
      .summary-label-desktop, .summary-desc-desktop { display:none !important; }
      .summary-label-mobile, .summary-desc-mobile { display:inline !important; }
      #money .legend, #money .summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; margin:8px 0 !important; }
      #money .legend-item, #money .summary-item { min-width:0; border-radius:var(--talaan-card-radius); }
      #money .legend-item { min-height:104px !important; padding:10px !important; display:grid !important; grid-template-columns:1fr !important; align-content:space-between !important; gap:8px !important; }
      #money .legend-copy { align-items:flex-start; gap:7px; }
      #money .legend-dot { width:9px; height:9px; margin-top:3px; }
      #money .legend-text strong, #money .summary-card-label { font-size:.72rem !important; line-height:1.15 !important; }
      #money .legend-text small, #money .summary-card-copy small { margin-top:3px; font-size:.61rem !important; line-height:1.2 !important; display:block; }
      #money .legend-total, #money .summary-card-value { justify-self:end; margin:0; font-size:.94rem !important; line-height:1.05; }
      #money .summary-item { min-height:96px !important; padding:10px !important; display:grid !important; grid-template-columns:1fr !important; align-content:space-between !important; gap:7px !important; }
      #money .summary-strip .summary-item:first-child, #money .summary-strip .summary-item:last-child { grid-column:1/-1 !important; min-height:72px !important; grid-template-columns:minmax(0,1fr) auto !important; align-items:center !important; }
      #money .summary-strip .summary-item:first-child .summary-card-value, #money .summary-strip .summary-item:last-child .summary-card-value { align-self:center; }

      #projects .project-record { display:grid !important; grid-template-columns:1fr !important; gap:8px !important; padding:12px !important; }
      #projects .project-record .record-title { grid-column:1 !important; }
      #projects .project-record .project-cell, #projects .project-record .project-calendar-cell { display:none !important; }
      #projects .project-mobile-summary { display:grid; gap:8px; padding:8px 0 2px; border-top:1px solid var(--line); }
      #projects .project-mobile-summary::before { content:none !important; display:none !important; }
      #projects .project-mobile-facts { display:flex; flex-wrap:wrap; gap:5px 9px; color:var(--muted); font-size:.69rem; line-height:1.25; }
      #projects .project-mobile-facts span:not(:last-child)::after { content:"·"; margin-left:9px; color:var(--line-strong); }
      #projects .project-mobile-statuses { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
      #projects .project-mobile-statuses .status-pill, #projects .project-deadline-state, #projects .project-revision-inline { min-height:28px; padding:4px 8px; font-size:.65rem; line-height:1.1; }
      #projects .project-source-line { margin-top:4px; font-size:.66rem; line-height:1.25; }
      #projects .record-title { padding-bottom:0; }
      #projects .mobile-record-actions.project-mobile-actions { display:grid !important; grid-template-columns:minmax(0,1fr) auto !important; gap:8px !important; width:100%; align-items:stretch; }
      #projects .project-mobile-actions > .button, #projects .project-mobile-actions > details > summary { min-height:44px !important; height:44px !important; padding:7px 10px !important; font-size:.72rem !important; line-height:1.1; white-space:nowrap; display:flex; align-items:center; justify-content:center; }
      #projects .project-mobile-actions > details > summary { min-width:82px; }
      #projects .project-mobile-actions .record-more-panel { right:0; left:auto; width:min(220px,calc(100vw - 48px)); }
      #projects .project-mobile-actions .record-more-panel .button { width:100%; min-height:44px; justify-content:flex-start; }
      #projects .project-section-header { gap:8px; }
      #projects .project-section-summary { font-size:.72rem; }
    }

    @media (max-width:380px) {
      .topbar { grid-template-columns:minmax(0,1fr) 44px 44px 44px !important; gap-inline:5px !important; }
      .topbar-actions .topbar-add-button:not([hidden]),
      .topbar-actions .cloud-sync-toolbar-button,
      .topbar-actions #cloudSyncStatusButton,
      .topbar-tools-menu > summary,
      .topbar-actions .month-nav-button { width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; max-height:44px !important; }
      .topbar-actions .month-navigator { grid-template-columns:44px minmax(0,1fr) 44px auto !important; gap:5px !important; }
      .topbar-actions .month-control, .topbar-actions .month-current-button, .topbar-actions .month-status-chip { height:44px !important; min-height:44px !important; max-height:44px !important; }
      #money .legend-item { min-height:100px !important; padding:9px !important; }
      #money .summary-item { min-height:92px !important; padding:9px !important; }
      #money .legend-total, #money .summary-card-value { font-size:.88rem !important; }
    }


    /* V13.0.10 · account spending from balance */
    #accountDialog .account-mode-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
    #accountDialog .account-mode-button { min-height:58px; display:grid; grid-template-columns:28px minmax(0,1fr); align-items:center; gap:9px; padding:9px 11px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); text-align:left; cursor:pointer; }
    #accountDialog .account-mode-button:hover, #accountDialog .account-mode-button:focus-visible { border-color:var(--primary); }
    #accountDialog .account-mode-button[aria-pressed="true"] { border-color:var(--primary); background:color-mix(in srgb,var(--primary) 8%,var(--surface)); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 30%,transparent); }
    #accountDialog .account-mode-button svg { width:22px; height:22px; display:block; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    #accountDialog .account-mode-button strong { display:block; font-size:.76rem; line-height:1.15; }
    #accountDialog .account-mode-button small { display:block; margin-top:3px; color:var(--muted); font-size:.61rem; line-height:1.2; font-weight:650; }
    #accountDialog .account-spend-panel { display:grid; gap:11px; }
    #accountDialog .account-spend-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    #accountDialog .account-spend-summary-copy { display:grid; gap:2px; }
    #accountDialog .account-spend-summary-copy span, #accountDialog .account-spend-summary-balance span { color:var(--muted); font-size:.62rem; font-weight:750; }
    #accountDialog .account-spend-summary-copy strong { font-size:.82rem; }
    #accountDialog .account-spend-summary-balance { text-align:right; }
    #accountDialog .account-spend-summary-balance strong { display:block; margin-top:2px; font-size:1rem; color:var(--green-text); }
    #accountDialog .account-spend-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
    #accountDialog .account-spend-grid .field-full { grid-column:1/-1; }
    #accountDialog .account-spend-total-choice { min-height:42px; display:flex; align-items:center; gap:9px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); }
    #accountDialog .account-spend-total-choice input { width:18px; height:18px; margin:0; }
    #accountDialog .account-spend-total-choice strong { display:block; font-size:.7rem; }
    #accountDialog .account-spend-total-choice small { display:block; margin-top:2px; color:var(--muted); font-size:.59rem; }
    #accountDialog .account-spend-preview { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:9px; align-items:center; min-height:54px; padding:9px 11px; border:1px solid color-mix(in srgb,var(--green) 35%,var(--line)); border-radius:var(--talaan-card-radius); background:color-mix(in srgb,var(--green) 6%,var(--surface)); }
    #accountDialog .account-spend-preview.is-warning { border-color:color-mix(in srgb,var(--danger) 45%,var(--line)); background:color-mix(in srgb,var(--danger) 6%,var(--surface)); }
    #accountDialog .account-spend-preview svg { width:22px; height:22px; fill:none; stroke:var(--green); stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    #accountDialog .account-spend-preview.is-warning svg { stroke:var(--danger); }
    #accountDialog .account-spend-preview p { margin:0; font-size:.67rem; line-height:1.35; }
    #accountDialog .account-spend-preview strong { font-size:.72rem; }
    #accountDialog .account-spend-preview-balance { text-align:right; white-space:nowrap; }
    .account-card-actions .account-spend-button svg { width:15px; height:15px; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .account-card-actions .account-spend-button { display:inline-flex; align-items:center; gap:4px; }
    @media (max-width:700px) {
      #accountDialog .account-mode-switch { grid-template-columns:1fr 1fr; gap:7px; }
      #accountDialog .account-mode-button { min-height:54px; grid-template-columns:22px minmax(0,1fr); padding:8px; gap:7px; }
      #accountDialog .account-mode-button svg { width:19px; height:19px; }
      #accountDialog .account-mode-button small { display:none; }
      #accountDialog .account-spend-grid { grid-template-columns:1fr; gap:9px; }
      #accountDialog .account-spend-grid .field-full { grid-column:1; }
      #accountDialog .account-spend-grid .input, #accountDialog .account-spend-grid .select { min-height:44px; height:44px; }
      #accountDialog .modal-footer .button { min-height:44px !important; height:44px !important; }
      #accountDialog .account-spend-total-choice { min-height:44px; }
      #accountDialog .account-spend-preview { grid-template-columns:24px 1fr; }
      #accountDialog .account-spend-preview-balance { grid-column:2; text-align:left; }
      #money .account-card-actions .account-spend-button { min-height:40px; }
    }


    /* V13.0.12 · interaction reliability and Edit Project responsive cleanup */
    #accountDialog #accountSpendAmount { position:relative; z-index:1; pointer-events:auto; touch-action:manipulation; }
    #accountDialog .account-spend-grid .field { min-width:0; }
    #accountDialog .account-spend-grid .input, #accountDialog .account-spend-grid .select { width:100%; max-width:100%; box-sizing:border-box; }
    .project-dialog-more-footer { display:none; position:relative; }
    .project-dialog-more-footer > summary { list-style:none; cursor:pointer; }
    .project-dialog-more-footer > summary::-webkit-details-marker { display:none; }
    .project-dialog-more-panel { position:absolute; right:0; bottom:calc(100% + 7px); z-index:45; display:grid; gap:5px; width:min(230px,calc(100vw - 32px)); padding:7px; border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:var(--shadow); }
    .project-dialog-more-panel .button { width:100%; justify-content:flex-start; }
    @media (max-width:700px) {
      #projectDialog { width:calc(100vw - 16px) !important; max-width:calc(100vw - 16px) !important; max-height:calc(100dvh - 12px) !important; }
      #projectDialog > form { max-height:calc(100dvh - 12px) !important; overflow:hidden; }
      #projectDialog .modal-header, #projectDialog .modal-footer { min-height:52px; padding:9px 11px; }
      #projectDialog .modal-body { padding:10px 11px; overflow-x:hidden !important; }
      #projectDialog .form-grid, #projectDialog .field, #projectDialog .project-work-section, #projectDialog .project-calendar-options, #projectDialog .project-financial-section, #projectDialog .project-revision-panel, #projectDialog .salary-work-summary { min-width:0 !important; max-width:100% !important; width:100%; box-sizing:border-box; }
      #projectDialog .form-grid { grid-template-columns:1fr !important; gap:8px !important; }
      #projectDialog .field, #projectDialog .field-full, #projectDialog .project-work-section, #projectDialog .project-calendar-options, #projectDialog .project-financial-section, #projectDialog .project-revision-panel { grid-column:1 !important; }
      #projectDialog .input, #projectDialog .select { width:100% !important; max-width:100% !important; min-width:0 !important; height:44px !important; min-height:44px !important; box-sizing:border-box !important; font-size:.83rem; }
      #projectDialog input[type="date"], #projectDialog input[type="month"] { appearance:auto; -webkit-appearance:auto; }
      #projectDialog .textarea { width:100% !important; max-width:100% !important; min-width:0 !important; min-height:76px; box-sizing:border-box !important; }
      #projectDialog .field > label { margin-bottom:4px; font-size:.68rem; line-height:1.2; color:var(--text); }
      #projectDialog .project-work-section { grid-template-columns:1fr !important; gap:8px; padding:9px; }
      #projectDialog .salary-work-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:7px; padding:8px; }
      #projectDialog .salary-work-summary strong { font-size:.76rem; line-height:1.2; }
      #projectDialog .salary-work-summary small { margin-top:2px; font-size:.62rem; line-height:1.25; }
      #projectDialog .salary-work-summary .status-pill { align-self:center; white-space:nowrap; padding:4px 7px; font-size:.62rem; }
      #projectDialog .salary-schedule-note { font-size:.62rem; line-height:1.35; }
      #projectDialog .project-calendar-options { grid-template-columns:1fr !important; gap:7px; padding:9px; }
      #projectDialog .project-calendar-check { font-size:.69rem; line-height:1.3; }
      #projectDialog .project-calendar-help { grid-column:1 !important; font-size:.61rem; line-height:1.35; }
      #projectDialog .project-revision-panel { padding:8px; gap:6px; }
      #projectDialog .project-financial-section { grid-template-columns:1fr !important; gap:8px; }
      #projectDialog .project-financial-section .field:last-child { max-width:none !important; grid-column:1 !important; }
      #projectDialog .project-dialog-footer { display:grid !important; grid-template-columns:1fr 1fr !important; gap:8px !important; align-items:center; }
      #projectDialog .project-dialog-footer > .project-delete-footer, #projectDialog .project-dialog-footer > .project-duplicate-footer, #projectDialog .project-dialog-footer > .project-revision-footer { display:none !important; }
      #projectDialog .project-dialog-footer .footer-spacer { display:none !important; }
      #projectDialog .project-dialog-more-footer:not([hidden]) { display:block !important; grid-column:1/-1; }
      #projectDialog .project-dialog-more-footer > summary { width:100%; min-height:44px; display:flex; align-items:center; justify-content:center; }
      #projectDialog .project-dialog-more-panel .button { min-height:44px; }
      #projectDialog .project-dialog-footer [data-close="projectDialog"], #projectDialog .project-dialog-footer button[type="submit"] { width:100%; min-height:44px; margin:0; }
      #projectDialog .project-dialog-footer [data-close="projectDialog"] { grid-column:1; }
      #projectDialog .project-dialog-footer button[type="submit"] { grid-column:2; }
    }


    /* V13.0.13 · Record Spending transaction hotfix */
    #accountDialog .account-spend-status { min-height:34px; display:flex; align-items:center; padding:7px 10px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--muted); font-size:.64rem; font-weight:700; line-height:1.3; }
    #accountDialog .account-spend-status[hidden] { display:none !important; }
    #accountDialog .account-spend-status[data-state="working"] { border-color:color-mix(in srgb,var(--primary) 35%,var(--line)); color:var(--primary); }
    #accountDialog .account-spend-status[data-state="success"] { border-color:color-mix(in srgb,var(--green) 40%,var(--line)); background:color-mix(in srgb,var(--green) 6%,var(--surface)); color:var(--green-text); }
    #accountDialog .account-spend-status[data-state="error"] { border-color:color-mix(in srgb,var(--danger) 40%,var(--line)); background:color-mix(in srgb,var(--danger) 6%,var(--surface)); color:var(--danger); }
    #accountDialog [data-mode-disabled="true"] { pointer-events:none; }

    /* V13.0.12 · spend reliability and phone budget compaction */
    .account-card-actions .account-spend-button svg { width:15px; height:15px; flex:0 0 auto; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .account-card-actions .account-spend-button { display:inline-flex; align-items:center; justify-content:center; gap:4px; }
    .available-money-total-wrap { display:grid; justify-items:end; gap:1px; }
    .available-money-account-count { color:var(--muted); font-size:.58rem; font-weight:750; line-height:1.1; }

    @media (max-width:700px) {
      #money .money-workspace-switcher { margin-bottom:8px !important; }
      #money .money-workspace-switcher .workspace-switcher-button { min-height:44px !important; padding:6px 7px !important; font-size:.7rem !important; }
      #money-title { font-size:1.05rem !important; line-height:1.15 !important; }
      #money-title + p { margin-top:3px !important; font-size:.69rem !important; line-height:1.3 !important; }
      #money .legend, #money .summary-strip { gap:7px !important; margin:7px 0 !important; }
      #money .legend-item { min-height:78px !important; padding:8px 9px !important; gap:5px !important; }
      #money .summary-item { min-height:76px !important; padding:8px 9px !important; gap:5px !important; }
      #money .summary-strip .summary-item:first-child,
      #money .summary-strip .summary-item:last-child { min-height:58px !important; padding:8px 10px !important; grid-template-columns:minmax(0,1fr) auto !important; align-items:center !important; }
      #money .legend-copy { gap:6px !important; }
      #money .legend-dot { width:8px !important; height:8px !important; margin-top:2px !important; }
      #money .legend-text strong, #money .summary-card-label { font-size:.68rem !important; line-height:1.12 !important; }
      #money .legend-text small, #money .summary-card-copy small { margin-top:2px !important; font-size:.56rem !important; line-height:1.18 !important; }
      #money .legend-total, #money .summary-card-value { font-size:.84rem !important; line-height:1 !important; }

      #availableMoneySection { padding:9px 10px !important; }
      #availableMoneySection .card-header { display:grid !important; grid-template-columns:minmax(0,1fr) auto !important; gap:7px 8px !important; align-items:start !important; margin-bottom:7px !important; padding-bottom:7px !important; }
      #availableMoneySection .card-header > div:first-child { min-width:0; }
      #availableMoneySection .section-title-row h3 { font-size:.84rem !important; }
      #availableMoneySection .card-header > div:first-child > p { max-width:195px; margin-top:2px !important; font-size:.58rem !important; line-height:1.2 !important; }
      #availableMoneySection .collapse-actions { display:grid !important; grid-template-columns:auto 35px !important; grid-template-areas:"total total" "add toggle" !important; justify-items:end !important; align-items:center !important; gap:5px 6px !important; }
      #availableMoneySection .available-money-total-wrap { grid-area:total; }
      #availableMoneySection #moneyAvailableTotal { font-size:.9rem !important; line-height:1 !important; }
      #availableMoneySection .available-money-account-count { font-size:.54rem; }
      #availableMoneySection #addAccountButton { grid-area:add; min-height:44px !important; height:44px !important; padding:7px 10px !important; font-size:.66rem !important; white-space:nowrap; }
      #availableMoneySection [data-collapse-toggle="available-money"] { grid-area:toggle; width:35px !important; min-width:35px !important; height:35px !important; min-height:35px !important; padding:0 !important; }
      #availableMoneySection.is-collapsed .card-header { margin-bottom:0 !important; padding-bottom:0 !important; border-bottom-color:transparent !important; }
      #availableMoneySection.is-collapsed .card-header > div:first-child > p { display:none !important; }
      #availableMoneySection .account-grid { gap:7px !important; }
      #availableMoneySection .account-card { min-height:62px !important; padding:7px 8px !important; gap:6px !important; }
      #availableMoneySection .account-card-main { gap:7px !important; }
      #availableMoneySection .account-card-icon { width:28px !important; height:28px !important; flex-basis:28px !important; }
      #availableMoneySection .account-card-label span { font-size:.66rem !important; }
      #availableMoneySection .account-card-label small { font-size:.54rem !important; }
      #availableMoneySection .account-card strong { margin-top:2px !important; font-size:.82rem !important; }
      #availableMoneySection .account-card-actions { gap:5px !important; align-items:center !important; }
      #availableMoneySection .account-card-actions .account-order-buttons { display:none !important; }
      #availableMoneySection .account-card-actions .button { min-height:44px !important; height:44px !important; padding:6px 9px !important; font-size:.65rem !important; }
      #availableMoneySection .account-card-actions .account-spend-button span { display:inline; }
    }

    @media (max-width:380px) {
      #money .legend-item { min-height:74px !important; padding:7px 8px !important; }
      #money .summary-item { min-height:72px !important; padding:7px 8px !important; }
      #money .summary-strip .summary-item:first-child,
      #money .summary-strip .summary-item:last-child { min-height:56px !important; }
      #money .legend-total, #money .summary-card-value { font-size:.8rem !important; }
      #availableMoneySection .card-header > div:first-child > p { max-width:160px; }
      #availableMoneySection #addAccountButton { padding-inline:8px !important; }
      #availableMoneySection .account-card-actions .account-spend-button span { display:none; }
      #availableMoneySection .account-card-actions .account-spend-button { width:44px !important; min-width:44px !important; padding:0 !important; }
      #availableMoneySection .account-card-actions .account-spend-button svg { width:18px; height:18px; }
    }
    /* V13.0.2 simplified Settings UI */
    .settings-mobile-back { display:none; }
    .settings-mobile-back svg { width:18px; height:18px; flex:0 0 auto; }
    #settings .settings-nav-group { margin:7px 8px 1px; color:var(--muted); font-size:.58rem; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
    #settings .settings-tablist button { display:grid; gap:1px; align-content:center; }
    #settings .settings-tablist button > span { color:inherit; font-size:.78rem; font-weight:850; }
    #settings .settings-tablist button > small { color:var(--muted); font-size:.62rem; font-weight:650; }
    #settings .settings-tablist button[aria-selected="true"] > small { color:var(--primary-contrast); }
    .settings-overview-panel { align-content:start; }
    .settings-overview-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 1px 5px; }
    .settings-overview-heading h3,.settings-overview-heading p { margin:0; }
    .settings-overview-heading p { margin-top:2px; color:var(--muted); font-size:.68rem; }
    .settings-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    #settings .settings-status-card { min-height:82px; display:grid; grid-template-columns:38px minmax(0,1fr) auto 12px; align-items:center; gap:10px; padding:10px; color:var(--text); text-align:left; cursor:pointer; }
    #settings .settings-status-card:hover { border-color:color-mix(in srgb,var(--primary) 42%,var(--line)); background:color-mix(in srgb,var(--primary) 5%,var(--surface)); }
    .settings-status-copy { min-width:0; display:grid; gap:1px; }
    .settings-status-copy > span { font-size:.7rem; font-weight:850; }
    .settings-status-copy strong { overflow:hidden; font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
    .settings-status-copy small { overflow:hidden; color:var(--muted); font-size:.62rem; text-overflow:ellipsis; white-space:nowrap; }
    .settings-status-icon { width:38px; height:38px; display:grid; place-items:center; border:1px solid color-mix(in srgb,var(--primary) 34%,var(--line)); border-radius:var(--talaan-control-radius); background:color-mix(in srgb,var(--primary) 10%,var(--surface)); color:var(--primary); }
    .settings-status-icon svg { width:21px; height:21px; }
    .settings-row-arrow { color:var(--muted); font-size:1.25rem; line-height:1; }
    .settings-state-chip { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border:1px solid var(--line); border-radius:999px; font-size:.62rem; font-weight:850; }
    .settings-state-chip.success { border-color:color-mix(in srgb,var(--green) 44%,var(--line)); background:color-mix(in srgb,var(--green) 12%,var(--surface)); color:var(--green-text); }
    .settings-state-chip.warning { border-color:color-mix(in srgb,var(--orange) 48%,var(--line)); background:color-mix(in srgb,var(--orange) 12%,var(--surface)); color:var(--orange-text); }
    .settings-state-chip.danger { border-color:color-mix(in srgb,var(--red) 48%,var(--line)); background:color-mix(in srgb,var(--red) 11%,var(--surface)); color:var(--danger); }
    .settings-state-chip.neutral { color:var(--muted); }

    .settings-section-intro { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:13px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .settings-section-intro h3,.settings-section-intro p { margin:0; }
    .settings-section-intro p { margin-top:3px; color:var(--muted); font-size:.72rem; line-height:1.45; }
    .settings-disclosure { border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface); overflow:visible; }
    .settings-disclosure > summary { min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 13px; cursor:pointer; list-style:none; }
    .settings-disclosure > summary::-webkit-details-marker { display:none; }
    .settings-disclosure > summary > span:first-child { display:grid; gap:2px; }
    .settings-disclosure > summary strong { color:var(--text); font-size:.8rem; }
    .settings-disclosure > summary small { color:var(--muted); font-size:.65rem; font-weight:650; }
    .settings-disclosure-chevron { color:var(--muted); transition:transform .2s ease; }
    .settings-disclosure[open] .settings-disclosure-chevron { transform:rotate(180deg); }
    .settings-disclosure-body { display:grid; gap:10px; padding:0 10px 10px; }
    .settings-disclosure-body > .card,.settings-disclosure-body > .grid,.settings-disclosure-body > div { margin:0 !important; }
    .settings-inline-details { margin-top:9px; border-top:1px solid var(--line); }
    .settings-inline-details > summary { min-height:42px; display:flex; align-items:center; cursor:pointer; color:var(--primary); font-size:.7rem; font-weight:850; }
    .settings-inline-details-body { display:grid; gap:8px; padding-bottom:4px; }
    .settings-quick-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .settings-quick-status > div { padding:10px; border:1px solid var(--line); border-radius:var(--talaan-card-radius); background:var(--surface-soft); }
    .settings-quick-status span,.settings-quick-status strong { display:block; }
    .settings-quick-status span { color:var(--muted); font-size:.64rem; }
    .settings-quick-status strong { margin-top:3px; font-size:.78rem; overflow-wrap:anywhere; }
    .settings-danger-zone { border-color:color-mix(in srgb,var(--red) 40%,var(--line)); }
    .settings-danger-zone > summary strong { color:var(--danger); }
    .settings-danger-actions { display:flex; flex-wrap:wrap; gap:8px; }
    .settings-danger-note { margin:0; color:var(--muted); font-size:.68rem; line-height:1.45; }
    .settings-walkthrough { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:2px; }
    .settings-walkthrough > span { color:var(--muted); font-size:.66rem; font-weight:800; }
    .settings-walkthrough > div { display:flex; flex-wrap:wrap; gap:7px; }
    #settings .settings-form-clean button[type="submit"]:disabled { opacity:.52; cursor:not-allowed; }
    #settings .settings-form-save-note { margin:0; color:var(--muted); font-size:.64rem; }
    #settings .settings-panel > .system-section-heading { display:none; }
    #settings .profile-settings-primary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    #settings .profile-settings-primary > .card { margin:0; }
    #settings .profile-two-column.settings-profile-hidden-grid { display:contents; }

    @media (max-width:850px) {
      #settings.active { display:block; }
      #settings:not(.settings-category-open) > .settings-navigation { display:none; }
      #settings > .settings-navigation { position:relative; top:auto; margin:0 0 10px; }
      #settings .settings-tablist { display:grid; grid-template-columns:1fr; gap:7px; overflow:visible; padding:0; border:0; background:transparent; backdrop-filter:none; }
      #settings .settings-tablist button { width:100%; min-width:0; min-height:58px; padding:10px 12px; text-align:left; border:1px solid var(--line); background:var(--surface); border-radius:var(--talaan-control-radius); }
      #settings .settings-tablist button[aria-selected="true"] { border-color:color-mix(in srgb,var(--primary) 45%,var(--line)); background:color-mix(in srgb,var(--primary) 9%,var(--surface)); color:var(--text); }
      #settings .settings-tablist button[aria-selected="true"] > small { color:var(--muted); }
      #settings.settings-category-open > .settings-navigation { display:none; }
      #settings.settings-category-open .settings-mobile-back { display:flex; position:sticky; top:var(--mobile-topbar-offset); z-index:25; align-items:center; justify-content:space-between; gap:10px; margin:0 0 9px; padding:7px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:color-mix(in srgb,var(--surface) 95%,transparent); backdrop-filter:blur(10px); }
      #settings.settings-category-open .settings-mobile-back[hidden] { display:none; }
      #settingsMobileCurrentTitle { padding-right:7px; font-size:.78rem; }
      #settings .settings-overview-grid { grid-template-columns:1fr 1fr; }
      #settings > .settings-navigation::before,#settings > .settings-navigation::after { display:none !important; }
    }
    @media (max-width:700px) {
      #settings .settings-overview-grid { grid-template-columns:1fr; }
      #settings .settings-status-card { min-height:76px; grid-template-columns:38px minmax(0,1fr) auto; }
      #settings .settings-row-arrow { display:none; }
      #settings .settings-quick-status { grid-template-columns:1fr; }
      #settings .profile-settings-primary { grid-template-columns:1fr; }
      #settings .settings-disclosure > summary { min-height:58px; }
      #settings .settings-disclosure-body { padding:0 8px 8px; }
      #settings .settings-danger-actions { display:grid; grid-template-columns:1fr; }
      #settings .settings-danger-actions .button { width:100%; }
      #settings .settings-walkthrough { display:grid; }
      #settings .settings-walkthrough > div { display:grid; grid-template-columns:1fr; }
      #settings .settings-walkthrough .button { width:100%; }
    }


    /* V13.0.3 · compact modal system and SVG interface icons */
    .app-dialog .modal-header,
    .app-dialog .modal-footer { min-height:48px; padding:9px 12px; }
    .app-dialog .modal-header h3 { font-size:.9rem; }
    .app-dialog .modal-header .button-small { min-height:32px; padding:5px 9px; }
    .app-dialog .modal-body { padding:10px 12px; }
    .dialog-form .form-grid,
    .dialog-form .form-grid.two-column { gap:7px 9px; }
    .dialog-form .field { gap:3px; }
    .dialog-form .field label,
    .dialog-form fieldset legend { font-size:.68rem; }
    .dialog-form .field-help,
    .dialog-form .record-icon-help { font-size:.61rem; line-height:1.3; }
    .dialog-form .input,
    .dialog-form .select,
    .dialog-form .textarea { min-height:38px; }
    .dialog-form .expense-total-choice { min-height:48px; padding:7px 9px; gap:8px; }
    .dialog-form .expense-total-choice strong { font-size:.72rem; }
    .dialog-form .expense-total-choice small,
    #expenseDialog .expense-total-choice small,
    #expenseDialog .expense-total-choice em { margin-top:1px; font-size:.59rem; line-height:1.25; }
    .dialog-form .required-note { margin-bottom:5px; font-size:.62rem; }
    .dialog-context-note,
    .dialog-form .income-form-mode-note,
    .dialog-form .expense-form-mode-note { margin-bottom:6px; padding:5px 7px; font-size:.62rem; }

    #quickAddMenuDialog { width:min(690px,calc(100vw - 28px)); }
    #quickAddMenuDialog .modal-body { gap:9px; }
    #quickAddMenuDialog .productivity-quick-grid { gap:7px; }
    #quickAddMenuDialog .productivity-quick-action {
      min-height:62px;
      display:grid;
      grid-template-columns:28px minmax(0,1fr);
      align-items:center;
      gap:8px;
      padding:8px 9px;
      border-radius:var(--talaan-control-radius);
    }
    #quickAddMenuDialog .productivity-quick-action > span:last-child { min-width:0; }
    #quickAddMenuDialog .productivity-quick-action strong,
    #quickAddMenuDialog .productivity-quick-action small { display:block; }
    #quickAddMenuDialog .productivity-quick-action strong { font-size:.72rem; }
    #quickAddMenuDialog .productivity-quick-action small { margin-top:1px; font-size:.58rem; line-height:1.25; }
    .productivity-quick-icon { width:24px; height:24px; display:grid; place-items:center; color:var(--text); }
    .productivity-quick-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    #quickAddMenuDialog .productivity-section { gap:6px; }
    #quickAddMenuDialog .productivity-section-heading h4 { font-size:.72rem; }
    #quickAddMenuDialog .productivity-section-heading small { font-size:.57rem; }
    #quickAddMenuDialog .productivity-chip { min-height:30px; padding:5px 8px; font-size:.63rem; }

    #expenseDialog .expense-compact-section {
      grid-column:1/-1;
      border:1px solid var(--line);
      border-radius:var(--talaan-card-radius);
      background:var(--surface-soft);
      overflow:hidden;
    }
    #expenseDialog .expense-compact-section[hidden] { display:none !important; }
    #expenseDialog .expense-compact-section > summary {
      min-height:42px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:7px 9px;
      cursor:pointer;
      list-style:none;
      color:var(--text);
      font-size:.72rem;
      font-weight:850;
    }
    #expenseDialog .expense-compact-section > summary::-webkit-details-marker { display:none; }
    #expenseDialog .expense-section-summary-meta { display:flex; align-items:center; gap:6px; color:var(--muted); }
    #expenseDialog .expense-section-summary-meta small { font-size:.59rem; font-weight:800; }
    #expenseDialog .expense-section-summary-meta svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:transform .15s ease; }
    #expenseDialog .expense-compact-section[open] .expense-section-summary-meta svg { transform:rotate(180deg); }
    #expenseDialog .expense-compact-section[open] > summary { border-bottom:1px solid var(--line); }
    #expenseDialog .expense-compact-section-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 9px; padding:8px 9px 9px; }
    #expenseDialog .expense-compact-section-body > .field-full,
    #expenseDialog .expense-compact-section-body > .expense-total-choice.field-full { grid-column:1/-1; }
    #expenseDialog .gym-schedule-field { padding:7px 8px 8px; }
    #expenseDialog .gym-day-grid { gap:5px; margin:1px 0 5px; }
    #expenseDialog .gym-day-grid span { min-height:34px; border-radius:var(--talaan-control-radius); font-size:.63rem; }
    #expenseDialog .gym-preview { gap:6px; }
    #expenseDialog .expense-dialog-footer { gap:6px; }
    #expenseDialog .expense-dialog-footer .button { min-height:38px; padding:7px 10px; }

    @media (max-width:700px) {
      .app-dialog .modal-header,
      .app-dialog .modal-footer { min-height:52px; padding:8px 10px; }
      .app-dialog .modal-body { padding:9px 10px; }
      .dialog-form .input,
      .dialog-form .select,
      .dialog-form .textarea { min-height:44px; }
      #quickAddMenuDialog .productivity-quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
      #quickAddMenuDialog .productivity-quick-action { min-height:68px; grid-template-columns:24px minmax(0,1fr); gap:7px; padding:8px; }
      #quickAddMenuDialog .productivity-quick-icon { width:22px; height:22px; }
      #quickAddMenuDialog .productivity-quick-icon svg { width:20px; height:20px; }
      #expenseDialog .expense-compact-section-body { grid-template-columns:1fr; }
      #expenseDialog .expense-compact-section-body > * { grid-column:1 !important; }
      #expenseDialog .gym-day-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
      #expenseDialog .gym-day-grid span { min-height:44px; }
      #expenseDialog .expense-dialog-footer { flex-wrap:wrap; }
      #expenseDialog .expense-dialog-footer .footer-spacer { display:none; }
      #expenseDialog .expense-dialog-footer .button { flex:1 1 calc(50% - 6px); min-height:44px; }
    }


    /* V13.0.4 · Settings and top-bar UI refinement */
    .topbar-actions { gap:6px; }
    .cloud-sync-toolbar-button { position:relative; min-height:38px; padding-inline:10px; }
    .cloud-sync-toolbar-button[data-sync-state="synced"] { border-color:color-mix(in srgb,var(--green) 48%,var(--line)); background:color-mix(in srgb,var(--green) 10%,var(--surface)); color:var(--green-text); }
    .cloud-sync-toolbar-button[data-sync-state="syncing"] { border-color:color-mix(in srgb,var(--primary) 42%,var(--line)); background:color-mix(in srgb,var(--primary) 8%,var(--surface)); color:var(--primary); }
    .cloud-sync-toolbar-button[data-sync-state="needs-sync"] { border-color:color-mix(in srgb,var(--orange) 45%,var(--line)); background:color-mix(in srgb,var(--orange) 9%,var(--surface)); color:var(--orange-text); }
    .cloud-sync-toolbar-button[data-sync-state="sync-issue"] { border-color:color-mix(in srgb,var(--red) 42%,var(--line)); background:color-mix(in srgb,var(--red) 8%,var(--surface)); color:var(--danger); }
    .cloud-sync-toolbar-popover { position:fixed; z-index:220; width:min(300px,calc(100vw - 20px)); padding:10px; border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:0 18px 48px rgba(15,23,42,.22); }
    .cloud-sync-toolbar-popover[hidden] { display:none !important; }
    .cloud-sync-toolbar-popover-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .cloud-sync-toolbar-popover-head strong { font-size:.78rem; }
    .cloud-sync-popover-close { width:30px; height:30px; display:grid; place-items:center; padding:0; border:0; border-radius:var(--talaan-control-radius); background:transparent; color:var(--muted); font-size:1rem; cursor:pointer; }
    .cloud-sync-toolbar-popover p { margin:5px 0 8px; color:var(--muted); font-size:.65rem; line-height:1.4; }
    .cloud-sync-toolbar-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; border-top:1px solid var(--line); color:var(--muted); font-size:.63rem; }
    .cloud-sync-toolbar-meta strong { color:var(--text); font-size:.65rem; }
    .cloud-sync-toolbar-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:4px; }

    .month-navigator { gap:4px; }
    .month-navigator .month-control { position:relative; width:190px; min-height:34px; padding:0; }
    .month-display-button { width:100%; min-height:34px; display:grid; grid-template-columns:auto 1px minmax(0,1fr); align-items:center; gap:7px; padding:4px 8px; border:0; border-radius:var(--talaan-control-radius); background:transparent; color:var(--text); font:inherit; cursor:pointer; }
    .month-display-button:hover,.month-display-button:focus-visible { background:color-mix(in srgb,var(--primary) 6%,var(--surface-soft)); outline:none; }
    .month-display-label { color:var(--muted); font-size:.61rem; font-weight:750; white-space:nowrap; }
    .month-display-separator { width:1px; height:16px; background:var(--line); }
    .month-display-value { min-width:0; color:var(--text); font-size:.76rem; font-weight:750; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .month-display-short { display:none; }
    .month-native-input { position:absolute !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; inset:auto !important; }
    .month-picker-popover { position:absolute; top:calc(100% + 8px); left:50%; transform:translateX(-50%); z-index:230; width:260px; padding:9px; border:1px solid var(--line); border-radius:var(--talaan-popover-radius); background:var(--surface); box-shadow:0 18px 48px rgba(15,23,42,.22); }
    .month-picker-popover[hidden] { display:none !important; }
    .month-picker-heading { display:grid; grid-template-columns:34px 1fr 34px; align-items:center; gap:6px; margin-bottom:7px; }
    .month-picker-heading strong { text-align:center; font-size:.78rem; }
    .month-picker-year-button { width:34px; height:34px; padding:0; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface-soft); color:var(--text); font-size:1rem; cursor:pointer; }
    .month-picker-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
    .month-picker-option { min-height:34px; padding:5px 4px; border:1px solid var(--line); border-radius:var(--talaan-control-radius); background:var(--surface); color:var(--text); font:inherit; font-size:.65rem; font-weight:720; cursor:pointer; }
    .month-picker-option:hover,.month-picker-option:focus-visible { border-color:var(--primary); color:var(--primary); }
    .month-picker-option[aria-selected="true"] { border-color:var(--primary); background:var(--primary); color:var(--primary-contrast); }
    .month-picker-option.is-current:not([aria-selected="true"]) { background:color-mix(in srgb,var(--green) 10%,var(--surface)); border-color:color-mix(in srgb,var(--green) 38%,var(--line)); color:var(--green-text); }

    #settings .savings-settings-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; align-items:end; }
    #settings .savings-settings-grid > .field { min-width:0; }
    #settings .savings-settings-grid > .field .select { width:100%; min-height:38px; height:38px; box-sizing:border-box; }
    #settings .savings-setting-check { width:100%; min-height:40px; height:40px; box-sizing:border-box; }
    #settings .savings-setting-check { justify-content:flex-start; padding:6px 9px; line-height:1.2; }
    #settings .salary-work-settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 10px; align-items:end; }
    #settings .salary-work-settings-grid > .field { min-width:0; }
    #settings .salary-work-settings-grid .input,
    #settings .salary-work-settings-grid .select { width:100%; min-height:38px; height:38px; box-sizing:border-box; }
    #settings .salary-work-settings-grid .field label { min-height:16px; display:flex; align-items:end; }

    #settings-panel-profiles .profile-sharing-card .profile-inline-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:8px; }
    #settings-panel-profiles .profile-sharing-card .profile-inline-fields > .field { min-width:0; }
    #settings-panel-profiles .profile-sharing-card .input,
    #settings-panel-profiles .profile-sharing-card .select,
    #settings-panel-profiles .profile-sharing-card > .button { min-height:38px; height:38px; box-sizing:border-box; }
    #settings-panel-profiles .profile-sharing-card > .button { margin-top:8px; width:auto; justify-self:start; }
    #settings-panel-profiles .profile-sharing-card #acceptProfileInviteButton:disabled { opacity:.5; cursor:not-allowed; }

    .ledger-table { width:100%; font-size:.72rem; }
    .ledger-table th { padding:7px 8px; font-size:.64rem; font-weight:780; line-height:1.2; }
    .ledger-table td { padding:7px 8px; font-size:.72rem; line-height:1.28; vertical-align:middle; }
    .ledger-table td strong { font-size:.72rem; font-weight:760; }
    .ledger-table td small { font-size:.61rem; line-height:1.25; }
    .ledger-table .status-chip,.ledger-table .ledger-type-chip { font-size:.58rem; min-height:22px; padding:3px 6px; }
    .reconciliation-table { font-size:.72rem; }
    .reconciliation-table th,.reconciliation-table td { padding:7px 8px; font-size:.7rem; }

    #expenseDialog .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 9px; align-items:end; }
    #expenseDialog .icon-name-control { grid-template-columns:38px minmax(0,1fr); gap:7px; }
    #expenseDialog .record-icon-preview { width:38px; min-width:38px; height:38px; }
    #expenseDialog #standardAmountField { grid-column:1; }
    #expenseDialog #expenseIncludeTotalsField { grid-column:2; min-height:38px; height:38px; margin-top:calc(.68rem + 3px); padding:5px 8px; align-items:center; }
    #expenseDialog #expenseIncludeTotalsField small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    #expenseDialog #budgetPeriodField { grid-column:1; }
    #expenseDialog #expenseDateField { grid-column:2; }
    #expenseDialog #expenseDueDayField { grid-column:1; }
    #expenseDialog #expenseCategoryField { grid-column:2; }
    #expenseDialog .input,#expenseDialog .select { height:38px; min-height:38px; box-sizing:border-box; }

    #quickAddMenuDialog { width:min(620px,calc(100vw - 24px)); }
    #quickAddMenuDialog .modal-body { gap:7px; }
    #quickAddMenuDialog .productivity-quick-grid { gap:5px; }
    #quickAddMenuDialog .productivity-quick-action { min-height:50px; grid-template-columns:22px minmax(0,1fr); gap:6px; padding:6px 8px; border-radius:var(--talaan-control-radius); }
    #quickAddMenuDialog .productivity-quick-icon { width:20px; height:20px; }
    #quickAddMenuDialog .productivity-quick-icon svg { width:19px; height:19px; }
    #quickAddMenuDialog .productivity-quick-action strong { font-size:.68rem; line-height:1.2; }
    #quickAddMenuDialog .productivity-quick-action small { display:none; }
    #quickAddMenuDialog .productivity-section-heading h4 { font-size:.68rem; }
    #quickAddMenuDialog .productivity-section-heading small { font-size:.54rem; }
    #quickAddMenuDialog .productivity-chip { min-height:28px; padding:4px 7px; font-size:.6rem; }

    @media (max-width:850px) {
      .topbar-actions .cloud-sync-toolbar-button,#cloudSyncStatusButton { grid-area:sync; }
      .topbar-actions .month-control { display:block; height:44px; min-height:44px; max-height:44px; padding:0; }
      .topbar-actions .month-display-button { min-height:42px; height:42px; padding:5px 8px; }
      .month-picker-popover { position:fixed; top:auto; left:10px; right:10px; bottom:max(10px,env(safe-area-inset-bottom)); transform:none; width:auto; }
      #settings .savings-settings-grid { grid-template-columns:1fr; }
      #settings .salary-work-settings-grid { grid-template-columns:1fr; }
    }
    @media (max-width:700px) {
      .month-display-long { display:none; }
      .month-display-short { display:inline; }
      .month-display-label { font-size:.6rem; }
      .month-display-value { font-size:.72rem; }
      #settings-panel-profiles .profile-sharing-card .profile-inline-fields { grid-template-columns:1fr; }
      #settings-panel-profiles .profile-sharing-card > .button { width:100%; min-height:44px; height:44px; }
      #expenseDialog .form-grid { grid-template-columns:1fr; align-items:stretch; }
      #expenseDialog .form-grid > * { grid-column:1 !important; }
      #expenseDialog #expenseIncludeTotalsField { margin-top:0; min-height:44px; height:auto; }
      #expenseDialog .input,#expenseDialog .select { height:44px; min-height:44px; }
      #expenseDialog .icon-name-control { grid-template-columns:44px minmax(0,1fr); }
      #expenseDialog .record-icon-preview { width:44px; min-width:44px; height:44px; }
      #quickAddMenuDialog .productivity-quick-action { min-height:56px; grid-template-columns:20px minmax(0,1fr); padding:7px; }
      .cloud-sync-toolbar-popover { width:min(286px,calc(100vw - 20px)); }
    }

/* Talaan · active workspace tabs */
:is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]),
:is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]):hover,
:is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]):focus-visible {
  background:#356FD1 !important;
  border-color:#356FD1 !important;
  color:#FFFFFF !important;
}

html[data-theme="dark"] :is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]),
html[data-theme="dark"] :is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]):hover,
html[data-theme="dark"] :is(.money-workspace-switcher, .project-workspace-switcher) .workspace-switcher-button:is(.active, [aria-selected="true"]):focus-visible {
  background:#356FD1 !important;
  border-color:#356FD1 !important;
  color:#FFFFFF !important;
}

/* Talaan · edge-to-edge row dividers */
.card > .simple-list > li,
.card > .dashboard-stat-line,
.system-card > .system-status-row {
  box-sizing:border-box;
  margin-inline:calc(-1 * var(--row-divider-bleed, var(--workspace-card-padding, 13px)));
  padding-inline:var(--row-divider-bleed, var(--workspace-card-padding, 13px));
}

#availableMoneySection {
  --row-divider-bleed:12px;
}

#availableMoneySection:not(.is-collapsed) > .card-header {
  box-sizing:border-box;
  margin-inline:calc(-1 * var(--row-divider-bleed));
  padding-inline:var(--row-divider-bleed);
}

.sidebar-settings-bottom {
  box-sizing:border-box;
  margin-inline:-8px;
  padding-inline:8px;
}

@media (max-width:850px) {
  .sidebar-settings-bottom {
    margin-inline:-16px;
    padding-inline:16px;
  }
}

@media (max-width:700px) {
  #availableMoneySection {
    --row-divider-bleed:10px;
  }

  #settings .settings-panel .system-card {
    --row-divider-bleed:10px;
  }
}

/* Anti-Slop keyboard focus: compact controls keep a visible high-contrast ring. */
:is(.expense-toolbar-single-line,.expense-toolbar-compact,.paid-toolbar-compact,.project-toolbar-compact,.income-toolbar) :is(.input,.select):focus-visible,
.topbar .month-display-button:focus-visible,
.record-icon-trigger:focus-visible {
  outline:2px solid var(--focus-ring,var(--primary)) !important;
  outline-offset:2px !important;
  border-color:var(--focus-ring,var(--primary)) !important;
  background:var(--surface) !important;
  box-shadow:0 0 0 1px var(--focus-ring,var(--primary)) !important;
}
:is(.expense-toolbar-single-line,.expense-toolbar-compact,.paid-toolbar-compact,.project-toolbar-compact,.income-toolbar) :is(.input.input-error,.select.input-error):focus-visible {
  border-color:var(--danger) !important;
  box-shadow:0 0 0 1px var(--danger) !important;
}
