:root {
  --navy: #1B2F3F;
  --navy-deep: #152533;
  --navy-box: rgba(255, 255, 255, 0.055);
  --navy-border: rgba(255, 255, 255, 0.09);
  --mauve: #8C605D;
  --rose: #D2ADAE;
  --rose-light: #E6D3D2;
  --sand: #F5E9DA;
  --sand-soft: #F5ECE4;
  --gold: #D1A35F;
  --slate: #7D95A8;
  --bg: #FAF6F1;
  --surface: #FFFFFF;
  --tabs-bg: #F3ECE8;
  --border: #E8DDD5;
  --input-border: #DFD2CA;
  --text: #1B2F3F;
  --text-soft: #5A5C61;
  --muted: #827B76;
  --radius-card: 20px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(27, 47, 63, 0.045);
  --font-display: 'Montserrat', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.chez-logo {
  height: 46px;
  width: auto;
  display: block;
}

.brand-description {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--navy);
  border-left: 1px solid #D9CEC6;
  padding-left: 16px;
  line-height: 1.5;
}

.brand-description small {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  font-size: 11.5px;
}

button.quiet {
  background: var(--surface);
  border: 1px solid #CBB6B3;
  color: var(--navy);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

button.quiet:hover {
  background: var(--sand-soft);
  border-color: var(--mauve);
}

/* Main container */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

/* Intro / Hero */
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 14px 0 36px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--navy);
  text-transform: uppercase;
}

.intro h1 {
  margin: 12px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.intro h1 em {
  font-style: normal;
  color: var(--mauve);
}

.intro p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
}

.intro-art {
  position: relative;
  width: 245px;
  flex-shrink: 0;
  margin-right: 12px;
}

.intro-art svg {
  width: 100%;
  height: auto;
  display: block;
}

.sticker {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) rotate(-3.5deg);
  background: var(--sand);
  color: #6B5648;
  border: 1px solid #CBB6A4;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(27, 47, 63, 0.08);
}

/* Workspace Grid */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
  gap: 24px;
  align-items: start;
}

/* Left Editor Card */
.editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  background: var(--tabs-bg);
  padding: 7px 8px;
  border-bottom: 1px solid #EDE4DE;
}

.tabs button {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 10px 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: #665E5B;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tabs button:hover {
  color: var(--navy);
}

.tabs button.active {
  background: var(--surface);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 47, 63, 0.08);
}

.panel {
  display: none;
  padding: 28px 30px 30px;
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sand-soft);
  border: 1px solid #DFCCB9;
  color: #7E6250;
}

label, .label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #54595F;
  margin: 18px 0 8px;
}

/* Borderless Big Input matching screenshot */
.big-input {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 0 4px;
}

.big-input input {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
  padding: 2px 0;
  background: transparent;
}

.big-input span {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  color: #B4A9A3;
  margin-left: 8px;
}

/* Standard Input Box */
.unit {
  display: flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.unit:focus-within {
  border-color: var(--mauve);
  box-shadow: 0 0 0 3px rgba(140, 96, 93, 0.14);
}

.unit input {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  padding: 11px 0;
  background: transparent;
}

.unit span {
  font-size: 13.5px;
  font-weight: 500;
  color: #9A908A;
  margin-left: 6px;
  white-space: nowrap;
}

select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  outline: none;
}

select:focus {
  border-color: var(--mauve);
  box-shadow: 0 0 0 3px rgba(140, 96, 93, 0.14);
}

/* Custom Range Slider matching screenshot */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--rose-light);
  border-radius: 999px;
  outline: none;
  margin: 14px 0 8px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mauve) 0%, var(--mauve) 34%, #FFFFFF 38%, #FFFFFF 100%);
  border: 1.5px solid #B59594;
  box-shadow: 0 1px 4px rgba(27, 47, 63, 0.18);
  cursor: pointer;
  transition: transform 0.12s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mauve) 0%, var(--mauve) 34%, #FFFFFF 38%, #FFFFFF 100%);
  border: 1.5px solid #B59594;
  box-shadow: 0 1px 4px rgba(27, 47, 63, 0.18);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9A908A;
  margin-bottom: 10px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

/* Segmented Control (TVA, Durations, Notary) */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: #F6F1ED;
  border: 1px solid #E5DBD3;
  padding: 3px;
  border-radius: 11px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #7B7470;
  cursor: pointer;
  transition: all 0.15s;
}

.seg button.selected {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 700;
}

.helper {
  font-size: 11.5px;
  color: var(--muted);
  margin: 8px 0 12px;
  line-height: 1.45;
}

.text-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mauve);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  background: var(--surface);
}

.stepper button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

.stepper input {
  width: 40px;
  text-align: center;
  border: none;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  outline: none;
}

.stepper span {
  font-size: 13px;
  color: var(--muted);
}

/* Check cards */
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  cursor: pointer;
  background: #FCFAF8;
}

.check-card input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

.check-card span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.check-card small {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

/* Inline details matching screenshot */
.panel details {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #EFE7E1;
}

.panel details summary {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel details summary::-webkit-details-marker {
  display: none;
}

.panel details summary::before {
  content: '▸';
  font-size: 11px;
  color: var(--navy);
  transition: transform 0.15s;
}

.panel details[open] summary::before {
  content: '▾';
}

.details-content {
  margin-top: 10px;
}

.notary-intro {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.notary-card {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--sand-soft);
  border: 1px solid #E8D9CA;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notary-card span {
  font-size: 12px;
  color: #7E6250;
  font-weight: 600;
}

.notary-card strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}

.notary-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.info {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #F6F1ED;
  border-left: 3px solid var(--mauve);
  font-size: 12px;
  color: var(--text-soft);
}

.next {
  margin-top: 24px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 11px;
  background: var(--navy);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.next:hover {
  background: #243C50;
}

/* Other Debts */
.debt-empty {
  padding: 16px;
  border: 1px dashed var(--input-border);
  border-radius: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

.debt-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #FCFAF8;
}

.debt-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.debt-item-head input {
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy);
  outline: none;
  width: 75%;
}

.debt-remove {
  border: none;
  background: transparent;
  color: var(--mauve);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.add-debt {
  width: 100%;
  padding: 11px;
  border: 1px dashed var(--mauve);
  border-radius: 11px;
  background: transparent;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.add-debt:hover {
  background: var(--sand-soft);
}

/* Right Dark Result Panel */
.result {
  background: var(--navy);
  color: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 26px 24px 24px;
  box-shadow: 0 14px 34px rgba(27, 47, 63, 0.16);
  position: sticky;
  top: 20px;
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.result .eyebrow {
  color: #C7B9AE;
  font-size: 9.5px;
}

.live {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #CFD8E0;
}

.result-label {
  margin: 0;
  font-size: 12.5px;
  color: #BAC7D3;
}

.monthly {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 14px;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}

.monthly small {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: #9FB0BE;
  margin-left: 3px;
}

.simulation-warning {
  font-size: 11px;
  line-height: 1.5;
  color: #C4D0DA;
  background: var(--navy-box);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  padding: 13px 14px;
  margin: 0 0 18px;
}

.result-note {
  font-size: 11px;
  font-weight: 500;
  color: #9CB0BE;
  margin: 0 0 10px;
}

.funding-bar {
  display: flex;
  gap: 3px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.funding-bar span {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s;
}

.funding-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}

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

.funding-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #D2DCE4;
}

.funding-row strong {
  color: #FFFFFF;
  font-weight: 700;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 16px 0;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 9px;
  color: #B4C3CF;
}

.metric strong {
  color: #FFFFFF;
  font-weight: 700;
}

.effort {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--navy-box);
  border: 1px solid var(--navy-border);
}

.effort .metric {
  margin-bottom: 6px;
}

.effort-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  margin: 8px 0 8px;
  overflow: hidden;
}

.effort-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--rose);
  transition: width 0.25s, background 0.25s;
}

.effort-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 70%;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
}

#effortNote {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #B4C3CF;
}

.alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.alert {
  font-size: 11px;
  line-height: 1.45;
  color: #C7D3DD;
  padding: 2px 0;
}

.alert.warn {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(209, 163, 95, 0.14);
  border: 1px solid rgba(209, 163, 95, 0.35);
  color: #F4DEC0;
}

.print {
  margin-top: 16px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}

.print:hover {
  filter: brightness(1.06);
}

.privacy {
  margin: 12px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: #8EA1B0;
  text-align: center;
}

/* Timeline Card */
.timeline {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px 30px;
  box-shadow: var(--shadow);
}

.timeline .eyebrow {
  color: #6B747C;
  margin-bottom: 4px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 18px 2px 32px;
  border-bottom: 1px solid #ECE3DC;
  margin: 10px 0 24px;
  overflow-x: auto;
}

.bar-col {
  flex: 1;
  min-width: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.bar-pill {
  width: 100%;
  max-width: 28px;
  border-radius: 5px 5px 2px 2px;
  transition: height 0.25s, opacity 0.15s;
  cursor: pointer;
}

.bar-pill:hover {
  opacity: 0.85;
}

.bar-label {
  position: absolute;
  bottom: -29px;
  font-size: 10px;
  line-height: 1.15;
  color: #8B827C;
  text-align: center;
  white-space: pre-line;
}

/* Phases with gold left border matching screenshot */
.phase-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 18px;
}

.phase-card {
  border-left: 2px solid var(--gold);
  padding: 2px 0 2px 14px;
}

.phase-card span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #8B827C;
}

.phase-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0 4px;
  color: var(--navy);
}

.phase-card strong small {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: #8B827C;
}

.phase-card .phase-detail {
  display: block;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-soft);
}

/* Sources & Footer */
.sources {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
}

.sources summary {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

.source-content {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.6;
}

.source-content ul {
  padding-left: 18px;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 28px 0 20px;
  font-size: 12.5px;
}

.legal-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 22px;
  color: var(--muted);
  font-size: 12.5px;
}

.footer-logo {
  height: 40px;
}

/* Responsive */
@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .result {
    position: static;
  }
  .intro {
    flex-direction: column;
    align-items: flex-start;
  }
  .intro-art {
    width: 210px;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .tabs {
    display: flex;
    overflow-x: auto;
  }
  .tabs button {
    white-space: nowrap;
    padding: 10px 12px;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 22px 18px;
  }
  .timeline {
    padding: 22px 18px;
  }
}

@media print {
  header button, .tabs, .next, .print, .add-debt, .debt-remove, .legal-links {
    display: none !important;
  }
  body {
    background: #FFFFFF;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .panel {
    display: block !important;
    border-top: 1px solid var(--border);
  }
  .result {
    background: #FFFFFF !important;
    color: #1B2F3F !important;
    border: 1px solid #CCCCCC;
    box-shadow: none;
    position: static;
  }
  .result * {
    color: #1B2F3F !important;
  }
}
