/*=========================================================
             RESET / VARIABLES
             ========================================================= */

    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --bg: #080b18;
      --bg2: #11152a;
      --bg3: #181d35;
      --border: #303858;
      --text: #f5f3ff;
      --text2: #9da3bb;
      --accent: #8b5cf6;
      --accent2: #6d28d9;
      --pink: #ec4899;
      --blue: #60a5fa;
      --green: #4ee3a2;
      --red: #ff7474;
      --yellow: #ffc857;
      --radius: 12px;
      --radius-sm: 8px;
      --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    }

    /*=========================================================
             BASE ELEMENTS / LAYOUT / NAVIGATION
             ========================================================= */

    body {
      font-family: var(--font);
      background: radial-gradient(circle at 16% -8%, rgba(139, 92, 246, .21), transparent 34%), radial-gradient(circle at 100% 12%, rgba(236, 72, 153, .11), transparent 29%), linear-gradient(180deg, #090c1a 0%, var(--bg) 42%, #070a15 100%);
      color: var(--text);
      min-height: 100vh;
      min-height: 100dvh;
      overflow-x: hidden;
      font-size: 15px;
      line-height: 1.5;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    nav {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(8, 11, 24, .90);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: stretch;
      padding: env(safe-area-inset-top) 10px 0 12px;
    }

    nav .nav-tab {
      flex: 1;
      min-width: 0;
      background: none;
      border: 0;
      color: var(--text2);
      font-size: 14px;
      font-weight: 600;
      padding: 14px 5px;
      min-height: 48px;
      cursor: pointer;
      position: relative;
    }

    .nav-settings {
      flex: 0 0 46px;
      width: 46px;
      min-width: 46px;
      min-height: 48px;
      margin-left: 4px;
      border: 0;
      border-left: 1px solid rgba(48, 56, 88, .68);
      background: none;
      color: #c4b5fd;
      font-size: 20px;
      line-height: 1;
      cursor: pointer;
      border-radius: 0;
    }

    .nav-settings:active {
      background: rgba(139, 92, 246, .10);
    }

    nav .nav-tab.active {
      color: var(--accent);
    }

    nav .nav-tab.active::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 20%;
      right: 20%;
      height: 2px;
      background: var(--accent);
      border-radius: 2px 2px 0 0;
    }

    .tab {
      display: none;
      padding: 18px 16px calc(88px + env(safe-area-inset-bottom));
      animation: fadeIn .18s ease;
      max-width: 900px;
      margin: 0 auto;
    }

    .tab.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(5px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }

    /*=========================================================
             SHARED COMPONENTS
             ========================================================= */

    .card {
      background: linear-gradient(160deg, rgba(17, 24, 39, .98), rgba(12, 18, 30, .98));
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      box-shadow: 0 14px 32px rgba(0, 0, 0, .12);
    }

    .section-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--text2);
      letter-spacing: .08em;
      text-transform: uppercase;
      margin: 24px 0 10px;
    }

    .section-title:first-child {
      margin-top: 0;
    }

    .muted {
      color: var(--text2);
    }

    .small {
      font-size: 12px;
    }

    .strong {
      font-weight: 700;
    }

    .spacer8 {
      height: 8px;
    }

    .spacer12 {
      height: 12px;
    }

    /*=========================================================
             BUTTONS / FORMS
             ========================================================= */

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 44px;
      padding: 11px 18px;
      border-radius: var(--radius-sm);
      border: 0;
      font-weight: 600;
      cursor: pointer;
      text-align: center;
      transition: transform .1s, opacity .15s, border-color .15s;
    }

    .btn:active {
      transform: scale(.98);
    }

    .btn:disabled {
      opacity: .45;
      cursor: not-allowed;
    }

    .btn-primary {
      background: var(--accent);
      color: white;
    }

    .btn-primary:hover {
      background: var(--accent2);
    }

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

    .btn-success {
      background: var(--green);
      color: #0d1712;
    }

    .btn-danger {
      background: var(--red);
      color: white;
    }

    .btn-warning {
      background: rgba(240, 180, 41, .15);
      color: var(--yellow);
      border: 1px solid rgba(240, 180, 41, .35);
    }

    .btn-full {
      width: 100%;
    }

    .btn-small {
      min-height: 38px;
      padding: 8px 12px;
      font-size: 13px;
    }

    .link-btn {
      background: none;
      border: 0;
      color: var(--text2);
      text-decoration: underline;
      text-underline-offset: 2px;
      min-height: 44px;
      padding: 8px 2px;
      cursor: pointer;
    }

    textarea,
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="month"],
    input[type="password"],
    select {
      width: 100%;
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-size: 14px;
      padding: 11px 12px;
      outline: none;
      min-height: 44px;
    }

    textarea:focus,
    input:focus,
    select:focus {
      border-color: var(--accent);
    }

    textarea {
      resize: vertical;
      min-height: 118px;
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-label {
      display: block;
      color: var(--text2);
      font-size: 12px;
      margin-bottom: 6px;
      font-weight: 600;
    }

    .row {
      display: flex;
      gap: 10px;
    }

    .row>* {
      flex: 1;
      min-width: 0;
    }

    .stack {
      display: grid;
      gap: 10px;
    }

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

    .stat-card {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px;
      min-width: 0;
    }

    .stat-card.wide {
      grid-column: 1/-1;
    }

    .stat-label {
      color: var(--text2);
      text-transform: uppercase;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .06em;
      margin-bottom: 5px;
    }

    .stat-value {
      font-size: 21px;
      font-weight: 750;
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .stat-sub {
      color: var(--text2);
      font-size: 11px;
      margin-top: 5px;
    }

    .raccoon-card {
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      gap: 14px;
      min-height: 132px;
      background: linear-gradient(135deg, rgba(23, 34, 55, .98), rgba(10, 20, 34, .98));
      border-color: rgba(105, 167, 255, .34);
    }

    .raccoon-card::after {
      content: '';
      position: absolute;
      width: 180px;
      height: 180px;
      right: -55px;
      top: -70px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(105, 167, 255, .20), transparent 66%);
      pointer-events: none;
    }

    .raccoon {
      font-size: 42px;
      line-height: 1;
      position: relative;
      z-index: 1;
      flex: 0 0 auto;
    }

    .raccoon-copy {
      flex: 1;
    }

    .raccoon-copy .eyebrow {
      color: var(--text2);
      font-size: 12px;
    }

    .raccoon-total {
      font-size: 25px;
      font-weight: 800;
      margin-top: 2px;
    }

    .paycheck-card {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: center;
    }

    .paycheck-date {
      font-size: 19px;
      font-weight: 750;
    }

    .paycheck-amount {
      color: var(--green);
      font-size: 17px;
      font-weight: 750;
      text-align: right;
    }

    .coverage {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .coverage strong {
      display: block;
    }

    .accordion {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      margin-bottom: 10px;
    }

    .accordion-head {
      width: 100%;
      background: none;
      border: 0;
      color: var(--text);
      padding: 13px 15px;
      min-height: 62px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 24px;
      gap: 12px;
      align-items: center;
      text-align: left;
      cursor: pointer;
    }

    .accordion-copy {
      min-width: 0;
    }

    .accordion-head .title {
      display: block;
      min-width: 0;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .accordion-head .right {
      display: flex;
      align-items: baseline;
      gap: 7px;
      min-width: 0;
      margin-top: 3px;
      text-align: left;
      flex-wrap: wrap;
    }

    .accordion-head .amount {
      font-weight: 800;
      white-space: nowrap;
    }

    .trend-text {
      color: var(--text2);
      font-size: 11px;
      margin-top: 2px;
    }

    .trend-good {
      color: var(--green);
    }

    .trend-bad {
      color: var(--red);
    }

    .accordion-body {
      display: none;
      border-top: 1px solid var(--border);
      padding: 12px 14px 14px;
    }

    .accordion.open .accordion-body {
      display: block;
    }

    .accordion-chevron {
      width: 24px;
      min-width: 24px;
      color: var(--text2);
      font-size: 22px;
      line-height: 1;
      text-align: right;
    }

    .accordion-chevron::before {
      content: '›';
    }

    .accordion.open .accordion-chevron::before {
      content: '⌄';
    }

    .mini-chart {
      width: 100%;
      display: block;
      height: 84px;
      margin: 8px 0 12px;
    }

    .drill-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 0;
      border-bottom: 1px solid rgba(42, 47, 61, .65);
    }

    .drill-row:last-child {
      border-bottom: 0;
    }

    .drill-main {
      flex: 1;
      min-width: 0;
    }

    .drill-name {
      font-weight: 600;
      font-size: 13px;
    }

    .drill-meta {
      color: var(--text2);
      font-size: 11px;
      margin-top: 2px;
    }

    .merchant-list {
      margin-top: 10px;
      border-top: 1px solid var(--border);
      padding-top: 8px;
    }

    .merchant-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      font-size: 12px;
      padding: 5px 0;
      color: var(--text2);
    }

    .merchant-row strong {
      color: var(--text);
    }

    .image-upload-area {
      border: 1px dashed var(--border);
      border-radius: var(--radius-sm);
      padding: 16px;
      min-height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      color: var(--text2);
      cursor: pointer;
    }

    .image-upload-area:hover {
      border-color: var(--accent);
      color: var(--text);
    }

    #imageInput {
      display: none;
    }

    #imagePreviewStrip {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .img-thumb {
      width: 64px;
      height: 64px;
      object-fit: cover;
      border-radius: 7px;
      border: 1px solid var(--border);
    }

    .loading-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text2);
      padding: 14px 0;
    }

    .spinner {
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255, 255, 255, .25);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .alert {
      padding: 12px 14px;
      border-radius: var(--radius-sm);
      font-size: 13px;
      margin-bottom: 12px;
    }

    .alert-error {
      background: rgba(240, 106, 106, .12);
      border: 1px solid rgba(240, 106, 106, .3);
      color: #f09090;
    }

    .alert-success {
      background: rgba(62, 207, 142, .12);
      border: 1px solid rgba(62, 207, 142, .3);
      color: var(--green);
    }

    .alert-info {
      background: rgba(91, 141, 238, .12);
      border: 1px solid rgba(91, 141, 238, .3);
      color: #8ab0f0;
    }

    .alert-warning {
      background: rgba(240, 180, 41, .12);
      border: 1px solid rgba(240, 180, 41, .3);
      color: var(--yellow);
    }

    .preview-summary {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 10px;
    }

    .preview-count {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px;
      text-align: center;
    }

    .preview-count strong {
      display: block;
      font-size: 18px;
    }

    .preview-count span {
      color: var(--text2);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .preview-group-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--text2);
      text-transform: uppercase;
      letter-spacing: .06em;
      margin: 16px 0 8px;
    }

    .preview-card {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 13px;
      margin-bottom: 8px;
    }

    .preview-card.warning {
      border-color: rgba(240, 180, 41, .45);
    }

    .preview-card.duplicate {
      border-color: rgba(91, 141, 238, .45);
    }

    .preview-top {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: flex-start;
    }

    .preview-label {
      font-weight: 650;
    }

    .preview-amount {
      font-size: 16px;
      font-weight: 750;
      color: var(--accent);
      white-space: nowrap;
    }

    .preview-meta {
      font-size: 11px;
      color: var(--text2);
      margin-top: 3px;
      overflow-wrap: anywhere;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 650;
      background: var(--bg3);
      color: var(--text2);
      margin: 5px 4px 0 0;
    }

    .badge.income {
      color: var(--green);
      background: rgba(62, 207, 142, .1);
    }

    .badge.loan {
      color: var(--yellow);
      background: rgba(240, 180, 41, .1);
    }

    .badge.transfer,
    .badge.investment {
      color: #a8b8e8;
      background: rgba(91, 141, 238, .1);
    }

    .clarify-reason {
      color: var(--yellow);
      font-size: 12px;
      margin: 9px 0;
    }

    .clarify-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .quick-options {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin: 8px 0 10px;
    }

    .quick-option {
      border: 1px solid var(--border);
      background: var(--bg3);
      color: var(--text);
      border-radius: 999px;
      min-height: 36px;
      padding: 7px 10px;
      cursor: pointer;
      font-size: 12px;
    }

    .duplicate-actions {
      display: flex;
      gap: 8px;
      margin-top: 10px;
    }

    .duplicate-actions button {
      flex: 1;
    }

    .duplicate-actions .selected {
      outline: 2px solid var(--accent);
      outline-offset: 1px;
    }

    .import-complete-box {
      margin-top: 12px;
      padding: 12px;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }

    .check-row {
      display: flex;
      gap: 9px;
      align-items: flex-start;
      cursor: pointer;
    }

    .check-row input {
      width: 20px;
      height: 20px;
      margin-top: 1px;
      accent-color: var(--accent);
      flex: 0 0 auto;
    }

    .save-row {
      position: sticky;
      bottom: calc(8px + env(safe-area-inset-bottom));
      z-index: 20;
      background: rgba(15, 17, 23, .94);
      backdrop-filter: blur(8px);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 9px;
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }

    .save-row .btn {
      flex: 1;
    }

    .filters {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 10px;
    }

    .filters .search {
      grid-column: 1/-1;
    }

    .tx-list {
      display: grid;
      gap: 8px;
    }

    .tx-row {
      width: 100%;
      text-align: left;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text);
      padding: 12px 13px;
      min-height: 62px;
      cursor: pointer;
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .tx-row:active {
      transform: scale(.995);
    }

    .tx-info {
      flex: 1;
      min-width: 0;
    }

    .tx-label {
      font-weight: 650;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tx-meta {
      color: var(--text2);
      font-size: 11px;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tx-amount {
      font-weight: 750;
      text-align: right;
      white-space: nowrap;
    }

    .tx-amount.income {
      color: var(--green);
    }

    .tx-amount.out {
      color: var(--accent);
    }

    .table-scroll {
      overflow-x: auto;
      border: 1px solid var(--border);
      background: var(--bg2);
      border-radius: var(--radius);
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      min-width: 520px;
    }

    .data-table th {
      color: var(--text2);
      text-align: left;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .05em;
      font-weight: 650;
      padding: 9px;
      border-bottom: 1px solid var(--border);
    }

    .data-table td {
      padding: 9px;
      border-bottom: 1px solid rgba(42, 47, 61, .55);
    }

    .data-table tr:last-child td {
      border-bottom: 0;
    }

    .data-footer {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 22px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }

    .empty-state {
      text-align: center;
      color: var(--text2);
      padding: 30px 16px;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }

    .empty-state-icon {
      font-size: 32px;
      margin-bottom: 8px;
    }

    .empty-state-title {
      color: var(--text);
      font-weight: 700;
    }

    /*=========================================================
             MODALS / OVERLAYS
             ========================================================= */

    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 250;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
      background: rgba(0, 0, 0, .72);
      backdrop-filter: blur(5px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .15s;
    }

    .modal-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    .modal {
      width: 100%;
      max-width: 520px;
      max-height: 88vh;
      max-height: 88dvh;
      overflow: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      transform: translateY(12px);
      transition: transform .15s;
    }

    .modal-overlay.show .modal {
      transform: none;
    }

    .modal h2 {
      font-size: 20px;
      margin-bottom: 6px;
    }

    .modal-body {
      color: var(--text2);
      font-size: 13px;
    }

    .modal-actions {
      display: flex;
      gap: 8px;
      margin-top: 16px;
      flex-wrap: wrap;
    }

    .modal-actions .btn {
      flex: 1;
    }

    .detail-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin: 14px 0;
    }

    .detail-item {
      background: var(--bg3);
      border-radius: 8px;
      padding: 10px;
      min-width: 0;
    }

    .detail-item.wide {
      grid-column: 1/-1;
    }

    .detail-key {
      color: var(--text2);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .detail-value {
      color: var(--text);
      margin-top: 3px;
      overflow-wrap: anywhere;
    }

    .detail-actions {
      display: flex;
      gap: 8px;
    }

    .detail-actions .btn {
      flex: 1;
    }

    #setupOverlay {
      position: fixed;
      inset: 0;
      z-index: 400;
      background: var(--bg);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    #setupOverlay.show {
      display: flex;
    }

    .setup-box {
      max-width: 420px;
      width: 100%;
    }

    .setup-box h1 {
      font-size: 26px;
      margin-bottom: 6px;
    }

    .setup-sub {
      color: var(--text2);
      font-size: 14px;
      margin-bottom: 24px;
    }

    #nightOutOverlay {
      position: fixed;
      inset: 0;
      z-index: 350;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      text-align: center;
    }

    #nightOutOverlay.good {
      background: linear-gradient(160deg, #0a2e1e, #0f3d28 45%, #133322);
    }

    #nightOutOverlay.neutral {
      background: linear-gradient(160deg, #0f111a, #171b28);
    }

    .night-out-content {
      max-width: 360px;
    }

    .night-emoji {
      font-size: 56px;
      margin-bottom: 12px;
    }

    .night-headline {
      font-size: 34px;
      font-weight: 850;
      margin-bottom: 10px;
    }

    .night-sub {
      color: var(--text2);
      font-size: 18px;
      margin-bottom: 30px;
    }

    #gotItBtn {
      min-height: 48px;
      padding: 12px 36px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, .2);
      background: rgba(255, 255, 255, .1);
      color: white;
      font-weight: 750;
      cursor: pointer;
    }

    .confetti-piece {
      position: fixed;
      width: 8px;
      height: 8px;
      border-radius: 2px;
      animation: confettiFall var(--dur) var(--delay) ease-in both;
      z-index: 349;
    }

    @keyframes confettiFall {
      from {
        transform: translateY(-20px) rotate(0);
        opacity: 1;
      }
      to {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
      }
    }

    .month-chips {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .month-chip {
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg3);
      color: var(--text2);
      font-size: 11px;
    }

    .month-chip.complete {
      color: var(--green);
    }

    .manage-preview {
      background: var(--bg3);
      border-radius: 8px;
      padding: 10px;
      margin-top: 10px;
    }

    .chart-card canvas {
      width: 100%;
      display: block;
    }

    .section-title::before {
      content: '';
      display: inline-block;
      width: 14px;
      height: 2px;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--accent), var(--pink));
      vertical-align: middle;
      margin-right: 7px;
    }

    .stat-card,
    .accordion,
    .tx-row {
      background: linear-gradient(155deg, rgba(17, 24, 39, .98), rgba(13, 20, 33, .98));
    }

    .personality-note {
      font-size: 10px;
      color: var(--text2);
      margin-top: 8px;
    }

    /*=========================================================
             DEVELOPER TOOLS — DEV ONLY
             Excluded when preparing the eventual production build.
             ========================================================= */

    .dev-tools {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
    }

    .dev-tools>summary {
      list-style: none;
      cursor: pointer;
      min-height: 54px;
      padding: 14px 15px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 750;
      user-select: none;
    }

    .dev-tools>summary::-webkit-details-marker {
      display: none;
    }

    .dev-tools>summary::before {
      content: '▶';
      color: var(--text2);
      font-size: 11px;
      transition: transform .15s;
    }

    .dev-tools[open]>summary::before {
      transform: rotate(90deg);
    }

    .dev-summary-title {
      flex: 1;
    }

    .dev-body {
      border-top: 1px solid var(--border);
      padding: 14px;
    }

    .dev-note {
      color: var(--text2);
      font-size: 12px;
      line-height: 1.5;
      margin-bottom: 12px;
    }

    .dev-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .dev-grid .wide {
      grid-column: 1/-1;
    }

    .dev-mode-pill {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 3px 8px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .04em;
    }

    .dev-mode-pill.live {
      color: var(--green);
      background: rgba(78, 227, 162, .1);
    }

    .dev-mode-pill.mock {
      color: var(--yellow);
      background: rgba(255, 200, 87, .1);
    }

    .dev-demo-tools {
      margin: 12px 0;
      padding: 11px;
      border: 1px dashed rgba(78, 227, 162, .34);
      border-radius: 10px;
      background: rgba(78, 227, 162, .05);
    }

    .dev-demo-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 9px;
    }

    .code-area {
      min-height: 180px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 12px;
      line-height: 1.4;
      white-space: pre;
    }

    .memory-list {
      display: grid;
      gap: 7px;
      margin-top: 8px;
    }

    .memory-entry {
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px;
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    .memory-copy {
      flex: 1;
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .memory-key {
      color: var(--text2);
      font-size: 10px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

    .memory-value {
      font-size: 12px;
      margin-top: 2px;
    }

    /* DEV-ONLY END — Developer Tools styling */

    /*=========================================================
             HOME / APP SHELL / FINANCE PRESENTATION
             ========================================================= */

    nav {
      max-width: 900px;
      margin: 0 auto;
    }

    nav .nav-tab {
      font-size: 13px;
      letter-spacing: .01em;
    }

    nav .nav-tab.active {
      color: #c4b5fd;
    }

    nav .nav-tab.active::after {
      background: linear-gradient(90deg, var(--accent), var(--pink));
      box-shadow: 0 0 14px rgba(139, 92, 246, .6);
    }

    .home-landing {
      max-width: 560px;
      padding-top: 26px;
    }

    .home-hero {
      position: relative;
      overflow: hidden;
      text-align: center;
      padding: 30px 14px 24px;
    }

    .home-hero::before {
      content: '';
      position: absolute;
      width: 260px;
      height: 260px;
      border-radius: 50%;
      left: 50%;
      top: -150px;
      transform: translateX(-50%);
      background: radial-gradient(circle, rgba(139, 92, 246, .30), rgba(139, 92, 246, 0) 68%);
      pointer-events: none;
    }

    .home-mascot {
      width: 66px;
      height: 66px;
      margin: 0 auto 16px;
      border-radius: 20px;
      display: grid;
      place-items: center;
      font-size: 38px;
      position: relative;
      background: linear-gradient(145deg, rgba(139, 92, 246, .32), rgba(236, 72, 153, .15));
      border: 1px solid rgba(196, 181, 253, .34);
      box-shadow: 0 18px 50px rgba(88, 28, 135, .28);
    }

    .home-mascot::after {
      content: '🧾';
      position: absolute;
      right: -8px;
      bottom: -7px;
      width: 28px;
      height: 28px;
      border-radius: 9px;
      display: grid;
      place-items: center;
      font-size: 15px;
      background: #161a30;
      border: 1px solid var(--border);
    }

    .home-eyebrow {
      color: #c4b5fd;
      font-size: 11px;
      font-weight: 850;
      letter-spacing: .13em;
      text-transform: uppercase;
      margin-bottom: 9px;
    }

    .home-title {
      max-width: 420px;
      margin: 0 auto;
      font-size: clamp(34px, 9vw, 48px);
      line-height: .98;
      letter-spacing: -.045em;
      font-weight: 900;
    }

    .home-title .gradient-text {
      background: linear-gradient(100deg, #f5f3ff 12%, #c4b5fd 48%, #f472b6 92%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    .home-lede {
      max-width: 440px;
      margin: 18px auto 0;
      color: #b7bdd2;
      font-size: 15px;
      line-height: 1.6;
    }

    .home-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin: 22px auto 0;
      max-width: 390px;
    }

    .home-actions .btn {
      min-height: 50px;
      border-radius: 999px;
    }

    .home-actions .btn-primary {
      background: linear-gradient(100deg, #7c3aed, #a855f7 58%, #d946ef);
      box-shadow: 0 12px 30px rgba(126, 34, 206, .28);
    }

    .home-actions .btn-secondary {
      background: rgba(18, 22, 43, .72);
      border-color: #4a5273;
    }

    .home-feature-grid {
      display: grid;
      gap: 10px;
      margin-top: 10px;
    }

    .home-feature-card {
      width: 100%;
      min-height: 92px;
      display: grid;
      grid-template-columns: 48px 1fr 18px;
      align-items: center;
      gap: 12px;
      text-align: left;
      color: var(--text);
      background: linear-gradient(145deg, rgba(21, 27, 51, .95), rgba(13, 17, 35, .96));
      border: 1px solid #343c61;
      border-radius: 16px;
      padding: 15px;
      cursor: pointer;
      box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    }

    .home-feature-card:active {
      transform: scale(.992);
    }

    .feature-icon {
      width: 46px;
      height: 46px;
      display: grid;
      place-items: center;
      border-radius: 13px;
      font-size: 22px;
      background: linear-gradient(145deg, rgba(139, 92, 246, .36), rgba(109, 40, 217, .20));
      border: 1px solid rgba(196, 181, 253, .22);
    }

    .home-feature-card:nth-child(2) .feature-icon {
      background: linear-gradient(145deg, rgba(236, 72, 153, .27), rgba(139, 92, 246, .18));
    }

    .home-feature-card:nth-child(3) .feature-icon {
      background: linear-gradient(145deg, rgba(96, 165, 250, .27), rgba(139, 92, 246, .18));
    }

    .home-feature-card:nth-child(4) .feature-icon {
      background: linear-gradient(145deg, rgba(78, 227, 162, .22), rgba(96, 165, 250, .12));
    }

    .feature-title {
      display: block;
      font-weight: 800;
      font-size: 15px;
    }

    .feature-copy {
      display: block;
      color: var(--text2);
      font-size: 12px;
      line-height: 1.45;
      margin-top: 3px;
    }

    .feature-chevron {
      color: #777f9b;
      font-size: 18px;
    }

    .how-steps {
      position: relative;
      display: grid;
      gap: 0;
      margin-top: 4px;
    }

    .how-step {
      position: relative;
      display: grid;
      grid-template-columns: 38px 1fr;
      gap: 12px;
      padding: 10px 0 15px;
    }

    .how-step:not(:last-child)::after {
      content: '';
      position: absolute;
      left: 18px;
      top: 44px;
      bottom: -3px;
      width: 1px;
      background: linear-gradient(var(--accent), rgba(139, 92, 246, .12));
    }

    .step-num {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      font-size: 13px;
      font-weight: 900;
      color: #fff;
      background: linear-gradient(145deg, #7c3aed, #a855f7);
      border: 1px solid rgba(255, 255, 255, .16);
      box-shadow: 0 0 20px rgba(139, 92, 246, .26);
    }

    .step-title {
      font-weight: 800;
      padding-top: 1px;
    }

    .step-copy {
      color: var(--text2);
      font-size: 12px;
      line-height: 1.45;
      margin-top: 2px;
    }

    .home-bottom-cta {
      margin-top: 22px;
      padding: 18px;
      text-align: center;
      border-radius: 18px;
      border: 1px solid rgba(139, 92, 246, .32);
      background: linear-gradient(145deg, rgba(45, 25, 88, .55), rgba(18, 20, 42, .90));
    }

    .home-bottom-cta p {
      color: #b8bfd5;
      font-size: 12px;
      margin-bottom: 10px;
    }

    .home-bottom-cta .btn {
      border-radius: 999px;
      background: linear-gradient(100deg, #6d28d9, #9333ea, #c026d3);
    }

    .home-skip {
      margin-top: 10px;
      color: #737b96;
      font-size: 11px;
    }

    .finance-hero {
      position: relative;
      overflow: hidden;
      background: linear-gradient(135deg, rgba(75, 35, 148, .48), rgba(25, 28, 58, .98) 62%, rgba(38, 24, 67, .94));
      border-color: rgba(139, 92, 246, .48);
      padding: 18px;
    }

    .finance-hero::after {
      content: '';
      position: absolute;
      width: 190px;
      height: 190px;
      border-radius: 50%;
      right: -70px;
      top: -90px;
      background: radial-gradient(circle, rgba(236, 72, 153, .20), transparent 68%);
    }

    .finance-hero .eyebrow {
      color: #c4b5fd;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .11em;
      text-transform: uppercase;
    }

    .finance-hero-total {
      font-size: 34px;
      line-height: 1;
      letter-spacing: -.035em;
      font-weight: 900;
      margin-top: 7px;
    }

    .finance-hero-sub {
      color: #b8bfd5;
      font-size: 12px;
      margin-top: 7px;
    }

    .finance-dev-date {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 10px;
      padding: 10px 11px;
      border: 1px dashed rgba(139, 92, 246, .45);
      border-radius: 10px;
      background: rgba(91, 33, 182, .10);
    }

    .finance-dev-date .dev-date-copy {
      flex: 1;
      min-width: 150px;
    }

    .finance-dev-date .dev-date-title {
      color: #c4b5fd;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .09em;
      text-transform: uppercase;
    }

    .finance-dev-date .dev-date-sub {
      color: var(--text2);
      font-size: 10px;
      margin-top: 2px;
    }

    .finance-dev-date input[type="date"] {
      width: auto;
      min-width: 145px;
      min-height: 38px;
      padding: 7px 9px;
      font-size: 12px;
    }

    .finance-dev-date .btn {
      min-height: 38px;
      padding: 7px 10px;
      font-size: 12px;
    }

    #paycheckSection .paycheck-card:first-child {
      border-color: rgba(139, 92, 246, .58);
      background: linear-gradient(125deg, rgba(109, 40, 217, .58), rgba(37, 32, 82, .96) 64%, rgba(18, 23, 44, .96));
      box-shadow: 0 16px 34px rgba(76, 29, 149, .18);
    }

    #paycheckSection .paycheck-card:first-child .paycheck-amount {
      color: #f0e9ff;
      font-size: 20px;
    }

    #paycheckSection .paycheck-card {
      border-left: 0;
    }

    .stat-card,
    .accordion,
    .tx-row,
    .dev-tools,
    .table-scroll {
      border-color: #303858;
    }

    .stat-card {
      background: linear-gradient(150deg, rgba(18, 23, 44, .98), rgba(12, 16, 31, .98));
    }

    .btn-primary {
      background: linear-gradient(100deg, #7c3aed, #9333ea);
    }

    .btn-primary:hover {
      background: linear-gradient(100deg, #6d28d9, #7e22ce);
    }

    #setupOverlay {
      background: rgba(7, 9, 20, .90);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .setup-box {
      background: linear-gradient(155deg, #151a32, #0f1327);
      border: 1px solid #343c61;
      border-radius: 20px;
      padding: 22px;
      box-shadow: 0 24px 70px rgba(0, 0, 0, .44);
    }

    .setup-close {
      float: right;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg3);
      color: var(--text2);
      cursor: pointer;
    }

    /*=========================================================
             FINANCE MONTH VIEWER / DATA HISTORY / DEV CLOCK
             ========================================================= */

    #genericModal {
      z-index: 300;
    }

    #detailModal {
      z-index: 250;
    }

    .finance-month-viewer {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) 44px;
      gap: 10px;
      align-items: center;
      width: 100%;
      margin-bottom: 10px;
    }

    .finance-month-viewer .month-main {
      min-width: 0;
      width: 100%;
      overflow: hidden;
    }

    .finance-month-viewer input[type="month"] {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      text-align: center;
      font-weight: 800;
      border-color: rgba(139, 92, 246, .48);
      background: linear-gradient(145deg, rgba(35, 29, 75, .92), rgba(22, 25, 49, .96));
    }

    .month-nav-btn {
      width: 44px;
      min-width: 0;
      max-width: 44px;
      padding: 0;
      font-size: 22px;
    }

    .finance-view-actions {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      margin: -2px 0 12px;
    }

    .finance-view-note {
      color: var(--text2);
      font-size: 11px;
      line-height: 1.4;
      flex: 1;
    }

    .historical-note {
      padding: 9px 11px;
      border-radius: 9px;
      border: 1px solid rgba(139, 92, 246, .28);
      background: rgba(91, 33, 182, .08);
      color: #b8bfd5;
      font-size: 11px;
      margin-bottom: 10px;
    }

    .undo-banner {
      position: sticky;
      top: calc(49px + env(safe-area-inset-top));
      z-index: 90;
      max-width: 900px;
      margin: 0 auto;
      padding: 0 16px;
      display: none;
    }

    .undo-banner.show {
      display: block;
    }

    .undo-banner-inner {
      margin-top: 8px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 11px;
      border-radius: 12px;
      border: 1px solid rgba(255, 200, 87, .42);
      background: rgba(35, 29, 35, .96);
      box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
    }

    .undo-banner-copy {
      flex: 1;
      min-width: 0;
      color: #f7e9b3;
      font-size: 12px;
    }

    .undo-banner .btn {
      min-height: 38px;
      padding: 7px 12px;
      white-space: nowrap;
    }

    .data-tree {
      display: grid;
      gap: 9px;
    }

    .tree-group {
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      background: linear-gradient(155deg, rgba(17, 21, 42, .98), rgba(11, 15, 31, .98));
    }

    .tree-head-row {
      display: flex;
      align-items: stretch;
      min-height: 58px;
    }

    .tree-head {
      flex: 1;
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 20px;
      align-items: center;
      gap: 10px;
      padding: 12px 13px;
      border: 0;
      background: none;
      color: var(--text);
      text-align: left;
      cursor: pointer;
    }

    .tree-head:active {
      background: rgba(139, 92, 246, .06);
    }

    .tree-chevron {
      width: 20px;
      color: #838ba7;
      font-size: 18px;
      line-height: 1;
      text-align: right;
    }

    .tree-chevron::before {
      content: '›';
    }

    .tree-group.open>.tree-head-row .tree-chevron::before {
      content: '⌄';
    }

    .tree-title-wrap {
      flex: 1;
      min-width: 0;
    }

    .tree-title {
      font-size: 15px;
      font-weight: 850;
      line-height: 1.2;
    }

    .tree-summary {
      margin-top: 7px;
      color: var(--text2);
      font-size: 11px;
      line-height: 1.35;
    }

    .tree-actions {
      width: 46px;
      flex: 0 0 46px;
      border: 0;
      border-left: 1px solid rgba(48, 56, 88, .65);
      background: rgba(24, 29, 53, .38);
      color: var(--text2);
      font-size: 20px;
      cursor: pointer;
    }

    .tree-actions:active {
      background: rgba(139, 92, 246, .10);
    }

    .tree-body {
      border-top: 1px solid rgba(48, 56, 88, .7);
      padding: 9px;
      display: grid;
      gap: 8px;
    }

    .month-group {
      border-radius: 11px;
      background: rgba(18, 23, 44, .72);
    }

    .month-group .tree-head-row {
      min-height: 54px;
    }

    .month-group .tree-title {
      font-size: 14px;
    }

    .week-group {
      border-radius: 10px;
      background: rgba(11, 15, 31, .72);
    }

    .week-group .tree-head-row {
      min-height: 48px;
    }

    .week-group .tree-title {
      font-size: 12px;
    }

    .week-group .tree-summary {
      margin-top: 4px;
      font-size: 10px;
    }

    .week-group .tree-body {
      padding: 7px;
      gap: 6px;
    }

    .tx-tree-row {
      width: 100%;
      display: grid;
      grid-template-columns: 10px minmax(0, 1fr) auto;
      gap: 9px;
      align-items: start;
      text-align: left;
      border: 1px solid rgba(48, 56, 88, .64);
      border-radius: 10px;
      background: rgba(19, 24, 46, .88);
      color: var(--text);
      padding: 10px;
      min-height: 62px;
      cursor: pointer;
    }

    .tx-tree-row:active {
      transform: scale(.996);
    }

    .tx-dot {
      grid-column: 1;
      grid-row: 1;
      align-self: center;
      width: 8px;
      height: 8px;
      margin-top: 3px;
      border-radius: 50%;
      background: #8b5cf6;
      box-shadow: 0 0 0 3px rgba(139, 92, 246, .08);
    }

    .tx-dot.income {
      background: var(--green);
      box-shadow: 0 0 0 3px rgba(78, 227, 162, .08);
    }

    .tx-dot.loan {
      background: var(--yellow);
      box-shadow: 0 0 0 3px rgba(255, 200, 87, .08);
    }

    .tx-dot.transfer {
      background: var(--blue);
      box-shadow: 0 0 0 3px rgba(96, 165, 250, .08);
    }

    .tx-dot.investment {
      background: #c084fc;
      box-shadow: 0 0 0 3px rgba(192, 132, 252, .08);
    }

    .tx-tree-main {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .tx-tree-label {
      min-width: 0;
      font-weight: 700;
      font-size: 13px;
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tx-tree-confidence {
      min-width: 0;
      min-height: 0;
    }

    .tx-tree-confidence:empty {
      display: none;
    }

    .tx-tree-confidence .confidence-pill {
      margin: 0;
    }

    .tx-tree-meta {
      min-width: 0;
      color: var(--text2);
      font-size: 10px;
      line-height: 1.35;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .tx-tree-amount {
      grid-column: 3;
      grid-row: 1;
      align-self: start;
      min-width: max-content;
      padding-left: 4px;
      font-weight: 850;
      font-size: 13px;
      white-space: nowrap;
      text-align: right;
    }

    .tx-tree-amount.income {
      color: var(--green);
    }

    .confidence-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 6px;
      border-radius: 999px;
      margin-left: 5px;
      font-size: 9px;
      font-weight: 800;
      vertical-align: 1px;
    }

    .confidence-pill.medium {
      color: var(--yellow);
      background: rgba(255, 200, 87, .10);
    }

    .confidence-pill.low {
      color: var(--red);
      background: rgba(255, 116, 116, .10);
    }

    .manage-mode-fields {
      display: grid;
      gap: 10px;
    }

    .manage-summary-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
      margin-top: 9px;
    }

    .manage-summary-item {
      border: 1px solid rgba(48, 56, 88, .8);
      border-radius: 8px;
      padding: 8px;
      background: rgba(17, 21, 42, .7);
    }

    .manage-summary-item span {
      display: block;
      color: var(--text2);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .manage-summary-item strong {
      display: block;
      margin-top: 2px;
      color: var(--text);
      font-size: 13px;
    }

    .dev-clock {
      margin: 10px 0 14px;
      padding: 11px;
      border: 1px dashed rgba(139, 92, 246, .42);
      border-radius: 10px;
      background: rgba(91, 33, 182, .08);
    }

    .dev-clock-row {
      display: flex;
      gap: 8px;
      align-items: end;
      flex-wrap: wrap;
    }

    .dev-clock-row .form-group {
      flex: 1;
      min-width: 170px;
      margin-bottom: 0;
    }

    .dev-clock-row .btn {
      min-height: 44px;
    }

    .manual-type-note {
      margin: -4px 0 12px;
      color: var(--text2);
      font-size: 11px;
      line-height: 1.45;
    }

    .manual-gas-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .manual-gas-grid .wide {
      grid-column: 1/-1;
    }

    /*=========================================================
             P2P / EFFECTIVE SPENDING
             ========================================================= */

    .badge.person-to-person {
      color: #f9a8d4;
      background: rgba(236, 72, 153, .11);
    }

    .tx-dot.person-to-person {
      background: #f472b6;
      box-shadow: 0 0 0 3px rgba(244, 114, 182, .09);
    }

    .p2p-memory-note {
      margin-top: 7px;
      color: #f9a8d4;
      font-size: 10px;
      font-weight: 750;
    }

    .p2p-fields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .p2p-fields .wide {
      grid-column: 1/-1;
    }

    .effective-context {
      color: var(--text2);
      font-size: 10px;
      margin-top: 3px;
    }

    .tree-summary {
      display: block;
    }

    .tree-group:not(.week-group)>.tree-head-row .tree-summary {
      margin-left: 13px;
    }

    .week-group>.tree-head-row .tree-summary {
      margin-left: 0;
    }

    /*=========================================================
             FINANCE ANALYTICS / SUBCATEGORY DISCLOSURE
             ========================================================= */

    .pace-insight {
      margin-top: 10px;
      padding: 10px 12px;
      border: 1px solid rgba(139, 92, 246, .28);
      border-radius: 10px;
      background: rgba(91, 33, 182, .08);
      color: #c9c4dc;
      font-size: 11px;
      line-height: 1.45;
    }

    .pace-insight strong {
      color: var(--text);
    }

    .average-text {
      color: #aeb4cc;
      font-size: 10px;
      margin-top: 2px;
      white-space: nowrap;
    }

    .composition-list {
      display: grid;
      gap: 10px;
    }

    .composition-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 4px 10px;
      align-items: center;
    }

    .composition-name {
      min-width: 0;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .composition-amount {
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .composition-track {
      grid-column: 1/-1;
      height: 7px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(48, 56, 88, .65);
    }

    .composition-fill {
      height: 100%;
      min-width: 2px;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--accent), var(--pink));
    }

    .composition-row.offset .composition-name,
    .composition-row.offset .composition-amount {
      color: #f9a8d4;
    }

    .composition-row.offset .composition-track {
      height: 5px;
      border: 1px dashed rgba(244, 114, 182, .34);
      background: transparent;
    }

    .composition-footer {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      color: var(--text2);
      font-size: 11px;
    }

    .composition-footer strong {
      color: var(--text);
      white-space: nowrap;
    }

    .finance-subcategory {
      border-bottom: 1px solid rgba(48, 56, 88, .62);
    }

    .finance-subcategory:last-child {
      border-bottom: 0;
    }

    .finance-subcategory > summary {
      list-style: none;
      min-height: 58px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 22px;
      gap: 10px;
      align-items: center;
      padding: 9px 0;
      cursor: pointer;
    }

    .finance-subcategory > summary::-webkit-details-marker {
      display: none;
    }

    .finance-subcategory > summary::after {
      content: '›';
      color: var(--text2);
      font-size: 20px;
      line-height: 1;
      text-align: right;
    }

    .finance-subcategory[open] > summary::after {
      content: '⌄';
    }

    .subcategory-main {
      min-width: 0;
    }

    .subcategory-title {
      min-width: 0;
      font-size: 13px;
      font-weight: 750;
      overflow-wrap: anywhere;
    }

    .subcategory-amount {
      margin-top: 2px;
      font-size: 13px;
      font-weight: 800;
      white-space: nowrap;
      text-align: left;
    }

    .subcategory-meta {
      margin-top: 2px;
      color: var(--text2);
      font-size: 10px;
      line-height: 1.35;
      text-align: left;
    }

    .subcategory-body {
      padding: 0 30px 10px 0;
    }

    .subcategory-actions {
      display: flex;
      justify-content: flex-end;
      margin: 4px 0 6px;
    }

    .field-helper {
      color: var(--text2);
      font-size: 10px;
      line-height: 1.35;
      margin-top: 4px;
    }

    .p2p-memory-review {
      margin: 8px 0 10px;
      padding: 8px 9px;
      border-radius: 8px;
      border: 1px solid rgba(236, 72, 153, .24);
      background: rgba(236, 72, 153, .07);
      color: #f9a8d4;
      font-size: 10px;
      line-height: 1.4;
    }

    /*=========================================================
             RECURRING PAYMENTS / OVERALL SPENDING TREND
             ========================================================= */

    .recurring-list {
      display: grid;
      gap: 9px;
    }

    .recurring-payment-row,
    .recurring-candidate-row {
      display: grid;
      grid-template-columns: minmax(0,1fr) auto;
      gap: 8px 10px;
      align-items: center;
      padding: 11px;
      border: 1px solid rgba(48,56,88,.72);
      border-radius: 11px;
      background: rgba(18,23,44,.62);
    }

    .recurring-payment-name {
      min-width: 0;
      font-size: 13px;
      font-weight: 800;
      overflow-wrap: anywhere;
    }

    .recurring-payment-meta {
      color: var(--text2);
      font-size: 10px;
      line-height: 1.45;
      margin-top: 3px;
    }

    .recurring-payment-amount {
      font-size: 12px;
      font-weight: 850;
      text-align: right;
      white-space: nowrap;
    }

    .recurring-row-actions {
      grid-column: 1/-1;
      display: flex;
      gap: 7px;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .recurring-row-actions .btn {
      min-height: 34px;
      padding: 6px 10px;
      font-size: 11px;
    }

    .recurring-subhead {
      margin: 13px 0 7px;
      padding-top: 11px;
      border-top: 1px solid var(--border);
      color: #d9d3ef;
      font-size: 11px;
      font-weight: 800;
    }

    .recurring-badge {
      display: inline-flex;
      align-items: center;
      margin-left: 5px;
      padding: 2px 6px;
      border-radius: 999px;
      color: #f9a8d4;
      background: rgba(236,72,153,.10);
      font-size: 9px;
      font-weight: 800;
      vertical-align: 1px;
    }

    .overall-trend-card {
      padding: 13px 14px;
      overflow: hidden;
    }

    .overall-trend-summary {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 5px 12px;
      align-items: end;
    }

    .overall-trend-value {
      font-size: 22px;
      line-height: 1.05;
      font-weight: 900;
      letter-spacing: -.02em;
    }

    .overall-trend-context {
      color: var(--text2);
      font-size: 10px;
      text-align: right;
      line-height: 1.4;
    }

    .compact-trend-canvas {
      width: 100%;
      max-width: 100%;
      height: 64px;
      display: block;
      margin: 7px 0 5px;
      cursor: pointer;
    }

    .overall-trend-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      color: var(--text2);
      font-size: 10px;
    }

    .trend-modal-summary {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 10px;
    }

    .trend-modal-stat {
      padding: 9px;
      border-radius: 9px;
      background: var(--bg3);
      border: 1px solid var(--border);
    }

    .trend-modal-stat span {
      display: block;
      color: var(--text2);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .trend-modal-stat strong {
      display: block;
      margin-top: 2px;
      color: var(--text);
      font-size: 13px;
    }

    /*=========================================================
             SETTINGS
             ========================================================= */

    body.settings-open,
    body.modal-open {
      overflow: hidden;
    }

    .settings-overlay {
      position: fixed;
      inset: 0;
      z-index: 245;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding: max(10px, env(safe-area-inset-top)) 10px 10px;
      background: rgba(0,0,0,.74);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .16s;
    }

    .settings-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    .settings-sheet {
      width: 100%;
      max-width: 620px;
      height: min(92dvh,900px);
      max-height: calc(100dvh - max(20px, env(safe-area-inset-top)));
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: linear-gradient(160deg,#14192f,#0c1022);
      border: 1px solid #394266;
      border-radius: 20px 20px 16px 16px;
      box-shadow: 0 28px 80px rgba(0,0,0,.48);
      transform: translateY(14px);
      transition: transform .16s;
    }

    .settings-overlay.show .settings-sheet {
      transform: none;
    }

    .settings-header {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 17px 18px 14px;
      border-bottom: 1px solid var(--border);
      background: rgba(16,20,40,.96);
    }

    .settings-heading {
      flex: 1;
      min-width: 0;
    }

    .settings-heading h2 {
      font-size: 22px;
      line-height: 1.15;
    }

    .settings-close {
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg3);
      color: var(--text);
      font-size: 24px;
      cursor: pointer;
    }

    .settings-body {
      flex: 1;
      overflow: auto;
      padding: 12px 14px calc(22px + env(safe-area-inset-bottom));
    }

    .settings-intro {
      color: var(--text2);
      font-size: 12px;
      line-height: 1.5;
      margin: 0 2px 11px;
    }

    .settings-section {
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      margin-bottom: 10px;
      background: linear-gradient(155deg,rgba(18,23,44,.98),rgba(11,15,31,.98));
    }

    .settings-section > summary {
      list-style: none;
      min-height: 62px;
      display: grid;
      grid-template-columns: 32px minmax(0,1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 12px 13px;
      cursor: pointer;
      user-select: none;
    }

    .settings-section > summary::-webkit-details-marker {
      display: none;
    }

    .settings-icon {
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: rgba(139,92,246,.13);
      border: 1px solid rgba(139,92,246,.24);
      font-size: 16px;
    }

    .settings-summary-title {
      font-size: 14px;
      font-weight: 850;
    }

    .settings-summary-copy {
      color: var(--text2);
      font-size: 10px;
      line-height: 1.35;
      margin-top: 2px;
    }

    .settings-chevron {
      color: var(--text2);
      font-size: 18px;
      transition: transform .15s;
    }

    .settings-section[open] .settings-chevron {
      transform: rotate(90deg);
    }

    .settings-section-body {
      border-top: 1px solid var(--border);
      padding: 12px;
    }

    .settings-card {
      padding: 12px;
      border: 1px solid rgba(48,56,88,.74);
      border-radius: 11px;
      background: rgba(24,29,53,.62);
      margin-bottom: 9px;
    }

    .settings-card:last-child {
      margin-bottom: 0;
    }

    .settings-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .settings-card-head > div:first-child {
      flex: 1;
      min-width: 0;
    }

    .settings-card-title {
      font-size: 13px;
      font-weight: 850;
      overflow-wrap: anywhere;
    }

    .settings-card-meta {
      color: var(--text2);
      font-size: 10px;
      line-height: 1.45;
      margin-top: 3px;
      overflow-wrap: anywhere;
    }

    .settings-card-value {
      color: #d9d3ef;
      font-size: 12px;
      font-weight: 800;
      text-align: right;
      max-width: 46%;
      overflow-wrap: anywhere;
    }

    .settings-card-actions {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      justify-content: flex-end;
      margin-top: 9px;
    }

    .settings-card-actions .btn {
      min-height: 44px;
      padding: 7px 10px;
      font-size: 11px;
    }

    .settings-toolbar {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .settings-toolbar .btn {
      flex: 1;
      min-width: 150px;
    }

    .settings-count-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit,minmax(105px,1fr));
      gap: 7px;
      margin-bottom: 10px;
    }

    .settings-count {
      padding: 9px 7px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg3);
      text-align: center;
    }

    .settings-count strong {
      display: block;
      font-size: 17px;
    }

    .settings-count span {
      display: block;
      color: var(--text2);
      font-size: 9px;
      line-height: 1.25;
      margin-top: 2px;
    }

    .settings-subhead {
      margin: 14px 0 7px;
      color: #d9d3ef;
      font-size: 11px;
      font-weight: 850;
    }

    .settings-subhead:first-child {
      margin-top: 0;
    }

    .settings-empty {
      padding: 13px;
      border: 1px dashed var(--border);
      border-radius: 10px;
      color: var(--text2);
      font-size: 11px;
      text-align: center;
    }

    .settings-danger-zone {
      margin-top: 11px;
      padding-top: 11px;
      border-top: 1px solid rgba(255,116,116,.20);
      display: grid;
      gap: 7px;
    }

    .settings-status {
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 9px;
      font-weight: 850;
    }

    .settings-status.confirmed {
      color: var(--green);
      background: rgba(78,227,162,.10);
    }

    .settings-status.dismissed {
      color: var(--yellow);
      background: rgba(255,200,87,.10);
    }

    .settings-form-note {
      color: var(--text2);
      font-size: 10px;
      line-height: 1.45;
      margin-top: 5px;
    }

    .settings-credential-row {
      display: grid;
      grid-template-columns: minmax(0,1fr) auto;
      gap: 7px;
      align-items: end;
    }

    .settings-credential-row .form-group {
      margin-bottom: 0;
    }

    .settings-data-actions {
      display: grid;
      gap: 8px;
    }

    .settings-data-action {
      width: 100%;
      justify-content: flex-start;
      text-align: left;
      min-height: 50px;
    }

    .settings-data-copy {
      flex: 1;
      min-width: 0;
    }

    .settings-data-copy strong {
      display: block;
    }

    .settings-data-copy span {
      display: block;
      color: var(--text2);
      font-size: 10px;
      font-weight: 500;
      margin-top: 2px;
    }

    .paycheck-editor-mode {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .paycheck-editor-mode .wide {
      grid-column: 1/-1;
    }

    /*=========================================================
             V3.8.2 HOME ONBOARDING / GLOBAL SETTINGS ACCESS
             ========================================================= */

    .home-onboarding {
      margin: 10px 0 18px;
      padding: 14px;
      border: 1px solid rgba(139, 92, 246, .36);
      border-radius: 16px;
      background: linear-gradient(145deg, rgba(39, 27, 75, .58), rgba(17, 21, 42, .94));
      box-shadow: 0 14px 34px rgba(55, 28, 110, .15);
    }

    .home-onboarding-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 11px;
    }

    .home-onboarding-head > div:first-child {
      flex: 1;
      min-width: 0;
    }

    .home-onboarding-title {
      font-size: 14px;
      font-weight: 900;
    }

    .home-onboarding-copy {
      color: var(--text2);
      font-size: 11px;
      line-height: 1.45;
      margin-top: 3px;
    }

    .home-onboarding-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .home-onboarding-action {
      min-height: 62px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 9px;
      text-align: left;
      padding: 10px 11px;
    }

    .home-onboarding-action > span:first-child {
      font-size: 18px;
      flex: 0 0 auto;
    }

    .home-onboarding-action strong {
      display: block;
      font-size: 12px;
    }

    .home-onboarding-action small {
      display: block;
      color: var(--text2);
      font-size: 9px;
      line-height: 1.35;
      margin-top: 2px;
      font-weight: 500;
    }

    .home-install-status {
      margin-top: 9px;
      color: var(--text2);
      font-size: 9px;
      line-height: 1.4;
    }

    /*=========================================================
             PHONE / HOME SCREEN EXPERIENCE
             ========================================================= */

    .install-status {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid rgba(139,92,246,.30);
      background: rgba(139,92,246,.09);
      color: #c4b5fd;
      font-size: 10px;
      font-weight: 850;
    }

    .install-status.detected {
      color: var(--green);
      border-color: rgba(78,227,162,.30);
      background: rgba(78,227,162,.08);
    }

    .install-guide {
      display: grid;
      gap: 12px;
      margin-top: 12px;
    }

    .install-platform {
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: rgba(24,29,53,.58);
    }

    .install-platform h3 {
      color: var(--text);
      font-size: 13px;
      margin-bottom: 6px;
    }

    .install-steps {
      margin: 0;
      padding-left: 20px;
      color: #c5cadb;
      font-size: 12px;
      line-height: 1.55;
    }

    .install-steps li + li {
      margin-top: 4px;
    }

    .install-note {
      padding: 10px 11px;
      border-radius: 10px;
      border: 1px solid rgba(255,200,87,.26);
      background: rgba(255,200,87,.07);
      color: #e6d9ad;
      font-size: 10px;
      line-height: 1.5;
    }

    /*=========================================================
             RESPONSIVE / MOBILE
             ========================================================= */

    @media (max-width:520px) {
      .home-onboarding-head {
        flex-direction: column;
      }
      .home-onboarding-actions {
        grid-template-columns: 1fr;
      }
      .settings-overlay {
        padding: max(6px, env(safe-area-inset-top)) 6px 6px;
      }
      .settings-sheet {
        height: calc(100dvh - max(6px, env(safe-area-inset-top)) - 6px);
        max-height: calc(100dvh - max(6px, env(safe-area-inset-top)) - 6px);
        border-radius: 18px 18px 12px 12px;
      }
      .settings-card-head {
        flex-direction: column;
      }
      .settings-card-value {
        max-width: none;
        text-align: left;
      }
      .settings-credential-row {
        grid-template-columns: 1fr;
      }
      .settings-credential-row .btn {
        width: 100%;
      }
      .paycheck-editor-mode {
        grid-template-columns: 1fr;
      }
      .paycheck-editor-mode .wide {
        grid-column: auto;
      }
      .p2p-fields {
        grid-template-columns: 1fr;
      }
      .p2p-fields .wide {
        grid-column: auto;
      }
      .undo-banner-inner,
      .finance-view-actions {
        align-items: flex-start;
      }
      .finance-month-viewer {
        grid-template-columns: 42px minmax(0,1fr) 42px;
        gap: 8px;
      }
      .month-nav-btn {
        width: 42px;
        max-width: 42px;
      }
      .accordion-head {
        grid-template-columns: minmax(0,1fr) 22px;
        gap: 9px;
      }
      .accordion-head .right {
        display: grid;
        gap: 1px;
      }
      .accordion-head .trend-text,
      .accordion-head .average-text {
        white-space: normal;
      }
      .dev-clock-row {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .dev-clock-row .form-group {
        min-width: 0;
        width: 100%;
      }
      .dev-clock-row input[type="date"],
      .dev-clock-row .btn {
        width: 100%;
      }
      .dev-demo-actions {
        grid-template-columns: 1fr;
      }
      .tx-tree-label {
        white-space: normal;
        overflow-wrap: anywhere;
      }
      .tx-tree-meta {
        padding-right: 2px;
      }
    }

    @media (min-width:680px) {
      .modal-overlay {
        align-items: center;
      }
      .filters {
        grid-template-columns: 2fr 1fr 1fr 1fr;
      }
      .filters .search {
        grid-column: auto;
      }
      .tx-tree-meta {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    /*=========================================================
             REDUCED MOTION
             ========================================================= */

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