:root {
  --ink: #372733;
  --muted: #78626f;
  --muted-soft: #987f8f;
  --canvas: #fff7fb;
  --surface: #fffdf8;
  --surface-soft: #fff3e5;
  --primary: #9a80ff;
  --primary-dark: #6f55df;
  --primary-soft: #eadfff;
  --teal: #4edfa6;
  --teal-soft: #d7fbe9;
  --amber: #b88700;
  --amber-soft: #fff0b8;
  --danger: #b42355;
  --danger-soft: #ffe1ea;
  --border: rgba(55, 39, 51, 0.16);
  --border-strong: #372733;
  --shadow-sm: 3px 3px 0 rgba(55, 39, 51, 0.09);
  --shadow-md: 4px 4px 0 rgba(55, 39, 51, 0.09);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 26px;
  --ink-faint: rgba(55, 39, 51, 0.10);
  --ink-soft: rgba(55, 39, 51, 0.16);
  --surface-warm: rgba(255, 253, 248, 0.74);
  --surface-lavender: rgba(234, 223, 255, 0.58);
  --surface-yellow: rgba(255, 240, 184, 0.72);
  --mint-ink: #10281c;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select {
  font: inherit;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary);
}

button,
select,
input {
  touch-action: manipulation;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.35);
  outline-offset: 3px;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner,
.footer-inner,
.footer-bottom {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 76px;
  justify-content: space-between;
  gap: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}

.site-brand img {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.site-brand span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.site-brand small {
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav,
.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a,
.footer-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--primary-dark);
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
  color: var(--muted);
}

.language-switcher summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.language-switcher summary::-webkit-details-marker {
  display: none;
}

.language-switcher summary:hover,
.language-switcher[open] summary {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.language-current {
  color: var(--ink);
}

.language-chevron {
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.language-menu a {
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.language-menu a:hover,
.language-menu a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.hero-section {
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 88% 18%, rgba(219, 234, 254, 0.75), transparent 34%),
    var(--canvas);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
  align-items: center;
  gap: 72px;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.035em;
}

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.02;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.1;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}

p {
  color: var(--muted);
}

.hero-intro {
  max-width: 640px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.hero-badges span,
.estimate-pill,
.result-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-badges span:nth-child(2) {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.hero-badges span:nth-child(3) {
  border-color: #99f6e4;
  background: var(--teal-soft);
  color: #115e59;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted-soft);
  font-size: 14px;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-soft);
}

.hero-summary {
  min-height: 310px;
  padding: 28px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, #eff6ff 0%, #ffffff 58%, #f0fdfa 100%);
  box-shadow: var(--shadow-md);
}

.summary-topline,
.summary-meta,
.result-header,
.result-actions,
.result-meta,
.progress-line,
.source-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-label {
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.estimate-pill,
.result-state-badge {
  border-color: #fcd34d;
  background: var(--amber-soft);
  color: #92400e;
}

.summary-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 48px 0 4px;
  font-variant-numeric: tabular-nums;
}

.summary-total span {
  color: var(--ink);
  font-size: clamp(48px, 6vw, 70px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.summary-total small {
  color: var(--muted-soft);
  font-size: 16px;
  font-weight: 700;
}

.hero-summary p {
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 600;
}

.summary-bars {
  display: grid;
  gap: 9px;
  margin-bottom: 26px;
}

.summary-bars span,
.result-meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.summary-bars span::after {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  content: "";
}

.summary-bars span:nth-child(2)::after {
  background: var(--teal);
}

.summary-bars span:nth-child(3)::after {
  background: #60a5fa;
}

.summary-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-meta span:first-child {
  color: var(--teal);
}

.tool-section {
  padding: 68px 0 84px;
  background: var(--surface);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.7;
}

.narrow-heading {
  max-width: 720px;
}

.tool-heading {
  margin-bottom: 28px;
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.96fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.calculator-inputs {
  padding: 30px;
  border-right: 1px solid var(--border);
}

.version-control {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.version-control label,
.number-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  padding: 0 38px 0 13px;
}

input[type="number"] {
  padding: 0 12px;
}

select:focus,
input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
  outline: none;
}

.field-help,
.fieldset-help,
.number-field .field-error {
  color: var(--muted-soft);
  font-size: 13px;
  line-height: 1.5;
}

.field-help {
  margin: 9px 0 0;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.fieldset-help {
  margin-bottom: 22px;
}

.error-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.subtest-list {
  display: grid;
  gap: 20px;
}

.subtest-row {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.subtest-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.subtest-heading h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.subtest-heading h3 span {
  margin-left: 5px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.subtest-heading p {
  max-width: 410px;
  margin: 0;
  color: var(--muted-soft);
  font-size: 13px;
  line-height: 1.45;
}

.official-total {
  flex: 0 0 auto;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.input-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.number-field .field-error {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: var(--danger);
}

.number-field.is-invalid input {
  border-color: var(--danger);
  background: #fffafa;
}

.progress-line {
  margin-top: 3px;
}

.progress-track {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.progress-value {
  min-width: 42px;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 46px;
  border-radius: var(--radius-sm);
  font-weight: 750;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: 24px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 15px rgba(29, 78, 216, 0.18);
}

.primary-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 9px 18px rgba(29, 78, 216, 0.24);
  transform: translateY(-1px);
}

.primary-button span {
  font-size: 20px;
  line-height: 1;
}

.secondary-button {
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--primary-dark);
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.text-button {
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.text-button:hover {
  color: var(--primary-dark);
}

.result-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 30px;
  background: #f8fbff;
}

.result-header {
  align-items: flex-start;
  margin-bottom: 22px;
}

.result-header .eyebrow {
  margin-bottom: 7px;
}

.result-header h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.result-state-badge {
  white-space: nowrap;
}

.result-panel[data-state="live"] .result-state-badge {
  border-color: #99f6e4;
  background: var(--teal-soft);
  color: #115e59;
}

.result-panel[data-state="empty"] .result-state-badge,
.result-panel[data-state="invalid"] .result-state-badge {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

.result-total-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 5px 12px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.result-total-card span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-total-card strong {
  color: var(--ink);
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
}

.result-total-card small {
  color: var(--muted-soft);
  font-size: 13px;
  font-weight: 700;
}

.score-list {
  display: grid;
  gap: 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.score-row div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.score-code {
  display: inline-grid;
  width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.score-row strong,
.context-grid strong {
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.context-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.context-grid span {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.context-grid strong {
  font-size: 16px;
}

.result-meter {
  margin-bottom: 20px;
  background: #dbeafe;
}

.result-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  transition: width 180ms ease;
}

.result-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.45;
}

.result-meta b {
  color: var(--muted);
}

.result-note {
  min-height: 66px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.result-actions {
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 6px;
}

.result-disclaimer {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--border);
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.55;
}

.result-disclaimer svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.pale-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.content-section {
  padding: 84px 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.step-card,
.output-card,
.text-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-card {
  min-height: 220px;
  padding: 22px;
}

.step-number,
.output-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 26px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.step-card p,
.output-card p,
.text-panel p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
}

.example-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  padding: 30px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  background: #eff6ff;
}

.example-panel h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3.5vw, 36px);
}

.example-panel p {
  margin-bottom: 14px;
}

.small-note {
  color: var(--muted-soft) !important;
  font-size: 13px !important;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.output-card {
  min-height: 260px;
  padding: 22px;
}

.output-card .output-icon {
  background: var(--teal-soft);
  color: #115e59;
}

.conversion-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.conversion-details summary,
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 18px 22px;
  color: var(--ink);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.conversion-details summary::-webkit-details-marker,
.faq-list summary::-webkit-details-marker {
  display: none;
}

.conversion-details summary span,
.faq-list summary span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 18px;
  line-height: 1;
}

.conversion-details[open] summary span,
.faq-list details[open] summary span {
  background: var(--primary-soft);
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

th {
  color: var(--ink);
  font-weight: 750;
}

thead th {
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-note {
  margin: 0;
  padding: 16px 22px 20px;
  color: var(--muted-soft);
  font-size: 13px;
}

.two-column-section {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 18px;
}

.text-panel {
  padding: 28px;
}

.text-panel h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.accent-panel {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.source-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 40px;
}

.source-panel h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
}

.source-panel p {
  margin-bottom: 18px;
}

.source-links {
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
}

.source-links a {
  font-weight: 750;
}

.faq-section {
  background: var(--surface);
}

.faq-list {
  display: grid;
  gap: 11px;
  max-width: 900px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
}

.faq-list details[open] {
  border-color: #bfdbfe;
}

.faq-list summary {
  padding: 17px 20px;
  font-size: 15px;
}

.faq-list details p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.error-panel {
  max-width: 720px;
  padding: 54px 0 20px;
}

.error-panel h1 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: clamp(72px, 13vw, 150px);
  line-height: 0.9;
}

.error-panel h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 44px);
}

.error-panel p:not(.eyebrow) {
  max-width: 580px;
  margin-bottom: 26px;
}

.error-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0 18px;
  text-decoration: none;
}

.site-footer {
  padding: 54px 0 26px;
  border-top: 1px solid var(--border);
  background: #0f172a;
  color: #cbd5e1;
}

.footer-inner {
  align-items: flex-start;
  justify-content: space-between;
  gap: 50px;
}

.footer-brand {
  max-width: 430px;
}

.site-footer .site-brand {
  color: #f8fafc;
}

.site-footer .site-brand small,
.site-footer p,
.site-footer .footer-links a {
  color: #94a3b8;
}

.site-footer .footer-links a:hover {
  color: #fff;
}

.footer-brand p {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.65;
}

.footer-links {
  align-items: flex-start;
  gap: 54px;
}

.footer-links > div {
  display: grid;
  gap: 10px;
  min-width: 150px;
}

.footer-links strong {
  color: #f8fafc;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-bottom {
  justify-content: space-between;
  gap: 18px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  color: #94a3b8;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-grid,
  .calculator-card,
  .example-panel,
  .source-panel,
  .two-column-section {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 38px;
  }

  .hero-summary {
    max-width: 560px;
  }

  .calculator-inputs {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .output-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 28px, 620px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    padding: 15px 0;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .site-nav {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    flex: 0 0 auto;
    font-size: 13px;
  }

  .hero-section {
    padding: 54px 0 48px;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-intro {
    font-size: 18px;
  }

  .calculator-inputs,
  .result-panel {
    padding: 22px 18px;
  }

  .content-section,
  .tool-section {
    padding: 58px 0;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    min-height: auto;
  }

  .example-panel,
  .text-panel,
  .source-panel {
    padding: 22px;
  }

  .source-panel {
    gap: 16px;
  }

  .footer-inner,
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 24px, 420px);
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 31px;
  }

  .hero-summary {
    padding: 20px;
  }

  .summary-total {
    margin-top: 36px;
  }

  .summary-total span {
    font-size: 52px;
  }

  .subtest-heading {
    display: block;
  }

  .official-total {
    display: block;
    margin-top: 7px;
  }

  .context-grid {
    grid-template-columns: 1fr;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-button,
  .text-button {
    width: 100%;
  }

  .output-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Reference-inspired visual theme: soft pink canvas, cream surfaces and playful offset borders. */
body {
  background: var(--canvas);
  color: var(--ink);
}

::selection {
  background: var(--amber-soft);
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(154, 128, 255, 0.22);
}

.skip-link {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 4px 4px 0 rgba(55, 39, 51, 0.16);
}

.site-header {
  border-bottom: 0;
  background: rgba(255, 247, 251, 0.88);
  backdrop-filter: blur(16px);
}

.site-nav {
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(55, 39, 51, 0.10);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70), 0 8px 22px rgba(55, 39, 51, 0.04);
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.site-nav a:hover {
  background: var(--amber-soft);
  color: var(--ink);
}

.language-switcher summary {
  padding: 9px 14px;
  border: 1px solid rgba(55, 39, 51, 0.16);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 8px 20px rgba(55, 39, 51, 0.08);
  color: var(--ink);
}

.language-switcher summary:hover,
.language-switcher[open] summary {
  border-color: var(--ink);
  background: var(--amber-soft);
  color: var(--ink);
}

.language-menu {
  border-color: rgba(55, 39, 51, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(55, 39, 51, 0.16);
}

.language-menu a:hover,
.language-menu a[aria-current="page"] {
  background: var(--amber-soft);
  color: var(--ink);
}

.hero-section {
  position: relative;
  overflow: hidden;
  border-bottom: 2px dashed rgba(55, 39, 51, 0.13);
  background:
    radial-gradient(circle at 90% 15%, rgba(255, 212, 95, 0.28), transparent 19%),
    radial-gradient(circle at 10% 12%, rgba(154, 128, 255, 0.16), transparent 22%),
    var(--canvas);
}

.hero-section::after {
  position: absolute;
  right: -70px;
  bottom: 34px;
  width: 180px;
  height: 180px;
  border: 2px solid rgba(55, 39, 51, 0.10);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.30);
  content: "";
  pointer-events: none;
  transform: rotate(18deg);
}

.hero-grid {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 2px 2px 0 rgba(55, 39, 51, 0.12);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.10em;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(44px, 6.5vw, 76px);
  line-height: 0.96;
}

h2 {
  line-height: 1.02;
}

.hero-intro,
.section-heading p:last-child,
p {
  color: var(--muted);
}

.hero-badges span,
.estimate-pill,
.result-state-badge {
  border-color: rgba(55, 39, 51, 0.20);
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
}

.hero-badges span:nth-child(2) {
  border-color: var(--ink);
  background: var(--amber-soft);
  color: var(--ink);
}

.hero-badges span:nth-child(3) {
  border-color: var(--ink);
  background: var(--teal-soft);
  color: var(--mint-ink);
}

.hero-note {
  color: var(--muted);
}

.status-dot {
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(78, 223, 166, 0.22);
}

.hero-summary {
  border: 1px solid var(--ink);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.estimate-pill,
.result-state-badge {
  border-color: var(--ink);
  background: var(--amber-soft);
  color: var(--ink);
}

.summary-bars span,
.result-meter {
  background: rgba(154, 128, 255, 0.24);
}

.summary-bars span::after {
  background: var(--teal);
}

.summary-bars span:nth-child(2)::after {
  background: var(--primary);
}

.summary-bars span:nth-child(3)::after {
  background: var(--amber);
}

.summary-meta span:first-child {
  color: var(--primary-dark);
}

.tool-section {
  background: rgba(255, 253, 248, 0.56);
}

.calculator-card {
  border: 1px solid var(--ink);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.calculator-inputs {
  border-right-color: rgba(55, 39, 51, 0.16);
  background: var(--surface-warm);
}

.version-control {
  padding: 18px;
  border: 1px solid rgba(55, 39, 51, 0.18);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
}

select,
input[type="number"] {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}

select:focus,
input[type="number"]:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(154, 128, 255, 0.24);
}

.error-summary {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--danger-soft);
  box-shadow: 2px 2px 0 rgba(55, 39, 51, 0.10);
  color: var(--danger);
}

.subtest-row {
  border-bottom: 1px dashed rgba(55, 39, 51, 0.18);
}

.subtest-heading h3 span {
  color: var(--primary-dark);
}

.official-total,
.field-help,
.fieldset-help,
.subtest-heading p,
.progress-value {
  color: var(--muted);
}

.progress-track {
  border: 1px solid rgba(55, 39, 51, 0.12);
  background: rgba(234, 223, 255, 0.64);
}

.progress-fill {
  background: var(--teal);
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 18px;
  font-weight: 900;
}

.primary-button {
  border: 2px solid var(--ink);
  background: var(--teal);
  box-shadow: 2px 3px 0 rgba(55, 39, 51, 0.10);
  color: var(--mint-ink);
}

.primary-button:hover {
  border-color: var(--ink);
  background: #6be5b1;
  box-shadow: 1px 1px 0 rgba(55, 39, 51, 0.10);
  color: var(--mint-ink);
  transform: translate(1px, 1px);
}

.secondary-button {
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 2px 3px 0 rgba(55, 39, 51, 0.10);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--ink);
  background: var(--amber-soft);
  color: var(--ink);
}

.text-button {
  color: var(--primary-dark);
}

.text-button:hover {
  color: var(--ink);
}

.result-panel {
  margin: 14px 14px 14px 0;
  border: 1px solid var(--ink);
  border-radius: 24px;
  background: var(--surface-lavender);
  box-shadow: 3px 3px 0 rgba(55, 39, 51, 0.08);
}

.result-panel[data-state="live"] .result-state-badge {
  border-color: var(--ink);
  background: var(--teal);
  color: var(--mint-ink);
}

.result-panel[data-state="empty"] .result-state-badge,
.result-panel[data-state="invalid"] .result-state-badge {
  border-color: var(--ink);
  background: var(--danger-soft);
  color: var(--danger);
}

.result-total-card {
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 2px 2px 0 rgba(55, 39, 51, 0.08);
}

.score-list {
  border-top-color: rgba(55, 39, 51, 0.18);
}

.score-row {
  border-bottom: 1px dashed rgba(55, 39, 51, 0.18);
}

.score-code {
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.context-grid div {
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 2px 2px 0 rgba(55, 39, 51, 0.08);
}

.result-meter {
  border: 1px solid rgba(55, 39, 51, 0.14);
}

.result-meter span {
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.result-meta,
.result-note,
.result-disclaimer {
  color: var(--muted);
}

.result-disclaimer {
  border-top: 1px dashed rgba(55, 39, 51, 0.20);
}

.pale-section,
.content-section,
.faq-section {
  border-top-color: rgba(55, 39, 51, 0.13);
  border-bottom-color: rgba(55, 39, 51, 0.13);
  background: rgba(255, 253, 248, 0.56);
}

.step-card,
.output-card,
.text-panel,
.conversion-details,
.faq-list details {
  border: 1px solid var(--ink);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-number,
.output-icon {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--primary-soft);
  box-shadow: 2px 2px 0 rgba(55, 39, 51, 0.12);
  color: var(--primary-dark);
}

.output-card .output-icon {
  background: var(--teal);
  color: var(--mint-ink);
}

.example-panel {
  border: 1px solid var(--ink);
  border-radius: 22px;
  background: var(--surface-yellow);
  box-shadow: 4px 4px 0 rgba(55, 39, 51, 0.09);
}

.conversion-details summary,
.faq-list summary {
  color: var(--ink);
}

.conversion-details summary span,
.faq-list summary span {
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--ink);
}

.conversion-details[open] summary span,
.faq-list details[open] summary span {
  background: var(--primary-soft);
}

.table-wrap {
  border-top-color: rgba(55, 39, 51, 0.18);
}

th,
td {
  border-bottom-color: rgba(55, 39, 51, 0.14);
  color: var(--muted);
}

th {
  color: var(--ink);
}

thead th {
  background: var(--amber-soft);
  color: var(--ink);
}

.accent-panel {
  border-color: var(--ink);
  background: var(--teal-soft);
}

.source-links a {
  color: var(--primary-dark);
}

.faq-list details[open] {
  border-color: var(--ink);
}

.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.site-footer .site-brand,
.site-footer .footer-links a,
.site-footer .footer-links strong {
  color: var(--ink);
}

.site-footer .site-brand small,
.site-footer p,
.site-footer .footer-links a,
.footer-bottom {
  color: var(--muted);
}

.site-footer .footer-links a:hover {
  color: var(--primary-dark);
}

.footer-bottom {
  border-top-color: rgba(55, 39, 51, 0.16);
}

@media (max-width: 980px) {
  .result-panel {
    margin: 14px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    border-radius: 16px;
  }

  .result-panel {
    margin: 14px;
  }
}

@media (max-width: 480px) {
  .result-panel {
    margin: 14px;
  }
}

/* Mobile navigation: collapse the full link set behind a compact menu trigger. */
.mobile-menu-toggle {
  display: none;
}

.language-current-code {
  display: none;
}

@media (max-width: 720px) {
  .ucat-page .header-inner {
    position: relative;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 12px 0;
  }

  .ucat-page .header-actions {
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    gap: 8px;
  }

  .ucat-page .site-header .site-brand {
    flex: 1 1 auto;
    gap: 8px;
  }

  .ucat-page .site-header .site-brand span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ucat-page .site-header .site-brand small {
    display: none;
  }

  .ucat-page .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 3px 3px 0 rgba(55, 39, 51, 0.18);
    color: var(--ink);
    touch-action: manipulation;
  }

  .ucat-page .mobile-menu-toggle:hover,
  .ucat-page .mobile-menu-toggle.is-open {
    background: var(--amber-soft);
  }

  .ucat-page .menu-icon {
    display: grid;
    gap: 4px;
    width: 19px;
  }

  .ucat-page .menu-icon span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .ucat-page .mobile-menu-toggle.is-open .menu-icon span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .ucat-page .mobile-menu-toggle.is-open .menu-icon span:nth-child(2) {
    opacity: 0;
  }

  .ucat-page .mobile-menu-toggle.is-open .menu-icon span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  .ucat-page .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 8px;
    overflow: visible;
    border: 1px solid rgba(55, 39, 51, 0.16);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 5px 5px 0 rgba(55, 39, 51, 0.12), 0 18px 36px rgba(55, 39, 51, 0.12);
    white-space: normal;
  }

  .ucat-page .site-nav.is-open {
    display: flex;
  }

  .ucat-page .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
  }

  .ucat-page .site-nav a:hover,
  .ucat-page .site-nav a:focus-visible {
    background: var(--amber-soft);
  }

  .ucat-page .language-switcher summary {
    min-height: 48px;
    padding: 0 12px;
  }

  .ucat-page .language-label,
  .ucat-page .language-current-name {
    display: none;
  }

  .ucat-page .language-current-code {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ucat-page .menu-icon span {
    transition: none;
  }
}
