:root {
  color-scheme: dark;
  --background: #080908;
  --surface: #11120f;
  --text: #f0f1ec;
  --muted: #adb0a6;
  --line: #33352e;
  --accent: #ffd400;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(calc(100% - 32px), 960px); margin-inline: auto; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; }
.topbar img { display: block; }
.login { color: var(--text); font-size: .9rem; }
.intro { padding-block: clamp(36px, 7vw, 80px) 32px; }
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { font-size: clamp(2.25rem, 6vw, 4.5rem); letter-spacing: -.055em; max-width: 18ch; }
h1 span { color: var(--accent); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: -.025em; }
h3 { font-size: 1.15rem; }
p { margin-block: .75em; color: var(--muted); }
.intro p, .guide { max-width: 68ch; }

.calculator, .contact {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: clamp(16px, 4vw, 32px);
}

.shared-cost { max-width: 250px; margin-top: 20px; }
.scenarios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-block: 16px 0; }
fieldset { margin: 0; min-width: 0; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding-inline: 6px; font-weight: 750; }
label { display: block; font-size: .9rem; }
fieldset label + label { margin-top: 10px; }
input {
  width: 100%;
  margin-top: 4px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font-size: 1rem;
}
.hint { font-size: .875rem; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--background);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #ffe264; }
.results { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.results dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.results dl div { display: grid; align-content: start; border-radius: 8px; background: var(--background); padding: 10px; }
dt { font-size: .875rem; color: var(--muted); }
dd { margin: 4px 0 0; font-size: clamp(1rem, 3vw, 1.5rem); font-weight: 750; overflow-wrap: anywhere; }
.results p { margin-bottom: 0; }
.results[data-stale] { opacity: .75; }

.contact { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.contact div { flex: 1 1 390px; }
.contact p { margin-bottom: 0; }
.guide { padding-block: 42px; }
.guide h3 { margin-top: 24px; }
.formula { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
caption { text-align: left; color: var(--muted); padding-block: 8px; }
th, td { padding: 8px 4px; text-align: left; border-bottom: 1px solid var(--line); }
thead, tbody tr:last-child { background: var(--surface); }
ul { padding-inline-start: 1.25rem; color: var(--muted); }
li + li { margin-top: 8px; }
footer { display: flex; flex-wrap: wrap; gap: 10px 20px; padding-block: 20px; border-top: 1px solid var(--line); font-size: .875rem; }

@media (max-width: 540px) {
  .scenarios, .results dl { grid-template-columns: 1fr; }
}
