:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --text: #10213b;
  --muted: #67758c;
  --line: #dfe6f1;
  --blue: #0b5cff;
  --blue-dark: #0647c8;
  --blue-soft: #eaf2ff;
  --green: #178a52;
  --green-soft: #e9f8f0;
  --amber: #9a6500;
  --amber-soft: #fff6dc;
  --red: #b42318;
  --red-soft: #fff0ee;
  --shadow: 0 16px 40px rgba(32, 56, 92, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: #f9fbff; border-right: 1px solid var(--line); padding: 25px 18px; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 22px; }
.brand-mark { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), #0042ae); color: white; font-weight: 800; box-shadow: 0 8px 20px rgba(11,92,255,.24); }
.brand strong { display: block; font-size: 19px; letter-spacing: -.02em; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.tax-year-pill { padding: 13px 14px; border: 1px solid var(--line); background: white; border-radius: 13px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.tax-year-pill span { color: var(--muted); font-size: 12px; }
.tax-year-pill strong { font-size: 13px; }
.step-nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #40506a; padding: 11px 12px; border-radius: 11px; display: flex; align-items: center; gap: 11px; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item span { width: 24px; height: 24px; border-radius: 7px; background: #eef2f8; color: #6a7890; display: grid; place-items: center; font-size: 11px; }
.nav-item:hover { background: #f0f5ff; }
.nav-item.active { background: var(--blue-soft); color: var(--blue-dark); }
.nav-item.active span { background: var(--blue); color: white; }
.sidebar-note { margin-top: auto; padding: 14px; border-radius: 13px; background: white; border: 1px solid var(--line); }
.sidebar-note strong { font-size: 12px; }
.sidebar-note p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); }
.main-area { grid-column: 2; min-width: 0; padding: 26px 330px 60px 34px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 3px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; color: var(--blue); }
h1 { font-size: 24px; margin: 0; letter-spacing: -.03em; }
.topbar-actions { display: flex; gap: 9px; }
.btn { border: 1px solid var(--line); background: white; color: var(--text); padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 12px; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(22,47,87,.08); }
.btn.primary { color: white; background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.ghost { background: white; }
.btn.danger { color: var(--red); }
.btn.full { width: 100%; }
.alert { padding: 14px 16px; border-radius: 12px; margin: 0 0 18px; font-size: 12px; line-height: 1.5; }
.alert.warning { color: #704a00; background: var(--amber-soft); border: 1px solid #f0d993; }
.hidden { display: none !important; }
.step-panel { display: none; }
.step-panel.active { display: block; animation: enter .18s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 8px 0 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 25px; letter-spacing: -.035em; }
.section-heading p { color: var(--muted); font-size: 12px; margin: 0 0 4px; max-width: 390px; text-align: right; }
.step-kicker { text-transform: uppercase; font-size: 10px; letter-spacing: .08em; color: var(--blue); font-weight: 800; }
.form-card, .card, .metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 24px; }
.narrow-card { max-width: 650px; }
.field-row { display: grid; gap: 18px; }
.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.field-grid.four-col { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 12px; font-weight: 760; color: #263955; }
.field small { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
select, input[type="number"] { width: 100%; border: 1px solid #cfd8e6; border-radius: 10px; padding: 11px 12px; background: white; color: var(--text); outline: none; transition: border .15s, box-shadow .15s; }
select:focus, input[type="number"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,92,255,.10); }
select:disabled { color: #4e5f79; background: #f8fafc; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button { border: 1px solid #d4dce9; color: #52627a; background: white; padding: 9px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.segmented button.selected { border-color: #9abaff; color: var(--blue-dark); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(11,92,255,.05); }
.checkbox-field { justify-content: flex-start; }
.check-line { display: flex; align-items: center; gap: 9px; min-height: 42px; border: 1px solid #d4dce9; border-radius: 10px; padding: 9px 11px; background: white; }
.check-line input { width: 16px; height: 16px; accent-color: var(--blue); }
.check-line span { font-size: 11.5px; color: #42536c; }
.money-input { display: flex; align-items: center; border: 1px solid #cfd8e6; border-radius: 10px; overflow: hidden; background: white; }
.money-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,92,255,.10); }
.money-input b { padding: 0 0 0 12px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.money-input input { border: 0; box-shadow: none !important; }
.special-field { background: #fffcf5; border: 1px dashed #ead49b; border-radius: 13px; padding: 14px; }
.special-field em { font-size: 9px; color: var(--amber); text-transform: uppercase; letter-spacing: .06em; font-style: normal; }
.info-strip { background: #f0f5ff; color: #445977; border: 1px solid #d6e4ff; padding: 12px 13px; border-radius: 11px; font-size: 11px; line-height: 1.5; margin-bottom: 20px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
h3 { margin: 0 0 14px; font-size: 15px; }
.max-500 { max-width: 500px; }
.summary-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { padding: 16px; box-shadow: none; }
.metric-card span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 9px; }
.metric-card strong { display: block; font-size: 20px; letter-spacing: -.03em; }
.metric-card small { display: block; font-size: 9px; color: #8390a3; margin-top: 5px; }
.metric-card.accent { border-color: #bcd2ff; background: linear-gradient(145deg,#f7faff,#eaf2ff); }
.metric-card.accent strong { color: var(--blue-dark); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px,.75fr); gap: 14px; }
.card { padding: 18px; box-shadow: none; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-heading h3 { margin: 0; }
.card-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.badge { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; background: var(--blue-soft); color: var(--blue-dark); padding: 5px 8px; border-radius: 999px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
th { color: #718096; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; text-align: left; background: #f7f9fc; }
th, td { padding: 10px 9px; border-bottom: 1px solid #e6ebf2; white-space: nowrap; }
td { color: #34465f; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-weight: 750; font-size: 9px; }
.status.ok { color: var(--green); background: var(--green-soft); }
.status.pending { color: var(--red); background: var(--red-soft); }
.footnote { color: var(--muted); font-size: 9.5px; margin-top: 12px; line-height: 1.45; }
.calculation-list { display: flex; flex-direction: column; gap: 2px; }
.calc-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #eef1f5; font-size: 10.5px; }
.calc-row span { color: #56677e; }
.calc-row b { color: #162a47; }
.calc-row.total { padding-top: 12px; font-size: 12px; }
.calc-row.total span, .calc-row.total b { font-weight: 800; color: var(--text); }
.summary-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.hero-summary { padding: 28px; background: linear-gradient(145deg,#0b5cff,#063fbd); color: white; border: 0; min-height: 285px; display: flex; flex-direction: column; justify-content: center; }
.hero-summary > span { opacity: .82; font-size: 12px; }
.hero-summary > strong { font-size: 44px; letter-spacing: -.05em; margin: 7px 0 8px; }
.hero-summary p { opacity: .84; font-size: 12px; max-width: 520px; line-height: 1.55; }
.hero-actions { display: flex; gap: 9px; margin-top: 15px; }
.hero-summary .btn.primary { background: white; color: var(--blue-dark); border-color: white; }
.hero-summary .btn.ghost { background: rgba(255,255,255,.09); color: white; border-color: rgba(255,255,255,.28); }
.scope-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.scope-card li { position: relative; padding-left: 21px; color: #7a8798; font-size: 11px; }
.scope-card li::before { content: '○'; position: absolute; left: 0; }
.scope-card li.done { color: #34536e; }
.scope-card li.done::before { content: '✓'; color: var(--green); font-weight: 900; }
.live-panel { position: fixed; top: 92px; right: 28px; width: 278px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 17px; }
.live-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.live-title div span, .live-title div strong { display: block; }
.live-title span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.live-title strong { font-size: 12px; margin-top: 2px; }
.live-dot { width: 9px; height: 9px; background: #19af6c; border-radius: 99px; box-shadow: 0 0 0 4px #e4f8ee; }
.live-main { padding: 18px 0; }
.live-main span { display: block; color: var(--muted); font-size: 10px; }
.live-main strong { display: block; font-size: 28px; margin: 5px 0; letter-spacing: -.045em; color: var(--blue-dark); }
.live-main small { font-size: 9.5px; color: #8793a5; }
.mini-breakdown { display: grid; gap: 10px; padding: 13px; background: #f8faff; border-radius: 12px; margin-bottom: 14px; }
.mini-breakdown div { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.mini-breakdown span { color: #718096; }
.mini-breakdown b { color: #293d5a; }
.privacy-note { text-align: center; margin: 11px 0 0; color: #9aa5b4; font-size: 8.5px; }
.toast { position: fixed; right: 28px; bottom: 25px; background: #12233d; color: white; padding: 11px 14px; border-radius: 10px; font-size: 11px; box-shadow: 0 10px 30px rgba(15,31,55,.25); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: none; }
@media (max-width: 1180px) {
  .main-area { padding-right: 34px; }
  .live-panel { position: static; width: auto; margin-top: 18px; }
  .summary-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: auto; min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .step-nav { display: grid; grid-template-columns: repeat(3,1fr); }
  .sidebar-note { display: none; }
  .main-area { padding: 22px; }
  .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading p { text-align: left; }
  .two-col, .field-grid, .field-grid.four-col, .content-grid, .summary-layout { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media print {
  .sidebar, .topbar-actions, .live-panel, .step-nav, .hero-actions, .toast { display: none !important; }
  .main-area { grid-column: 1; padding: 20px; }
  .step-panel { display: none !important; }
  .step-panel[data-panel="advance"], .step-panel[data-panel="summary"] { display: block !important; margin-bottom: 24px; }
  body { background: white; }
  .form-card, .card, .metric-card { box-shadow: none; }
}
