    :root {
      color-scheme: dark;
      --ink: #edf3f0;
      --muted: #91a09a;
      --line: rgba(178, 195, 188, .18);
      --panel: #111a1d;
      --panel-strong: #162225;
      --paper: #0b1114;
      --green: #42d392;
      --red: #ff6b7a;
      --blue: #7eb6ff;
      --gold: #e8bd55;
      --teal: #64d8cb;
      --violet: #8f7dff;
      --shadow: 0 14px 32px rgba(0, 0, 0, .22);
      --glow: 0 0 0 1px rgba(178, 195, 188, .1), 0 14px 30px rgba(0, 0, 0, .2);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--paper);
      color: var(--ink);
    }

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

    button {
      border: 1px solid var(--line);
      background: #172326;
      color: var(--ink);
      min-height: 38px;
      border-radius: 7px;
      padding: 8px 12px;
      cursor: pointer;
      box-shadow: none;
      transition: border-color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
    }

    button:hover {
      border-color: rgba(56, 227, 210, .5);
      box-shadow: none;
      transform: translateY(-1px);
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 244px 1fr;
    }

    .sidebar {
      background: #0e171a;
      color: #eefcff;
      padding: 22px 16px;
      display: flex;
      flex-direction: column;
      gap: 18px;
      position: sticky;
      top: 0;
      height: 100vh;
      border-right: 1px solid var(--line);
      box-shadow: none;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 11px;
      font-weight: 800;
      font-size: 20px;
      letter-spacing: 0;
    }

    .mark {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: #dce9e4;
      color: #061116;
      font-weight: 900;
      box-shadow: none;
    }

    .nav,
    .nav-group {
      display: grid;
      gap: 7px;
    }

    .nav-group {
      padding: 8px 0 10px;
      border-top: 1px solid rgba(255,255,255,.07);
    }

    .nav-group:first-child {
      border-top: 0;
      padding-top: 0;
    }

    .nav-heading {
      color: #748882;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .08em;
      line-height: 1;
      padding: 0 10px 2px;
      text-transform: uppercase;
    }

    .nav button {
      color: #d7eef2;
      background: transparent;
      border-color: rgba(255,255,255,.04);
      text-align: left;
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 36px;
      padding: 8px 10px;
    }

    .nav button.active {
      background: #172326;
      border-color: rgba(100,216,203,.34);
      color: white;
      box-shadow: none;
    }

    .sidebar-note {
      margin-top: auto;
      border-top: 1px solid rgba(56,227,210,.16);
      padding-top: 16px;
      color: #91aeb8;
      font-size: 13px;
      line-height: 1.45;
    }

    .build-label {
      color: #7f98a2;
      font-size: 12px;
      line-height: 1.45;
    }

    .build-label strong {
      display: block;
      color: #d7eef2;
      font-size: 13px;
      font-weight: 700;
    }

    main {
      padding: 22px 26px 38px;
      display: grid;
      gap: 16px;
      align-content: start;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
      border: 1px solid var(--line);
      background: #101a1d;
      border-radius: 8px;
      padding: 12px 14px;
      box-shadow: var(--glow);
      backdrop-filter: none;
    }

    h1, h2, h3, p { margin: 0; }

    h1 { font-size: 28px; letter-spacing: 0; }
    h2 { font-size: 18px; color: #f5fdff; }
    h3 { font-size: 15px; }

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

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

    .toolbar-primary,
    .toolbar-secondary {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .toolbar-secondary button {
      min-height: 34px;
      padding: 7px 10px;
    }

    #installAppBtn {
      border-color: rgba(126, 182, 255, .48);
      color: #d8e9ff;
    }

    .primary {
      background: var(--green);
      color: #051116;
      border-color: rgba(155, 255, 232, .65);
      font-weight: 800;
    }

    .danger {
      color: var(--red);
      border-color: rgba(255, 102, 119, .35);
      background: rgba(65, 20, 30, .6);
    }

    .grid {
      display: grid;
      gap: 14px;
    }

    .stats {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-hero {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
      gap: 14px;
      align-items: stretch;
    }

    .hero-panel {
      background: #fbfcfa;
      border: 1px solid rgba(32, 48, 52, .12);
      border-radius: 8px;
      box-shadow: 0 8px 18px rgba(23, 35, 38, .06);
      padding: 18px;
      display: grid;
      gap: 10px;
    }

    .hero-panel h2 {
      font-size: 24px;
      line-height: 1.15;
    }

    .hero-panel .actions {
      margin-top: 4px;
    }

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

    .focus-item {
      background: #ffffff;
      border: 1px solid rgba(32, 48, 52, .1);
      border-radius: 8px;
      padding: 12px;
      display: grid;
      gap: 6px;
      min-height: 94px;
    }

    .focus-item strong {
      font-size: 13px;
      color: #172326;
    }

    .focus-item span {
      color: #697a74;
      font-size: 13px;
      line-height: 1.35;
    }

    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      padding: 14px;
      backdrop-filter: none;
      position: relative;
      overflow: hidden;
    }

    .card::before {
      content: "";
      position: absolute;
      inset: 0;
      border-top: 1px solid rgba(255,255,255,.08);
      pointer-events: none;
    }

    .card-layout-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 255, 255, .58);
      padding: 10px 12px;
      margin-bottom: 12px;
    }

    .card-layout-bar strong {
      color: #172326;
      font-size: 13px;
    }

    .card-layout-actions,
    .card-config-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }

    .card-config-actions {
      justify-content: flex-end;
      margin-bottom: 8px;
      margin-left: auto;
    }

    .panel-head .card-config-actions {
      margin-bottom: 0;
    }

    .card-layout-actions button,
    .card-config-actions button {
      min-height: 24px;
      min-width: 24px;
      padding: 3px 7px;
      font-size: 11px;
      line-height: 1;
      border-radius: 999px;
      box-shadow: none;
    }

    .card[data-card-hidden="true"] {
      display: none !important;
    }

    .card[data-layout-card="true"] {
      cursor: default;
    }

    .card[data-card-size="wide"] {
      grid-column: span 2;
    }

    .card[data-card-size="full"] {
      grid-column: 1 / -1;
    }

    .card[data-card-height="tall"] {
      min-height: 420px;
    }

    .card-resize-handle {
      position: absolute;
      right: 7px;
      bottom: 7px;
      width: 20px;
      height: 20px;
      min-height: 20px;
      padding: 0;
      border-radius: 6px;
      border: 1px solid rgba(31, 122, 85, .24);
      background: rgba(255, 255, 255, .72);
      cursor: nwse-resize;
      touch-action: none;
      z-index: 3;
    }

    .card-resize-handle::before {
      content: "";
      position: absolute;
      right: 5px;
      bottom: 5px;
      width: 8px;
      height: 8px;
      border-right: 2px solid rgba(31, 122, 85, .74);
      border-bottom: 2px solid rgba(31, 122, 85, .74);
    }

    .card.card-resizing {
      cursor: nwse-resize;
      user-select: none;
      outline: 2px solid rgba(31, 122, 85, .28);
    }

    .card[data-card-custom-height="true"] {
      align-self: start;
      overflow: hidden;
    }

    .card[data-card-custom-width="true"] {
      justify-self: start;
      max-width: 100%;
    }

    .card[data-card-custom-height="true"] > .grid,
    .card[data-card-custom-height="true"] > .budget-list,
    .card[data-card-custom-height="true"] > .goal-list,
    .card[data-card-custom-height="true"] > .connector-list,
    .card[data-card-custom-height="true"] > .bill-list,
    .card[data-card-custom-height="true"] > .chart,
    .card[data-card-custom-height="true"] > .import-box,
    .card[data-card-custom-height="true"] > form,
    .card[data-card-custom-height="true"] .chat {
      overflow: auto;
    }

    .card-size-label {
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      padding: 5px 8px;
      border: 1px solid rgba(32, 48, 52, .1);
      border-radius: 999px;
      background: rgba(238, 245, 240, .8);
      white-space: nowrap;
    }

    .card.card-dragging {
      opacity: .58;
      outline: 2px dashed rgba(31, 122, 85, .38);
    }

    .hidden-card-list {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }

    .stat {
      display: grid;
      gap: 8px;
      min-height: 112px;
    }

    .stat .label {
      color: var(--muted);
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    .stat .value {
      font-size: 28px;
      font-weight: 800;
      overflow-wrap: anywhere;
      color: #ffffff;
      text-shadow: none;
    }

    .split {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(330px, .9fr);
      gap: 12px;
      align-items: start;
    }

    .section {
      display: none;
      gap: 12px;
    }

    .section.active { display: grid; }

    .panel-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 14px;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
      gap: 10px;
      align-items: end;
    }

    label {
      display: grid;
      gap: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      background: rgba(4, 13, 19, .76);
      color: var(--ink);
      min-height: 38px;
      border-radius: 7px;
      padding: 8px 10px;
      outline: none;
      box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
    }

    input:focus, select:focus, textarea:focus {
      border-color: rgba(56, 227, 210, .62);
      box-shadow: 0 0 0 3px rgba(56, 227, 210, .1), 0 0 24px rgba(56, 227, 210, .08);
    }

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

    table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    th, td {
      padding: 11px 9px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: middle;
      overflow-wrap: anywhere;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .amount { text-align: right; font-variant-numeric: tabular-nums; }
    .income { color: var(--green); }
    .expense { color: var(--red); }

    .date-repair {
      display: grid;
      gap: 5px;
      min-width: 132px;
    }

    .date-repair input {
      width: 100%;
      min-width: 0;
    }

    .progress {
      height: 10px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(4, 13, 19, .82);
      border: 1px solid rgba(255,255,255,.04);
    }

    .bar {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, var(--teal), var(--green));
      transition: width .25s ease;
      box-shadow: 0 0 18px rgba(53, 227, 159, .32);
    }

    .bar.warning { background: var(--gold); }
    .bar.over { background: var(--red); }

    .budget-list, .goal-list, .connector-list, .bill-list {
      display: grid;
      gap: 10px;
    }

    .row-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      display: grid;
      gap: 8px;
      background: #0e171a;
    }

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

    #tools {
      gap: 10px;
    }

    #tools .stats {
      gap: 10px;
    }

    #tools .stat {
      min-height: 92px;
      gap: 5px;
      padding: 12px;
    }

    #tools .stat .value {
      font-size: 24px;
    }

    #tools .split {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    #tools .card {
      padding: 12px;
    }

    #tools .panel-head {
      margin-bottom: 9px;
    }

    #tools .budget-list {
      gap: 7px;
    }

    #tools .row-card {
      padding: 9px 10px;
      gap: 5px;
    }

    #tools .form-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    #tools textarea {
      min-height: 66px;
    }

    .section-kicker {
      color: #697a74;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
      margin: 4px 0 -4px;
    }

    .compact-panel {
      display: grid;
      gap: 10px;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      width: fit-content;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      color: var(--muted);
      background: rgba(5, 17, 24, .75);
    }

    .connection-pill {
      color: var(--muted);
      border-color: var(--line);
    }

    .connection-pill::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: var(--muted);
      box-shadow: 0 0 0 3px rgba(143, 163, 166, .12);
    }

    .connection-pill.online {
      color: #d9fff4;
      border-color: rgba(53, 227, 159, .45);
      background: rgba(53, 227, 159, .12);
    }

    .connection-pill.online::before {
      background: var(--green);
      box-shadow: 0 0 0 3px rgba(53, 227, 159, .18), 0 0 14px rgba(53, 227, 159, .45);
    }

    .connection-pill.offline {
      color: #ffd8d8;
      border-color: rgba(255, 107, 107, .42);
      background: rgba(255, 107, 107, .10);
    }

    .connection-pill.offline::before {
      background: var(--red);
      box-shadow: 0 0 0 3px rgba(255, 107, 107, .16);
    }

    .chart {
      min-height: 260px;
      display: grid;
      gap: 10px;
    }

    .chart-row {
      display: grid;
      grid-template-columns: 105px 1fr 76px;
      align-items: center;
      gap: 10px;
      font-size: 13px;
    }

    .chart-track {
      height: 16px;
      background: rgba(4, 13, 19, .82);
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid rgba(255,255,255,.04);
    }

    .chart-fill {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, var(--blue), var(--teal));
      box-shadow: 0 0 18px rgba(88, 199, 255, .28);
    }

    .insight {
      border-left: 4px solid var(--teal);
      padding: 10px 12px;
      background: rgba(56, 227, 210, .08);
      border-radius: 6px;
      color: #d7fbff;
      line-height: 1.45;
    }

    .empty {
      color: var(--muted);
      text-align: center;
      padding: 28px 16px;
      border: 1px dashed var(--line);
      border-radius: 8px;
      background: rgba(5, 17, 24, .48);
    }

    .chat {
      min-height: 430px;
      max-height: 58vh;
      overflow-y: auto;
      display: grid;
      gap: 10px;
      align-content: start;
      padding-right: 4px;
    }

    .message {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      line-height: 1.45;
      max-width: 84%;
      white-space: pre-wrap;
    }

    .message.ai {
      background: rgba(56, 227, 210, .08);
      border-color: rgba(56, 227, 210, .2);
    }

    .message.user {
      justify-self: end;
      background: rgba(242, 201, 76, .08);
      border-color: rgba(242, 201, 76, .22);
    }

    .floating-ai {
      position: fixed;
      right: 4px;
      bottom: 8px;
      z-index: 18;
      display: grid;
      justify-items: end;
      gap: 10px;
      pointer-events: none;
      transition: opacity .16s ease, visibility .16s ease;
    }

    body.modal-open .floating-ai {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .floating-ai-toggle {
      width: auto;
      min-width: 48px;
      height: 36px;
      min-height: 36px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      font-weight: 800;
      letter-spacing: 0;
      padding: 0 7px;
      font-size: 11px;
      background: #112327;
      color: #e9fff5;
      border-color: rgba(66, 211, 146, .46);
      box-shadow: 0 16px 34px rgba(13, 28, 31, .26);
      pointer-events: auto;
    }

    .floating-ai-panel {
      width: min(390px, calc(100vw - 36px));
      max-height: min(620px, calc(100vh - 108px));
      display: none;
      grid-template-rows: auto minmax(180px, 1fr) auto;
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(31, 122, 85, .22);
      border-radius: 8px;
      background: #f8fbf8;
      color: #182426;
      box-shadow: 0 20px 42px rgba(15, 27, 30, .22);
      pointer-events: auto;
    }

    .floating-ai.open .floating-ai-panel { display: grid; }

    .floating-ai-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border-bottom: 1px solid rgba(31, 122, 85, .14);
      padding-bottom: 8px;
    }

    .floating-ai-head strong { color: #172326; }

    .floating-ai-head span {
      display: block;
      color: #5f6f69;
      font-size: 12px;
      margin-top: 2px;
    }

    .floating-ai-close {
      min-height: 32px;
      width: 34px;
      padding: 0;
    }

    .floating-chat {
      overflow-y: auto;
      display: grid;
      align-content: start;
      gap: 8px;
      padding-right: 3px;
    }

    .floating-chat .message {
      max-width: 92%;
      font-size: 13px;
      padding: 10px;
    }

    .floating-ai-form {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: end;
    }

    .floating-ai-form textarea {
      min-height: 52px;
      max-height: 120px;
      resize: vertical;
    }

    .prompt-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: end;
    }

    .quick-prompts {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .import-box {
      border: 1px dashed rgba(88, 199, 255, .32);
      background: rgba(5, 17, 24, .52);
      border-radius: 8px;
      padding: 16px;
      display: grid;
      gap: 12px;
    }

    body.eula-pending,
    body.eula-required {
      overflow: hidden;
    }

    body.eula-pending > .app,
    body.eula-pending > .launch-account,
    body.eula-pending > .floating-ai,
    body.eula-required > .app,
    body.eula-required > .launch-account,
    body.eula-required > .floating-ai {
      visibility: hidden;
    }

    .eula-gate {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: none;
      place-items: center;
      overflow-y: auto;
      padding: 24px;
      background:
        radial-gradient(circle at 18% 8%, rgba(56, 227, 210, .16), transparent 34%),
        linear-gradient(145deg, #07131a, #102832 58%, #071118);
    }

    body.eula-pending .eula-gate,
    body.eula-required .eula-gate {
      display: grid;
    }

    .eula-gate-panel {
      width: min(860px, 100%);
      max-height: calc(100vh - 48px);
      display: grid;
      grid-template-rows: auto auto minmax(180px, 1fr) auto auto auto auto;
      gap: 14px;
      padding: clamp(20px, 4vw, 34px);
      overflow: hidden;
      color: #eaf6f5;
      background: linear-gradient(180deg, rgba(20, 42, 54, .99), rgba(8, 18, 26, .99));
      border: 1px solid rgba(100, 216, 203, .38);
      border-radius: 12px;
      box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
    }

    .eula-gate-brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .eula-gate-brand span {
      color: #64d8cb;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .16em;
    }

    .eula-gate-brand h1 {
      margin: 2px 0 0;
      font-size: clamp(24px, 4vw, 36px);
    }

    .eula-gate-mark {
      width: 50px;
      height: 50px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: #07131a;
      background: linear-gradient(135deg, #64d8cb, #f3c465);
      border-radius: 12px;
      font-size: 28px;
      font-weight: 900;
    }

    .eula-gate-panel > p {
      margin: 0;
      color: #c5d8d9;
    }

    .eula-gate-text {
      min-height: 180px;
      margin: 0;
      padding: 16px;
      overflow: auto;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      color: #dce9ea;
      background: rgba(2, 10, 15, .78);
      border: 1px solid rgba(100, 216, 203, .22);
      border-radius: 8px;
      font: 12px/1.55 "Segoe UI", system-ui, sans-serif;
      overscroll-behavior: contain;
    }

    .eula-gate-status {
      min-height: 20px;
      color: #a9c4c6 !important;
      font-size: 13px;
    }

    .eula-gate-status.is-error {
      color: #ffb0a8 !important;
    }

    .eula-gate-consent {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      color: #f3f7f7;
      font-weight: 700;
      line-height: 1.4;
      cursor: pointer;
    }

    .eula-gate-consent input {
      width: 20px;
      height: 20px;
      margin-top: 1px;
      flex: 0 0 auto;
      accent-color: #64d8cb;
    }

    .eula-gate-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
    }

    .eula-gate-actions button {
      min-width: 150px;
    }

    .eula-gate-links {
      text-align: center;
      font-size: 13px;
    }

    .eula-gate-links a {
      color: #78e8dc;
    }

    .toast {
      position: fixed;
      right: 18px;
      top: 18px;
      background: rgba(8, 22, 30, .96);
      color: white;
      padding: 12px 14px;
      border-radius: 8px;
      box-shadow: var(--shadow);
      border: 1px solid rgba(56,227,210,.24);
      display: none;
      max-width: min(360px, calc(100vw - 36px));
      z-index: 70;
    }

    .toast.show { display: block; }

    .modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 8, 13, .68);
      display: none;
      align-items: start;
      justify-items: center;
      padding: clamp(24px, 7vh, 72px) 20px 96px;
      overflow-y: auto;
      z-index: 60;
    }

    .modal.show { display: grid; }

    .modal-card {
      width: min(680px, 100%);
      max-height: calc(100vh - 128px);
      background: linear-gradient(180deg, rgba(20, 42, 54, .98), rgba(8, 18, 26, .98));
      border-radius: 8px;
      border: 1px solid var(--line);
      padding: 18px;
      box-shadow: var(--shadow);
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      gap: 12px;
      overflow: hidden;
    }

    #modalBody {
      min-height: 0;
      overflow-y: auto;
      padding-right: 4px;
      overscroll-behavior: contain;
    }

    /* Finance console polish layer */
    main {
      max-width: 1480px;
      width: 100%;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 4;
    }

    .topbar .actions button {
      min-height: 34px;
      padding: 7px 10px;
    }

    .stats {
      gap: 10px;
    }

    .stat {
      min-height: 96px;
      padding: 14px;
      border-left: 3px solid rgba(100, 216, 203, .48);
    }

    .stat .value {
      font-size: 25px;
      line-height: 1.05;
    }

    .card {
      box-shadow: none;
    }

    .card::before {
      display: none;
    }

    .panel-head {
      border-bottom: 1px solid rgba(178, 195, 188, .12);
      padding-bottom: 10px;
    }

    .budget-list, .goal-list, .connector-list, .bill-list {
      gap: 7px;
    }

    .row-card {
      padding: 10px 11px;
      gap: 6px;
    }

    .row-card .actions {
      padding-top: 2px;
    }

    table {
      background: #0e171a;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }

    th {
      background: #132023;
      color: #b8c8c2;
    }

    tr:hover td {
      background: rgba(100, 216, 203, .045);
    }

    .chart {
      min-height: 220px;
    }

    .chart-row {
      grid-template-columns: minmax(100px, 150px) 1fr 90px;
    }

    .insight {
      border-left-width: 3px;
      background: #0e1b1d;
      color: #dce9e4;
    }

    #dashboard .split {
      grid-template-columns: minmax(0, 1.35fr) minmax(340px, .8fr);
    }

    #ai .split {
      grid-template-columns: minmax(0, 1fr) 360px;
    }

    #ai .chat {
      min-height: 500px;
    }

    #budgets .card:has(#budgetList) {
      padding: 12px;
    }

    #budgetList .row-card {
      grid-template-columns: 1fr;
      border-left: 3px solid rgba(100, 216, 203, .42);
    }

    .quick-prompts button,
    .row-card button,
    .actions button {
      min-height: 32px;
    }

    /* UI refresh 0.16.1: light finance workspace, dark navigation rail */
    body {
      color-scheme: light;
      background: #e9eeeb;
      color: #192326;
    }

    .app {
      background: #e9eeeb;
    }

    .sidebar {
      background: #10191c;
      color: #eef6f2;
      border-right: 1px solid rgba(16, 25, 28, .18);
    }

    .brand,
    .build-label strong {
      color: #f4fbf7;
    }

    .mark {
      background: #e9f5ef;
      color: #0f1b1e;
    }

    .nav button {
      color: #b8c7c1;
      border-color: transparent;
      background: transparent;
    }

    .nav button:hover {
      background: rgba(255, 255, 255, .06);
      border-color: rgba(255, 255, 255, .08);
    }

    .nav button.active {
      background: #e9f5ef;
      color: #0f1b1e;
      border-color: transparent;
      font-weight: 800;
    }

    .sidebar-note,
    .build-label {
      color: #94a49d;
    }

    main {
      background: #e9eeeb;
    }

    .topbar {
      background: rgba(249, 251, 248, .94);
      color: #172326;
      border-color: rgba(32, 48, 52, .12);
      box-shadow: 0 10px 22px rgba(23, 35, 38, .08);
    }

    h1,
    h2,
    h3 {
      color: #172326;
    }

    .subtle,
    label,
    th {
      color: #697a74;
    }

    .card {
      background: #fbfcfa;
      color: #172326;
      border-color: rgba(32, 48, 52, .12);
      box-shadow: 0 8px 18px rgba(23, 35, 38, .06);
    }

    .stat {
      background: #fbfcfa;
      border-left-color: #42a87c;
    }

    .stat .value {
      color: #172326;
    }

    input,
    select,
    textarea {
      background: #ffffff;
      color: #172326;
      border-color: rgba(32, 48, 52, .16);
    }

    button {
      background: #ffffff;
      color: #172326;
      border-color: rgba(32, 48, 52, .16);
    }

    button:hover {
      border-color: rgba(66, 168, 124, .55);
      background: #f5faf7;
    }

    .primary {
      background: #1f7a55;
      color: #ffffff;
      border-color: #1f7a55;
    }

    .danger {
      background: #fff4f5;
      color: #b42335;
      border-color: rgba(180, 35, 53, .26);
    }

    .row-card,
    table,
    .import-box,
    .empty,
    .modal-card {
      background: #ffffff;
      color: #172326;
      border-color: rgba(32, 48, 52, .12);
    }

    .panel-head,
    th,
    td {
      border-color: rgba(32, 48, 52, .1);
    }

    th {
      background: #f0f5f1;
    }

    tr:hover td {
      background: #f7faf8;
    }

    .pill {
      background: #eef5f0;
      color: #51625b;
      border-color: rgba(32, 48, 52, .12);
    }

    .progress,
    .chart-track {
      background: #e7eee9;
      border-color: rgba(32, 48, 52, .08);
    }

    .bar,
    .chart-fill {
      background: #1f7a55;
      box-shadow: none;
    }

    .bar.warning {
      background: #c9861a;
    }

    .bar.over {
      background: #c33f51;
    }

    .income {
      color: #16724e;
    }

    .expense {
      color: #bd3045;
    }

    .insight,
    .message.ai {
      background: #eef7f1;
      color: #203034;
      border-color: rgba(31, 122, 85, .22);
    }

    .full-locked {
      position: relative;
      overflow: hidden;
    }

    .full-locked > *:not(.premium-lock) {
      filter: grayscale(.15);
      opacity: .38;
      pointer-events: none;
      user-select: none;
    }

    .premium-lock {
      position: absolute;
      inset: 10px;
      z-index: 4;
      display: grid;
      place-items: center;
      padding: 16px;
      text-align: center;
      background: rgba(250, 252, 248, .9);
      border: 1px solid rgba(31, 122, 85, .22);
      border-radius: 8px;
      box-shadow: 0 16px 36px rgba(20, 35, 34, .14);
    }

    .premium-lock strong {
      display: block;
      margin-bottom: 6px;
      color: #172326;
    }

    .premium-lock .actions {
      justify-content: center;
      margin-top: 10px;
    }

    .message.user {
      background: #fff8e8;
      color: #203034;
      border-color: rgba(201, 134, 26, .26);
    }

    .toast {
      background: #172326;
      color: #ffffff;
    }

    .modal {
      background: rgba(15, 27, 30, .48);
    }

    /* Natural card rhythm with user-controlled dimensions. */
    .section.active {
      align-items: start;
    }

    .dashboard-hero,
    .focus-strip,
    .split {
      align-items: start;
    }

    .stats { align-items: stretch; }

    .stats {
      grid-auto-rows: minmax(106px, auto);
    }

    .split {
      grid-auto-rows: auto;
    }

    .card,
    .hero-panel,
    .focus-item,
    .stat {
      height: auto;
      min-width: 0;
    }

    .card {
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .card > .grid,
    .card > .budget-list,
    .card > .goal-list,
    .card > .connector-list,
    .card > .bill-list,
    .card > .chart,
    .card > .import-box,
    .card > form {
      min-height: 0;
    }

    .card > .grid:not(form),
    .card > .budget-list,
    .card > .goal-list,
    .card > .connector-list,
    .card > .bill-list,
    .card > .chart {
      flex: 0 1 auto;
    }

    .card > .empty,
    .budget-list > .empty,
    .goal-list > .empty,
    .connector-list > .empty,
    .bill-list > .empty {
      min-height: 116px;
      display: grid;
      place-items: center;
    }

    #dashboard .split > .card,
    #income .split > .card,
    #budgets .split > .card,
    #goals .split > .card,
    #invest .split > .card,
    #tools .split > .card,
    #connect .split > .card,
    #settings .split > .card {
      min-height: 0;
    }

    #tools .split {
      grid-auto-rows: minmax(250px, auto);
    }

    #ai .split {
      align-items: stretch;
    }

    #ai .split > .card:first-child {
      min-height: 620px;
    }

    #ai .split > .card:first-child .chat {
      flex: 1;
      min-height: 360px;
    }

    .panel-head {
      min-height: 43px;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 8px;
    }

    .panel-head h2 {
      line-height: 1.2;
      min-width: 0;
      flex: 1 1 auto;
    }

    .panel-head > .pill {
      flex: 0 0 auto;
      min-height: 24px;
      padding: 4px 9px;
      font-size: 11px;
      line-height: 1.1;
      white-space: nowrap;
      box-shadow: none;
    }

    .panel-head .card-config-actions {
      flex: 0 1 auto;
      gap: 4px;
    }

    .panel-head .card-config-actions button {
      color: #51625b;
      background: #f5f8f6;
      border-color: rgba(32, 48, 52, .1);
      min-height: 23px;
      min-width: 23px;
      padding: 3px 7px;
      font-size: 10px;
      font-weight: 800;
      border-radius: 6px;
    }

    .panel-head .card-size-label {
      background: #f5f8f6;
      color: #697a74;
      border-color: rgba(32, 48, 52, .08);
      font-size: 10px;
      min-height: 23px;
      display: none;
      align-items: center;
    }

    .card[data-card-custom-width="true"] .card-size-label,
    .card[data-card-custom-height="true"] .card-size-label {
      display: inline-flex;
    }

    .card-drag-handle {
      cursor: grab;
      touch-action: none;
    }

    .card-drag-handle:active {
      cursor: grabbing;
    }

    .card-config-actions {
      gap: 4px;
    }

    .card-config-actions button {
      min-width: 23px;
      min-height: 23px;
      padding: 3px 6px;
      border-radius: 6px;
      color: #51625b;
      background: #f5f8f6;
      border-color: rgba(32, 48, 52, .1);
    }

    .card-config-actions > .card-size-label,
    .card-config-actions > [data-card-reset-size] {
      display: none;
    }

    .card[data-card-custom-width="true"] .card-config-actions > .card-size-label,
    .card[data-card-custom-height="true"] .card-config-actions > .card-size-label,
    .card[data-card-custom-width="true"] .card-config-actions > [data-card-reset-size],
    .card[data-card-custom-height="true"] .card-config-actions > [data-card-reset-size] {
      display: inline-flex;
      align-items: center;
    }

    [data-card-layout-container="true"]:not(.section),
    .section.active[data-card-layout-container="true"] {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      align-content: flex-start;
      gap: 12px;
    }

    [data-card-layout-container="true"] > :not(.card) {
      flex: 0 0 100%;
      width: 100%;
      min-width: 0;
    }

    [data-card-layout-container="true"] > .card {
      height: auto;
      min-height: 0;
      max-width: 100%;
      align-self: flex-start;
      padding-bottom: 32px;
    }

    [data-card-layout-container="true"].stats > .card {
      flex: 1 1 190px;
      align-self: stretch;
    }

    [data-card-layout-container="true"].split > .card {
      flex: 1 1 620px;
      min-width: min(620px, 100%);
    }

    [data-card-layout-container="true"].stats > .card .subtle {
      overflow-wrap: anywhere;
      padding-right: 18px;
    }

    .section[data-card-layout-container="true"] > .card {
      flex: 1 1 100%;
    }

    [data-card-layout-container="true"] > .card[data-card-custom-width="true"] {
      flex: 0 1 var(--card-width, 360px);
      width: var(--card-width, 360px);
      min-width: min(220px, 100%);
      max-width: 100%;
    }

    .card[data-card-custom-height="true"] {
      height: var(--card-height, auto) !important;
      min-height: var(--card-height, 0) !important;
      overflow: auto;
    }

    .budget-list > .row-card,
    .goal-list > .row-card,
    .connector-list > .row-card,
    .bill-list > .row-card {
      align-self: start;
    }

    body.launch-account-open { overflow: hidden; }

    .launch-account {
      position: fixed;
      inset: 0;
      z-index: 100;
      display: none;
      place-items: center;
      overflow-y: auto;
      padding: 24px;
      background: #edf3ef;
    }

    .launch-account.show { display: grid; }

    .launch-account-panel {
      width: min(480px, 100%);
      display: grid;
      gap: 16px;
      padding: 24px;
      border: 1px solid rgba(32, 48, 52, .14);
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 22px 55px rgba(20, 42, 45, .16);
    }

    .launch-account-brand {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .launch-account-mark {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: #102326;
      color: #eafff4;
      font-size: 22px;
      font-weight: 900;
    }

    .launch-account-brand h1 {
      margin: 0;
      color: #172326;
      font-size: 24px;
      line-height: 1.15;
    }

    .launch-account-brand p {
      margin: 3px 0 0;
      color: #66766f;
      font-size: 13px;
    }

    .launch-account-status {
      min-height: 48px;
      padding: 11px 12px;
      border: 1px solid rgba(31, 122, 85, .18);
      border-radius: 6px;
      background: #f3f8f4;
      color: #42564d;
      line-height: 1.45;
    }

    .launch-account-form {
      display: grid;
      gap: 12px;
    }

    .launch-account-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .launch-account-panel > button { width: 100%; }

    .launch-account-upgrade {
      width: 100%;
      min-height: 42px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(56, 227, 210, .38);
      border-radius: 6px;
      color: #9cf4eb;
      background: rgba(12, 55, 63, .34);
      text-decoration: none;
      font-weight: 800;
    }

    .launch-account.is-trial-ended .launch-account-status {
      border-color: rgba(255, 174, 77, .48);
      color: #ffe1ad;
      background: rgba(91, 50, 7, .34);
    }

    .launch-account-privacy {
      margin: 0;
      color: #6b7a74;
      font-size: 12px;
      text-align: center;
    }

    .integration-coming-soon {
      position: relative;
      min-height: 300px;
      overflow: hidden;
      isolation: isolate;
    }

    .integration-coming-soon .coming-soon-content {
      display: grid;
      gap: 12px;
      opacity: .34;
      filter: saturate(.55);
      pointer-events: none;
      user-select: none;
    }

    .coming-soon-overlay {
      position: absolute;
      inset: 0;
      z-index: 3;
      display: grid;
      place-content: center;
      justify-items: center;
      gap: 9px;
      padding: 24px;
      text-align: center;
      background:
        radial-gradient(circle at 50% 42%, rgba(28, 118, 103, .22), transparent 44%),
        rgba(7, 18, 25, .74);
      backdrop-filter: blur(3px);
    }

    .coming-soon-overlay strong {
      color: #f4fffb;
      font-size: clamp(24px, 4vw, 38px);
      letter-spacing: -.03em;
    }

    .coming-soon-overlay p {
      max-width: 440px;
      margin: 0;
      color: #c6d9d2;
      line-height: 1.5;
    }

    .coming-soon-badge {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 5px 10px;
      border: 1px solid rgba(100, 216, 203, .46);
      border-radius: 999px;
      color: #8be8dc;
      background: rgba(15, 52, 53, .76);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    @media (max-width: 980px) {
      .app { grid-template-columns: 1fr; }
      .sidebar {
        position: static;
        height: auto;
        padding: 16px;
      }
      .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
      }
      .nav-group {
        border-top: 0;
        padding: 0;
      }
      .nav button { justify-content: center; text-align: center; }
      .sidebar-note, .build-label { display: none; }
      main { padding: 18px; }
      .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dashboard-hero { grid-template-columns: 1fr; }
      .split { grid-template-columns: 1fr; }
      .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      [data-card-layout-container="true"].stats > .card { flex-basis: calc(50% - 6px); }
      [data-card-layout-container="true"].split > .card,
      .section[data-card-layout-container="true"] > .card { flex-basis: 100%; }
      #dashboard .split > .card,
      #income .split > .card,
      #budgets .split > .card,
      #goals .split > .card,
      #invest .split > .card,
      #tools .split > .card,
      #connect .split > .card,
      #settings .split > .card,
      #ai .split > .card:first-child {
        min-height: auto;
      }
    }

    @media (max-width: 620px) {
      .eula-gate { padding: 10px; }
      .eula-gate-panel { max-height: calc(100vh - 20px); padding: 18px; gap: 10px; }
      .eula-gate-text { min-height: 150px; }
      .eula-gate-actions { display: grid; grid-template-columns: 1fr; }
      .eula-gate-actions button { width: 100%; }
      .launch-account { padding: 14px; }
      .launch-account-panel { padding: 18px; }
      .launch-account-actions { grid-template-columns: 1fr; }
      .toast { top: 10px; right: 10px; max-width: calc(100vw - 20px); }
      .modal { padding: 14px 10px 84px; }
      .modal-card { max-height: calc(100vh - 98px); }
      .topbar, .row-main { align-items: stretch; flex-direction: column; }
      .nav { grid-template-columns: 1fr; }
      .nav-group { grid-template-columns: 1fr 1fr; }
      .nav-heading { grid-column: 1 / -1; text-align: center; }
      .stats, .form-grid { grid-template-columns: 1fr; }
      [data-card-layout-container="true"] > .card,
      [data-card-layout-container="true"] > .card[data-card-custom-width="true"] {
        flex-basis: 100%;
        width: 100%;
      }
      .focus-strip { grid-template-columns: 1fr; }
      .actions { width: 100%; }
      .actions button { flex: 1; }
      th:nth-child(4), td:nth-child(4) { display: none; }
      .chart-row { grid-template-columns: 82px 1fr 62px; }
    }
