:root {
  color-scheme: light;
  --ink: #122134;
  --muted: #647184;
  --line: #dce2e8;
  --paper: #f3f6f8;
  --white: #fff;
  --blue: #0756d7;
  --navy: #0b2856;
  --orange: #ff8a3d;
  --green: #25b67a;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 9px 12px; border-radius: 6px; background: #fff; color: var(--navy); font-weight: 750; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, 5vw); background: var(--navy); color: #fff; }
header p { margin: 0; color: #cbd8ea; font-size: .875rem; }
.brand { color: #fff; text-decoration: none; font-weight: 850; letter-spacing: .08em; }
.brand span { margin-left: 12px; padding: 5px 8px; border: 1px solid #ffffff40; border-radius: 4px; font-size: .68rem; font-weight: 650; color: #bcd0ee; }
header nav { display: flex; gap: 18px; }
header nav a { color: #bcd0ee; text-decoration: none; font-size: .875rem; }
header nav a[aria-current="page"], header nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
main { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 44px 0 54px; }
.heading { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 28px; }
.kicker { margin: 0; color: var(--blue); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.heading h1 { margin: 9px 0 0; font-size: clamp(2.1rem, 4.5vw, 3.6rem); line-height: 1.1; letter-spacing: -.055em; }
.heading-copy { padding-bottom: 5px; }
.heading-copy p { max-width: 480px; margin: 0 0 16px; color: var(--muted); }
button { border: 1px solid #b9c4d0; background: #fff; color: var(--navy); border-radius: 7px; padding: 9px 14px; font-size: .875rem; font-weight: 700; }
button:hover { background: #eef4ff; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #79a9ff; outline-offset: 2px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px #25395212; }
.inputs { padding: 28px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-title h2 { margin: 0; font-size: 1.1rem; }
.section-title button { border: 0; padding: 5px; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.fields label { display: grid; gap: 7px; color: #39485b; font-size: .88rem; font-weight: 700; }
.money-input { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 500; }
.money-input input { width: 100%; min-width: 0; height: 45px; padding: 0 12px; border: 1px solid #bcc7d2; border-radius: 7px; color: var(--ink); background: #fbfcfd; font-weight: 650; }
.form-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.results { padding: 30px; background: var(--navy); color: #fff; }
.result-label { margin: 0; color: #b9ccec; font-size: .9rem; }
.profit { margin: 5px 0 0; font-size: clamp(2.7rem, 5vw, 4rem); font-weight: 850; letter-spacing: -.05em; }
.profit.negative { color: #ff9a8f; }
.verdict { min-height: 25px; margin: 2px 0 22px; color: #d8e3f4; font-size: .9rem; }
.verdict[data-state="negative"] { color: #ffc0b9; }
.breakdown { display: flex; height: 11px; margin-bottom: 14px; border-radius: 20px; overflow: hidden; background: #ffffff18; }
.breakdown i { display: block; transition: width .2s; }
.cost { background: var(--orange); }
.ad { background: var(--blue); }
.gain { background: var(--green); }
.legend { display: grid; gap: 7px; margin-bottom: 24px; color: #c6d5eb; font-size: .76rem; }
.legend span { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend b { color: #fff; font-weight: 650; }
.results dl { margin: 0; }
.results dl div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid #ffffff24; }
.results dt { color: #c6d5eb; font-size: .86rem; }
.results dd { margin: 0; text-align: right; font-weight: 750; }
.results .target { margin-top: 8px; padding: 16px 13px; border: 1px solid #ffffff24; border-radius: 8px; background: #ffffff0c; }
.explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 38px; }
.explain h2 { margin: 0 0 9px; font-size: 1.05rem; }
.explain p { margin: 0; color: var(--muted); font-size: .88rem; }
.guide { width: min(850px, 100%); margin: auto; }
.guide h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.045em; }
.guide > .lead { margin: 0 0 30px; color: var(--muted); font-size: 1.08rem; }
.guide article { padding: 26px 28px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.guide h2 { margin: 0 0 12px; font-size: 1.2rem; }
.guide p { margin: 8px 0; color: #47576b; }
.guide a { color: var(--blue); }
.formula { padding: 13px 15px; border-left: 4px solid var(--blue); background: #eef4ff; color: var(--navy) !important; font-weight: 700; }
.example-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.example-table th, .example-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.example-table th { color: var(--muted); font-size: .84rem; }
.guide .back { display: inline-block; margin-top: 10px; color: var(--blue); font-weight: 750; }
.compare-heading { margin-bottom: 26px; }
.compare-heading h1 { margin: 8px 0 10px; font-size: clamp(2rem, 4.5vw, 3.3rem); line-height: 1.12; letter-spacing: -.05em; }
.compare-heading > p:last-child { margin: 0; color: var(--muted); }
.compare-form { display: grid; gap: 18px; }
.common-costs, .scenario { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.common-costs h2, .scenario h2 { margin: 0 0 17px; font-size: 1.08rem; }
.compact-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.compact-fields label, .scenario-fields label { display: grid; gap: 6px; color: #39485b; font-size: .82rem; font-weight: 700; }
.compact-fields input, .scenario-fields input { width: 100%; min-width: 0; height: 43px; padding: 0 10px; border: 1px solid #bcc7d2; border-radius: 7px; background: #fbfcfd; color: var(--ink); font-weight: 650; }
.scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.scenario-a { border-top: 5px solid var(--blue); }
.scenario-b { border-top: 5px solid var(--orange); }
.scenario-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.comparison-result { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare-card { padding: 25px; border-radius: 14px; background: var(--navy); color: #fff; }
.compare-card h2 { margin: 0; color: #c7d6eb; font-size: .95rem; }
.compare-profit { margin: 5px 0 16px; font-size: 2.4rem; font-weight: 850; letter-spacing: -.045em; }
.compare-profit.negative { color: #ff9a8f; }
.compare-card dl { margin: 0; }
.compare-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #ffffff24; }
.compare-card dt { color: #c7d6eb; font-size: .84rem; }
.compare-card dd { margin: 0; text-align: right; font-weight: 750; }
.winner { padding: 20px 24px; border: 1px solid #b9d8ca; border-radius: 12px; background: #effaf5; }
.winner h2 { margin: 0 0 5px; color: #176544; font-size: 1.05rem; }
.winner p { margin: 0; color: #345e4e; }
.compare-note { margin: 0; color: var(--muted); font-size: .82rem; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(24px, 5vw); border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .8rem; }
footer strong { color: var(--ink); }
footer a { color: var(--blue); }

@media (max-width: 800px) {
  header { flex-wrap: wrap; padding-block: 14px; }
  header p { display: none; }
  header nav { order: 3; width: 100%; }
  main { width: min(100% - 28px, 620px); padding-top: 28px; }
  .heading { grid-template-columns: 1fr; gap: 18px; }
  .workbench { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .inputs, .results { padding: 22px; }
  .explain { grid-template-columns: 1fr; gap: 24px; }
  .results dl div { align-items: flex-start; }
  .guide article { padding: 20px; }
  .example-table { font-size: .85rem; }
  .compact-fields { grid-template-columns: 1fr 1fr; }
  .scenarios, .comparison-result { grid-template-columns: 1fr; }
  footer { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .compact-fields, .scenario-fields { grid-template-columns: 1fr; }
}
