/* ==========================================================================
   Rapid Rep Tools — design system
   Single source of truth for every page. Tokens first, then primitives,
   then components. Nothing here is page-specific.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand: #ed1c24;
  --brand-hi: #f6444b;
  --brand-600: #d8161e;
  --brand-700: #b21219;
  --brand-tint: #fef3f3;
  --brand-line: #f9cdcf;

  /* Ink */
  --ink: #0b0f19;
  --ink-2: #333d4d;
  --ink-3: #6b7686;
  --ink-4: #98a2b3;

  /* Surfaces */
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --surface-sunken: #f1f3f6;

  /* Lines */
  --line: #e5e8ee;
  --line-soft: #eef1f5;
  --line-strong: #d6dbe3;

  /* Status */
  --ok: #067a53;
  --ok-tint: #ecfdf5;
  --ok-line: #a7e8cd;
  --warn-tint: #fffbeb;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Elevation — paired ambient + key shadows for a glassy, layered feel */
  --sh-xs: 0 1px 2px rgba(11, 15, 25, 0.05);
  --sh-sm: 0 1px 2px rgba(11, 15, 25, 0.05), 0 2px 6px -2px rgba(11, 15, 25, 0.06);
  --sh-md: 0 1px 3px rgba(11, 15, 25, 0.05), 0 10px 20px -8px rgba(11, 15, 25, 0.1);
  --sh-lg: 0 2px 6px rgba(11, 15, 25, 0.05), 0 22px 40px -16px rgba(11, 15, 25, 0.16);
  --sh-brand: 0 1px 2px rgba(158, 14, 20, 0.3), 0 10px 22px -10px rgba(237, 28, 36, 0.55);
  --sh-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 130ms;
  --t: 200ms;
  --t-slow: 320ms;

  /* Layout */
  --gutter: 24px;
  --w-narrow: 640px;
  --w-mid: 880px;
  --w-wide: 1160px;
  --header-h: 72px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

/* Soft brand glow behind the top of every page — the "gloss" ground. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90% 120% at 50% -30%, rgba(237, 28, 36, 0.07), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--brand-600); }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

/* One consistent focus ring everywhere, keyboard-only. */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: rgba(237, 28, 36, 0.16); }

.tnum { font-variant-numeric: tabular-nums; }

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

.is-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--mid { max-width: var(--w-mid); }
.container--narrow { max-width: var(--w-narrow); }

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.page__body { flex: 1 0 auto; padding-bottom: 72px; }

/* --------------------------------------------------------------------------
   4. Header + navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 16px -8px rgba(11, 15, 25, 0.28);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: none;
  border: 0;
  padding: 4px;
  margin-inline-start: -4px;
  cursor: pointer;
  transition: opacity var(--t) var(--ease);
}
.brand:hover { opacity: 0.75; }
.brand:active { transform: translateY(0.5px); }
.brand__mark { height: 30px; width: auto; }

/* Segmented pill nav */
.nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  box-shadow: inset 0 1px 2px rgba(11, 15, 25, 0.05);
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current='page'] {
  color: var(--ink);
  font-weight: 650;
  background: var(--surface);
  box-shadow: var(--sh-xs), var(--sh-inset-top);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   5. Page header
   -------------------------------------------------------------------------- */
.page-head {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 0 32px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 12px 5px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--brand-line);
  background: var(--brand-tint);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.16);
}

.page-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.9rem);
  letter-spacing: -0.032em;
}

.page-sub {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--ink-3);
  line-height: 1.6;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.006em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled],
.btn[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

/* Glossy primary */
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hi) 0%, var(--brand) 46%, var(--brand-600) 100%);
  box-shadow: var(--sh-brand), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 50%, var(--brand-700) 100%);
  box-shadow: 0 2px 4px rgba(158, 14, 20, 0.3), 0 14px 28px -12px rgba(237, 28, 36, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--secondary {
  color: var(--ink);
  background: linear-gradient(180deg, #fff, var(--surface-2));
  border-color: var(--line-strong);
  box-shadow: var(--sh-sm), var(--sh-inset-top);
}
.btn--secondary:hover { border-color: var(--ink-4); background: #fff; }

.btn--outline {
  color: var(--brand-600);
  background: var(--surface);
  border-color: var(--brand-line);
  box-shadow: var(--sh-xs);
}
.btn--outline:hover {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand-600));
  border-color: transparent;
  box-shadow: var(--sh-brand);
}

.btn--ghost {
  color: var(--ink-3);
  background: transparent;
}
.btn--ghost:hover { color: var(--ink); background: var(--surface-sunken); }

.btn--danger {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand-600));
  box-shadow: var(--sh-brand), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--lg { --btn-h: 52px; padding-inline: 26px; font-size: 16px; }
.btn--sm { --btn-h: 36px; padding-inline: 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn--block { width: 100%; }

.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.65s linear infinite;
}

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

/* --------------------------------------------------------------------------
   7. Surfaces
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.panel {
  position: relative;
  padding: 28px;
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md), var(--sh-inset-top);
}

.panel__title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.014em;
}

/* Hairline sheen along the top edge of elevated surfaces. */
.panel::after,
.card--sheen::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0.9) 70%, transparent);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.field { display: block; }
.field + .field { margin-top: 18px; }

.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.004em;
}

.field__hint {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 2px rgba(11, 15, 25, 0.04);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
  appearance: none;
}
.input::placeholder { color: var(--ink-4); }
.input:hover,
.select:hover { border-color: var(--ink-4); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(237, 28, 36, 0.14), inset 0 1px 2px rgba(11, 15, 25, 0.03);
}
.input[aria-invalid='true'] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(237, 28, 36, 0.12);
}

.input--money { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7686' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.select--sm { min-height: 36px; padding: 5px 34px 5px 10px; font-size: 13.5px; background-position: right 10px center; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field-grid .field + .field { margin-top: 0; }
.field-grid__full { grid-column: 1 / -1; }

.field-error {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-700);
}

/* Switch */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.switch:hover { border-color: var(--line-strong); }
.switch__input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  box-shadow: inset 0 1px 3px rgba(11, 15, 25, 0.16);
  transition: background var(--t) var(--ease);
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11, 15, 25, 0.3);
  transition: transform var(--t) var(--ease-out);
}
.switch__input:checked + .switch__track {
  background: linear-gradient(180deg, var(--brand-hi), var(--brand-600));
}
.switch__input:checked + .switch__track::after { transform: translateX(16px); }
.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.switch__text { font-size: 14.5px; font-weight: 550; color: var(--ink); }

/* --------------------------------------------------------------------------
   9. Plan cards
   -------------------------------------------------------------------------- */
/* Every card shares one row rhythm through subgrid, so titles, figures,
   tiers and Apply buttons land on the same line across the whole row — the
   thing that makes a set of plans actually comparable at a glance. Each card
   emits all six slots; unused ones stay empty and collapse to nothing.
   Row gap is 0 because the parent's gutters would otherwise show up between
   every internal slot; card separation comes from margin-bottom instead. */
/* The 210px minimum is what lets four plans sit on one row on a ~1000px
   laptop screen; every figure inside the card is sized to stay legible at
   that width. auto-fit, not auto-fill, so three primary plans stretch to
   fill the row instead of leaving a phantom track. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  column-gap: 18px;
  row-gap: 0;
}

.plan-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 6;
  row-gap: 0;
  margin-bottom: 18px;
  padding: 22px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

/* Older engines fall back to equal-height flex cards with a pinned footer. */
@supports not (grid-template-rows: subgrid) {
  .plan-grid { row-gap: 18px; }
  .plan-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
  }
  .plan-card__foot { margin-top: auto; }
}
@media (hover: hover) {
  .plan-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--sh-lg);
  }
}

.plan-card--featured {
  border-color: var(--brand-line);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(237, 28, 36, 0.06);
}
@media (hover: hover) {
  .plan-card--featured:hover { border-color: var(--brand); }
}

/* Slot spacing. Empty slots zero out so a card without a price block or
   advance tiers contributes no height to those shared tracks. */
.plan-card__intro { margin-top: 14px; }
.plan-card__price { margin-top: 20px; }
.plan-card__rows { margin-top: 18px; }
.plan-card__tiers { margin-top: 16px; }
.plan-card__foot { margin-top: 20px; }

.plan-card__price:empty,
.plan-card__tiers:empty { margin-top: 0; }

.plan-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.plan-card__id {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.plan-card__title {
  font-size: 1.05rem;
  letter-spacing: -0.022em;
  line-height: 1.3;
  text-wrap: pretty;
}

.plan-card__desc {
  margin-top: 7px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  text-wrap: pretty;
}

.plan-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line-soft);
}
.plan-row:first-child { border-top: 0; }
.plan-row__value {
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.014em;
  text-align: right;
}

/* Advance tiers carry a full range in the value, which will not sit beside
   its label in a narrow card — so the label rides above it instead. */
.plan-row--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}
.plan-row--stacked .plan-row__value { text-align: left; }

.plan-tiers {
  padding: 4px 13px 9px;
  background: var(--surface-sunken);
  border-radius: var(--r-md);
}
.plan-tiers__title {
  padding-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.plan-tiers .plan-row { border-top-color: rgba(11, 15, 25, 0.06); }
.plan-tiers .plan-row:first-of-type { border-top: 0; }

/* Overview mode has no figures to show yet, so the tiers note stays a single
   quiet line rather than a box that doubles the card's height. */
.plan-note {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.plan-note::before {
  content: '';
  flex: 0 0 3px;
  border-radius: 2px;
  background: var(--brand-line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--brand {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand-600));
  box-shadow: 0 1px 2px rgba(158, 14, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.badge--muted {
  color: var(--ink-3);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   10. Segmented control (filters)
   -------------------------------------------------------------------------- */
.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  box-shadow: inset 0 1px 2px rgba(11, 15, 25, 0.05);
}
.segmented__btn {
  padding: 7px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-3);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.segmented__btn:hover { color: var(--ink); }
.segmented__btn[aria-pressed='true'] {
  color: var(--ink);
  font-weight: 650;
  background: var(--surface);
  box-shadow: var(--sh-xs), var(--sh-inset-top);
}

/* --------------------------------------------------------------------------
   11. Feedback: alerts, empty states, skeletons
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
}
.alert--error {
  color: var(--brand-700);
  background: var(--brand-tint);
  border-color: var(--brand-line);
}
.alert--success {
  color: var(--ok);
  background: var(--ok-tint);
  border-color: var(--ok-line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.state {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14.5px;
}
.state__title {
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--ink);
}

.skeleton-card {
  height: 268px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.85) 50%, transparent 80%),
    var(--surface-sunken);
  background-size: 220% 100%, auto;
  animation: shimmer 1.4s var(--ease) infinite;
}
@keyframes shimmer {
  from { background-position: 160% 0, 0 0; }
  to { background-position: -60% 0, 0 0; }
}

/* --------------------------------------------------------------------------
   12. Dialog
   -------------------------------------------------------------------------- */
dialog.modal {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  color: var(--ink-2);
}
dialog.modal::backdrop {
  background: rgba(11, 15, 25, 0.4);
  backdrop-filter: blur(3px);
}
dialog.modal[open] { animation: modal-in var(--t-slow) var(--ease-out); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal__body { padding: 26px 26px 8px; }
.modal__title { font-size: 1.15rem; letter-spacing: -0.02em; }
.modal__text { margin-top: 8px; font-size: 14.5px; color: var(--ink-3); line-height: 1.55; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 26px 24px;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-4);
}
.site-footer a { color: var(--ink-3); text-decoration: none; font-weight: 550; }
.site-footer a:hover { color: var(--brand-600); }

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --gutter: 18px; }

  .site-header__inner { flex-wrap: wrap; row-gap: 10px; padding-block: 10px; }
  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav__link { flex: 1 0 auto; justify-content: center; padding-inline: 12px; }

  .page-head { padding: 36px 0 26px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 22px 18px; border-radius: var(--r-lg); }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .plan-card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .btn, .segmented { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .plan-card { break-inside: avoid; box-shadow: none; }
}
