:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --card-alt: #fafbfc;
  --text: #15181d;
  --muted: #626b78;
  --border: #e4e7ec;
  --border-strong: #d3d8e0;
  --primary: #ea580c;
  --primary-hover: #c2470a;
  --on-primary: #ffffff;
  --track: #e9ecf1;
  --radius: 12px;
  --radius-sm: 9px;
  --hover: #f1f3f6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- top bar ---- */
.bar,
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 28px);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: -2px;
}

.bar-actions {
  display: flex;
  gap: 8px;
}

.chip {
  min-width: 44px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.chip:hover {
  background: var(--hover);
  border-color: var(--muted);
}

/* ---- layout ---- */
.wrap {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 30px) clamp(16px, 4vw, 24px) 64px;
}

.tagline {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ---- lift cards ---- */
.cards {
  display: grid;
  gap: 12px;
}

.card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-top h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.w-display {
  font-variant-numeric: tabular-nums;
}

.w-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.w-unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.plates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.plate {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-alt);
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.plate:hover {
  background: var(--hover);
  border-color: var(--muted);
}

.plate-clear {
  margin-left: auto;
  color: var(--muted);
}

.reps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reps-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.rep-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rep {
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.rep:hover {
  background: var(--hover);
}

.rep.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* ---- result ---- */
.result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.result-rows {
  display: grid;
  gap: 8px;
}

.rrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.rrow span { color: var(--muted); }

.rrow-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.total-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  color: var(--muted);
}

#totalValue {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* ---- progressive disclosure ---- */
.more-toggle {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.more-toggle:hover {
  background: var(--hover);
  border-color: var(--muted);
}

.advanced {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.advanced[hidden] { display: none; }

.stats {
  display: grid;
  gap: 12px;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-alt);
}

.seg-btn {
  min-width: 44px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  transition: background-color 120ms ease, color 120ms ease;
}

.seg-btn.is-on {
  background: var(--primary);
  color: var(--on-primary);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.step {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.step:hover {
  background: var(--hover);
  border-color: var(--muted);
}

.stepper strong {
  min-width: 84px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bench,
.loc {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.bench-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bench-head span {
  color: var(--muted);
  font-weight: 600;
}

.bench-head strong {
  font-weight: 800;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 200ms ease;
}

.bench p,
.loc p {
  margin: 8px 0 0;
}

.loc {
  display: grid;
  gap: 8px;
}

.loc strong {
  font-weight: 800;
}

.loc .chip {
  justify-self: start;
}

.btn-ghost {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn-ghost:hover {
  background: var(--hover);
  border-color: var(--muted);
}

/* ---- footer ---- */
.foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.foot nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.foot a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.foot a:hover {
  color: var(--text);
  border-bottom-color: var(--primary);
}

/* ---- focus ---- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ---- legal pages (privacy / terms / methodology) ---- */
.topnav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.topnav a {
  border-bottom: 1px solid transparent;
}

.topnav a:hover {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.legal-page {
  width: min(760px, calc(100% - 32px));
  margin: 32px auto 72px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-page h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.legal-page h2 {
  margin: 28px 0 0;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page a {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
