/* Hadef UI upgrades: marketing. Every rule is scoped under html.ui-<flag>,
   which api/static/js/marketing-upgrades.js adds only for an enabled flag, so
   a flag set to false leaves the page exactly as it was. Existing tokens from
   marketing-v4.css only. Motion is transform and opacity, at most 280ms, and
   static under prefers-reduced-motion. */

.mkt-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;
}

/* ── mkt_mobile_nav_sheet ─────────────────────────────────────── */
html.ui-mkt_mobile_nav_sheet .mkt-menu-btn { display: none; }
html.ui-mkt_mobile_nav_sheet .mkt-sheet[hidden] { display: none; }

@media (max-width: 760px) {
  html.ui-mkt_mobile_nav_sheet .mkt-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-right: -10px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }
  html.ui-mkt_mobile_nav_sheet .nav-cta-row { gap: 12px; }
  /* Sign in and Start free stay on one line beside the menu button, as on
     pages without it. Squeezed by the button, both wrapped to two lines. */
  html.ui-mkt_mobile_nav_sheet .nav-cta-row > a { white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 389px) {
  /* Below 390px Sign in, Start free and the menu button need about 384px and
     cannot share the header. Sign in and Start free stay; the menu button goes. */
  html.ui-mkt_mobile_nav_sheet .mkt-menu-btn { display: none; }
}

html.ui-mkt_mobile_nav_sheet.mkt-sheet-locked,
html.ui-mkt_mobile_nav_sheet.mkt-sheet-locked body { overflow: hidden; }

html.ui-mkt_mobile_nav_sheet .mkt-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.23, 1, 0.32, 1);
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-left: 1px solid var(--border);
  padding: 16px 24px 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.23, 1, 0.32, 1);
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet.is-open .mkt-sheet-overlay { opacity: 1; }
html.ui-mkt_mobile_nav_sheet .mkt-sheet.is-open .mkt-sheet-panel { transform: translateX(0); }

html.ui-mkt_mobile_nav_sheet .mkt-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 8px;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-foot .mkt-sheet-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  font-size: 15px;
}
html.ui-mkt_mobile_nav_sheet .mkt-sheet-foot .nav-link-muted.mkt-sheet-cta {
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
}
html.ui-mkt_mobile_nav_sheet .mkt-menu-btn:focus-visible,
html.ui-mkt_mobile_nav_sheet .mkt-sheet :focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* ── mkt_pricing_plan_tabs ────────────────────────────────────── */
html.ui-mkt_pricing_plan_tabs .mkt-plan-tabs[hidden] { display: none; }
html.ui-mkt_pricing_plan_tabs .mkt-plan-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: var(--cream-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
}
html.ui-mkt_pricing_plan_tabs .mkt-plan-tab {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
html.ui-mkt_pricing_plan_tabs .mkt-plan-tab-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
html.ui-mkt_pricing_plan_tabs .mkt-plan-tab-price {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
html.ui-mkt_pricing_plan_tabs .mkt-plan-tab[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--accent-dark);
}
html.ui-mkt_pricing_plan_tabs .mkt-plan-tab:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  html.ui-mkt_pricing_plan_tabs .pricing-grid.mkt-plan-tabbed { margin-top: 0; }
  html.ui-mkt_pricing_plan_tabs .pricing-grid.mkt-plan-tabbed > .pricing-card:not(.mkt-plan-active) {
    display: none !important;
  }
  html.ui-mkt_pricing_plan_tabs .pricing-grid.mkt-plan-tabbed > .pricing-card.mkt-plan-active {
    animation: mkt-plan-in 220ms cubic-bezier(0.23, 1, 0.32, 1) 1;
  }
  /* The badge sits above the card's top edge; leave it room under the tabs. */
  html.ui-mkt_pricing_plan_tabs .pricing-grid.mkt-plan-tabbed > .pricing-card--featured { margin-top: 12px; }
}
@keyframes mkt-plan-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── mkt_pricing_cycle_a11y ───────────────────────────────────── */
/* Behaviour only (aria-pressed and a live region); no visual change. */
html.ui-mkt_pricing_cycle_a11y .pricing-toggle-seg:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* ── mkt_reduced_motion ───────────────────────────────────────── */
/* marketing-v4.css glides every anchor jump (scroll-behavior: smooth, up to
   9,000px from the header to #faq) and animates each FAQ answer open, with no
   reduced-motion exception for either. */
@media (prefers-reduced-motion: reduce) {
  html.ui-mkt_reduced_motion { scroll-behavior: auto; }
  html.ui-mkt_reduced_motion .faq-a { animation: none; }
  html.ui-mkt_reduced_motion .faq-q,
  html.ui-mkt_reduced_motion .faq-icon,
  html.ui-mkt_reduced_motion .faq-item,
  html.ui-mkt_reduced_motion .nav-links a,
  html.ui-mkt_reduced_motion .pricing-toggle-seg { transition: none; }

  html.ui-mkt_mobile_nav_sheet .mkt-sheet-overlay,
  html.ui-mkt_mobile_nav_sheet .mkt-sheet-panel { transition: none; }
  html.ui-mkt_pricing_plan_tabs .pricing-grid.mkt-plan-tabbed > .pricing-card.mkt-plan-active { animation: none; }
}
