*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f0f0f0; --white: #ffffff; --nav-w: 220px;
    --accent: #F59E1B; --accent-light: #FFF8EE;
    --gold: #F59E1B; --gold-light: #FFF8EE;
    --green: #16a34a; --red: #dc2626;
    --border: #e2e2e2; --text: #1a1a1a;
    --label: #1e5fa8; /* blue labels */
    --muted: #6b7280; --input-bg: #fafafa;
    --radius: 8px; --shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #ffffff; color: #040404; min-height: 100vh; display: flex; flex-direction: column; font-size: 14px; }

  /* HEADER */
  .app-header { background: #ffffff; border-bottom: 3px solid #F59E1B; padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
  .app-header .logo { font-weight: 900; font-size: 15px; color: #ffffff; letter-spacing: -0.3px; }
  .region-btn { border: 1px solid var(--border); background: var(--white); padding: 4px 12px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); transition: all .15s; }
  .region-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* SIDEBAR */
  .sidebar { width: var(--nav-w); min-height: calc(100vh - 52px); background: var(--white); border-right: 1px solid var(--border); padding: 24px 0; position: sticky; top: 52px; flex-shrink: 0; align-self: flex-start; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 20px; cursor: pointer; transition: background .1s; }
  .nav-item:hover { background: var(--accent-light); }
  .nav-item.active { background: #FFF8EE; border-right: 3px solid #F59E1B; }
  .nav-item.active .nav-label { color: #C47D0E; font-weight: 700; }
  .nav-num { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0; background: var(--white); }
  .nav-item.active .nav-num { background: var(--gold); border-color: var(--gold); color: var(--white); }
  .nav-item.done .nav-num { background: var(--green); border-color: var(--green); color: var(--white); }
  .nav-item.done .nav-num::after { content: '✓'; }
  .nav-item.done .nav-num span { display: none; }
  .nav-item.skipped .nav-num { background: #fbbf24; border-color: #fbbf24; color: var(--white); }
  .nav-item.skipped .nav-num::after { content: '–'; }
  .nav-item.skipped .nav-num span { display: none; }
  .nav-label { font-size: 13px; color: var(--muted); }

  /* MAIN */
  .main { flex: 1; padding: 28px 32px 100px; max-width: 860px; position: relative; z-index: 1; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22320%22%20height%3D%22200%22%20viewBox%3D%220%200%20320%20200%22%3E%0A%20%20%3Cg%20transform%3D%22rotate%28-25%2C%20160%2C%20100%29%22%20opacity%3D%220.045%22%3E%0A%20%20%20%20%3Cpolygon%20points%3D%2260%2C62%2070%2C62%2076%2C80%2070%2C98%2060%2C98%2066%2C80%22%20fill%3D%22%23040404%22/%3E%0A%20%20%20%20%3Cpolygon%20points%3D%2266%2C70%2076%2C70%2080%2C80%2076%2C90%2066%2C90%2070%2C80%22%20fill%3D%22%23040404%22/%3E%0A%20%20%20%20%3Ctext%20x%3D%2287%22%20y%3D%2288%22%20font-family%3D%22Open%20Sans%2CArial%2Csans-serif%22%20font-weight%3D%22900%22%20font-size%3D%2222%22%20fill%3D%22%23040404%22%20letter-spacing%3D%22-0.5%22%3EEXPERIOR%3C/text%3E%0A%20%20%20%20%3Ctext%20x%3D%2287%22%20y%3D%22100%22%20font-family%3D%22Open%20Sans%2CArial%2Csans-serif%22%20font-weight%3D%22400%22%20font-size%3D%228%22%20fill%3D%22%23040404%22%20letter-spacing%3D%223%22%3EFINANCIAL%20GROUP%3C/text%3E%0A%20%20%3C/g%3E%0A%3C/svg%3E"); background-repeat: repeat; background-size: 320px 200px; background-position: 0 0; }

  /* CARDS */
  .card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
  .card-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; color: #040404; border-bottom: 2px solid #F59E1B; padding-bottom: 8px; }
  .card-subtitle { font-size: 13px; font-weight: 700; color: #040404; margin: 16px 0 10px; padding-bottom: 4px; border-bottom: 1px solid #f3e0c2; }

  /* FIELD LABELS — BLUE */
  .field-row { display: flex; gap: 14px; margin-bottom: 12px; align-items: flex-end; }
  .field { flex: 1; min-width: 0; }
  .field label { display: block; font-size: 12px; font-weight: 600; color: var(--label); margin-bottom: 4px; }
  .field label .req { color: var(--red); margin-left: 2px; }
  .field input, .field select, .field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 6px;
    padding: 7px 10px; font-size: 13px; background: var(--input-bg);
    color: var(--text); outline: none; transition: border .15s;
  }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: #fff; }
  .hint { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
  .field input[readonly] { background: #f5f5f5; color: var(--muted); }

  .prefix-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg); overflow: hidden; }
  .prefix-input:focus-within { border-color: var(--accent); background: #fff; }
  .prefix-input .prefix { padding: 7px 9px; color: var(--muted); font-size: 13px; border-right: 1px solid var(--border); background: #f5f5f5; white-space: nowrap; }
  .prefix-input input { border: none; outline: none; background: transparent; padding: 7px 10px; flex: 1; font-size: 13px; min-width: 0; }

  .radio-group { display: flex; gap: 18px; margin-top: 5px; flex-wrap: wrap; }
  .radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--text); }
  .radio-group input[type=radio] { accent-color: var(--accent); width: 14px; height: 14px; }

  .checkbox-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; padding: 3px 0; color: var(--text); }
  .checkbox-group input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }

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

  /* ADD BUTTONS */
  .add-btn { width: 100%; border: 1.5px dashed var(--border); background: transparent; border-radius: var(--radius); padding: 12px; font-size: 13px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; margin-top: 10px; }
  .add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

  /* EXPANDABLE */
  .expandable { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
  .expandable-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; cursor: pointer; background: var(--white); user-select: none; }
  .expandable-header:hover { background: var(--accent-light); }
  .expandable-header .ex-title { font-weight: 700; font-size: 13px; color: var(--text); }
  .expandable-header .ex-remove { color: var(--red); font-size: 20px; line-height: 1; padding: 0 4px; border: none; background: none; cursor: pointer; }
  .expandable-body { padding: 16px; border-top: 1px solid var(--border); background: #fafafa; }

  /* FOOTER */
  .footer-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--border); padding: 11px 32px; display: flex; align-items: center; justify-content: space-between; z-index: 50; }
  .note-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 5px; font-weight: 500; }
  .btn-group { display: flex; gap: 10px; }
  .btn { padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--muted); transition: all .15s; }
  .btn-primary { background: #F59E1B; border-color: #F59E1B; color: #040404; font-weight: 700; }
  .btn-primary:hover { background: #d98a12; border-color: #d98a12; }
  .btn:hover { background: #f5f5f5; }
  .btn-skip { color: var(--gold); border-color: var(--gold); }
  .btn-skip:hover { background: var(--gold-light); }

  /* BADGES */
  .badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
  .badge-green { background: #dcfce7; color: #16a34a; }
  .badge-gold { background: var(--gold-light); color: var(--gold); }
  .badge-best { background: #d1fae5; color: #065f46; }

  /* AL TOTALS */
  .al-totals { display: flex; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
  .al-total { font-size: 13px; }
  .al-total span { font-weight: 700; font-size: 15px; }
  .al-total span.pos { color: var(--green); }
  .al-total span.neg { color: var(--red); }
  .al-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .al-col-head { font-weight: 700; font-size: 14px; padding: 6px 0 10px; color: var(--text); border-bottom: 2px solid var(--border); margin-bottom: 12px; }

  /* BUDGET BAR */
  .income-bar { background: #FFF8EE; border: 1px solid #F59E1B; border-radius: 6px; padding: 12px 16px; display: flex; gap: 32px; margin-bottom: 16px; flex-wrap: wrap; }
  .income-bar .ib-item { font-size: 12px; color: var(--muted); }
  .income-bar .ib-val { font-weight: 700; font-size: 15px; color: #040404; margin-top: 2px; }

  /* REVIEW */
  .quote-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
  .quote-card.best { border-color: var(--green); }
  .quote-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
  .quote-carrier { font-weight: 700; font-size: 13px; }
  .quote-product { color: var(--muted); font-size: 12px; }
  .quote-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .quote-stat .qlabel { font-size: 11px; color: var(--muted); }
  .quote-stat .qvalue { font-size: 18px; font-weight: 800; }

  /* BUDGET OVERVIEW */
  .bov-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
  .bov-row:last-child { border-bottom: none; }
  .bov-label { color: var(--muted); }
  .bov-val { font-weight: 600; font-size: 14px; }
  .budget-chart-wrap { display: flex; gap: 24px; align-items: flex-start; margin-top: 16px; }
  .legend { flex: 1; }
  .legend-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 12px; border-bottom: 1px solid #f3f4f6; }
  .legend-row:last-child { border-bottom: none; font-weight: 700; }
  .legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
  .legend-label { display: flex; align-items: center; gap: 7px; flex: 1; color: var(--text); }
  .legend-val { font-weight: 600; color: var(--text); }

  /* PIE */
  .pie-wrap { position: relative; flex-shrink: 0; }
  .pie-wrap canvas { display: block; }
  #pie-tooltip { position: absolute; background: rgba(0,0,0,.8); color: #fff; padding: 6px 10px; border-radius: 5px; font-size: 11px; pointer-events: none; display: none; white-space: nowrap; z-index: 10; }

  /* RISK BOX */
  .risk-box { background: var(--gold-light); border: 1px solid #f5d98e; border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
  .risk-box .risk-title { font-weight: 700; font-size: 13px; color: #92400e; margin-bottom: 4px; }

  /* CALC RESULT */

  /* MODAL */
  .overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; align-items: center; justify-content: center; }
  .overlay.open { display: flex; }
  .modal { background: var(--white); border-radius: 10px; padding: 26px; width: 480px; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
  .modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
  .modal p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
  .pdf-options { display: flex; gap: 10px; margin-bottom: 18px; }
  .pdf-opt { flex: 1; border: 2px solid var(--border); border-radius: 6px; padding: 12px; cursor: pointer; text-align: center; transition: all .15s; }
  .pdf-opt.selected { border-color: var(--accent); background: var(--accent-light); }
  .pdf-opt .opt-title { font-weight: 700; font-size: 13px; }
  .pdf-opt .opt-desc { font-size: 11px; color: var(--muted); margin-top: 3px; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

  /* VERSION HISTORY */
  .ver-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .ver-row:last-child { border-bottom: none; }

  /* DRAG-TO-REORDER SIDEBAR */
  .nav-item { cursor: pointer; }
  .nav-item.dragging { opacity: 0.4; background: var(--accent-light); }
  .nav-item.drag-over { border-top: 2px solid var(--accent); }
  .drag-handle { color: #c4b5fd; font-size: 13px; margin-right: -2px; cursor: grab; user-select: none; flex-shrink: 0; padding: 4px 4px; border-radius: 3px; transition: color .15s; }
  .drag-handle:hover { color: var(--accent); background: var(--accent-light); }

  /* NOTE MODAL (per-section) */
  .note-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 400; align-items: center; justify-content: center; }
  .note-modal-overlay.open { display: flex; }
  .note-modal { background: var(--white); border-radius: 10px; width: 440px; box-shadow: 0 8px 40px rgba(0,0,0,0.18); overflow: hidden; }
  .note-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; }
  .note-modal-header h3 { font-size: 16px; font-weight: 700; }
  .note-modal-header button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
  .note-modal-vis { margin: 0 20px 10px; }
  .note-modal-vis select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; background: var(--white); color: var(--text); outline: none; }
  .note-modal-vis select:focus { border-color: var(--accent); }
  .note-editor-area { margin: 0 20px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
  .note-editor-body { min-height: 140px; padding: 10px; font-size: 13px; outline: none; line-height: 1.5; }
  .note-editor-body[contenteditable]:empty::before { content: attr(data-placeholder); color: #aaa; }
  .note-modal-footer { display: flex; justify-content: flex-end; padding: 14px 20px; }

  /* NET WORTH OVERVIEW CARD */
  .nw-stats { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
  .nw-stat .nw-val { font-size: 22px; font-weight: 800; }
  .nw-stat .nw-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .nw-breakdown { display: flex; gap: 24px; align-items: flex-start; }

  /* RETIREMENT OVERVIEW CARD */
  .ret-hero { display: flex; gap: 32px; margin-bottom: 16px; flex-wrap: wrap; }
  .ret-hero-stat .rh-val { font-size: 22px; font-weight: 800; }
  .ret-hero-stat .rh-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .ret-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
  .ret-table th { text-align: right; color: var(--muted); font-weight: 600; padding: 5px 10px; font-size: 12px; }
  .ret-table th:first-child { text-align: left; }
  .ret-table td { text-align: right; padding: 6px 10px; border-top: 1px solid var(--border); }
  .ret-table td:first-child { text-align: left; color: var(--muted); }

  /* EXPORT MODAL ENHANCEMENTS */
  .version-select-row { display: flex; gap: 10px; margin-bottom: 14px; }
  .ver-select-card { flex: 1; border: 2px solid var(--border); border-radius: 6px; padding: 10px 12px; cursor: pointer; transition: all .15s; }
  .ver-select-card.selected { border-color: var(--accent); background: var(--accent-light); }
  .ver-select-card .vs-title { font-weight: 700; font-size: 13px; }
  .ver-select-card .vs-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

  /* PROTECTION CHECKBOX */
  .protection-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 0 2px; cursor: pointer; }
  .protection-check input { accent-color: var(--accent); width: 14px; height: 14px; }

  /* SUBSECTION SPACER */
  .mt8 { margin-top: 8px; }
  .mt12 { margin-top: 12px; }

  /* INLINE NESTED BLOCK */
  .nested-block { background: #f8f9ff; border: 1px solid #dde5ff; border-radius: 6px; padding: 14px; margin-top: 8px; }

  /* CLOSING QUESTIONS CARD */
  .closing-card { background: #FAFAFA; border: 1px solid #EBEBEB; border-left: 4px solid #F59E1B; border-radius: var(--radius); padding: 18px 20px; margin-top: 18px; }
  .closing-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .closing-card-icon { font-size: 18px; }
  .closing-card-title { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
  .closing-card-subtitle { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
  .cq-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ddd6fe; }
  .cq-item:last-child { border-bottom: none; padding-bottom: 0; }
  .cq-check { flex-shrink: 0; margin-top: 1px; accent-color: var(--accent); width: 15px; height: 15px; }
  .cq-text { flex: 1; }
  .cq-q { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
  .cq-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }
  .cq-response { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
  .cq-response label { font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 5px; cursor: pointer; }
  .cq-response input[type=radio] { accent-color: var(--accent); }

  /* PHONE ROW */
  .phone-row { display: flex; gap: 8px; }
  .phone-row select { width: 110px; flex-shrink: 0; }
  .phone-row input { flex: 1; }

  /* SECTION NOTE INLINE */
  .section-note-inline { display: flex; align-items: flex-start; gap: 8px; background: #f4f2fd; border-radius: 6px; padding: 10px 14px; font-size: 12px; color: var(--accent); margin-bottom: 14px; }
  .experior-note-tag { display: inline-block; margin: 0 0 5px; padding: 2px 7px; border-radius: 999px; background: #fff4e0; color: #92400e; font-size: 10px; font-weight: 700; }

  /* HEADER BUTTONS */
  .header-btn { border: 1px solid var(--border); background: var(--white); padding: 5px 13px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 5px; transition: all .15s; }
  .header-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

  /* TOOLTIP on calculated fields */
  .calc-field-wrap { position: relative; display: inline-flex; align-items: center; width: 100%; }
  .calc-field-wrap .field-inner { flex: 1; }
  .calc-tip-icon { flex-shrink: 0; margin-left: 6px; width: 18px; height: 18px; border-radius: 50%; background: #dbeafe; color: var(--label); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; cursor: help; position: relative; }
  .calc-tip-icon:hover .calc-tip-popup { display: block; }
  .calc-tip-popup { display: none; position: absolute; right: 0; top: 24px; width: 240px; background: #1e293b; color: #e2e8f0; font-size: 11px; line-height: 1.5; padding: 10px 12px; border-radius: 6px; z-index: 300; box-shadow: 0 4px 16px rgba(0,0,0,.25); font-weight: 400; }
  .calc-tip-popup::before { content: ''; position: absolute; top: -5px; right: 8px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #1e293b; }

  /* AUDIT HISTORY MODAL */
  .audit-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; align-items: flex-start; justify-content: flex-end; padding: 60px 16px 16px 0; }
  .audit-overlay.open { display: flex; }
  .audit-panel { background: var(--white); width: 440px; max-height: calc(100vh - 76px); border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; }
  .audit-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .audit-header h3 { font-size: 15px; font-weight: 700; }
  .audit-filter { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; background: #fafafa; }
  .audit-filter select { flex: 1; border: 1px solid var(--border); border-radius: 5px; padding: 5px 8px; font-size: 12px; outline: none; background: #fff; }
  .audit-list { flex: 1; overflow-y: auto; padding: 8px 0; }
  .audit-entry { padding: 10px 16px; border-bottom: 1px solid #f3f4f6; font-size: 12px; }
  .audit-entry:last-child { border-bottom: none; }
  .audit-entry .ae-field { font-weight: 700; color: var(--text); margin-bottom: 2px; }
  .audit-entry .ae-change { color: var(--muted); line-height: 1.4; }
  .audit-entry .ae-change .old { color: var(--red); text-decoration: line-through; }
  .audit-entry .ae-change .new { color: var(--green); }
  .audit-entry .ae-meta { color: #9ca3af; font-size: 11px; margin-top: 3px; }
  .audit-empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13px; }

  /* PDF UPLOAD MODAL */
  .pdf-upload-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; align-items: center; justify-content: center; }
  .pdf-upload-overlay.open { display: flex; }
  .pdf-upload-modal { background: var(--white); width: 520px; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.2); overflow: hidden; }
  .pdf-upload-header { padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
  .pdf-upload-header h3 { font-size: 16px; font-weight: 700; }
  .pdf-drop-zone { margin: 20px 22px; border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 20px; text-align: center; cursor: pointer; transition: all .15s; }
  .pdf-drop-zone:hover, .pdf-drop-zone.dragging { border-color: var(--accent); background: var(--accent-light); }
  .pdf-drop-zone .drop-icon { font-size: 32px; margin-bottom: 10px; }
  .pdf-drop-zone p { font-size: 13px; color: var(--muted); }
  .pdf-drop-zone strong { color: var(--accent); }
  .pdf-drop-zone input[type=file] { display: none; }
  .pdf-conflict-list { margin: 0 22px 16px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
  .pdf-conflict-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
  .pdf-conflict-row:last-child { border-bottom: none; }
  .pdf-conflict-row .cf-field { font-weight: 700; color: var(--text); min-width: 130px; flex-shrink: 0; }
  .pdf-conflict-row .cf-vals { flex: 1; }
  .pdf-conflict-row .cf-old { color: var(--red); }
  .pdf-conflict-row .cf-new { color: var(--green); }
  .pdf-conflict-row .cf-choice { display: flex; gap: 6px; margin-top: 4px; }
  .cf-btn { border: 1px solid var(--border); background: var(--white); border-radius: 4px; padding: 2px 10px; font-size: 11px; cursor: pointer; font-weight: 600; }
  .cf-btn.keep { color: var(--muted); }
  .cf-btn.use-new { color: var(--green); border-color: var(--green); }
  .cf-btn.use-new.active { background: var(--green); color: #fff; }
  .cf-btn.keep.active { background: #f3f4f6; }
  .pdf-upload-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

  /* EXPORT SECTION REORDER */
  .export-section-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 5px; cursor: default; font-size: 13px; margin-bottom: 2px; background: var(--white); border: 1px solid transparent; transition: background .1s; }
  .export-section-row:hover { background: var(--accent-light); border-color: var(--border); }
  .export-section-row.drag-over-ex { border-top: 2px solid var(--accent); }
  .ex-drag-handle { color: #c4b5fd; font-size: 12px; cursor: grab; user-select: none; flex-shrink: 0; }
  .ex-drag-handle:hover { color: var(--accent); }

  /* FORMULA INFO PAGE */
  .formula-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; align-items: flex-start; justify-content: center; padding-top: 40px; }
  .formula-overlay.open { display: flex; }
  .formula-panel { background: var(--white); width: 660px; max-height: calc(100vh - 80px); border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; }
  .formula-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .formula-header h3 { font-size: 15px; font-weight: 700; }
  .formula-nav { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--border); padding: 0 16px; }
  .formula-tab { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
  .formula-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .formula-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
  .formula-row { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .formula-row:last-child { border-bottom: none; margin-bottom: 0; }
  .formula-row .fr-field { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px; }
  .formula-row .fr-formula { font-family: monospace; font-size: 12px; background: #f1f5f9; padding: 8px 10px; border-radius: 5px; color: #334155; margin-bottom: 5px; }
  .formula-row .fr-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

  /* ── v12 rebuild additions ─────────────────────────────────────────────────────────────────
     Everything above is the v12 mockup stylesheet. Everything below styles structure the mockups
     express with inline attributes, plus the states a live application needs and a static
     prototype does not: overrides, save status, focus, and narrow viewports. */

  /* SHELL */
  .logo-mark { display: flex; align-items: center; gap: 10px; }
  .qc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .qc-icon { font-size: 18px; }
  .qc-title { margin: 0; color: #C47D0E; border-bottom: none; padding-bottom: 0; }
  .app-header { height: 52px; min-height: 52px; gap: 12px; flex-wrap: nowrap; }
  .app-header .logo-mark { flex-shrink: 0; }
  .header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: nowrap; min-width: 0; }
  .header-tools { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
  .header-btn.ok { color: var(--green); border-color: var(--green); }
  .header-btn.ok:hover { background: var(--green); border-color: var(--green); color: #fff; }
  .header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }

  /* ACCOUNT MENU */
  .account-menu { position: relative; display: inline-block; font-size: 12px; color: var(--muted); }
  .account-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    max-width: 200px;
    transition: all .15s;
  }
  .account-summary::-webkit-details-marker { display: none; }
  .account-summary:hover { background: #f5f5f5; border-color: var(--accent); }
  .account-summary .account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-summary .caret { font-size: 10px; color: var(--muted); }
  .account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
  }
  .account-item {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    text-align: left;
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
    display: block;
    width: 100%;
    white-space: nowrap;
    transition: background .1s, color .1s;
  }
  .account-item:hover { background: var(--accent-light); color: #C47D0E; }
  .user-chip { font-size: 12px; color: var(--muted); white-space: nowrap; }
  @media (max-width: 1180px) {
    .header-actions .user-chip { display: none; }
  }
  .app-body { display: flex; flex: 1; }
  .editor-wrap { display: flex; flex: 1; min-height: calc(100vh - 52px); position: relative; z-index: 1; }
  .main, .main.wide {
    max-width: 860px;
    background-image: none;
    background-color: transparent;
  }
  input.age-field, input[data-age-from] { background: #e8e4f9; color: var(--text); }
  .case-chip { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; margin-bottom: 14px; }
  .step-heading { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
  .lede { color: var(--muted); font-size: 13px; line-height: 1.55; }

  /* FOOTER STATUS */
  .footer-status { flex: 1; text-align: center; }
  .save-chip { font-size: 12px; color: var(--muted); }
  .btn[disabled] { opacity: .45; cursor: not-allowed; }
  .btn-xs { padding: 5px 12px; font-size: 12px; }
  .btn.warn { color: var(--gold); border-color: var(--gold); }
  .icon-btn { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
  .row-remove { background: none; border: none; cursor: pointer; color: var(--red); font-size: 20px; line-height: 1; padding: 0 4px; align-self: center; }
  .link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
  .source-line { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
  .source-line .link-btn { font-size: 11px; }

  /* BANNERS */
  .banner { border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
  .banner.warn { background: #fff8e1; border: 1px solid #fdd835; border-left: 4px solid var(--gold); color: #5d4037; }
  .banner.gate { background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid var(--red); color: #7f1d1d; }
  .banner.ok { background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid var(--green); color: #166534; }
  .banner-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .banner-links .btn { padding: 4px 12px; font-size: 12px; background: #fff; border-color: currentColor; color: inherit; }
  .advisor-error-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .advisor-error-row .btn { flex-shrink: 0; background: #fff; border-color: currentColor; color: inherit; }
  .error-details { margin-top: 8px; font-size: 11px; color: #6b7280; }
  .error-details summary { cursor: pointer; width: max-content; font-weight: 700; }
  .error-details div { margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

  /* EXPLAINERS — the mockup's inline-styled callout boxes */
  .explainer { border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; font-size: 12px; line-height: 1.6; }
  .explainer.tight { padding: 10px 14px; margin: 12px 0; }
  .explainer.green { background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid var(--green); color: #1a3a2a; }
  .explainer.gold { background: #fff8e1; border: 1px solid #fdd835; border-left: 4px solid var(--gold); color: #5d4037; }
  .explainer.accent { background: var(--accent-light); border: 1px solid #f5d98e; border-left: 4px solid var(--accent); color: #92400e; font-size: 13px; }
  .group-heading { font-size: 14px; color: var(--label); font-weight: 700; margin-bottom: 10px; }

  /* CALCULATED FIELDS AND OVERRIDES */
  .calc-flag { font-size: 10px; color: var(--muted); font-weight: 400; }
  .derived, input.derived { background: #f5f5f5; color: var(--muted); }
  .derived-box { padding: 7px 10px; background: #f5f5f5; border-radius: 6px; font-size: 13px; color: var(--muted); flex: 1; }
  .calc-strip { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .total-strip { border-top: 2px solid var(--accent); margin-top: 12px; padding-top: 14px; }
  .override-btn { flex-shrink: 0; margin-left: 6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .override-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
  .override-btn.on { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
  .label-aside { font-size: 11px !important; color: var(--muted) !important; font-weight: 500 !important; }
  .override-note { margin-top: 4px; font-size: 11px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 5px; padding: 6px 8px; line-height: 1.5; }
  .override-stale { color: var(--red); }
  .goal-short-hint { color: var(--gold); margin-top: 4px; }
  .carry-flag { font-size: 10px; color: var(--accent); font-weight: 600; }
  .sync-flag { margin-top: 4px; font-size: 11px; font-weight: 600; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 5px; padding: 4px 8px; line-height: 1.5; }
  .sync-flag.manual { font-weight: 400; }
  .sync-flag .link-btn { font-size: 11px; color: #92400e; }

  /* AGENT LOOKUP */
  .inline-search { display: flex; gap: 8px; }
  .inline-search input { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 13px; background: var(--input-bg); outline: none; }
  .inline-search input:focus { border-color: var(--accent); background: #fff; }
  .match-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
  .match-row { display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%; background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 12px; cursor: pointer; }
  .match-row:hover { border-color: var(--accent); background: var(--accent-light); }
  .match-row span { color: var(--muted); }
  .split-ok { color: var(--green); font-size: 12px; margin-top: 4px; font-weight: 600; }
  .split-error { color: var(--red); font-size: 12px; margin-top: 4px; font-weight: 600; }

  /* HEALTH QUESTIONNAIRE */
  .condition-group { margin-bottom: 10px; }
  .condition-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
  .nested-row { border-top: 1px solid #dde5ff; padding-top: 10px; margin-top: 10px; }
  .nested-row:first-child { border-top: none; padding-top: 0; margin-top: 0; }

  /* DATA TABLES */
  .table-scroll { overflow-x: auto; }
  .data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .data-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--label); border-bottom: 2px solid var(--border); white-space: nowrap; }
  .data-table.accent th { background: var(--accent); color: #fff; border-bottom: none; }
  .data-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
  .data-table tbody tr:nth-child(even) { background: #fafafa; }
  .data-table .ta-right, .data-table th.ta-right { text-align: right; }
  .data-table .muted { color: var(--muted); }
  .data-table .pos { color: var(--green); }
  .data-table .neg { color: var(--red); }
  .data-table .gold { color: var(--gold); }
  .data-table .plan { color: #C47D0E; }
  .data-table tr.total-row { background: var(--accent-light); }
  .data-table tr.total-row td { color: #C47D0E; }
  .data-table tr.milestone-retire { background: #fff4e0; border-bottom: 2px solid var(--accent); font-weight: 700; }
  .data-table tr.milestone-life { background: #fee2e2; border-bottom: 2px solid var(--red); font-weight: 700; }

  /* STAT TILES */
  .stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
  .stat-tile { border-radius: 6px; padding: 12px; text-align: center; }
  .stat-tile.accent { background: var(--accent-light); }
  .stat-tile.green { background: #dcfce7; }
  .stat-tile.red { background: #fee2e2; }
  .st-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
  .st-value { font-size: 20px; font-weight: 900; color: #C47D0E; }
  .stat-tile.green .st-value { color: var(--green); }
  .stat-tile.red .st-value { color: var(--red); }
  .formula-strip { background: var(--accent-light); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #92400e; }

  /* COVERAGE MIX */
  .mix-row { display: flex; gap: 10px; flex-wrap: wrap; }
  .mix-tile { flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 6px; padding: 10px; text-align: center; }
  .mix-tile.total { border: 2px solid var(--accent); background: var(--accent-light); }
  .mx-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
  .mix-tile.total .mx-label { color: var(--accent); font-weight: 700; }
  .mx-value { font-size: 16px; font-weight: 800; color: #C47D0E; }

  /* PIE TOOLTIP */
  .pie-tooltip { position: absolute; background: rgba(0,0,0,.8); color: #fff; padding: 6px 10px; border-radius: 5px; font-size: 11px; pointer-events: none; white-space: nowrap; z-index: 10; }

  /* MODALS */
  .modal-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
  #export-section-list { background: var(--bg); border-radius: 6px; padding: 8px; margin-bottom: 10px; }
  .export-section-row.dragging { opacity: .4; }
  .export-section-row input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
  .note-toolbar { display: flex; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--border); background: #fafafa; }
  .note-toolbar button { background: none; border: none; border-radius: 4px; padding: 4px 7px; cursor: pointer; font-size: 13px; color: var(--muted); transition: background .1s; }
  .note-toolbar button:hover { background: var(--border); color: var(--text); }
  .note-modal-hint { padding: 8px 20px 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
  .note-modal-footer { gap: 10px; }
  .audit-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 1.5; }

  /* LOGIN */
  .login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f7f7f5; padding: 24px; position: relative; z-index: 1; }
  .login-card { width: 420px; max-width: 100%; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 10px; padding: 28px; box-shadow: var(--shadow); }
  .login-card .brand-logo { margin-bottom: 14px; }
  .login-card h1 { font-size: 22px; margin: 8px 0 6px; }
  .login-card .lede { margin-bottom: 18px; }
  .btn-block { display: block; width: 100%; text-align: center; text-decoration: none; }

  /* CASE LIST */
  .list-page { max-width: 1080px; margin: 0 auto; padding: 28px 32px 80px; position: relative; z-index: 1; }
  .list-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .case-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
  .case-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: #fafafa; border-bottom: 1px solid var(--border); }
  .case-table td { padding: 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; vertical-align: top; }
  .case-table tr:last-child td { border-bottom: none; }
  .case-table tbody tr[data-open] { cursor: pointer; }
  .case-table tbody tr[data-open]:hover { background: var(--accent-light); }
  .filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
  .status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
  .status-draft { background: #fff4e0; color: #92400e; }
  .status-completed { background: #dcfce7; color: #166534; }
  .empty-state { padding: 36px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; background: #fff; }
  .empty-state.compact { padding: 18px; margin-top: 12px; }
  .client-flow-modal, .import-modal { width: min(920px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; }
  .start-options { border: 0; padding: 0; margin: 18px 0 0; }
  .start-options legend { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
  .start-options label { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--border); border-radius: 7px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
  .start-options input { margin-top: 3px; accent-color: var(--accent); }
  .start-options span { display: flex; flex-direction: column; gap: 2px; }
  .start-options small { color: var(--muted); font-size: 11px; }
  .client-search { margin-bottom: 12px; }
  .client-results { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; margin-top: 12px; }
  .client-result { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, .7fr) auto; gap: 14px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--border); }
  .client-result:last-child { border-bottom: 0; }
  .client-result-heading { padding-top: 7px; padding-bottom: 7px; background: #fafafa; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .client-advisor { color: var(--text); font-size: 12px; }
  .client-advisor span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
  .profile-notice { color: #92400e; font-size: 11px; margin-top: 3px; }
  .client-loading { min-height: 150px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
  .client-loading-inline { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
  .loading-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: efa-spin .8s linear infinite; }
  @keyframes efa-spin { to { transform: rotate(360deg); } }
  .review-differences-title { margin: 18px 0 8px; font-size: 15px; }
  .automatic-fill { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; border-radius: 6px; padding: 9px 11px; margin-bottom: 12px; font-size: 12px; font-weight: 600; }
  .import-review-table th:last-child { min-width: 220px; }
  .import-review-table .import-note-value { white-space: pre-wrap; word-break: break-word; }
  .import-choice { display: flex; flex-direction: column; gap: 5px; white-space: nowrap; }
  .import-choice label { font-size: 11px; font-weight: 600; cursor: pointer; }
  .import-choice input { accent-color: var(--accent); }
  .app-toast { position: fixed; top: 70px; right: 24px; z-index: 1200; max-width: 420px; padding: 11px 15px; border-radius: 7px; background: #166534; color: #fff; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
  .stat { background: #fafafa; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
  .stat-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .stat-value { display: block; font-size: 14px; font-weight: 700; margin-top: 2px; word-break: break-word; }
  .json-dump { white-space: pre-wrap; word-break: break-word; max-height: 18rem; overflow: auto; font-size: 12px; margin: 8px 0 0; }
  .quote-disclaimer { font-size: 11px; color: #92400e; margin-top: 8px; }

  /* FOCUS — the mockup only recolours the border, which leaves keyboard users nothing to follow */
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
  .nav-item:focus-visible { outline-offset: -2px; }

  /* RESPONSIVE — the mockups are desktop-only; these keep the same hierarchy at narrower widths */
  @media (max-width: 1080px) {
    .main, .main.wide { max-width: none; }
    .stat-tiles { grid-template-columns: 1fr; }
    .dev-table { min-width: 620px; }
  }
  @media (max-width: 860px) {
    .app-header { height: auto; padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
    .sidebar { position: static; width: 100%; min-height: 0; border-right: none; border-bottom: 1px solid var(--border); padding: 8px 0; display: flex; overflow-x: auto; }
    .editor-wrap { flex-direction: column; }
    .nav-item { flex-direction: column; gap: 4px; padding: 8px 12px; white-space: nowrap; }
    .nav-item.active { border-right: none; border-bottom: 3px solid #F59E1B; }
    .drag-handle { display: none; }
    .main { padding: 18px 16px 120px; }
    .list-page { padding: 18px 16px 80px; }
    .field-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .al-grid { grid-template-columns: 1fr; }
    .budget-chart-wrap, .nw-breakdown { flex-direction: column; }
    .footer-bar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .footer-status { order: 3; flex-basis: 100%; text-align: left; }
    .checkbox-group[style] { grid-template-columns: 1fr !important; }
    .modal, .note-modal, .pdf-upload-modal, .formula-panel, .audit-panel { width: calc(100vw - 32px) !important; }
    .client-result { grid-template-columns: 1fr; }
    .dev-auth-block { grid-template-columns: 1fr; }
    .dev-table { min-width: 560px; }
  }

  /* DEV TOOLS & API CATALOG */
  .dev-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 6px; margin: 8px 0 12px; background: #fff; }
  .dev-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
  .dev-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; background: #fafafa; border-bottom: 1px solid var(--border); }
  .dev-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; font-size: 12.5px; }
  .dev-table tr:last-child td { border-bottom: none; }
  .dev-group-block { margin-top: 18px; }
  .dev-group-title { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; }
  .dev-op-key { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; color: var(--muted); margin-top: 3px; }
  .dev-list { margin: 0; padding-left: 16px; list-style-type: disc; display: flex; flex-direction: column; gap: 4px; }
  .dev-list li { font-size: 12px; line-height: 1.45; color: var(--text); }
  .dev-feature-desc { color: var(--muted); font-size: 11px; margin-left: 4px; }
  .http-badge { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 700; font-size: 11px; padding: 2px 7px; border-radius: 4px; letter-spacing: 0.04em; text-align: center; line-height: 1.3; }
  .method-get { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
  .method-post { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
  .method-delete { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
  .method-put { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
  .badge-muted { background: #f3f4f6; color: #4b5563; }
  .dev-banner-note { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 14px; font-size: 12px; color: #334155; line-height: 1.5; }
  .dev-auth-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
  .dev-auth-tile { background: #fafafa; border: 1px solid var(--border); border-radius: 6px; padding: 12px; font-size: 12px; line-height: 1.5; }
  .dev-auth-tile strong { display: block; font-size: 12px; color: var(--label); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
  .dev-write-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0 14px; }
  .dev-write-tile { background: #fafafa; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; text-align: center; }
  .dev-write-tile .tile-count { font-size: 16px; font-weight: 700; color: #C47D0E; }
  .dev-write-tile .tile-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

  /* PRINT */
  /* ── Round 1 QA (2026-10-08) ─────────────────────────────────────────────────────────────── */
  .nav-item.in-progress .nav-num { border-color: var(--gold); color: #C47D0E; background: var(--gold-light); }
  .section-note-inline { flex-direction: column; gap: 4px; background: #ffffff; border: 1px solid var(--border); color: #040404; font-size: 13px; }
  .section-note-inline .note-visibility { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .section-note-inline .note-body, .section-note-inline .note-body * { font-weight: 400; color: #040404; }
  .date-picker { display: flex; gap: 6px; }
  .field .date-picker select { flex: 1; min-width: 0; padding: 7px 6px; }
  .date-store { display: none !important; }
  .cq-slider { display: flex; align-items: center; gap: 8px; width: 100%; }
  .cq-slider input[type=range] { flex: 1; accent-color: var(--accent); }
  .cq-slider input[type=number] { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
  .audit-entry .ae-line { margin-top: 2px; }
  .audit-entry .ae-line-field { color: var(--text); }
  @media print {
    body.printing-audit { min-height: 0 !important; display: block !important; }
    body.printing-audit .editor-wrap, body.printing-audit .app-toast { display: none !important; }
  }

  /* PRINT */
  @media print {
    .app-header, .sidebar, .footer-bar, .page-watermark, .no-print { display: none !important; }
    .main { padding: 0; max-width: none; background: none; }
    body.printing-audit .main,
    body.printing-audit .modal,
    body.printing-audit .note-modal,
    body.printing-audit .formula-panel {
      display: none !important;
    }
    body.printing-audit #audit-overlay {
      display: block !important;
      position: static !important;
      background: none !important;
      padding: 0 !important;
    }
    body.printing-audit .audit-panel {
      width: 100% !important;
      max-height: none !important;
      box-shadow: none !important;
      border: none !important;
    }
    body.printing-audit .audit-header button,
    body.printing-audit .audit-filter,
    body.printing-audit [data-action="print-audit"] {
      display: none !important;
    }
  }
