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

  :root {
    --bg:       #0A0A0B;
    --surface:  #111113;
    --card:     #16161A;
    --border:   #252530;
    --borderHi: #3A3A4A;
    --gold:     #C9A84C;
    --goldDim:  #8A6F32;
    --goldGlow: rgba(201,168,76,0.12);
    --text:     #E8E6DF;
    --muted:    #7A7870;
    --dim:      #3A3830;
    --success:  #4A9B6F;
    --danger:   #9B4A4A;
  }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
  }

  .app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
      radial-gradient(ellipse 60% 40% at 80% 10%, rgba(201,168,76,0.04) 0%, transparent 60%),
      radial-gradient(ellipse 50% 60% at 10% 80%, rgba(74,127,165,0.04) 0%, transparent 60%),
      var(--bg);
  }

  /* Header */
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    border-bottom: 0.5px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,11,0.95);
    backdrop-filter: blur(12px);
  }
  .logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--gold);
  }
  .logo span { color: var(--text); }
  .header-right { display: flex; align-items: center; gap: 12px; }
  .header-tag {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--muted);
    text-transform: uppercase;
  }
  .api-btn {
    background: rgba(201,168,76,0.1);
    border: 0.5px solid rgba(201,168,76,0.3);
    border-radius: 3px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--gold);
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
  }
  .api-btn.set {
    background: rgba(74,155,111,0.15);
    border-color: rgba(74,155,111,0.4);
    color: var(--success);
  }
  .api-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 48px;
    background: var(--card);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    z-index: 200;
    min-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: none;
  }
  .api-dropdown.open { display: block; }
  .api-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
  .api-row { display: flex; gap: 8px; }
  .api-input {
    flex: 1;
    background: var(--bg);
    border: 0.5px solid var(--border);
    border-radius: 3px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
  }
  .api-input:focus { border-color: var(--goldDim); }
  .api-done {
    background: var(--gold);
    color: var(--bg);
    border: none;
    border-radius: 3px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
  }
  .api-note { font-size: 11px; color: var(--dim); margin-top: 8px; }

  /* Progress */
  .progress-wrap {
    padding: 0 48px;
    border-bottom: 0.5px solid var(--border);
    background: var(--surface);
    display: none;
  }
  .progress-wrap.visible { display: block; }
  .progress-steps { display: flex; max-width: 960px; margin: 0 auto; }
  .step-tab {
    flex: 1;
    padding: 14px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
  }
  .step-tab.active { border-bottom-color: var(--gold); }
  .step-tab.done { border-bottom-color: var(--goldDim); }
  .step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 0.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted);
    flex-shrink: 0; transition: all 0.3s;
  }
  .step-tab.active .step-num { border-color: var(--gold); color: var(--gold); }
  .step-tab.done .step-num { background: var(--goldDim); border-color: var(--goldDim); color: #fff; font-size: 10px; }
  .step-name { font-size: 11px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; transition: color 0.3s; }
  .step-tab.active .step-name { color: var(--text); }
  .step-tab.done .step-name { color: var(--goldDim); }

  /* Main */
  .main { flex: 1; padding: 48px 48px 80px; max-width: 1008px; margin: 0 auto; width: 100%; }

  .section-eyebrow { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
  .section-title { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 300; color: var(--text); line-height: 1.2; margin-bottom: 8px; }
  .section-desc { color: var(--muted); font-size: 14px; max-width: 560px; margin-bottom: 36px; }

  /* Form */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
  .form-grid.single { grid-template-columns: 1fr; }
  .form-grid.triple { grid-template-columns: 1fr 1fr 1fr; }
  .field { display: flex; flex-direction: column; gap: 8px; }
  .field.span2 { grid-column: span 2; }
  .field-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .field-label .req { color: var(--gold); margin-left: 3px; }
  .field-input, .field-select, .field-textarea {
    background: var(--card);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 300;
    padding: 12px 14px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
  }
  .field-input:focus, .field-select:focus, .field-textarea:focus {
    border-color: var(--goldDim);
    box-shadow: 0 0 0 3px var(--goldGlow);
  }
  .field-input::placeholder { color: var(--dim); }
  .field-select { cursor: pointer; }
  .field-select option { background: var(--card); }
  .field-textarea { resize: vertical; min-height: 80px; }
  .input-wrap { position: relative; display: flex; align-items: center; }
  .input-prefix { position: absolute; left: 14px; color: var(--muted); font-size: 14px; pointer-events: none; }
  .input-wrap .field-input { padding-left: 28px; }

  /* Pills */
  .pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
  .pill {
    padding: 7px 16px;
    border-radius: 2px;
    border: 0.5px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .pill:hover { border-color: var(--borderHi); color: var(--text); }
  .pill.selected { border-color: var(--gold); color: var(--gold); background: var(--goldGlow); }

  /* Slider */
  .slider-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
  .slider-value { font-size: 20px; font-family: 'Cormorant Garamond', serif; font-weight: 300; color: var(--gold); }
  input[type=range] {
    -webkit-appearance: none;
    width: 100%; height: 2px;
    background: var(--border);
    border-radius: 1px;
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--gold);
    cursor: pointer;
  }
  .slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

  /* Nav */
  .nav-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 48px; padding-top: 32px;
    border-top: 0.5px solid var(--border);
  }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 2px;
    font-family: 'DM Sans', sans-serif; font-size: 12px;
    font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; border: none; outline: none;
  }
  .btn-ghost { background: transparent; color: var(--muted); border: 0.5px solid var(--border); }
  .btn-ghost:hover { border-color: var(--borderHi); color: var(--text); }
  .btn-primary { background: var(--gold); color: var(--bg); font-weight: 500; }
  .btn-primary:hover { background: #D4B05C; }
  .btn-primary:disabled { background: var(--dim); color: var(--muted); cursor: not-allowed; }
  .btn-outline { background: transparent; color: var(--gold); border: 0.5px solid var(--gold); }
  .btn-outline:hover { background: var(--goldGlow); }
  .btn-sm { padding: 6px 14px; font-size: 11px; }

  /* Asset class cards (step 7) */
  .asset-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    background: var(--card);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
  }
  .asset-card.selected { background: var(--goldGlow); border-color: var(--gold); }
  .asset-check {
    width: 20px; height: 20px; border-radius: 2px; flex-shrink: 0;
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
  }
  .asset-card.selected .asset-check { background: var(--gold); border-color: var(--gold); }
  .asset-check-mark { display: none; color: var(--bg); font-size: 12px; font-weight: 700; }
  .asset-card.selected .asset-check-mark { display: block; }
  .asset-name { font-size: 13px; color: var(--muted); transition: color 0.2s; }
  .asset-card.selected .asset-name { color: var(--text); }
  .asset-desc { font-size: 11px; color: var(--dim); }
  .asset-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-left: auto; transition: opacity 0.2s; }

  /* Priority list */
  .priority-list { margin-top: 16px; background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 14px 18px; }
  .priority-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .priority-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 0.5px solid var(--border); }
  .priority-item:last-child { border-bottom: none; }
  .priority-num { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: var(--goldDim); min-width: 20px; }
  .priority-text { font-size: 13px; color: var(--text); }

  /* Review */
  .review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; }
  .review-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 20px 24px; }
  .review-card-title { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
  .review-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 0.5px solid var(--border); gap: 16px; }
  .review-row:last-child { border-bottom: none; }
  .review-key { color: var(--muted); font-size: 12px; }
  .review-val { color: var(--text); font-size: 13px; text-align: right; }
  .review-val.included { color: var(--success); }
  .review-val.excluded { color: var(--muted); }

  /* Loading */
  .loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; gap: 24px; }
  .loading-ring { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); border-top-color: var(--gold); animation: spin 1.2s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-text { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 300; color: var(--muted); }
  .loading-sub { font-size: 12px; color: var(--dim); letter-spacing: 0.08em; }

  /* Error */
  .error-box { background: rgba(155,74,74,0.08); border: 0.5px solid rgba(155,74,74,0.3); border-radius: 4px; padding: 16px 20px; color: #C47070; font-size: 13px; margin-bottom: 20px; white-space: pre-wrap; }

  /* Output */
  .output-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: rgba(74,155,111,0.12); border: 0.5px solid rgba(74,155,111,0.3); border-radius: 2px; font-size: 11px; letter-spacing: 0.08em; color: var(--success); margin-bottom: 16px; }
  .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  .metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
  .metric-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 18px 20px; }
  .metric-label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
  .metric-value { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 300; color: var(--gold); }
  .metric-sub { font-size: 11px; color: var(--dim); margin-top: 4px; }

  .subsection-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

  /* Allocation bars */
  .alloc-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 20px 24px; margin-bottom: 32px; }
  .alloc-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
  .alloc-row:last-child { margin-bottom: 0; }
  .alloc-name { width: 220px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
  .alloc-track { flex: 1; height: 6px; background: var(--border); border-radius: 1px; overflow: hidden; }
  .alloc-fill { height: 100%; border-radius: 1px; transition: width 1.2s cubic-bezier(0.16,1,0.3,1); width: 0; }
  .alloc-pct { width: 44px; text-align: right; font-size: 13px; color: var(--gold); font-family: 'Cormorant Garamond', serif; font-weight: 500; }

  /* Rec cards */
  .rec-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
  .rec-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 0.5px solid var(--border); cursor: pointer; }
  .rec-card-header:hover { background: rgba(255,255,255,0.02); }
  .rec-card-title { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text); }
  .rec-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .rec-card-right { display: flex; align-items: center; gap: 16px; }
  .rec-card-pct { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 300; color: var(--gold); }
  .rec-card-toggle { color: var(--muted); font-size: 20px; line-height: 1; }
  .rec-card-body { padding: 16px 20px; font-size: 13px; color: var(--muted); display: none; }
  .rec-card-body.open { display: block; }
  .rec-rationale { color: var(--text); line-height: 1.7; margin-bottom: 14px; }
  .instruments-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--goldDim); margin-bottom: 8px; }
  .instrument-row { display: flex; gap: 10px; padding: 5px 0; border-bottom: 0.5px solid var(--border); align-items: flex-start; }
  .instrument-row:last-child { border-bottom: none; }
  .instrument-dash { color: var(--goldDim); flex-shrink: 0; margin-top: 1px; }
  .instrument-name { font-size: 13px; color: var(--text); }

  /* Analysis grid */
  .analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; }
  .analysis-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 20px 24px; }
  .analysis-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
  .bar-item { margin-bottom: 14px; }
  .bar-item:last-child { margin-bottom: 0; }
  .bar-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
  .bar-label { font-size: 12px; color: var(--muted); }
  .bar-pct { font-size: 13px; color: var(--gold); font-family: 'Cormorant Garamond', serif; font-weight: 500; }
  .bar-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
  .bar-fill { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(0.16,1,0.3,1); width: 0; }
  .bar-rationale { font-size: 11px; color: var(--dim); margin-top: 4px; line-height: 1.5; }

  /* Considerations */
  .bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .considerations-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 20px 24px; }
  .considerations-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
  .consideration-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 0.5px solid var(--border); }
  .consideration-row:last-child { border-bottom: none; }
  .consideration-dash { color: var(--goldDim); flex-shrink: 0; }
  .consideration-text { font-size: 13px; color: var(--muted); line-height: 1.6; }
  .notes-stack { display: flex; flex-direction: column; gap: 16px; }
  .note-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 18px 20px; }
  .note-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
  .note-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

  .divider { height: 0.5px; background: var(--border); margin: 32px 0; }

  .disclaimer { margin-top: 32px; padding: 14px 20px; background: rgba(155,74,74,0.06); border: 0.5px solid rgba(155,74,74,0.2); border-radius: 4px; }
  .disclaimer p { font-size: 12px; color: #9B7070; line-height: 1.6; }
  .disclaimer strong { color: #C47070; }

  .summary-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 4px; padding: 20px 24px; margin-bottom: 24px; }
  .summary-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
  .summary-text { font-size: 14px; color: var(--text); line-height: 1.75; }

  .output-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 36px; }

  /* Screens */
  .screen { display: none; }
  .screen.active { display: block; }

  @media (max-width: 720px) {
    .header { padding: 16px 20px; }
    .progress-wrap { padding: 0 20px; }
    .main { padding: 32px 20px 60px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.span2 { grid-column: span 1; }
    .review-grid, .analysis-grid, .bottom-grid { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: 1fr 1fr; }
    .step-name { display: none; }
    .api-dropdown { right: 20px; min-width: calc(100vw - 40px); }
  }

  /* Interactive sliders on output */
  .slider-output { width: 100%; height: 4px; cursor: pointer; accent-color: var(--gold); }
  .slider-row-out { margin-bottom: 18px; }
  .slider-row-out:last-child { margin-bottom: 0; }
  .slider-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
  .slider-row-label { font-size: 12px; color: var(--muted); }
  .slider-row-pct { font-size: 15px; color: var(--gold); font-family: 'Cormorant Garamond', serif; font-weight: 500; min-width: 40px; text-align: right; }
  .slider-row-rationale { font-size: 11px; color: var(--dim); line-height: 1.5; margin-top: 4px; }
  .total-badge { font-size: 11px; padding: 2px 8px; border-radius: 2px; margin-left: 10px; }
  .total-badge.ok { background: rgba(74,155,111,0.15); color: var(--success); border: 0.5px solid rgba(74,155,111,0.3); }
  .total-badge.bad { background: rgba(155,74,74,0.15); color: #C47070; border: 0.5px solid rgba(155,74,74,0.3); }
  .refresh-btn { display: none; }
  .refresh-btn.visible { display: inline-flex; }

  .allocation-help { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
  .error-box { white-space: pre-wrap; }
  @media (max-width: 720px) {
    .output-header { flex-direction: column; gap: 16px; }
    .header-right { flex-wrap: wrap; justify-content: flex-end; }
    .header-tag { display: none; }
    .api-dropdown { width: calc(100vw - 40px); }
    .form-grid.triple { grid-template-columns: 1fr; }
  }
