@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --ink: #1c2220;
  --muted: #6f7772;
  --line: #d9d4c9;
  --panel: #fffdf8;
  --signal: #e46d52;
  --signal-dark: #b64d38;
  --sage: #607d70;
  --shadow: 0 18px 50px rgba(41, 45, 39, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--ink); color: var(--paper); font: 500 11px 'DM Mono', monospace; letter-spacing: -0.05em; }
.topbar-note { color: var(--muted); }

.hero { display: flex; justify-content: space-between; gap: 60px; padding: 74px 0 62px; }
.hero-copy { max-width: 720px; }
.eyebrow, .section-kicker { margin: 0 0 18px; color: var(--signal-dark); font: 500 11px 'DM Mono', monospace; letter-spacing: 0.14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: clamp(40px, 6vw, 72px); line-height: 1.04; letter-spacing: -0.05em; font-weight: 800; }
h1 em { color: var(--signal); font-style: normal; }
.hero-description { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.hero-aside { align-self: flex-end; display: grid; gap: 8px; width: 210px; padding-left: 20px; border-left: 2px solid var(--signal); color: var(--muted); font-size: 12px; line-height: 1.5; }
.hero-aside strong { color: var(--ink); font-size: 15px; }
.hero-aside-label { color: var(--signal-dark); font: 500 10px 'DM Mono', monospace; letter-spacing: 0.1em; }

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.panel { background: var(--panel); box-shadow: var(--shadow); }
.input-panel { padding: 38px 42px 34px; }
.result-panel { display: flex; flex-direction: column; min-height: 660px; padding: 38px 42px 34px; background: var(--ink); color: var(--panel); }
.panel-heading, .result-topline, .progress-meta, .stat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading { margin-bottom: 40px; }
.panel-heading.compact { margin: 0 0 27px; }
.panel-heading h2 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.panel-index { color: var(--signal-dark); font: 500 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; }
.field-group { margin-bottom: 22px; }
.field-group label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.field-group label span { color: var(--muted); font-size: 11px; font-weight: 400; }
.input-wrap { display: flex; align-items: center; height: 52px; padding: 0 15px; border: 1px solid var(--line); background: #fbfaf5; color: var(--muted); transition: border-color .2s, background .2s; }
.input-wrap:focus-within { border-color: var(--signal); background: #fff; }
.input-wrap input { width: 100%; min-width: 0; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 19px; font-weight: 700; }
.input-wrap span { font: 500 13px 'DM Mono', monospace; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-fields .field-group label { display: block; }
.two-fields .input-wrap input { padding-left: 0; }
.section-rule { height: 1px; margin: 34px 0 32px; background: var(--line); }
.form-note { margin: 28px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.reset-button { padding: 0; border: 0; background: transparent; color: var(--signal-dark); font-size: 12px; font-weight: 700; }
.reset-button:hover { text-decoration: underline; text-underline-offset: 4px; }

.result-topline .section-kicker { color: #cf9d8d; margin-bottom: 0; }
.status-dot { width: 9px; height: 9px; background: var(--signal); border-radius: 50%; box-shadow: 0 0 0 5px rgba(228,109,82,.14); }
.status-dot.is-success { background: #9db9a2; box-shadow: 0 0 0 5px rgba(157,185,162,.15); }
.result-status { margin-top: 56px; color: var(--signal); font-size: 14px; font-weight: 800; }
.result-status.is-success { color: #9db9a2; }
.result-lead { max-width: 390px; min-height: 48px; margin: 12px 0 40px; color: #b8c0b9; font-size: 13px; line-height: 1.8; }
.target-number { padding-bottom: 28px; border-bottom: 1px solid #3c4540; }
.target-number span { display: block; margin-bottom: 10px; color: #909c94; font-size: 11px; }
.target-number strong { display: block; color: var(--panel); font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.05em; line-height: 1; }
.progress-track { height: 6px; margin-top: 30px; background: #3c4540; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .3s ease; }
.progress-meta { margin-top: 10px; color: #89948c; font: 11px 'DM Mono', monospace; }
.progress-meta strong { color: #c5cec5; font-weight: 500; }
.freedom-time { margin-top: 28px; padding: 18px 0 20px; border-top: 1px solid #3c4540; border-bottom: 1px solid #3c4540; }
.freedom-time span, .freedom-time small { display: block; color: #89948c; font-size: 11px; }
.freedom-time strong { display: block; margin: 7px 0 4px; color: var(--panel); font-size: 28px; letter-spacing: -0.04em; line-height: 1.1; }
.freedom-time small { color: #c5cec5; }
.result-stats { margin-top: auto; padding-top: 42px; }
.stat-row { padding: 13px 0; border-bottom: 1px solid #3c4540; color: #9ca69e; font-size: 12px; }
.stat-row strong { color: var(--panel); font-size: 14px; font-weight: 600; }
.stat-row strong.accent { color: var(--signal); }
.stat-row strong.warning { color: #e1b65c; font-size: 12px; }
.formula-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 28px; color: #9ca69e; font-size: 11px; line-height: 1.7; }
.formula-note p { margin: 0; }
.formula-note small { color: #69756c; font-size: 10px; }
.formula-mark { color: var(--signal); font: 500 20px 'DM Mono', monospace; }
.footer { display: flex; justify-content: space-between; padding: 28px 0 34px; color: var(--muted); font: 11px 'DM Mono', monospace; }

@media (max-width: 800px) {
  .shell { width: min(100% - 28px, 620px); }
  .topbar { min-height: 64px; }
  .topbar-note { display: none; }
  .hero { display: block; padding: 54px 0 42px; }
  h1 { font-size: clamp(40px, 13vw, 62px); }
  .hero-description { font-size: 14px; }
  .hero-aside { width: auto; margin-top: 30px; }
  .calculator-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 610px; }
}

@media (max-width: 460px) {
  .input-panel, .result-panel { padding: 28px 22px; }
  .panel-heading { margin-bottom: 30px; }
  .field-group label { display: block; line-height: 1.5; }
  .field-group label span { display: block; margin-top: 3px; }
  .two-fields { gap: 10px; }
  .two-fields .field-group label { min-height: 38px; }
  .footer { display: block; line-height: 2; }
}
