:root {
  --ink: #191c18;
  --muted: #656861;
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: #c8c9c3;
  --blue: #3156d8;
  --blue-soft: #e9edff;
  --green: #0c7a5a;
  --yellow: #ffd84d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(980px, calc(100% - 36px)); margin: 0 auto; }
.nav { display: flex; justify-content: space-between !important; }
.nav-links { margin-left: auto; }

.intro { padding: 34px 0 22px; }
.breadcrumb { margin: 0 0 16px; font-size: 14px; }
.breadcrumb a { color: var(--ink); text-underline-offset: 3px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 10px; font-size: clamp(38px, 6vw, 66px); line-height: .98; letter-spacing: -.055em; }
.intro-copy { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 18px; }

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--surface);
}
.calculator-shell { display: flex; flex-direction: column; }
.calculator-shell .local-note { order: 1; }
.calculator-shell .calculator-layout { order: 2; }
.calculator-shell .results-stack { order: 3; }
.local-dot { flex: 0 0 11px; width: 11px; height: 11px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.local-note p { margin: 0; font-size: 14px; }
.local-note small { display: block; margin-top: 3px; color: var(--muted); }

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: stretch;
}
.input-panel, .result-panel, .data-section, .rep-section, .strength-section {
  border: 1px solid var(--ink);
  background: var(--surface);
}
.input-panel { padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 3px; font-size: 23px; letter-spacing: -.025em; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.reset-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 850; }
.weight-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.number-wrap { position: relative; }
.number-wrap input {
  width: 100%;
  min-height: 58px;
  padding: 10px 50px 10px 14px;
  border: 1px solid #9b9e97;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 23px;
  font-weight: 800;
}
.number-wrap > span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  font-weight: 800;
  transform: translateY(-50%);
}
.unit-toggle { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--ink); border-radius: 11px; background: #f1f1ed; }
.unit-toggle button {
  min-width: 54px;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}
.unit-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
input:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
input[aria-invalid="true"] { border-color: #b32d26; }
.field-help { min-height: 20px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.field-error { min-height: 20px; margin: 4px 0 0; color: #a22620; font-size: 12px; font-weight: 750; }

.result-panel {
  display: flex;
  min-height: 326px;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
  background: var(--blue);
  color: #fff;
}
.result-label { margin-bottom: 5px; font-size: 14px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.result-value { display: block; margin: 0 0 4px; font-size: clamp(58px, 8vw, 92px); font-weight: 950; line-height: .95; letter-spacing: -.065em; }
.result-basis { margin-bottom: 20px; color: #e9edff; font-size: 15px; }
.formula-line { margin: auto 0 0; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.38); color: #fff; font-size: 13px; }
.accuracy-note { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--yellow); background: rgba(0,0,0,.16); font-size: 13px; }
.empty-result { margin: auto; text-align: center; }
.empty-result strong { display: block; font-size: 25px; }
.empty-result span { color: #e9edff; }

.results-stack { display: grid; gap: 18px; padding: 18px 0 52px; }
.section-heading { padding: 20px 22px 13px; }
.section-heading h2 { margin-bottom: 4px; font-size: 25px; letter-spacing: -.03em; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.training-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.training-table th, .training-table td { padding: 12px 16px; border-top: 1px solid var(--line); text-align: left; }
.training-table thead th { background: #f0f0eb; color: #555850; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.training-table thead th:nth-child(1) { width: 23%; }
.training-table thead th:nth-child(2) { width: 31%; }
.training-table tbody th { color: var(--blue); font-weight: 900; }
.training-table tbody td:nth-child(2) { font-weight: 900; }
.training-table tbody td:last-child { color: var(--muted); }
.table-note { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.strength-scale { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 22px 22px; }
.strength-band { min-height: 64px; padding: 10px 8px; border-top: 9px solid var(--blue); border-right: 1px solid var(--line); }
.strength-band:nth-child(2) { border-top-color: #5574dc; }
.strength-band:nth-child(3) { border-top-color: #2745a9; }
.strength-band:nth-child(4) { border-top-color: var(--ink); border-right: 0; }
.strength-band strong, .strength-band span { display: block; }
.strength-band strong { font-size: 13px; }
.strength-band span { color: var(--muted); font-size: 12px; }

.rep-max-grid { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); }
.rep-max-grid div { padding: 17px 12px; border-right: 1px solid var(--line); text-align: center; }
.rep-max-grid div:last-child { border-right: 0; }
.rep-max-grid span, .rep-max-grid strong { display: block; }
.rep-max-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.rep-max-grid strong { margin-top: 3px; font-size: 18px; }

.explain-section { padding: 48px 0; border-top: 1px solid var(--line); background: #fff; }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.explain-grid h2 { font-size: 22px; letter-spacing: -.025em; }
.explain-grid p { margin-bottom: 0; color: var(--muted); }
.safety-note { margin-top: 30px; padding: 16px 18px; border-left: 4px solid var(--yellow); background: var(--paper); }
.safety-note strong { display: block; margin-bottom: 2px; }
.safety-note p { margin: 0; color: var(--ink); }

.faq-section { padding: 48px 0; }
.faq-section h2 { margin-bottom: 18px; font-size: 30px; }
.faq-list { border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 17px 4px; font-weight: 850; cursor: pointer; }
.faq-list p { max-width: 780px; padding: 0 4px 17px; margin: 0; color: var(--muted); }
.related-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-tools h2 { width: 100%; margin-bottom: 3px; font-size: 20px; }
.related-tools a { padding: 9px 13px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; text-decoration: none; }

[hidden] { display: none !important; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 980px); }
  .nav-links a:not(.nav-pill) { display: none; }
  .intro { padding: 17px 0 12px; }
  .breadcrumb { display: none; }
  h1 { margin-bottom: 8px; font-size: clamp(36px, 12vw, 50px); }
  .intro-copy { font-size: 16px; line-height: 1.42; }
  .local-note { margin-bottom: 12px; padding: 11px 12px; }
  .local-note small { font-size: 12px; line-height: 1.35; }
  .calculator-layout { grid-template-columns: 1fr; gap: 10px; }
  .calculator-shell .calculator-layout { order: 1; }
  .calculator-shell .local-note { order: 2; margin-top: 12px; }
  .calculator-shell .results-stack { order: 3; }
  .input-panel { padding: 16px; }
  .panel-heading { margin-bottom: 14px; }
  .panel-heading h2 { font-size: 20px; }
  .panel-heading p { display: none; }
  .field { margin-bottom: 12px; }
  .number-wrap input { min-height: 56px; font-size: 22px; }
  .unit-toggle button { min-width: 50px; min-height: 48px; }
  .field-help, .field-error { min-height: 17px; font-size: 11px; }
  .result-panel { min-height: 220px; padding: 20px; }
  .result-value { font-size: clamp(58px, 20vw, 78px); }
  .result-basis { margin-bottom: 14px; }
  .formula-line { padding-top: 12px; font-size: 12px; }
  .results-stack { gap: 12px; padding-top: 12px; }
  .section-heading { padding: 16px 14px 10px; }
  .section-heading h2 { font-size: 22px; }
  .training-table th, .training-table td { padding: 10px 8px; font-size: 13px; }
  .training-table thead th { font-size: 10px; letter-spacing: .03em; }
  .training-table thead th:nth-child(1) { width: 22%; }
  .training-table thead th:nth-child(2) { width: 29%; }
  .training-table td:last-child { font-size: 12px; }
  .strength-scale { padding: 0 12px 16px; }
  .strength-band { min-height: 58px; padding: 8px 4px; }
  .strength-band strong { font-size: 11px; }
  .strength-band span { font-size: 10px; }
  .rep-max-grid { grid-template-columns: repeat(3, 1fr); }
  .rep-max-grid div { border-bottom: 1px solid var(--line); }
  .rep-max-grid div:nth-child(3) { border-right: 0; }
  .rep-max-grid div:nth-child(n+4) { border-bottom: 0; }
  .explain-section, .faq-section { padding: 36px 0; }
  .explain-grid { grid-template-columns: 1fr; gap: 26px; }
  .safety-note { margin-top: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
