/* PLANS - selectable editorial comparison using MDJ tokens and copy. */
.plans-section {
  width: 100vw;
  max-width: 1440px;
  margin-inline: auto;
  padding: max(96px, calc(var(--mdj-header-safe-offset) + 22px)) 128px 52px;
}
.plans-head {
  max-width: 920px;
  margin: 0 auto 42px;
  text-align: center;
}
.plans-head h2 {
  font-size: clamp(2rem, 4.4vw, 4.3rem);
  line-height: 1;
}
.plans-head p:not(.eyebrow) {
  max-width: 760px;
  margin-inline: auto;
}
.plans-grid { margin-top: 0; }
.plans-mobile-cards { display: none; }

.plans-compare {
  --feature-width: 176px;
  --plan-width: 168px;
  position: relative;
  isolation: isolate;
  width: 100%;
}
.plans-summary-scroll,
.plans-detail-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scroll-padding-inline-start: var(--feature-width);
  scrollbar-color: var(--subtle) transparent;
  -webkit-overflow-scrolling: touch;
}
.plans-summary-scroll {
  position: sticky;
  z-index: 8;
  top: 78px;
  scrollbar-width: none;
}
.plans-summary-scroll::-webkit-scrollbar { display: none; }
.plans-summary-scroll:focus-visible,
.plans-detail-scroll:focus-visible {
  outline-offset: 5px;
}
.plans-grid-row,
.plans-group-heading {
  width: 100%;
  min-width: calc(var(--feature-width) + 5 * var(--plan-width));
}
.plans-grid-row {
  display: grid;
  grid-template-columns: var(--feature-width) repeat(5, minmax(var(--plan-width), 1fr));
}

.plans-summary {
  align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  box-shadow: 0 16px 24px color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
}
.plans-summary .plan-column {
  min-width: 0;
  padding: 0;
  text-align: center;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.plans-summary .plan-column + .plan-column {
  border-left: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
}
.plan-name {
  display: block;
  min-height: 2.5em;
  margin: 0;
  color: var(--text);
  font-size: clamp(.88rem, 1.05vw, 1.06rem);
  font-weight: 850;
  line-height: 1.25;
}
.plan-price {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1;
}
.plan-interval {
  min-height: 2.5em;
  margin: 7px 0 0;
  color: var(--gold);
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.25;
}
.plan-summary-copy {
  display: block;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.42;
}
.plan-summary-select {
  width: 100%;
  height: 100%;
  min-height: 208px;
  padding: 25px 12px 23px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: transform 140ms cubic-bezier(.23, 1, .32, 1);
}
.plan-summary-select:active { transform: scale(.975); }

.plans-group { min-width: max-content; }
.plans-group-heading {
  padding: 58px 14px 17px;
  border-bottom: 1px solid var(--line);
}
.plans-group-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
}
.plans-group-heading p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}
.plans-row {
  min-height: 96px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.plans-row .plan-column {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 20px 12px;
  color: var(--text);
  text-align: center;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.plans-row .plan-column + .plan-column {
  border-left: 1px solid color-mix(in srgb, var(--line) 38%, transparent);
}
.plans-feature {
  position: sticky;
  z-index: 4;
  left: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 18px 14px;
  background: var(--bg);
  color: var(--text);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
}
.plans-corner {
  z-index: 10;
  align-items: end;
  padding-bottom: 24px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.plan-value-text {
  display: inline-block;
  max-width: 18ch;
  font-size: .84rem;
  font-weight: 720;
  line-height: 1.38;
}
.plan-check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 20%, transparent);
}
.plan-check .ui-icon {
  width: 16px;
  height: 16px;
}

.plans-selection-row {
  min-height: 104px;
  border-bottom: 1px solid var(--line);
}
.plans-selection-label {
  color: var(--gold);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.plan-selection-cell {
  display: grid;
  place-items: center;
  border-left: 1px solid color-mix(in srgb, var(--line) 38%, transparent);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.plan-selection-control {
  display: grid;
  width: 100%;
  min-height: 103px;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.plan-selection-ring {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 50%;
  background: var(--bg-soft);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(.23, 1, .32, 1);
}
.plan-selection-ring .ui-icon {
  width: 17px;
  height: 17px;
  opacity: 0;
  transform: scale(.92);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(.23, 1, .32, 1);
}
.is-selected .plan-selection-ring,
[data-plan-select][aria-pressed="true"] .plan-selection-ring {
  border-color: color-mix(in srgb, var(--red-bright) 70%, var(--line));
  background: var(--red);
  transform: scale(1.04);
}
.is-selected .plan-selection-ring .ui-icon,
[data-plan-select][aria-pressed="true"] .plan-selection-ring .ui-icon {
  opacity: 1;
  transform: scale(1);
}
.plan-column.is-selected {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  box-shadow: inset 1px 0 color-mix(in srgb, var(--red-bright) 28%, transparent), inset -1px 0 color-mix(in srgb, var(--red-bright) 28%, transparent);
}
.plan-purchase-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  margin-top: 20px;
  padding: 16px 18px;
  border-block: 1px solid var(--line);
  opacity: .72;
  transform: translateY(3px);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.23, 1, .32, 1), border-color 200ms ease;
}
.plan-purchase-dock.is-ready {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
  opacity: 1;
  transform: translateY(0);
}
.plan-purchase-dock__copy {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .82rem;
}
.plan-purchase-dock__copy strong {
  color: var(--text);
  font-size: 1.05rem;
}
.plan-purchase-dock .button { width: auto; max-width: 100%; flex: 0 0 auto; white-space: nowrap; }
.plan-purchase-dock .button:active { transform: scale(.975); }

@media (hover: hover) and (pointer: fine) {
  .plan-column.is-plan-hovered:not(.is-selected) {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
  }
}

::view-transition-group(selected-plan) { animation-duration: 260ms; animation-timing-function: cubic-bezier(.77, 0, .175, 1); }

.feature-info {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  font: 800 .72rem/1 inherit;
  cursor: help;
}
.feature-info::after {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 10px);
  left: 0;
  width: min(280px, 72vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  color: var(--text);
  content: attr(data-tooltip);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.feature-info:hover::after,
.feature-info:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.plans-compare--loading { min-height: 520px; overflow-x: auto; }
.plans-compare--loading .plans-summary { min-height: 214px; }
.plans-compare--loading .plans-row { min-height: 96px; }
.plan-skeleton {
  display: block;
  align-self: center;
  justify-self: center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface), var(--surface-strong), var(--surface));
  background-size: 200% 100%;
  animation: plans-shimmer 1.2s linear infinite;
}
.plan-skeleton--column { width: 62%; height: 12px; }
.plan-skeleton--feature { width: 72%; height: 12px; margin: 0 14px; }
.plan-skeleton--heading { width: 240px; max-width: 70vw; height: 20px; }
@keyframes plans-shimmer { to { background-position: -200% 0; } }

.plan-mobile-card--loading {
  min-height: 156px;
  align-content: center;
  justify-items: start;
  gap: 18px;
  padding: 18px;
}
.plan-mobile-card--loading .plan-skeleton--heading { width: 46%; }
.plan-mobile-card--loading .plan-skeleton--column { width: 82%; }

.plans-error {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  border-block: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}
.plans-error p { margin: 0; }

.payment-note {
  margin: 0;
  color: var(--gold);
  font-size: .84rem;
  line-height: 1.55;
}
.plans-contact-note {
  margin-top: 14px;
  text-align: center;
}

@media (min-width: 1024px) and (max-width: 1439px) {
  .plans-section { padding-inline: 64px; }
  .plan-summary-copy { font-size: .64rem; }
}

@media (max-width: 1023px) {
  .plans-section { padding: max(88px, calc(var(--mdj-header-safe-offset) + 22px)) 16px 44px; }
  .plans-head { margin-bottom: 30px; padding-inline: 8px; }
  .plans-compare { --feature-width: 154px; --plan-width: 164px; }
  .plans-summary .plan-column { padding-inline: 10px; }
  .plan-summary-copy { font-size: .64rem; }
  .plans-group-heading { padding-top: 44px; }
}

@media (max-width: 640px) {
  .plans-section { padding-top: max(112px, calc(var(--mdj-header-safe-offset) + 22px)); }
  .plans-head { margin-bottom: 20px; padding-inline: 0; }
  .plans-head .eyebrow,
  .plans-head p:not(.eyebrow) { display: none; }
  .plans-head h2 { font-size: clamp(1.85rem, 9vw, 2.35rem); line-height: 1.04; }
  .plans-compare { display: none; }
  .plans-mobile-cards { display: grid; gap: 10px; }
  .plan-mobile-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(.23, 1, .32, 1);
  }
  .plan-mobile-card.is-selected {
    border-color: color-mix(in srgb, var(--red-bright) 58%, var(--line));
    background: color-mix(in srgb, var(--red) 10%, var(--surface));
    transform: translateY(-2px);
  }
  .plan-mobile-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 15px 13px;
  }
  .plan-mobile-card__name {
    margin: 0;
    color: var(--text);
    font-size: .98rem;
    line-height: 1.2;
  }
  .plan-mobile-card__interval {
    margin: 5px 0 0;
    color: var(--gold);
    font-size: .68rem;
    font-weight: 800;
  }
  .plan-mobile-card__price {
    flex: 0 0 auto;
    margin: 0;
    color: var(--text);
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -.04em;
    line-height: 1;
  }
  .plan-mobile-card__choice {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 9px;
  }
  .plan-mobile-card__select {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1;
  }
  .plan-mobile-card__select .plan-selection-ring { width: 28px; height: 28px; }
  .plan-mobile-card__select .plan-selection-ring .ui-icon { width: 14px; height: 14px; }
  .plan-mobile-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid var(--line);
  }
  .plan-mobile-metric {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 3px;
    padding: 11px 5px 10px;
    text-align: center;
  }
  .plan-mobile-metric + .plan-mobile-metric { border-left: 1px solid var(--line); }
  .plan-mobile-metric__value {
    overflow: hidden;
    max-width: 100%;
    color: var(--text);
    font-size: 1.18rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .plan-mobile-metric__label {
    overflow: hidden;
    max-width: 100%;
    color: var(--subtle);
    font-size: .62rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .plan-mobile-card details { color: var(--muted); }
  .plan-mobile-card summary {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: var(--muted);
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
    list-style: none;
  }
  .plan-mobile-card summary::-webkit-details-marker { display: none; }
  .plan-mobile-card summary::after { content: "+"; color: var(--gold); font-size: 1rem; }
  .plan-mobile-card details[open] summary { border-bottom: 1px solid var(--line); }
  .plan-mobile-card details[open] summary::after { content: "−"; }
  .plan-mobile-card__details { padding: 4px 15px 8px; }
  .plan-mobile-detail {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
    font-size: .7rem;
  }
  .plan-mobile-detail:last-child { border-bottom: 0; }
  .plan-mobile-detail strong { max-width: 58%; color: var(--text); text-align: right; }
  .plan-purchase-dock {
    position: sticky;
    bottom: 12px;
    z-index: 7;
    align-items: stretch;
    gap: 12px;
    margin: 16px 0 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(130%);
  }
  .plan-purchase-dock__copy { align-content: center; min-width: 0; }
  .plan-purchase-dock__copy strong,
  .plan-purchase-dock__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .plan-purchase-dock .button { min-height: 46px; padding-inline: 15px; font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-info::after { transition-duration: .01ms; }
  .plan-skeleton { animation: none; }
  .plan-column,
  .plan-summary-select,
  .plan-selection-ring,
  .plan-selection-ring .ui-icon,
  .plan-mobile-card,
  .plan-purchase-dock { transition-duration: .01ms; transform: none; }
  ::view-transition-group(selected-plan) { animation-duration: .01ms; }
}
