:root {
  --app-height: 100dvh;
  --keyboard-offset: 0px;
  --bg: #edf7fb;
  --bg-strong: #e4f4f0;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-soft: #f8fcff;
  --ink: #132431;
  --muted: #607687;
  --line: rgba(19, 36, 49, 0.1);
  --blue: #2477d6;
  --green: #0d8a74;
  --green-deep: #0a6758;
  --danger: #9b3348;
  --warning: #986220;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 24px 72px rgba(29, 85, 126, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(36, 119, 214, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(13, 138, 116, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--green-deep);
}

[hidden] {
  display: none !important;
}

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

.landing-shell,
.app-shell {
  height: var(--app-height);
  width: min(1120px, calc(100% - 20px));
  margin: 0 auto;
  padding: 10px 0;
}

.landing-card,
.journey-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.landing-card {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "copy media"
    "side media"
    "actions media";
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(36, 119, 214, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(239, 250, 246, 0.94));
}

.landing-copy,
.landing-side,
.landing-media {
  min-height: 0;
  border-radius: var(--radius-lg);
}

.landing-copy {
  grid-area: copy;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 6px 6px 6px 2px;
  position: relative;
  z-index: 1;
}

.landing-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(13, 138, 116, 0.1);
  border: 1px solid rgba(13, 138, 116, 0.12);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.landing-copy h1,
.step-head h3,
.breakdown-card h4 {
  margin: 0;
  line-height: 1.05;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.landing-copy h1 {
  font-size: clamp(1.9rem, 4.3vw, 3.1rem);
  max-width: 14ch;
  text-wrap: balance;
}

.step-head h3 {
  font-size: 1.35rem;
}

.landing-text,
.step-copy,
.progress-status,
.fine-print,
.status-copy,
.field small,
.price-status,
.source-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow,
.section-kicker,
.progress-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--green-deep);
}

.landing-badges,
.landing-pill-row,
.landing-actions,
.choice-row,
.journey-actions,
.journey-actions-right,
.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(19, 36, 49, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.landing-button {
  min-width: 190px;
  position: relative;
  z-index: 1;
}

.secondary-landing-button {
  box-shadow: none;
}

.landing-side {
  grid-area: side;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  position: relative;
  z-index: 1;
}

.landing-footer-actions {
  grid-area: actions;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid rgba(19, 36, 49, 0.08);
  position: relative;
  z-index: 1;
}

.landing-media {
  grid-area: media;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  align-self: start;
  justify-self: end;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  animation: heroImageIn 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.landing-media img {
  display: block;
  width: min(100%, 470px);
  height: auto;
  max-height: 560px;
  margin-top: 4px;
  border-radius: 28px;
  object-fit: cover;
  opacity: 0.96;
  filter: saturate(1.03) contrast(1.02);
  box-shadow: 0 28px 80px rgba(29, 85, 126, 0.1);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.92) 74%, rgba(0, 0, 0, 0.16));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.92) 74%, rgba(0, 0, 0, 0.16));
  transition: transform 220ms ease, opacity 220ms ease;
}

.landing-card:hover .landing-media img {
  transform: translateY(-3px);
  opacity: 1;
}

@keyframes heroImageIn {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.landing-explain-drawer,
.source-drawer,
.result-metric,
.mini-card {
  border-radius: 20px;
  border: 1px solid rgba(19, 36, 49, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.landing-explain-drawer[open] {
  display: grid;
  gap: 8px;
  padding: 15px;
}

.landing-explain-drawer:not([open]) {
  padding: 12px 14px;
}

.landing-flow {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.landing-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-drawer {
  padding: 12px 14px;
}

.source-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
}

.landing-explain-drawer summary,
.landing-source-drawer summary {
  list-style: none;
}

.landing-explain-drawer summary::-webkit-details-marker,
.landing-source-drawer summary::-webkit-details-marker {
  display: none;
}

.landing-source-drawer,
.landing-explain-drawer {
  margin-top: 2px;
}

.landing-explain-drawer summary::after,
.landing-source-drawer summary::after {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease, color 140ms ease;
}

.landing-explain-drawer[open] summary::after,
.landing-source-drawer[open] summary::after {
  transform: rotate(270deg);
  color: var(--ink);
}

.source-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.learn-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.learn-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 25, 34, 0.46);
  backdrop-filter: blur(8px);
}

.learn-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88dvh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(19, 36, 49, 0.1);
  background:
    radial-gradient(circle at top right, rgba(36, 119, 214, 0.12), transparent 32%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(239, 250, 246, 0.96));
  box-shadow: 0 28px 90px rgba(8, 25, 34, 0.24);
  outline: none;
}

.learn-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.learn-panel-head h2,
.learn-card h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.learn-panel-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.learn-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
  border-color: rgba(19, 36, 49, 0.16);
  background: rgba(19, 36, 49, 0.06);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(19, 36, 49, 0.08);
}

.learn-close:hover,
.learn-close:focus-visible {
  border-color: rgba(36, 119, 214, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

.learn-close-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(36, 119, 214, 0.12);
  color: var(--blue);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.learn-panel-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.learn-hero,
.learn-card {
  border-radius: 20px;
  border: 1px solid rgba(19, 36, 49, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.learn-hero {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.learn-hero strong {
  font-size: 1.06rem;
}

.learn-hero p,
.learn-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.learn-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.learn-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.learn-source-list {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.journey-topbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.journey-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.journey-heading {
  min-width: 0;
  display: grid;
  gap: 6px;
}

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

.progress-kicker {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 138, 116, 0.1);
}

.progress-current {
  margin: 0;
  font-weight: 700;
}

.top-reset {
  white-space: nowrap;
  padding: 10px 14px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.timeline-step {
  position: relative;
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 9px 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.timeline-step:hover,
.timeline-step:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(13, 138, 116, 0.32);
  outline: none;
}

.timeline-dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(36, 119, 214, 0.1);
  color: var(--blue);
  font-weight: 800;
}

.timeline-label {
  font-size: 0.76rem;
  font-weight: 700;
}

.timeline-step.is-active {
  border-color: rgba(36, 119, 214, 0.3);
  background: linear-gradient(135deg, rgba(230, 242, 255, 0.96), rgba(231, 249, 244, 0.96));
}

.timeline-step.is-active .timeline-dot,
.timeline-step.is-complete .timeline-dot {
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
}

.timeline-step.is-complete {
  border-color: rgba(13, 138, 116, 0.24);
}

.stage-wrap {
  min-height: 0;
  height: 100%;
}

.journey-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.step-panel {
  display: none;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
  scroll-padding: 18px 0 calc(var(--keyboard-offset) + 28px);
  overscroll-behavior: contain;
}

.step-panel.is-active {
  display: block;
}

.step-panel > .field-grid,
.step-panel > .price-actions,
.step-panel > .fine-print,
.step-panel > .toggle,
.step-panel > .result-card,
.step-panel > .source-drawer,
.step-panel > .result-export-note {
  margin-top: 14px;
}

.step-stage {
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(19, 36, 49, 0.08);
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.step-head {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field-grid,
.mini-grid,
.result-grid {
  display: grid;
  gap: 12px;
}

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

.field {
  display: grid;
  gap: 8px;
  position: relative;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 4px;
}

.field-label {
  font-weight: 700;
  line-height: 1.2;
  max-width: fit-content;
  color: var(--ink);
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(19, 36, 49, 0.12);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 13px 14px;
  scroll-margin: 18px 0 calc(var(--keyboard-offset) + 24px);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: rgba(96, 118, 135, 0.78);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  outline: none;
  border-color: rgba(36, 119, 214, 0.44);
  box-shadow: 0 0 0 4px rgba(36, 119, 214, 0.12);
}

input:not([type="checkbox"]):not([type="radio"]):focus::placeholder {
  color: transparent;
}

.price-input-shell {
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid rgba(19, 36, 49, 0.12);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.currency-prefix {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 0 0 0 14px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.currency-prefix-mark {
  display: block;
  width: auto;
  height: 21px;
  object-fit: contain;
}

.currency-prefix[data-kind="image"] {
  padding-right: 2px;
}

.price-input-shell input:not([type="checkbox"]):not([type="radio"]) {
  min-height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 10px;
}

.price-input-shell:focus-within {
  border-color: rgba(36, 119, 214, 0.44);
  box-shadow: 0 0 0 4px rgba(36, 119, 214, 0.12);
}

.price-input-shell input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: transparent;
  box-shadow: none;
}

.choice-chip {
  position: relative;
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  display: inline-flex;
  align-items: center;
  padding: 12px 15px;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(19, 36, 49, 0.12);
  background: var(--surface-soft);
  font-weight: 700;
}

.choice-chip input:checked + span {
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  border-color: transparent;
}

.toggle {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 13px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(36, 119, 214, 0.08), rgba(13, 138, 116, 0.08));
  border: 1px solid rgba(19, 36, 49, 0.08);
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 3px 0 0;
  border: 1.5px solid rgba(19, 36, 49, 0.38);
  border-radius: 5px;
  background: #fff;
  box-shadow: none;
  display: inline-grid;
  place-content: center;
}

.toggle input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  transform: scale(0);
  transition: transform 140ms ease;
}

.toggle input[type="checkbox"]:checked {
  border-color: rgba(36, 119, 214, 0.48);
  background: rgba(255, 255, 255, 0.96);
}

.toggle input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(36, 119, 214, 0.12);
}

.toggle span {
  display: block;
  flex: 1 1 auto;
  line-height: 1.45;
}

.primary-button,
.ghost-button {
  appearance: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  box-shadow: 0 14px 24px rgba(36, 119, 214, 0.18);
}

.ghost-button {
  border: 1px solid rgba(19, 36, 49, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.primary-button:hover,
.ghost-button:hover,
.primary-button:focus-visible,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.price-status[data-tone="success"] {
  color: var(--green-deep);
}

.price-status[data-tone="error"] {
  color: var(--danger);
}

.journey-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(19, 36, 49, 0.08);
}

.journey-footer-link {
  appearance: none;
  border: 0;
  background: transparent;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition: color 140ms ease, transform 140ms ease;
}

.journey-footer-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.journey-footer-link:hover,
.journey-footer-link:focus-visible {
  color: var(--ink);
  transform: translateY(-1px);
  outline: none;
}

.journey-actions-right {
  justify-content: flex-end;
}

.print-button {
  white-space: nowrap;
}

.result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(238, 247, 255, 0.96), rgba(237, 251, 247, 0.96));
  border: 1px solid rgba(36, 119, 214, 0.12);
}

.result-card:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(36, 119, 214, 0.12);
}

.status-row {
  display: grid;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(19, 36, 49, 0.08);
  font-weight: 800;
}

.status-pill[data-state="zakat_due"] {
  background: rgba(13, 138, 116, 0.16);
  color: var(--green-deep);
}

.status-pill[data-state="below_nisab"] {
  background: rgba(152, 98, 32, 0.14);
  color: var(--warning);
}

.status-pill[data-state="awaiting_hawl"] {
  background: rgba(36, 119, 214, 0.14);
  color: var(--blue);
}

.result-hero {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(19, 36, 49, 0.08);
}

.result-hero span,
.result-metric span,
.mini-card span,
.breakdown-row span {
  color: var(--muted);
}

.result-hero strong {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--green-deep);
  line-height: 1;
}

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

.result-metric,
.mini-card {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.result-metric strong,
.mini-card strong {
  font-size: 1rem;
}

.mini-grid {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breakdown-card {
  margin-top: 10px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(19, 36, 49, 0.08);
}

.breakdown-row:last-child {
  border-bottom: 0;
}

.result-export-note {
  margin-top: 10px;
}

.print-report {
  display: none;
}

.print-report-header {
  break-inside: avoid;
}

.print-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--green-deep);
}

.print-report h1,
.print-report h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.1;
}

.print-meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.print-section {
  margin-top: 20px;
}

.print-summary-grid,
.print-detail-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.print-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-summary-card,
.print-detail-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(19, 36, 49, 0.12);
  border-radius: 14px;
  background: #fff;
}

.print-summary-card span,
.print-detail-card span {
  color: var(--muted);
}

.print-summary-card strong {
  font-size: 1.2rem;
}

.print-breakdown {
  margin-top: 10px;
}

.print-explanation,
.print-source-list {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.45;
}

.print-explanation,
.print-source-note,
.print-source-inline {
  margin: 8px 0 0;
  line-height: 1.4;
}

@media (min-width: 860px) {
  .journey-card {
    grid-template-rows: auto auto auto auto;
    align-content: start;
  }

  .step-stage {
    max-height: calc(100dvh - 246px);
  }

  .step-panel {
    height: auto;
    max-height: calc(100dvh - 272px);
  }

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

  .price-actions {
    align-items: center;
  }
}

@media (max-width: 860px) {
  .landing-shell,
  .app-shell {
    width: min(100% - 12px, 1120px);
    padding: 6px 0;
  }

  .landing-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "copy"
      "media"
      "side"
      "actions";
    align-content: start;
    gap: 12px;
    padding: 14px;
  }

  .landing-copy {
    padding: 0;
  }

  .landing-side {
    align-content: start;
  }

  .landing-media {
    justify-self: center;
    max-width: min(100%, 340px);
    margin-top: 2px;
    pointer-events: auto;
  }

  .timeline {
    grid-auto-flow: column;
    grid-auto-columns: minmax(76px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 2px;
  }

}

@media (max-width: 640px) {
  .landing-card,
  .journey-card {
    border-radius: 20px;
  }

  .landing-copy h1 {
    max-width: 100%;
    font-size: clamp(1.7rem, 7.8vw, 2.35rem);
  }

  .landing-copy .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    padding: 7px 10px;
  }

  .landing-text,
  .landing-note,
  .landing-flow,
  .step-copy {
    line-height: 1.45;
  }

  .landing-pill-row,
  .landing-badges,
  .landing-actions,
  .price-actions,
  .journey-actions,
  .journey-actions-right,
  .journey-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .journey-actions {
    display: flex;
  }

  .landing-actions .primary-button,
  .landing-actions .ghost-button,
  .price-actions .primary-button,
  .journey-actions .primary-button,
  .journey-actions .ghost-button,
  .journey-actions-right .ghost-button {
    width: 100%;
  }

  .landing-pill-row {
    gap: 8px;
  }

  .landing-footer-actions {
    padding-top: 8px;
    border-top: 0;
    margin-top: auto;
  }

  .landing-pill {
    padding: 6px 9px;
    font-size: 0.78rem;
  }

  .landing-explain-drawer,
  .source-drawer {
    padding: 13px;
  }

  .landing-media {
    border-radius: 22px;
    overflow: hidden;
  }

  .landing-media img {
    width: 100%;
    max-height: 420px;
    margin-top: 0;
    border-radius: 22px;
    opacity: 1;
    box-shadow: 0 18px 40px rgba(29, 85, 126, 0.14);
    mask-image: none;
    -webkit-mask-image: none;
  }

  .landing-side {
    gap: 8px;
  }

  .landing-explain-drawer:not([open]),
  .landing-source-drawer:not([open]) {
    padding: 11px 13px;
  }

  .journey-topbar {
    align-items: flex-start;
  }

  .journey-summary {
    gap: 6px;
  }

  .top-reset {
    width: auto;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 14px;
  }

  .journey-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px;
  }

  .journey-footer-link {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 22px;
    order: 3;
  }

  .learn-panel {
    max-height: min(92dvh, 860px);
    padding: 14px;
    border-radius: 20px;
  }

  .learn-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .result-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: initial;
    grid-auto-columns: auto;
    overflow: hidden;
    padding-bottom: 0;
  }

  .timeline-step {
    min-width: 0;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 14px;
  }

  .timeline-dot {
    width: 24px;
    height: 24px;
    font-size: 0.82rem;
  }

  .timeline-label {
    font-size: 0.68rem;
  }

  .journey-card {
    gap: 8px;
    padding: 10px;
  }

  .step-stage {
    padding: 10px;
    border-radius: 18px;
  }

  .step-panel {
    padding-right: 0;
  }

  .step-head {
    gap: 4px;
    margin-bottom: 8px;
  }

  .field-grid,
  .mini-grid,
  .result-grid {
    gap: 10px;
  }

  .field {
    gap: 6px;
  }

  .choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select {
    padding: 11px 12px;
  }

  .price-status,
  .fine-print {
    font-size: 0.88rem;
  }

  .toggle {
    gap: 10px;
    padding: 12px;
  }

  .primary-button,
  .ghost-button {
    padding: 11px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-media {
    animation: none;
  }

  .landing-card:hover .landing-media img {
    transform: none;
    opacity: 0.96;
  }
}

@media print {
  @page {
    margin: 6mm;
  }

  :root {
    --ink: #111;
    --muted: #555;
    --line: rgba(0, 0, 0, 0.14);
  }

  html,
  body {
    height: auto;
  }

  body {
    overflow: visible;
    background: #fff;
    color: #111;
    font-size: 9pt;
    line-height: 1.2;
  }

  .landing-shell,
  .app-shell {
    display: none !important;
  }

  .print-report {
    display: block;
    max-width: none;
    margin: 0 auto;
    padding: 0;
  }

  .print-report h1 {
    font-size: 15pt;
  }

  .print-report h2 {
    font-size: 9pt;
  }

  .print-section {
    margin-top: 8px;
  }

  .print-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .print-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .print-summary-card,
  .print-detail-card,
  .result-metric,
  .mini-card {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .print-summary-card strong {
    font-size: 0.92rem;
  }

  .print-kicker,
  .print-meta,
  .print-summary-card span,
  .print-detail-card span,
  .print-summary-card p,
  .print-section p,
  .print-explanation,
  .print-source-inline,
  .breakdown-row {
    font-size: 8pt;
  }

  .print-meta {
    display: none;
  }

  .print-breakdown {
    margin-top: 2px;
  }

  .breakdown-row {
    padding: 2px 0;
  }

  .print-explanation,
  .print-source-note,
  .print-source-inline {
    margin-top: 2px;
    line-height: 1.2;
  }

  .print-report-header,
  .print-summary-grid,
  .print-detail-grid {
    break-inside: avoid;
  }

  a {
    color: #111;
    text-decoration: none;
  }
}
