  /* Font loaded via <link> in HTML for non-blocking render */
  * { margin: 0; padding: 0; box-sizing: border-box; }

  :root {
    --bg: #09090B;
    --surface: #131316;
    --surface2: #1c1c20;
    --border: #2a2a30;
    --border-hover: #3a3a42;
    --text: #f5f5f5;
    --text-muted: #9CA3AF;
    --accent: #4F46E5;
    --accent-light: #A855F7;
    --accent-progress: #C084FC;
    --accent-glow: rgba(79, 70, 229, 0.18);
    --green: #22c55e;
    --yellow: #eab308;
    --orange: #f97316;
    --red: #ef4444;
  }

  /* ═══ LIGHT MODE ═══ */
  [data-theme="light"] {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface2: #f0f1f3;
    --border: #e0e2e6;
    --border-hover: #c8ccd2;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --accent: #4F46E5;
    --accent-light: #7c3aed;
    --accent-progress: #8b5cf6;
    --accent-glow: rgba(79, 70, 229, 0.12);
  }
  [data-theme="light"] .grain { display: none; }
  [data-theme="light"] select option { background: #fff; color: #1a1a2e; }
  [data-theme="light"] .verdict-card.go { background: rgba(34,197,94,0.08); }
  [data-theme="light"] .verdict-card.maybe { background: rgba(234,179,8,0.08); }
  [data-theme="light"] .verdict-card.wait { background: rgba(249,115,22,0.08); }
  [data-theme="light"] .verdict-card.no { background: rgba(239,68,68,0.08); }
  [data-theme="light"] .opp-cost-disclaimer { color: #999; }
  [data-theme="light"] .disclaimer-banner { color: #8a7a40; }
  [data-theme="light"] .disclaimer-banner strong { color: #6b5c20; }
  [data-theme="light"] .skeleton { background: linear-gradient(90deg, #e8e9eb 25%, #f4f5f6 50%, #e8e9eb 75%); background-size: 200% 100%; }

  body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  .grain {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999;
  }

  .container { max-width: 580px; margin: 0 auto; padding: 50px 24px 120px; }

  header { text-align: center; margin-bottom: 44px; display: flex; flex-direction: column; align-items: center; }
  header h1 { font-size: 2.5rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 10px; }
  header p { margin-bottom: 4px; }

  /* Mode toggle in header */
  .mode-toggle {
    display: inline-flex;
    gap: 4px;
    background: var(--surface);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--border);
    margin-top: 14px;
  }
  .mode-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
  }
  .mode-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
  }
  header h1 span {
    background: linear-gradient(135deg, #A855F7, #C084FC, #A855F7);
    background-size: 200% 200%;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
  }
  @keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
  header p { color: var(--text-muted); font-size: 1.05rem; }

  .step { display: none; }
  .step.active { display: block; animation: slideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
  .step.slide-out-left { animation: slideOutLeft 0.2s ease forwards; }
  .step.slide-out-right { animation: slideOutRight 0.2s ease forwards; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes slideInReverse { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes slideOutLeft { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-24px); } }
  @keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(24px); } }

  .step-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-light); margin-bottom: 8px; }
  .step h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.02em; }

  .input-group { margin-bottom: 18px; }
  .input-group label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-muted); margin-bottom: 7px; }
  .input-wrapper { position: relative; }
  .input-wrapper .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; font-weight: 600; pointer-events: none; }
  .input-wrapper .suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; font-weight: 500; pointer-events: none; }

  input[type="text"], input[type="number"], select {
    width: 100%; padding: 13px 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; color: var(--text); font-size: 1rem; font-family: inherit; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
  input.dollar-input { padding-left: 36px; }
  input.pct-input { padding-right: 36px; }
  input::placeholder { color: #6B7280; }

  select { cursor: pointer; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
  }
  select option { background: #1a1a1a; color: var(--text); }

  .big-input input { font-size: 1.5rem; font-weight: 700; padding: 18px 20px 18px 42px; border-radius: 16px; }
  .big-input .prefix { font-size: 1.3rem; left: 18px; }
  .item-input input { font-size: 1.15rem; font-weight: 600; padding: 16px 20px; border-radius: 16px; }

  .toggle-row { display: flex; gap: 6px; background: var(--surface); border-radius: 10px; padding: 4px; border: 1px solid var(--border); margin-bottom: 18px; }
  .toggle-btn { flex: 1; padding: 10px 14px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; }
  .toggle-btn.active { background: var(--accent); color: white; box-shadow: 0 2px 8px rgba(79,70,229,0.35); }

  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .three-col { display: grid; grid-template-columns: 2fr 1.2fr 0.8fr; gap: 10px; align-items: end; }

  .btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 28px; border: none; border-radius: 12px; font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; gap: 8px; }
  .btn-primary { background: var(--accent); color: white; width: 100%; margin-top: 8px; }
  .btn-primary:hover { background: #5B52F0; transform: translateY(-1px); box-shadow: 0 4px 24px rgba(79, 70, 229, 0.35); }
  .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
  .btn-ghost { background: transparent; color: var(--text-muted); padding: 10px 18px; font-size: 0.88rem; }
  .btn-ghost:hover { color: var(--text); }

  .btn-row { display: flex; gap: 12px; margin-top: 8px; }
  .btn-row .btn-primary { flex: 1; margin-top: 0; }

  .progress { display: flex; gap: 6px; margin-bottom: 36px; }
  .progress-dot { height: 6px; flex: 1; border-radius: 3px; background: var(--border); transition: background 0.3s; }
  .progress-dot.filled { background: var(--accent-progress); }
  .progress-dot.current { background: var(--accent-progress); box-shadow: 0 0 10px rgba(192, 132, 252, 0.4); }

  .quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .quick-option { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; font-family: inherit; }
  .quick-option:hover { border-color: var(--accent); background: var(--accent-glow); }
  .quick-option.selected { border-color: var(--accent); background: var(--accent-glow); color: white; }

  .slider-group { margin-bottom: 22px; }
  .slider-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
  .slider-header label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
  .slider-value {
    font-size: 0.95rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
    cursor: pointer; padding: 4px 8px; border-radius: 8px; border: 1px dashed transparent; transition: all 0.2s;
    min-width: 70px; text-align: right; display: inline-block;
  }
  .slider-value:hover { border-color: var(--accent); background: rgba(168,85,247,0.06); }

  .slider-edit-input {
    width: 100px; font-size: 0.95rem; font-weight: 700; color: var(--text);
    background: var(--surface); border: 1px solid var(--accent); border-radius: 8px;
    padding: 4px 8px; text-align: right; font-family: inherit;
    font-variant-numeric: tabular-nums; outline: none;
  }
  .slider-edit-input:focus { box-shadow: 0 0 0 2px rgba(168,85,247,0.3); }

  input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--border); outline: none; touch-action: none; }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-progress); cursor: pointer; box-shadow: 0 2px 8px rgba(168,85,247,0.4); transition: transform 0.15s; }
  input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
  input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-progress); cursor: pointer; border: none; }

  .estimate-box { background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; display: none; }
  .estimate-box.visible { display: block; }
  .estimate-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-light); font-weight: 600; margin-bottom: 4px; }
  .estimate-amount { font-size: 1.3rem; font-weight: 800; color: var(--text); }
  .estimate-detail { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

  /* ═══ DEBT CARDS ═══ */
  .debt-list { margin-bottom: 16px; }

  .debt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
    position: relative;
    animation: fadeUp 0.3s ease;
  }

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

  .debt-card-type {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
  }

  .debt-card-remove {
    width: 28px; height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
  }
  .debt-card-remove:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.1); }

  .debt-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .debt-card-fields .input-group { margin-bottom: 0; }
  .debt-card-fields label { font-size: 0.72rem; margin-bottom: 5px; }
  .debt-card-fields input { padding: 10px 12px; font-size: 0.88rem; border-radius: 10px; }
  .debt-card-fields input.dollar-input { padding-left: 30px; }
  .debt-card-fields input.pct-input { padding-right: 30px; }
  .debt-card-fields .prefix { font-size: 0.9rem; left: 12px; }
  .debt-card-fields .suffix { font-size: 0.75rem; right: 12px; }

  .debt-card-interest-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
  }
  .debt-card-interest-note span { color: var(--yellow); font-weight: 600; }

  /* Add debt button */
  .add-debt-btn {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
  }
  .add-debt-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
  .add-debt-btn .plus-icon { font-size: 1.2rem; font-weight: 400; }

  /* Debt type picker (modal-like dropdown) */
  .debt-type-picker {
    display: none;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 16px;
    animation: fadeUp 0.2s ease;
  }
  .debt-type-picker.visible { display: block; }

  .debt-type-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
  }
  .debt-type-option:hover { background: var(--accent-glow); }
  .debt-type-icon { font-size: 1.1rem; width: 28px; text-align: center; }
  .debt-type-info { flex: 1; }
  .debt-type-name { font-weight: 600; }
  .debt-type-rate { font-size: 0.72rem; color: var(--text-muted); }

  /* Debt summary */
  .debt-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: none;
  }
  .debt-summary.visible { display: block; }
  .debt-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
  }
  .debt-summary-row:last-child { margin-bottom: 0; }
  .debt-summary-label { font-size: 0.78rem; color: var(--text-muted); }
  .debt-summary-value { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
  .debt-summary-value.warn { color: var(--yellow); }
  .debt-summary-value.bad { color: var(--red); }

  /* No debt label */
  .no-debt-note {
    text-align: center;
    padding: 8px;
    font-size: 0.82rem;
    color: #6B7280;
    margin-bottom: 12px;
  }

  /* Results */
  .verdict-card { text-align: center; padding: 36px 24px; border-radius: 20px; margin-bottom: 28px; border: 1px solid; position: relative; overflow: hidden; }
  .verdict-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
  .verdict-card.go { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.2); }
  .verdict-card.go::before { background: var(--green); }
  .verdict-card.maybe { background: rgba(234,179,8,0.06); border-color: rgba(234,179,8,0.2); }
  .verdict-card.maybe::before { background: var(--yellow); }
  .verdict-card.wait { background: rgba(249,115,22,0.06); border-color: rgba(249,115,22,0.2); }
  .verdict-card.wait::before { background: var(--orange); }
  .verdict-card.no { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
  .verdict-card.no::before { background: var(--red); }
  .verdict-emoji { font-size: 3.2rem; margin-bottom: 14px; display: block; }
  .verdict-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
  .verdict-card.go .verdict-title { color: var(--green); }
  .verdict-card.maybe .verdict-title { color: var(--yellow); }
  .verdict-card.wait .verdict-title { color: var(--orange); }
  .verdict-card.no .verdict-title { color: var(--red); }
  .verdict-sub { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
  .verdict-bullets { list-style: none; padding: 0; margin: 10px 0 0 0; }
  .verdict-bullets li { position: relative; padding-left: 18px; margin-bottom: 5px; font-size: 0.88rem; line-height: 1.45; }
  .verdict-bullets li::before { content: '•'; position: absolute; left: 0; color: var(--text-muted); font-weight: 700; }

  .breakdown { margin-bottom: 28px; }
  .breakdown h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }

  .metric { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--surface); border-radius: 12px; margin-bottom: 7px; border: 1px solid var(--border); }
  .metric-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
  .metric-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
  .metric-icon.pass { background: rgba(34,197,94,0.15); color: var(--green); }
  .metric-icon.warn { background: rgba(234,179,8,0.15); color: var(--yellow); }
  .metric-icon.fail { background: rgba(239,68,68,0.15); color: var(--red); }
  .metric-text { min-width: 0; }
  .metric-name { font-size: 0.85rem; font-weight: 600; }
  .metric-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
  .metric-value { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; flex-shrink: 0; margin-left: 12px; }
  .metric-value.pass { color: var(--green); }
  .metric-value.warn { color: var(--yellow); }
  .metric-value.fail { color: var(--red); }

  .real-cost-card { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); border-radius: 14px; padding: 18px 20px; margin-bottom: 24px; text-align: center; display: none; }
  .real-cost-card.visible { display: block; }
  .real-cost-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); font-weight: 600; margin-bottom: 4px; }
  .real-cost-amount { font-size: 1.6rem; font-weight: 800; color: var(--red); }
  .real-cost-detail { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

  /* Debt breakdown in results */
  .debt-breakdown { margin-bottom: 24px; }
  .debt-breakdown h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }
  .debt-breakdown-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--surface); border-radius: 10px;
    margin-bottom: 6px; border: 1px solid var(--border);
  }
  .dbi-left { display: flex; flex-direction: column; }
  .dbi-name { font-size: 0.85rem; font-weight: 600; }
  .dbi-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
  .dbi-cost { text-align: right; }
  .dbi-monthly { font-size: 0.85rem; font-weight: 700; color: var(--red); }
  .dbi-label { font-size: 0.68rem; color: var(--text-muted); }

  /* Assumptions overlay */
  .assumptions-link {
    display: block; margin-top: 2px;
    font-size: 0.78rem; color: var(--accent-light); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    transition: color 0.2s;
  }
  .assumptions-link:hover { color: var(--accent-progress); }

  /* Assumptions button in header */
  .assumptions-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
  }
  .assumptions-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    background: rgba(168,85,247,0.06);
  }

  /* Mode toggle description */
  .mode-desc {
    font-size: 0.7rem;
    color: #6B7280;
    margin-top: 6px;
    transition: opacity 0.2s;
  }

  /* Inline assumption editing */
  .assumption-value .inline-edit {
    width: 52px;
    padding: 4px 6px;
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent-light);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    text-align: right;
    outline: none;
  }

  .overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
  .overlay.visible { display: flex; }
  .overlay-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
    max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
    padding: 32px 28px; position: relative; animation: fadeUp 0.3s ease;
  }
  .overlay-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }
  .overlay-close {
    position: absolute; top: 16px; right: 18px; width: 34px; height: 34px;
    border-radius: 10px; border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
  }
  .overlay-close:hover { border-color: var(--red); color: var(--red); }

  .assumption-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--border);
  }
  .assumption-row:last-child { border-bottom: none; }
  .assumption-label { font-size: 0.85rem; color: var(--text); flex: 1; padding-right: 12px; }
  .assumption-label small { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
  .assumption-value { font-size: 0.9rem; font-weight: 700; color: var(--accent-light); text-align: right; white-space: nowrap; }
  .assumption-value input {
    width: 70px; padding: 6px 8px; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--accent-light); font-size: 0.85rem; font-weight: 700;
    font-family: inherit; text-align: right; outline: none;
  }
  .assumption-value input:focus { border-color: var(--accent); }
  .assumption-section-title {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-top: 16px; margin-bottom: 4px; font-weight: 600;
  }

  /* Mortgage fields */
  .mortgage-fields { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); animation: fadeUp 0.3s ease; }
  .mortgage-fields.visible { display: block; }
  .mortgage-tag {
    display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.72rem;
    font-weight: 600; background: rgba(168,85,247,0.15); color: var(--accent-light);
    margin-bottom: 12px;
  }
  /* Financing fields */
  .financing-fields { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); animation: fadeUp 0.3s ease; }
  .financing-fields.visible { display: block; }

  /* Opportunity cost */
  .opp-cost-card {
    background: rgba(79,70,229,0.06);
    border: 1px solid rgba(79,70,229,0.2);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 24px;
    text-align: center;
  }
  .opp-cost-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .opp-cost-amount {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-light);
  }
  .opp-cost-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
  }

  .opp-cost-disclaimer {
    font-size: 0.68rem;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    line-height: 1.5;
    font-style: italic;
  }

  /* Disclaimer banner on results */
  .disclaimer-banner {
    background: rgba(234,179,8,0.08);
    border: 1px solid rgba(234,179,8,0.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #b0a070;
    margin-bottom: 20px;
    text-align: center;
  }
  .disclaimer-banner strong {
    color: #d4b850;
  }
  .disclaimer-banner a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Budget snapshot */
  .budget-snapshot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
  }
  .budget-snapshot h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
  }
  .budget-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .budget-col {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  .budget-col.before { background: rgba(34,197,94,0.04); }
  .budget-col.after { background: rgba(239,68,68,0.04); }
  .budget-col-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 10px;
  }
  .budget-col.before .budget-col-title { color: var(--green); }
  .budget-col.after .budget-col-title { color: var(--red); }
  .budget-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 0.82rem;
  }
  .budget-line-label { color: var(--text-muted); }
  .budget-line-value { font-weight: 700; font-variant-numeric: tabular-nums; }
  .budget-line-value.positive { color: var(--green); }
  .budget-line-value.negative { color: var(--red); }
  .budget-line.total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9rem;
  }
  .budget-bar {
    height: 6px;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
    background: var(--border);
  }
  .budget-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
  .budget-bar-fill.positive { background: var(--green); }
  .budget-bar-fill.negative { background: var(--red); }
  .budget-bar-fill.warning { background: var(--yellow); }

  .budget-verdict {
    text-align: center;
    padding: 12px;
    margin-top: 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
  }
  .budget-verdict.comfortable { background: rgba(34,197,94,0.1); color: var(--green); }
  .budget-verdict.tight { background: rgba(234,179,8,0.1); color: var(--yellow); }
  .budget-verdict.stretched { background: rgba(249,115,22,0.1); color: var(--orange); }
  .budget-verdict.breaking { background: rgba(239,68,68,0.1); color: var(--red); }

  /* Recurring costs */
  .recurring-card {
    background: rgba(234,179,8,0.06);
    border: 1px solid rgba(234,179,8,0.2);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 24px;
  }
  .recurring-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--yellow);
    font-weight: 600;
    margin-bottom: 8px;
  }
  .recurring-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(234,179,8,0.1);
  }
  .recurring-item:last-child { border-bottom: none; }
  .recurring-item-label { color: var(--text-muted); }
  .recurring-item-value { font-weight: 700; color: var(--yellow); }

  /* What can I afford */
  .afford-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
  }
  .afford-card h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
  }
  .afford-tier {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
  }
  .afford-tier:last-child { margin-bottom: 0; }
  .afford-tier-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
  }
  .afford-tier.comfort .afford-tier-icon { background: rgba(34,197,94,0.15); }
  .afford-tier.stretch .afford-tier-icon { background: rgba(234,179,8,0.15); }
  .afford-tier.max .afford-tier-icon { background: rgba(239,68,68,0.15); }
  .afford-tier-text { flex: 1; min-width: 0; }
  .afford-tier-label { font-size: 0.75rem; color: var(--text-muted); }
  .afford-tier-amount { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .afford-tier.comfort .afford-tier-amount { color: var(--green); }
  .afford-tier.stretch .afford-tier-amount { color: var(--yellow); }
  .afford-tier.max .afford-tier-amount { color: var(--red); }
  .afford-tier-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

  /* Savings plan card */
  .savings-plan-card {
    background: rgba(34,197,94,0.04);
    border: 1px solid rgba(34,197,94,0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
  }
  .savings-plan-card h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green);
    margin-bottom: 6px;
  }
  .savings-plan-gap {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
  }
  .savings-scenario {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
  }
  .savings-scenario:last-child { margin-bottom: 0; }
  .savings-scenario-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 2px;
  }
  .savings-scenario-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
  }
  .savings-scenario-result {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--green);
    font-variant-numeric: tabular-nums;
  }

  /* Impulse check */
  .impulse-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 18px;
    cursor: pointer;
    transition: border-color 0.2s;
  }
  .impulse-check:hover { border-color: var(--accent); }
  .impulse-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
  }
  .impulse-check label {
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    line-height: 1.4;
  }
  .impulse-check label small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
  }

  /* ═══ VERDICT BADGE ═══ */
  .verdict-score {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .verdict-card.go .verdict-score { background: rgba(34,197,94,0.15); color: var(--green); }
  .verdict-card.maybe .verdict-score { background: rgba(234,179,8,0.15); color: var(--yellow); }
  .verdict-card.wait .verdict-score { background: rgba(249,115,22,0.15); color: var(--orange); }
  .verdict-card.no .verdict-score { background: rgba(239,68,68,0.15); color: var(--red); }

  /* ═══ SLIDER TOOLTIP ═══ */
  .slider-group { position: relative; }
  .slider-tooltip {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
    z-index: 10;
    font-variant-numeric: tabular-nums;
  }
  .slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--accent);
  }
  .slider-tooltip.visible { opacity: 1; }

  /* ═══ RECURRING CARD (updated for bullet layout) ═══ */
  .recurring-item {
    display: block;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: none;
  }

  /* ═══ SKELETON LOADING ═══ */
  .skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s infinite;
    border-radius: 12px;
  }
  .skeleton-card { height: 180px; margin-bottom: 20px; border-radius: 20px; }
  .skeleton-row { height: 60px; margin-bottom: 8px; }
  .skeleton-text { height: 14px; width: 60%; margin-bottom: 10px; border-radius: 6px; }
  @keyframes shimmerLoad {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  /* ═══ MICRO-INTERACTIONS ═══ */
  .metric { transition: transform 0.15s, box-shadow 0.15s; }
  .metric:active { transform: scale(0.985); }
  @media (hover: hover) {
    .metric:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
  }

  .debt-card { transition: transform 0.15s, box-shadow 0.15s; }
  @media (hover: hover) {
    .debt-card:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
  }

  .quick-option { transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
  .quick-option:active { transform: scale(0.97); }

  .afford-tier { transition: transform 0.15s, box-shadow 0.15s; }
  @media (hover: hover) {
    .afford-tier:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
  }

  .budget-col { transition: transform 0.15s; }
  @media (hover: hover) {
    .budget-col:hover { transform: translateY(-1px); }
  }

  /* ═══ CONFETTI CANVAS ═══ */
  #confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99998;
  }

  /* ═══ THEME TOGGLE ═══ */
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
  }
  .theme-toggle:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    background: rgba(168,85,247,0.06);
  }

  .footer-note { text-align: center; color: var(--text-muted); font-size: 0.75rem; margin-top: 36px; line-height: 1.5; }

  @media (max-width: 600px) {
    .container { padding: 32px 14px 90px; max-width: 100%; }
    header h1 { font-size: 1.8rem; }
    header p { font-size: 0.92rem; }
    .mode-toggle { margin-top: 12px; }
    .mode-btn { padding: 7px 14px; font-size: 0.78rem; }
    .quick-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .debt-card-fields { grid-template-columns: 1fr; }
    .btn { padding: 14px 20px; font-size: 0.95rem; min-height: 48px; }
    .big-input input { font-size: 1.3rem; padding: 16px 18px 16px 38px; min-height: 52px; }
    .verdict-card { padding: 28px 18px; }
    .verdict-title { font-size: 1.5rem; }
    .verdict-emoji { font-size: 2.6rem; }
    .overlay-card { padding: 24px 18px; border-radius: 16px; max-height: 90vh; }
    .overlay-card h2 { font-size: 1.15rem; }
    .assumption-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .assumption-value { text-align: left; }
    .mortgage-fields .two-col { grid-template-columns: 1fr; }
    .metric { padding: 12px 12px; }
    .metric-left { gap: 8px; }
    .metric-icon { width: 30px; height: 30px; font-size: 0.8rem; }
    .metric-name { font-size: 0.8rem; }
    .metric-detail { font-size: 0.7rem; }
    .metric-value { font-size: 0.82rem; }
    .step h2 { font-size: 1.2rem; }
    .step-label { font-size: 0.68rem; }
    .budget-cols { grid-template-columns: 1fr; }
    select { font-size: 0.9rem; min-height: 48px; }
    .slider-group { margin-bottom: 26px; }
    .slider-header { margin-bottom: 12px; }
    .slider-header label { font-size: 0.85rem; }
    .slider-value { font-size: 1rem; padding: 6px 10px; }
    .slider-edit-input { width: 110px; font-size: 1rem; padding: 6px 10px; }
    input[type="range"] { height: 8px; }
    input[type="range"]::-webkit-slider-thumb { width: 34px; height: 34px; }
    input[type="range"]::-moz-range-thumb { width: 34px; height: 34px; }
    .quick-option { padding: 14px 16px; font-size: 0.9rem; min-height: 48px; }
    .toggle-btn { min-height: 44px; }
    input[type="number"] { min-height: 48px; font-size: 1rem; }
    .pct-input { min-height: 48px; }
    .dollar-input { min-height: 52px; }
  }

  @media (max-width: 360px) {
    .container { padding: 24px 10px 80px; }
    header h1 { font-size: 1.5rem; }
    .btn-row { flex-direction: column; gap: 8px; }
    .btn-row .btn-ghost { order: 2; }
    .btn-row .btn-primary { order: 1; }
  }

  /* Focus-visible for keyboard navigation */
  :focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
  }
  input:focus-visible, select:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
  }
  .btn:focus-visible, .toggle-btn:focus-visible, .mode-btn:focus-visible, .quick-option:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
  }
  .overlay-close:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
  }

  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  input[type="number"] { -moz-appearance: textfield; }

  /* Print styles */
  @media print {
    body { background: white; color: black; }
    .grain, .progress, .btn-row, .mode-toggle, .mode-desc, .assumptions-btn,
    .impulse-check, footer, #shared-banner, #resume-banner { display: none !important; }
    .container { max-width: 100%; padding: 20px; }
    .step { display: none !important; }
    #step-results { display: block !important; }
    .verdict-card { break-inside: avoid; border: 2px solid #333; }
    .verdict-card.go { background: #f0fff0; }
    .verdict-card.no { background: #fff0f0; }
    .verdict-card.maybe { background: #fffbe6; }
    .verdict-card.wait { background: #fff5eb; }
    .verdict-title { -webkit-text-fill-color: initial; }
    .metric { break-inside: avoid; border: 1px solid #ccc; background: #fafafa; }
    .breakdown, .budget-snapshot, .afford-card, .opp-cost-card, .real-cost-card,
    .savings-plan-card, .recurring-card { break-inside: avoid; }
    .footer-note { color: #666; border-top: 1px solid #ccc; padding-top: 12px; }
    a { color: #333; }
  }
