/*
 * Financial Life Simulator V2 — shared design foundation.
 * Authoritative tokens: financial-life-simulator-v2-implementation-pack/
 * manifests/design-tokens.json. This file is loaded last so later page phases
 * can replace legacy selectors without reintroducing a second design system.
 */

@font-face {
  font-family: "Studio Sans";
  src: url("assets/fonts/studio-sans-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Studio Sans";
  src: url("assets/fonts/studio-sans-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

@font-face {
  font-family: "Studio Condensed";
  src: url("assets/fonts/studio-condensed-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

@font-face {
  font-family: "Studio Serif";
  src: url("assets/fonts/studio-serif-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Studio Serif";
  src: url("assets/fonts/studio-serif-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Studio Serif";
  src: url("assets/fonts/studio-serif-italic.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --v2-paper: #f4e8d3;
  --v2-paper-light: #fbf4e6;
  --v2-ink: #0c3554;
  --v2-ink-muted: #53616a;
  --v2-coral: #d85b37;
  --v2-coral-readable: #9d3c22;
  --v2-ultramarine: #3d6ea6;
  --v2-teal: #2f7f7c;
  --v2-ochre: #d59b2f;
  --v2-plum: #744766;
  --v2-dusty-rose: #b56d72;
  --v2-olive: #7b844b;
  --v2-sky: #63a0b7;
  --v2-paper-deep: #eadbc2;
  --v2-rule: rgba(12, 53, 84, .64);
  --v2-rule-soft: rgba(12, 53, 84, .25);
  --v2-rule-faint: rgba(12, 53, 84, .13);
  --v2-focus: #0c3554;
  --v2-font-display: "Studio Condensed", "Arial Narrow", sans-serif;
  --v2-font-editorial: "Studio Serif", Georgia, serif;
  --v2-font-interface: "Studio Sans", Arial, sans-serif;
  --v2-max-width: 1440px;
  --v2-gutter: clamp(2rem, 3vw, 2.5rem);
  --v2-space-1: .5rem;
  --v2-space-2: .75rem;
  --v2-space-3: 1rem;
  --v2-space-4: 1.25rem;
  --v2-space-5: 1.5rem;
  --v2-space-6: 2rem;
  --v2-space-7: 2.5rem;
  --v2-space-8: 3rem;
  --v2-space-9: 4rem;
  --v2-radius: 2px;
  --v2-motion-fast: 140ms;
  --v2-motion-medium: 240ms;
  --v2-chart-axis: #0c3554;
  --v2-chart-grid: rgba(12, 53, 84, .18);
  --v2-chart-primary: #3d6ea6;
  --v2-chart-secondary: #2f7f7c;
  --v2-chart-tertiary: #d85b37;
  --v2-chart-band: rgba(61, 110, 166, .26);
  --v2-chart-pattern: rgba(12, 53, 84, .34);
}

.v2-foundation,
.v2-foundation :where(button, input, select, textarea) {
  font-family: var(--v2-font-interface);
}

body.v2-foundation {
  min-width: 0;
  margin: 0;
  color: var(--v2-ink);
  background-color: var(--v2-paper);
  background-image: url("assets/texture/paper-grain.svg");
  background-size: 240px 240px;
  font-family: var(--v2-font-interface);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

/* Keep the static landing scaffold from flashing before the requested route
   and the locally hosted Studio fonts are ready. The class is removed by
   app.js immediately after the first real view is rendered. */
body.v2-booting {
  visibility: hidden;
}

body.v2-foundation::before {
  display: none;
}

.v2-foundation *,
.v2-foundation *::before,
.v2-foundation *::after {
  box-sizing: border-box;
}

.v2-foundation [hidden] {
  display: none !important;
}

.mechanics-transfer-notice {
  position: fixed;
  z-index: 1200;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(390px, calc(100vw - 48px));
  padding: 15px 18px;
  gap: 3px;
  color: var(--v2-paper-light);
  border: 1px solid var(--v2-paper-light);
  background: var(--v2-ink);
  box-shadow: 5px 5px 0 rgba(216, 91, 55, .75);
  font-size: 14px;
  line-height: 1.35;
}

.mechanics-transfer-notice strong {
  font-family: var(--v2-font-display);
  font-size: 15px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.v2-foundation :where(img, svg) {
  display: block;
  max-width: 100%;
}

.v2-foundation :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--v2-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--v2-paper-light);
}

.v2-foundation :where(button, input, select, textarea) {
  color: var(--v2-ink);
  font-size: 1rem;
}

.v2-foundation :where(button, summary, a) {
  -webkit-tap-highlight-color: transparent;
}

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

.v2-skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  color: var(--v2-paper-light);
  background: var(--v2-ink);
  font-weight: 800;
  transform: translateY(-180%);
}

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

.v2-page {
  width: min(var(--v2-max-width), calc(100% - (var(--v2-gutter) * 2)));
  margin-inline: auto;
}

.v2-header {
  display: grid;
  min-height: 72px;
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: center;
  gap: var(--v2-space-5);
  border-bottom: 1px solid var(--v2-rule);
}

.v2-brand {
  margin: 0;
  color: var(--v2-ink);
  font-family: var(--v2-font-interface);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .015em;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.v2-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}

.v2-nav a,
.v2-nav button {
  display: inline-flex;
  min-height: 44px;
  padding: .7rem 1.15rem;
  align-items: center;
  justify-content: center;
  color: var(--v2-ink);
  border: 1px solid transparent;
  border-radius: var(--v2-radius);
  background: transparent;
  font-family: var(--v2-font-interface);
  font-size: .91rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--v2-motion-fast) ease, background-color var(--v2-motion-fast) ease;
}

.v2-nav a:hover,
.v2-nav button:hover {
  border-color: var(--v2-rule-soft);
  background: rgba(251, 244, 230, .56);
}

.v2-nav :is(a, button)[aria-current="page"] {
  border-color: var(--v2-ink);
  background: rgba(251, 244, 230, .68);
}

.v2-editorial-hero {
  position: relative;
  display: grid;
  min-height: clamp(330px, 31vw, 455px);
  padding: clamp(2.25rem, 5vw, 4.75rem) 0 1.75rem;
  grid-template-columns: minmax(300px, .9fr) minmax(430px, 1.35fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  overflow: hidden;
}

.v2-hero-copy {
  position: relative;
  z-index: 3;
  padding-left: .5rem;
}

.v2-hero-title,
.v2-section-title,
.v2-result-title,
.v2-knowledge-card h3 {
  margin: 0;
  color: var(--v2-ink);
  font-family: var(--v2-font-editorial);
  font-weight: 400;
  letter-spacing: -.025em;
}

.v2-hero-title {
  max-width: 12ch;
  font-size: clamp(2.375rem, 5vw, 4.5rem);
  line-height: .98;
}

.v2-hero-lead {
  max-width: 33ch;
  margin: 1.35rem 0 0;
  font-family: var(--v2-font-editorial);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.38;
}

.v2-hero-visual {
  position: relative;
  min-height: 310px;
  align-self: stretch;
}

.v2-monumental-word {
  position: absolute;
  z-index: 1;
  top: 41%;
  right: 0;
  color: var(--v2-coral);
  font-family: var(--v2-font-display);
  font-size: clamp(6rem, 15.7vw, 15.625rem);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .7;
  opacity: .94;
  transform: translateY(-50%);
  white-space: nowrap;
}

.v2-hero-art {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -3%;
  width: 100%;
  height: 58%;
  object-fit: cover;
  object-position: 55% center;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 13%), linear-gradient(to bottom, transparent 0, #000 24%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 13%), linear-gradient(to bottom, transparent 0, #000 24%);
  mask-composite: intersect;
}

.v2-gallery-main {
  padding-bottom: var(--v2-space-9);
}

.v2-gallery-intro {
  display: flex;
  margin: 0 0 var(--v2-space-5);
  align-items: end;
  justify-content: space-between;
  gap: var(--v2-space-6);
  border-bottom: 1px solid var(--v2-rule-soft);
}

.v2-gallery-intro h2 {
  margin: 0 0 .65rem;
  font-family: var(--v2-font-interface);
  font-size: .78rem;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.v2-gallery-intro p {
  margin: 0 0 .65rem;
  color: var(--v2-ink-muted);
  font-family: var(--v2-font-editorial);
  font-size: 1rem;
}

.v2-calculator-shell {
  display: grid;
  grid-template-columns: minmax(290px, 36fr) minmax(0, 64fr);
  gap: var(--v2-space-5);
  align-items: start;
}

.v2-input-panel,
.v2-result-stage {
  border: 1px solid var(--v2-rule-soft);
  border-radius: var(--v2-radius);
  background: rgba(251, 244, 230, .3);
}

.v2-input-panel {
  padding: clamp(1.25rem, 2.1vw, 2rem);
}

.v2-panel-label {
  display: flex;
  min-height: 32px;
  margin: 0 0 var(--v2-space-4);
  align-items: center;
  border-bottom: 1px solid var(--v2-rule-soft);
  color: var(--v2-coral-readable);
  font-family: var(--v2-font-interface);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.v2-field {
  display: grid;
  margin-bottom: var(--v2-space-4);
  gap: .45rem;
}

.v2-field > label,
.v2-control-label {
  color: var(--v2-ink);
  font-family: var(--v2-font-interface);
  font-size: .94rem;
  font-weight: 700;
}

.v2-control-label {
  margin: .15rem 0 .35rem;
}

.v2-field.is-changed > label::after {
  content: "Changed";
  margin-left: .5rem;
  color: var(--v2-coral-readable);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.v2-scenario-tabs.is-changed {
  box-shadow: inset 3px 0 0 var(--v2-coral);
}

.v2-field-error {
  margin: -.2rem 0 0;
  color: #8d321f;
  font-family: var(--v2-font-interface);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
}

.v2-input-wrap:has([aria-invalid="true"]) {
  border-color: #8d321f;
  box-shadow: inset 3px 0 0 #8d321f;
}

.v2-input-wrap {
  position: relative;
  display: flex;
  min-height: 52px;
  align-items: center;
  border: 1px solid var(--v2-rule-soft);
  background: rgba(251, 244, 230, .72);
}

.v2-input-wrap:focus-within {
  border-color: var(--v2-ink);
}

.v2-input-wrap > span {
  flex: 0 0 auto;
  padding-left: 1rem;
  color: var(--v2-ink-muted);
  font-family: var(--v2-font-editorial);
  font-size: 1.2rem;
}

.v2-input-wrap > .v2-input-suffix {
  padding: 0 1rem 0 .5rem;
  font-family: var(--v2-font-interface);
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
}

.v2-input-wrap input,
.v2-input-wrap select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: .6rem 1rem;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--v2-font-editorial);
  font-size: 1.35rem;
  line-height: 1;
}

.v2-input-wrap select {
  font-family: var(--v2-font-interface);
  font-size: 1rem;
}

.v2-input-wrap :is(input, select):focus-visible {
  outline: 0;
  box-shadow: none;
}

.v2-two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--v2-space-3);
}

.v2-scenario-tabs {
  display: grid;
  min-height: 46px;
  margin: .5rem 0 1.4rem;
  grid-template-columns: repeat(var(--v2-tab-count, 2), minmax(0, 1fr));
  border: 1px solid var(--v2-rule);
}

.v2-scenario-tabs button {
  min-height: 44px;
  padding: .65rem 1rem;
  border: 0;
  border-right: 1px solid var(--v2-rule-soft);
  background: transparent;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.v2-scenario-tabs button:last-child {
  border-right: 0;
}

.v2-scenario-tabs button[aria-pressed="true"] {
  color: var(--v2-paper-light);
  background: var(--v2-ink);
}

.v2-disclosure {
  border-top: 1px solid var(--v2-rule-soft);
  border-bottom: 1px solid var(--v2-rule-soft);
}

.v2-disclosure summary {
  display: flex;
  min-height: 52px;
  padding: .75rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--v2-ink);
  font-family: var(--v2-font-editorial);
  font-size: 1.08rem;
  list-style: none;
  cursor: pointer;
}

.v2-disclosure summary::-webkit-details-marker {
  display: none;
}

.v2-disclosure summary svg {
  width: 22px;
  height: 22px;
  transition: transform var(--v2-motion-fast) ease;
}

.v2-disclosure[open] summary svg {
  transform: rotate(45deg);
}

.v2-disclosure-content {
  padding: 0 0 var(--v2-space-4);
  color: var(--v2-ink-muted);
  font-size: .94rem;
}

.v2-button-row {
  display: flex;
  margin-top: var(--v2-space-5);
  flex-wrap: wrap;
  gap: var(--v2-space-3);
}

.v2-input-panel .v2-button-row {
  display: grid;
  grid-template-columns: 1fr;
}

.v2-input-panel .v2-button {
  width: 100%;
}

.v2-button {
  display: inline-flex;
  min-height: 52px;
  padding: .85rem 1.45rem;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  border: 1px solid var(--v2-ink);
  border-radius: var(--v2-radius);
  background: transparent;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--v2-motion-fast) ease, background-color var(--v2-motion-fast) ease;
}

.v2-button svg {
  width: 22px;
  height: 22px;
}

.v2-button-primary {
  color: var(--v2-paper-light);
  border-color: var(--v2-coral);
  background: var(--v2-coral);
  font-size: 1.19rem;
}

.v2-button-primary:hover {
  border-color: var(--v2-coral-readable);
  background: var(--v2-coral-readable);
}

.v2-button-secondary:hover {
  color: var(--v2-paper-light);
  background: var(--v2-ink);
}

.v2-button:disabled,
.v2-button[aria-disabled="true"] {
  opacity: .48;
  cursor: not-allowed;
}

.v2-button:disabled:hover,
.v2-button[aria-disabled="true"]:hover {
  color: inherit;
  border-color: var(--v2-ink);
  background: transparent;
}

.v2-result-stage {
  padding: clamp(1.4rem, 2.5vw, 2.25rem);
}

.v2-result-toolbar {
  display: flex;
  margin-bottom: var(--v2-space-3);
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-4);
  border-bottom: 1px solid var(--v2-rule-soft);
}

.v2-result-toolbar .v2-panel-label {
  flex: 1 1 auto;
  margin: 0;
  border-bottom: 0;
}

.v2-unit-note {
  margin: 0;
  color: var(--v2-ink-muted);
  font-family: var(--v2-font-interface);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.v2-result-state {
  min-height: 420px;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 1.15rem;
  border: 1px solid var(--v2-rule-soft);
  background: rgba(251, 244, 230, .46);
}

.v2-result-state h3 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  line-height: 1.02;
}

.v2-result-state p {
  max-width: 46ch;
  margin: .65rem 0 0;
  color: var(--v2-ink-muted);
  font-family: var(--v2-font-editorial);
  font-size: 1.05rem;
}

.v2-state-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--v2-rule);
  border-radius: 50%;
  color: var(--v2-coral);
}

.v2-state-mark svg {
  width: 25px;
  height: 25px;
}

.v2-loader {
  width: 25px;
  height: 25px;
  border: 2px solid var(--v2-rule-faint);
  border-top-color: var(--v2-coral);
  border-radius: 50%;
  animation: v2-spin .8s linear infinite;
}

@keyframes v2-spin {
  to { transform: rotate(360deg); }
}

.v2-error-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: #8d321f;
  font-family: var(--v2-font-interface);
  font-size: .9rem;
  font-weight: 800;
}

.v2-error-list a {
  color: inherit;
  text-underline-offset: .2em;
}

.v2-stale-notice {
  margin: 0 0 var(--v2-space-4);
  padding: .75rem 1rem;
  border-left: 4px solid var(--v2-ochre);
  background: rgba(213, 155, 47, .12);
  color: var(--v2-ink);
  font-size: .9rem;
  font-weight: 800;
}

.v2-result-heading {
  display: flex;
  margin-bottom: var(--v2-space-4);
  align-items: start;
  justify-content: space-between;
  gap: var(--v2-space-4);
}

.v2-result-title {
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1;
}

.v2-result-mode {
  margin: .35rem 0 0;
  color: var(--v2-ink-muted);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.v2-result-figure {
  margin: .4rem 0 .15rem;
  color: var(--v2-ink);
  font-family: var(--v2-font-editorial);
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .95;
}

.v2-result-annotation {
  max-width: 58ch;
  margin: .65rem 0 1.25rem;
  color: var(--v2-ink-muted);
  font-family: var(--v2-font-editorial);
  font-size: 1rem;
}

.v2-chart {
  position: relative;
  margin: var(--v2-space-4) 0;
  padding: 1rem 0 .25rem;
  border-top: 1px solid var(--v2-rule-soft);
  border-bottom: 1px solid var(--v2-rule-soft);
}

.v2-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.v2-chart-grid {
  fill: none;
  stroke: var(--v2-chart-grid);
  stroke-width: 1;
}

.v2-chart-axis {
  fill: none;
  stroke: var(--v2-chart-axis);
  stroke-width: 1.2;
}

.v2-chart-band {
  fill: var(--v2-chart-band);
  stroke: var(--v2-chart-pattern);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.v2-chart-line {
  fill: none;
  stroke: var(--v2-chart-primary);
  stroke-width: 3;
}

.v2-chart-goal {
  fill: none;
  stroke: var(--v2-chart-axis);
  stroke-width: 1.4;
  stroke-dasharray: 3 4;
}

.v2-chart-label,
.v2-chart-axis-label {
  fill: var(--v2-ink);
  font-family: var(--v2-font-interface);
}

.v2-chart-label {
  font-size: 15px;
  font-weight: 800;
}

.v2-chart-axis-label {
  font-size: 12px;
}

.v2-chart-values {
  width: 100%;
  margin-top: .75rem;
  border-collapse: collapse;
  font-size: .85rem;
}

.v2-chart-values caption {
  margin-bottom: .5rem;
  color: var(--v2-ink-muted);
  text-align: left;
}

.v2-chart-values th,
.v2-chart-values td {
  padding: .55rem .75rem;
  border-top: 1px solid var(--v2-rule-faint);
  text-align: right;
}

.v2-chart-values th:first-child,
.v2-chart-values td:first-child {
  text-align: left;
}

.v2-result-split {
  display: grid;
  margin-top: var(--v2-space-4);
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--v2-rule-soft);
}

.v2-result-split > div {
  min-height: 128px;
  padding: 1.1rem 1.35rem;
}

.v2-result-split > div + div {
  border-left: 1px solid var(--v2-rule-soft);
}

.v2-result-split span {
  display: block;
  font-family: var(--v2-font-editorial);
  font-size: 1rem;
}

.v2-result-split strong {
  display: block;
  margin-top: .35rem;
  color: var(--v2-teal);
  font-family: var(--v2-font-editorial);
  font-size: clamp(2.3rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
}

.v2-result-actions {
  display: grid;
  margin-top: var(--v2-space-4);
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: var(--v2-space-3);
}

.v2-result-actions .v2-button {
  width: 100%;
}

.v2-comparison-note {
  margin-top: var(--v2-space-3);
  padding: .7rem .85rem;
  border: 1px solid var(--v2-rule-soft);
  color: var(--v2-teal);
  font-size: .86rem;
  font-weight: 800;
}

.v2-knowledge-card {
  display: grid;
  margin-top: var(--v2-space-5);
  grid-template-columns: minmax(150px, 26%) 1fr;
  border: 1px solid var(--v2-rule-soft);
}

.v2-knowledge-card img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.v2-knowledge-copy {
  padding: 1.25rem 1.5rem;
}

.v2-knowledge-card h3 {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  line-height: 1.05;
}

.v2-knowledge-card p {
  max-width: 56ch;
  margin: .65rem 0 1rem;
  font-family: var(--v2-font-editorial);
  font-size: 1rem;
}

.v2-text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  color: var(--v2-ink);
  font-size: .94rem;
  font-weight: 800;
  text-underline-offset: .22em;
}

.v2-text-link svg {
  width: 20px;
  height: 20px;
}

.v2-result-drawers {
  margin-top: var(--v2-space-4);
  border-top: 1px solid var(--v2-rule);
}

.v2-result-drawer {
  border-bottom: 1px solid var(--v2-rule-soft);
}

.v2-result-drawer > summary,
.v2-technical-details > summary {
  display: flex;
  min-height: 52px;
  padding: .75rem .2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--v2-ink);
  font-family: var(--v2-font-interface);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .055em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.v2-result-drawer > summary::-webkit-details-marker,
.v2-technical-details > summary::-webkit-details-marker {
  display: none;
}

.v2-result-drawer > summary svg {
  width: 20px;
  height: 20px;
  transition: transform var(--v2-motion-fast) ease;
}

.v2-result-drawer[open] > summary svg {
  transform: rotate(45deg);
}

.v2-result-drawer-content {
  padding: 0 .2rem var(--v2-space-4);
  color: var(--v2-ink-muted);
  font-size: .88rem;
}

.v2-assumption-row {
  display: grid;
  min-height: 54px;
  padding: .65rem 0;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  border-top: 1px solid var(--v2-rule-faint);
}

.v2-assumption-row strong,
.v2-assumption-row small {
  display: block;
}

.v2-assumption-row strong {
  color: var(--v2-ink);
}

.v2-assumption-row small {
  margin-top: .12rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.v2-technical-details {
  border-top: 1px solid var(--v2-rule-faint);
}

.v2-technical-details > summary {
  min-height: 44px;
  padding-inline: 0;
  color: var(--v2-ink-muted);
  font-size: .76rem;
}

.v2-technical-details p {
  margin: .35rem 0;
}

.v2-result-drawer-content ul {
  margin: 0;
  padding-left: 1.1rem;
}

.v2-result-drawer-content li + li {
  margin-top: .45rem;
}

.v2-evidence-drawer {
  margin-top: var(--v2-space-5);
  border-top: 1px solid var(--v2-rule);
  border-bottom: 1px solid var(--v2-rule);
}

.v2-evidence-drawer summary {
  display: flex;
  min-height: 52px;
  padding: .75rem .25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--v2-ink);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.v2-evidence-drawer summary::-webkit-details-marker {
  display: none;
}

.v2-evidence-drawer summary svg {
  width: 20px;
  height: 20px;
  transition: transform var(--v2-motion-fast) ease;
}

.v2-evidence-drawer[open] summary svg {
  transform: rotate(45deg);
}

.v2-evidence-content {
  display: grid;
  padding: .25rem .25rem 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--v2-space-4);
  color: var(--v2-ink-muted);
  font-size: .88rem;
}

.v2-evidence-content strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--v2-ink);
}

.v2-status {
  min-height: 24px;
  margin: .65rem 0 0;
  color: var(--v2-teal);
  font-size: .9rem;
  font-weight: 800;
}

.v2-footer {
  display: flex;
  min-height: 104px;
  padding: 1.25rem 0 1.5rem;
  align-items: start;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--v2-rule);
  color: var(--v2-ink);
  font-family: var(--v2-font-interface);
  font-size: .76rem;
  line-height: 1.45;
}

.v2-footer p {
  margin: 0;
}

.v2-footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem 1.2rem;
  color: var(--v2-ink-muted);
  text-align: right;
}

.v2-colophon {
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Phase-2 integration: unify the existing app canvas and shared chrome only.
 * Individual calculator internals remain under their current selectors until
 * their assigned migration phase. */
body.editorial-ui.v2-foundation {
  --paper: var(--v2-paper);
  --paper-raised: var(--v2-paper-light);
  --ink: var(--v2-ink);
  --ink-soft: var(--v2-ink-muted);
  --ink-muted: var(--v2-ink-muted);
  --coral: var(--v2-coral);
  --teal: var(--v2-teal);
  --ochre: var(--v2-ochre);
  --plum: var(--v2-plum);
  background-color: var(--v2-paper);
  background-image: url("assets/texture/paper-grain.svg");
}

body.editorial-ui.v2-foundation .app-shell {
  width: min(var(--v2-max-width), calc(100% - (var(--v2-gutter) * 2)));
  max-width: none;
  margin-inline: auto;
}

body.editorial-ui.v2-foundation .site-header.v2-header {
  width: 100%;
  max-width: none;
  min-height: 72px;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--v2-rule);
  background: transparent;
  box-shadow: none;
}

body.editorial-ui.v2-foundation .site-header.v2-header .site-name {
  color: var(--v2-ink);
  font-family: var(--v2-font-interface);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .015em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.editorial-ui.v2-foundation .site-header.v2-header .primary-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}

body.editorial-ui.v2-foundation .site-header.v2-header .nav-action {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: .7rem 1.05rem;
  align-items: center;
  justify-content: center;
  color: var(--v2-ink);
  border: 1px solid transparent;
  border-radius: var(--v2-radius);
  background: transparent;
  font-family: var(--v2-font-interface);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

body.editorial-ui.v2-foundation .site-header.v2-header .nav-action::after {
  display: none;
}

body.editorial-ui.v2-foundation .site-header.v2-header .nav-action:hover {
  border-color: var(--v2-rule-soft);
  background: rgba(251, 244, 230, .56);
}

body.editorial-ui.v2-foundation .site-header.v2-header .nav-action[aria-current="page"] {
  border-color: var(--v2-ink);
  background: rgba(251, 244, 230, .7);
}

body.editorial-ui.v2-foundation .site-footer.v2-footer {
  width: 100%;
  max-width: none;
  margin: var(--v2-space-7) 0 0;
  border-top-color: var(--v2-rule);
  background: transparent;
  box-shadow: none;
}

@media (min-width: 821px) and (min-height: 900px) {
  .v2-result-stage {
    position: sticky;
    top: 18px;
  }
}

@media (max-width: 1100px) {
  .v2-header {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .v2-nav a,
  .v2-nav button,
  body.editorial-ui.v2-foundation .site-header.v2-header .nav-action {
    padding-inline: .72rem;
    font-size: .82rem;
  }

  .v2-editorial-hero {
    grid-template-columns: minmax(275px, .8fr) minmax(390px, 1.2fr);
  }
}

@media (max-width: 820px) {
  :root {
    --v2-gutter: clamp(1rem, 4vw, 2rem);
  }

  .v2-header,
  body.editorial-ui.v2-foundation .site-header.v2-header {
    min-height: 0;
    padding: .8rem 0;
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .v2-nav,
  body.editorial-ui.v2-foundation .site-header.v2-header .primary-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
  }

  .v2-nav a,
  .v2-nav button,
  body.editorial-ui.v2-foundation .site-header.v2-header .nav-action {
    width: 100%;
    white-space: normal;
  }

  .v2-editorial-hero {
    min-height: 420px;
    padding-top: 2.5rem;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .v2-hero-title {
    max-width: 11ch;
  }

  .v2-hero-visual {
    min-height: 160px;
  }

  .v2-monumental-word {
    top: 33%;
    left: 0;
    right: auto;
    font-size: clamp(5.8rem, 27vw, 10rem);
  }

  .v2-hero-art {
    width: 100%;
    height: 78%;
  }

  .v2-calculator-shell {
    grid-template-columns: 1fr;
  }

  .v2-result-stage {
    position: static;
    grid-row: 2;
  }

  .v2-evidence-content {
    grid-template-columns: 1fr;
  }

  .v2-footer {
    flex-direction: column;
  }

  .v2-footer-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 520px) {
  body.v2-foundation {
    font-size: 16px;
  }

  .v2-editorial-hero {
    min-height: 375px;
    padding-top: 2rem;
  }

  .v2-hero-title {
    font-size: clamp(2.3rem, 12vw, 3.35rem);
  }

  .v2-two-up,
  .v2-result-split,
  .v2-knowledge-card,
  .v2-result-actions {
    grid-template-columns: 1fr;
  }

  .v2-result-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }

  .v2-unit-note {
    padding-bottom: .65rem;
    white-space: normal;
  }

  .v2-result-state {
    min-height: 300px;
    padding: 1.25rem;
    grid-template-columns: 1fr;
  }

  .v2-assumption-row {
    align-items: start;
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .v2-result-split > div + div {
    border-top: 1px solid var(--v2-rule-soft);
    border-left: 0;
  }

  .v2-knowledge-card img {
    max-height: 180px;
  }

  .v2-result-heading {
    flex-direction: column;
    gap: .35rem;
  }

  .v2-result-mode {
    white-space: normal;
  }

  .v2-button-row {
    flex-direction: column;
  }

  .v2-button {
    width: 100%;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --v2-rule-soft: rgba(12, 53, 84, .58);
    --v2-rule-faint: rgba(12, 53, 84, .36);
  }

  .v2-input-panel,
  .v2-result-stage,
  .v2-knowledge-card {
    background: var(--v2-paper-light);
  }
}
