/* Stone ground, flat white cards, grey code chips, maroon-black buttons, lavender badges */
:root {
  --ground: #ECECE8;
  --card: #FFFFFF;
  --ink: #191610;
  --paper: #F3EEED;
  --btn: #2B1116;
  --btn-hover: #3B1A20;
  --text: #141414;
  --text-2: #3D3D3D;
  --muted: #767676;
  --line: #DCDCD8;
  --pill: #E9E9E6;
  --chip: #EDEDEB;
  --soft: #F4F4F2;
  --hair: #EEEEEC;
  --corner: #CFCFCA;
  --badge-bg: #F3E8FF;
  --badge-fg: #8A3FD1;
  --radius: 28px;
  --side: 384px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --gutter: 24px;
  color-scheme: light;

  /* Motion shared by the toolbar and the plan card (values from both components) */
  --tabs-dur: 250ms; --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --press-scale: 0.99; --press-dur: 150ms; --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { height: 100%; }
body { min-height: 100%; font-family: var(--font); font-size: 15px; line-height: 1.45; letter-spacing: -0.005em; color: var(--text); background: var(--ground); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
a { color: var(--text); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button { font-family: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.pill { min-height: 48px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color var(--press-dur) var(--ease-smooth-out), transform var(--press-dur) var(--ease-smooth-out); }
.pill:is(:active, .is-pressed) { transform: scale(var(--press-scale)); }
.pill.dark { background: var(--btn); color: #FFFFFF; }
.pill.dark:hover { background: var(--btn-hover); }
.pill.grey { background: var(--pill); color: var(--text); }
.pill.grey:hover { background: #E0E0DC; }
.pill.light { background: var(--paper); color: var(--btn); }
.pill.light:hover { background: #FFFFFF; }
.pill.ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px rgba(243, 238, 237, 0.28); }
.pill.ghost:hover { background: rgba(243, 238, 237, 0.08); }
.link-btn { border: 0; padding: 0; background: none; font: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.circle { flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--pill); color: var(--text); cursor: pointer; }
.circle.soft { background: var(--ground); }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 8px; background: var(--chip); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; align-self: flex-start; min-height: 26px; padding: 3px 12px; border-radius: 999px; background: var(--badge-bg); color: var(--badge-fg); font-size: 13px; }
.lead { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; }
.lead b { font-weight: 600; }
.head .chip { background: var(--card); }

/* ---------- Proposal document: cover, numbered sections, closing ---------- */
.proposal { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px calc(var(--gutter) + 6px); }
.topbar .logo { height: 20px; width: auto; display: block; }
.topbar-meta { display: flex; align-items: center; gap: 8px; }
.topbar-meta .chip { background: var(--card); }
.topbar-meta .badge { white-space: nowrap; }
.cover { padding: 64px calc(var(--gutter) + 6px) 40px; }
.eyebrow { margin: 0 0 20px; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted); }
.display { margin: 0; max-width: 15ch; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7.2vw, 112px); line-height: 0.95; letter-spacing: -0.025em; color: var(--text); text-wrap: balance; }
.display em { font-style: italic; }
.cover-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 36px; }
.intro { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.cover-cta { width: auto; flex: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 24px; margin: 48px 0 0; }
.facts div { padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }

.sec { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.sec-num { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-name { font-family: var(--serif); font-size: 36px; line-height: 1; letter-spacing: -0.015em; }
.doc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; margin: 0 calc(var(--gutter) + 6px); padding: 40px 0 72px; border-top: 1px solid var(--line); }
.doc-head { display: flex; align-items: baseline; gap: 12px; }
.sec-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1; letter-spacing: -0.015em; }
.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
.items.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.items li { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.item-n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.items h3 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.items p { margin: 0; color: var(--text-2); max-width: 40ch; }
.invest { display: flex; flex-direction: column; gap: 24px; }
.equation { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 28px; padding: 28px; border-radius: var(--radius); background: var(--card); }
.term { display: flex; flex-direction: column; gap: 8px; }
.big { font-family: var(--serif); font-size: 72px; line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.big small { font-family: var(--font); font-size: 15px; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.lbl { font-size: 13px; color: var(--muted); }
.term.total .big { font-style: italic; }
.op { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--corner); }
.invest-note { margin: 0; color: var(--muted); max-width: 62ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-row .pill { width: auto; padding: 0 24px; }
.closing { margin: 24px var(--gutter) 0; padding: 88px 40px 72px; border-radius: var(--radius); background: var(--btn); color: var(--paper); display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.closing .display { color: var(--paper); max-width: none; }
.closing-sub { margin: 0; max-width: 52ch; font-size: 17px; color: rgba(243, 238, 237, 0.72); }
.foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding: 28px calc(var(--gutter) + 6px) 40px; font-size: 13px; color: var(--muted); }
.foot img { height: 16px; width: auto; margin-right: auto; }
.dock, .explore-close, .frame-cover, .head-biz { display: none; }

/* ---------- Desktop: frame left, cards right ---------- */
.app { position: relative; z-index: 1; height: 100vh; height: 100svh; min-height: 640px; display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 24px; padding: var(--gutter); scroll-margin-top: 0; }
.stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 0 6px; }
.head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.head-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-sub { display: none; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { display: none; }

/* Crop-mark corners around the preview */
.frame-shell { position: relative; flex: 1; min-height: 0; display: flex; }
.corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--corner); pointer-events: none; }
.corner.tl { top: -9px; left: -9px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: -9px; right: -9px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: -9px; left: -9px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: -9px; right: -9px; border-bottom-width: 1px; border-right-width: 1px; }

.frame-wrap { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; border-radius: var(--radius); overflow: hidden; background: var(--card); }

/* Loading screen: animated pixel gradient until the preview arrives */
.loader { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: flex-start; padding: 24px; background: #D9C9B4; transition: opacity 400ms var(--ease-smooth-out); }
.loader canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader .chip { position: relative; background: rgba(255, 255, 255, 0.85); }
.loader.done { opacity: 0; pointer-events: none; }
.frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #FFFFFF; }
.frame-wrap[data-size="tablet"], .frame-wrap[data-size="phone"] { padding: 20px 0 96px; background: #F3F2EF; }
.frame-wrap[data-size="tablet"] iframe { width: 820px; max-width: calc(100% - 40px); border-radius: 28px; box-shadow: 0 0 0 1px #E4E2DD, 0 12px 32px rgba(25, 22, 16, 0.06); }
.frame-wrap[data-size="phone"] iframe { width: 390px; max-width: calc(100% - 40px); border-radius: 32px; box-shadow: 0 0 0 1px #E4E2DD, 0 12px 32px rgba(25, 22, 16, 0.06); }
.frame-wrap.fit { justify-content: flex-start; }
.frame-wrap.fit iframe { flex: none; transform-origin: 0 0; }
.foot-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 0 6px; font-size: 13px; color: var(--muted); }
.foot-note a { color: var(--muted); }

.side { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.card { border-radius: var(--radius); background: var(--card); }
.who { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.who img { height: 20px; width: auto; align-self: flex-start; }
.who-text { display: flex; flex-direction: column; gap: 10px; }
.biz { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.sheet-bar, .who .circle { display: none; }
@media (min-width: 900px) { .who { display: none; } }

.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.actions { margin-top: auto; padding: 24px; border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; gap: 14px; }
.actions-text { margin: 0; color: var(--muted); }
.fine { margin: 0; font-size: 12.5px; color: var(--muted); }

.book { flex: 1; min-height: 0; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.book-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.book-frame { flex: 1; min-height: 440px; width: 100%; border: 0; border-radius: 16px; background: var(--soft); }
.book-link { text-align: center; font-size: 13px; color: var(--muted); }
.book-link a { color: var(--muted); }

.mobile-actions, .scrim { display: none; }

/* Toolbar options: price panel off, focus mode */
@media (min-width: 900px) {
  .app.no-side, body.focus .app { grid-template-columns: minmax(0, 1fr); }
  .app.no-side .side, body.focus .side { display: none; }
  body.focus .doc-only { display: none; }
  body.focus .head-title { color: var(--paper); }
  body.focus .sec-num { color: rgba(243, 238, 237, 0.6); }
  body.focus .head-sub, body.focus .foot-note, body.focus .foot-note a { color: rgba(243, 238, 237, 0.6); }
}

/* =====================================================================
   Plan card: "Manage Subscription" (transitions.dev community), adapted
   ===================================================================== */
/* @motion
[Plan pages] plan panels
--page-slide-dur: Duration
--page-slide-distance: Distance
--page-blur: Blur
more --page-fade-dur: Fade duration
more --page-stagger: Stagger
more --page-exit-enabled: Exit enabled
more --page-slide-ease: Slide easing
more --page-fade-ease: Fade easing
[Tabs pill] billing and plan tabs
--tabs-dur: Duration
--tabs-ease: Easing
[Price pop-in] price digits
--digit-dur: Duration
--digit-distance: Distance
--digit-blur: Blur
more --digit-stagger: Stagger
more --digit-ease: Easing
more --digit-dir-x: Direction X
more --digit-dir-y: Direction Y
more [Button label swap] action button
--text-swap-dur: Duration
--text-swap-translate-y: Distance
--text-swap-blur: Blur
--text-swap-ease: Easing
more [Button press] buttons
--press-scale: Scale
--press-dur: Duration
--ease-smooth-out: Easing
*/
:root {
  --page-slide-dur: 250ms; --page-fade-dur: 250ms; --page-slide-distance: 8px; --page-blur: 3px; --page-stagger: 0ms; --page-exit-enabled: 1;
  --page-slide-ease: cubic-bezier(0.22, 1, 0.36, 1); --page-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --digit-dur: 500ms; --digit-distance: 8px; --digit-stagger: 70ms; --digit-blur: 2px; --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1); --digit-dir-x: 0; --digit-dir-y: 1;
  --text-swap-dur: 150ms; --text-swap-translate-y: 4px; --text-swap-blur: 2px; --text-swap-ease: ease-in-out;
}
.sub {
  /* Theme: --stage-* mapped to the light card tokens */
  --stage-bg: var(--ground);
  --stage-fg: var(--text);
  --stage-muted: var(--muted);
  --stage-border: var(--line);
  --stage-surface: var(--card);
  --stage-accent: var(--btn);
  --stage-on-accent: #FFFFFF;
  --chip: rgba(20, 20, 20, 0.045); --chip-hover: rgba(20, 20, 20, 0.065);
  --divider: color-mix(in srgb, var(--stage-border) 49%, transparent);
  width: 100%; box-sizing: border-box; padding: 20px; border-radius: var(--radius); background: var(--stage-surface); color: var(--stage-fg);
  display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 20px;
}
.sub :where(button) { font: inherit; font-size: 13px; line-height: 20px; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 500; }
.sub-meta { margin: 0; font-size: 12px; line-height: 16px; color: var(--stage-muted); }
.sub .t-tabs { position: relative; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 48px; background: var(--chip); }
.sub .t-tabs.sm { display: inline-flex; }
.sub .t-tab { position: relative; flex: 1; height: 26px; padding: 0 12px; border-radius: 48px; color: var(--stage-muted); z-index: 1; font-weight: 500; white-space: nowrap; transition: color var(--tabs-dur) var(--tabs-ease); }
.sub .t-tab[aria-selected="true"] { color: var(--stage-fg); }
.sub .t-tabs-pill { position: absolute; top: 3px; left: 0; height: 26px; width: 0; background: var(--stage-surface); border-radius: 48px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04); transform: translateX(0); transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease); z-index: 0; pointer-events: none; }
.t-page-slide { display: grid; }
.t-page { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; opacity: 0; pointer-events: none; transform: translateX(calc(var(--dir, 1) * var(--page-slide-distance) * var(--page-exit-enabled))); filter: blur(calc(var(--page-blur) * var(--page-exit-enabled))); transition: opacity var(--page-fade-dur) var(--page-fade-ease), transform var(--page-slide-dur) var(--page-slide-ease), filter var(--page-slide-dur) var(--page-slide-ease); }
.t-page.on { opacity: 1; pointer-events: auto; transform: translateX(0); filter: blur(0); transition-delay: var(--page-stagger); }
.sub-price { display: flex; align-items: baseline; gap: 4px; font-size: 28px; line-height: 34px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sub-price small { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--stage-muted); }
.feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.feats li { display: flex; gap: 8px; align-items: flex-start; }
.feats .hi { margin-top: 2px; flex: none; color: var(--stage-muted); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--divider) 20%, var(--divider) 80%, transparent); }
.t-digit-group { display: inline-flex; align-items: baseline; }
.t-digit { display: inline-block; }
.t-digit-group.is-animating .t-digit { animation: t-digit-pop-in var(--digit-dur) var(--digit-ease) both; }
.t-digit-group.is-animating .t-digit[data-stagger="1"] { animation-delay: var(--digit-stagger); }
.t-digit-group.is-animating .t-digit[data-stagger="2"] { animation-delay: calc(var(--digit-stagger) * 2); }
.t-digit-group.is-animating .t-digit[data-same] { animation: none; }
@keyframes t-digit-pop-in {
  0% { transform: translate(calc(var(--digit-distance) * var(--digit-dir-x)), calc(var(--digit-distance) * var(--digit-dir-y))); opacity: 0; filter: blur(var(--digit-blur)); }
  100% { transform: translate(0, 0); opacity: 1; filter: blur(0); }
}
.t-text-swap { display: inline-block; transform: translateY(0); filter: blur(0); opacity: 1; transition: transform var(--text-swap-dur) var(--text-swap-ease), filter var(--text-swap-dur) var(--text-swap-ease), opacity var(--text-swap-dur) var(--text-swap-ease); }
.t-text-swap.is-exit { transform: translateY(calc(var(--text-swap-translate-y) * -1)); filter: blur(var(--text-swap-blur)); opacity: 0; }
.t-text-swap.is-enter-start { transform: translateY(var(--text-swap-translate-y)); filter: blur(var(--text-swap-blur)); opacity: 0; transition: none; }
.sub-cta { height: 40px; border-radius: 8px; width: 100%; font-weight: 500; background: var(--stage-accent) !important; color: var(--stage-on-accent) !important; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); --press-scale: 0.99; transition: transform var(--press-dur) var(--ease-smooth-out), background-color var(--press-dur) var(--ease-smooth-out); }
.sub-cta[disabled] { background: var(--chip) !important; color: var(--stage-muted) !important; box-shadow: none; cursor: default; }
.sub-cta:is(:active, .is-pressed):not([disabled]) { transform: scale(var(--press-scale)); }
.sub button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--stage-surface), 0 0 0 4px var(--stage-accent); }

/* =====================================================================
   Preview toolbar: "Snapshot Toolbar remix", adapted
   ===================================================================== */
/* @motion
[Mode pill] sliding selector
--tabs-dur: Duration
--tabs-ease: Easing
[Menu open] options menu
--dropdown-open-dur: Duration
--dropdown-ease: Easing
--dropdown-pre-scale: Scale
[Menu close] options menu
--dropdown-close-dur: Duration
--dropdown-closing-scale: Scale
more [Label morph] copy button
--text-morph-dur: Duration
--text-morph-resize-dur: Duration
--text-morph-ease: Easing
--text-morph-stagger: Letter stagger
more --text-morph-blur: Blur
more --text-morph-rise: Letter rise
more --text-morph-shrink-lag: Shrink lag
more [Icon swap] copy icon
--icon-swap-dur: Duration
--icon-swap-ease: Easing
--icon-swap-start-scale: Scale
more --icon-swap-blur: Blur
more [Tooltip] mode icons
--tt-in-dur: Duration
--tt-delay: Delay
--tt-move-dur: Travel duration
more --tt-out-dur: Hide duration
more --tt-scale: Scale
more --tt-in-ease: Easing in
more --tt-out-ease: Easing out
more --tt-move-ease: Travel easing
more [Button press] buttons
--press-scale: Scale
--press-dur: Duration
--ease-smooth-out: Easing
*/
:root {
  --dropdown-open-dur: 250ms; --dropdown-close-dur: 150ms; --dropdown-pre-scale: 0.97; --dropdown-closing-scale: 0.99; --dropdown-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --text-morph-dur: 180ms; --text-morph-resize-dur: 240ms; --text-morph-blur: 2px; --text-morph-ease: cubic-bezier(0.22, 1, 0.36, 1); --text-morph-stagger: 35ms; --text-morph-rise: 3px; --text-morph-shrink-lag: 60ms;
  --icon-swap-dur: 250ms; --icon-swap-blur: 2px; --icon-swap-start-scale: 0.25; --icon-swap-ease: ease-in-out;
  --tt-in-dur: 150ms; --tt-out-dur: 50ms; --tt-scale: 0.98; --tt-delay: 80ms; --tt-in-ease: ease-out; --tt-out-ease: ease-out; --tt-move-dur: 160ms; --tt-move-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.stage-bar, .backdrop {
  /* Theme: --stage-* mapped to Hyperdesk ink and paper */
  --stage-bg: var(--ink);
  --stage-fg: var(--paper);
  --stage-muted: rgba(243, 238, 237, 0.5);
  --stage-border: rgba(243, 238, 237, 0.14);
  --stage-surface: #24211B;
  --stage-accent: var(--paper);
  --stage-on-accent: var(--ink);
  --stage-backdrop: #0C0B08;
  --tt-bg: var(--stage-surface); --tt-fg: var(--stage-fg);
  --seg-fill: rgba(243, 238, 237, 0.08); --opt-hover-fill: rgba(243, 238, 237, 0.03);
  --btn-edge-top: rgba(255, 255, 255, 0.1); --btn-edge-bottom: rgba(255, 255, 255, 0.02);
  --btn-edge-top-cap: rgba(255, 255, 255, 0.6); --btn-edge-bottom-cap: rgba(25, 22, 16, 0.08);
}
.backdrop { position: fixed; inset: 0; z-index: 0; background: var(--stage-backdrop); pointer-events: none; opacity: 0; transition: opacity var(--tabs-dur) var(--tabs-ease); }
body.focus .backdrop { opacity: 1; }
.stage-bar { position: absolute; left: 50%; bottom: 56px; z-index: 5; transform: translateX(-50%); }
.wrap { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.close { flex: none; width: 47px; height: 47px; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; background: var(--stage-bg); color: var(--stage-fg); box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.4); --press-scale: 0.95; transition: transform var(--press-dur) var(--ease-smooth-out), background-color var(--press-dur) var(--ease-smooth-out); }
.close:is(:active, .is-pressed) { transform: scale(var(--press-scale)); }
.close:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--stage-bg), 0 0 0 4px var(--stage-fg); }
@media (hover: hover) { .close:hover { background: #221F18; } }
.t-tt-group { position: relative; display: inline-flex; }
.t-tt { position: absolute; bottom: calc(100% + 14px); left: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 0; overflow: hidden; translate: var(--tt-x, 0px) 0; scale: var(--tt-scale); transform-origin: 50% 100%; padding: 8px 12px; border-radius: 8px; background: var(--tt-bg); color: var(--tt-fg); font-size: 12px; line-height: 16px; font-weight: 400; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 0 0 1px rgba(196, 196, 196, 0.08), 0 8px 24px rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; z-index: 3; transition: opacity var(--tt-out-dur) var(--tt-out-ease), scale var(--tt-out-dur) var(--tt-out-ease), translate var(--tt-move-dur) var(--tt-move-ease), width var(--tt-move-dur) var(--tt-move-ease); }
.t-tt[data-show=true] { opacity: 1; scale: 1; transition: opacity var(--tt-in-dur) var(--tt-in-ease) var(--tt-delay), scale var(--tt-in-dur) var(--tt-in-ease) var(--tt-delay), translate var(--tt-move-dur) var(--tt-move-ease), width var(--tt-move-dur) var(--tt-move-ease); }
.t-tt-text { white-space: nowrap; }
.bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 26px; background: var(--stage-bg); color: var(--stage-fg); box-shadow: inset 0 0 0 0.5px var(--stage-border), 0 8px 32px -4px rgba(0, 0, 0, 0.4); }
:where(.bar) button { font: inherit; font-size: 13px; line-height: 20px; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; transition: transform var(--press-dur) var(--ease-smooth-out), background-color var(--press-dur) var(--ease-smooth-out), color var(--press-dur) var(--ease-smooth-out); }
.bar button:is(:active, .is-pressed) { transform: scale(var(--press-scale)); }
.bar button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--stage-bg), 0 0 0 4px var(--stage-fg); }
.modes { position: relative; display: flex; gap: 4px; }
.modes .t-tabs-pill { position: absolute; top: 0; left: 0; width: 0; height: 40px; border-radius: 20px; background: var(--seg-fill); transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease); pointer-events: none; }
.mode { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--stage-muted); --press-scale: 0.95; }
.mode[aria-selected=true] { color: var(--stage-fg); }
@media (hover: hover) { .mode:not([aria-selected=true]):hover { color: rgba(243, 238, 237, 0.8); } .opt:hover { background: var(--opt-hover-fill); } .item:hover { background: rgba(243, 238, 237, 0.07); } }
.mode, .opt, .cap, .item { transition: transform var(--press-dur) var(--ease-smooth-out), background-color var(--press-dur) var(--ease-smooth-out), color var(--press-dur) var(--ease-smooth-out); }
.modes .t-tab { position: relative; z-index: 1; cursor: pointer; transition: transform var(--press-dur) var(--ease-smooth-out), color var(--tabs-dur) var(--tabs-ease); }
.modes .t-tab[aria-selected=true] { color: var(--stage-fg); }
.sep { width: 2px; height: 16px; border-radius: 2px; background: var(--stage-border); }
.opt-wrap { position: relative; }
.opt { height: 40px; padding: 0 10px 0 14px; border-radius: 20px; background: transparent; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; --press-scale: 0.97; }
.opt-chev { display: inline-flex; flex: none; color: var(--stage-muted); }
.opt::after { opacity: 0; transition: opacity var(--press-dur) var(--ease-smooth-out); }
.opt[aria-expanded=true] { background: var(--seg-fill); }
.opt[aria-expanded=true]::after { opacity: 1; }
.cap { height: 40px; padding: 0 12px 0 10px; border-radius: 20px; background: var(--stage-accent); color: var(--stage-on-accent); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; box-shadow: 0 0 18px rgba(243, 238, 237, 0.18); --press-scale: 0.97; }
@media (hover: hover) { .cap:hover { background: #FFFFFF; } }
.cap svg { flex: none; }
.cap { transition: transform var(--press-dur) var(--ease-smooth-out), background-color var(--press-dur) var(--ease-smooth-out), color var(--press-dur) var(--ease-smooth-out), padding-right var(--text-morph-resize-dur) var(--text-morph-ease) var(--text-morph-shrink-delay, 0ms); }
.cap.is-snapped { padding-right: 14px; }
.close, .opt, .cap { position: relative; }
.close::after, .opt::after, .cap::after, .modes .t-tabs-pill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 0.5px; background: linear-gradient(180deg, var(--btn-edge-top), var(--btn-edge-bottom)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.cap::after { background: linear-gradient(180deg, var(--btn-edge-top-cap), var(--btn-edge-bottom-cap)); }
.menu { position: absolute; bottom: calc(100% + 12px); left: 50%; margin-left: -84px; width: 168px; box-sizing: border-box; padding: 6px; border-radius: 22px; background: var(--stage-surface); color: var(--stage-fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 0 0 1px rgba(196, 196, 196, 0.08), 0 8px 24px rgba(0, 0, 0, 0.4); }
.item { width: 100%; height: 32px; padding: 0 8px 0 6px; border-radius: 16px; display: flex; align-items: center; gap: 8px; text-align: left; }
.item-ic { flex: none; display: inline-flex; width: 16px; height: 16px; color: var(--stage-muted); }
.item-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-check { flex: none; opacity: 0; transition: opacity var(--press-dur) var(--ease-smooth-out); }
.item[aria-checked=true] .item-check { opacity: 1; }
.t-dropdown { transform-origin: top left; transform: scale(var(--dropdown-pre-scale)); opacity: 0; pointer-events: none; transition: transform var(--dropdown-open-dur) var(--dropdown-ease), opacity var(--dropdown-open-dur) var(--dropdown-ease); }
.t-dropdown[data-origin=bottom-center] { transform-origin: bottom center; }
.t-dropdown.is-open { transform: scale(1); opacity: 1; pointer-events: auto; }
.t-dropdown.is-closing { transform: scale(var(--dropdown-closing-scale)); opacity: 0; pointer-events: none; transition: transform var(--dropdown-close-dur) var(--dropdown-ease), opacity var(--dropdown-close-dur) var(--dropdown-ease); }
.t-morph { white-space: nowrap; }
.t-morph-swap { display: inline-grid; vertical-align: bottom; justify-items: start; overflow-x: clip; overflow-y: visible; transition: width var(--text-morph-resize-dur) var(--text-morph-ease) var(--text-morph-shrink-delay, 0ms); }
.t-morph-swap > span { grid-area: 1 / 1; white-space: pre; }
.t-morph-ch { display: inline-block; white-space: pre; transition: opacity var(--text-morph-dur) var(--text-morph-ease) calc(var(--i, 0) * var(--text-morph-stagger)), filter var(--text-morph-dur) var(--text-morph-ease) calc(var(--i, 0) * var(--text-morph-stagger)), transform var(--text-morph-dur) var(--text-morph-ease) calc(var(--i, 0) * var(--text-morph-stagger)); }
.t-morph-new .t-morph-ch { opacity: 0; filter: blur(var(--text-morph-blur)); transform: translateY(var(--text-morph-rise)); }
.t-morph-swap.is-morphing .t-morph-old .t-morph-ch { opacity: 0; filter: blur(var(--text-morph-blur)); transform: translateY(calc(var(--text-morph-rise) * -1)); }
.t-morph-swap.is-morphing .t-morph-new .t-morph-ch { opacity: 1; filter: blur(0); transform: none; }
.t-icon-swap { position: relative; display: inline-grid; flex: none; width: 20px; height: 20px; }
.t-icon-swap .t-icon { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity var(--icon-swap-dur) var(--icon-swap-ease), filter var(--icon-swap-dur) var(--icon-swap-ease), transform var(--icon-swap-dur) var(--icon-swap-ease); }
.t-icon-swap[data-state=a] .t-icon[data-icon=a], .t-icon-swap[data-state=b] .t-icon[data-icon=b] { opacity: 1; filter: blur(0); transform: scale(1); }
.t-icon-swap[data-state=a] .t-icon[data-icon=b], .t-icon-swap[data-state=b] .t-icon[data-icon=a] { opacity: 0; filter: blur(var(--icon-swap-blur)); transform: scale(var(--icon-swap-start-scale)); }

@media (prefers-reduced-motion: reduce) {
  /* Toolbar */
  .modes .t-tabs-pill, .t-tab, .t-dropdown, .t-morph-swap, .t-morph-swap > span, .t-morph-ch, .t-icon-swap .t-icon, .bar button, .close, .t-tt { transition: none !important; }
  .bar button:is(:active, .is-pressed), .close:is(:active, .is-pressed) { transform: none; }
  .opt::after { transition: none !important; }
  /* Plan card */
  .t-page, .sub .t-tabs-pill, .sub .t-tab, .t-text-swap, .sub-cta { transition: none !important; }
  .t-digit-group .t-digit { animation: none !important; }
  /* Page */
  .backdrop, .side, .loader, .pill { transition: none !important; }
  .pill:is(:active, .is-pressed) { transform: none; }
}
/* Icons: Heroicons (outline), Copyright (c) Tailwind Labs, Inc. MIT License */

/* Touch: controls press in full on a tap, never select their label, and hover only applies with a mouse. */
:where(button, [role="button"], [role="tab"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="switch"], summary, .t-pressable) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* end touch */

/* ---------- Phone and narrow tablet ---------- */
@media (max-width: 899px) {
  :root { --gutter: 14px; }
  .topbar { padding: max(16px, env(safe-area-inset-top, 0px)) 20px 0; }
  .topbar .logo { height: 18px; }
  #proposal-id-top { display: none; }
  .cover { padding: 40px 20px 28px; }
  .eyebrow { margin-bottom: 14px; }
  .display { font-size: clamp(42px, 12vw, 64px); }
  .cover-row { flex-direction: column; align-items: stretch; gap: 20px; margin-top: 22px; }
  .intro { font-size: 16px; }
  .cover-cta { width: 100%; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; margin-top: 32px; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 0 20px; padding: 28px 0 40px; }
  .sec-title { font-size: 30px; }
  .items, .items.steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .equation { padding: 22px; gap: 4px 16px; }
  .big { font-size: 52px; }
  .op { font-size: 40px; }
  .term.total { flex-basis: 100%; margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--hair); }
  .op.eq { display: none; }
  .sec-name { font-size: 30px; }
  .cta-row .pill { width: 100%; }
  .closing { margin: 8px 12px 0; padding: 48px 24px 32px; }
  .closing .display { font-size: clamp(40px, 11vw, 56px); }
  .foot { padding: 24px 20px 24px; flex-direction: column; align-items: flex-start; }
  .foot img { margin: 0 0 4px; }
  .dock { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 8px; padding: 24px max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(rgba(236, 236, 232, 0), var(--ground) 40%); }
  .dock .pill { flex: 1; padding: 0 12px; }

  /* Document mode: the preview sits in the page behind a tap-to-explore cover */
  .app { display: block; height: auto; min-height: 0; padding: 0 12px; }
  .stage { gap: 12px; }
  .stage-bar { display: none; }
  .head { padding: 0 8px; }
  .head-title { white-space: normal; }
  .head-actions { display: flex; }
  .corner { display: none; }
  .frame-shell { display: block; }
  .frame-wrap, .frame-wrap[data-size] { height: 72vh; height: 72svh; min-height: 420px; padding: 0; background: var(--card); border-radius: 22px; }
  .frame-wrap[data-size] iframe { width: 100%; max-width: none; border-radius: 0; box-shadow: none; transform: none; }
  .frame-cover { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; padding: 16px; border: 0; background: linear-gradient(rgba(20, 20, 20, 0) 70%, rgba(20, 20, 20, 0.18)); cursor: pointer; }
  .frame-cover .chip { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--btn); color: #FFFFFF; font-size: 14px; box-shadow: 0 6px 20px rgba(20, 20, 20, 0.2); }
  .foot-note { display: none; }
  .mobile-actions { display: none; }

  /* Explore mode: the preview fills the screen, with the actions under it */
  body.exploring { overflow: hidden; }
  body.exploring .app { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 0; background: var(--ground); }
  body.exploring .stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
  body.exploring .head { justify-content: flex-start; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
  body.exploring .explore-close { display: flex; }
  body.exploring .head-text { flex: 1; }
  body.exploring .head .sec { display: none; }
  body.exploring .head-biz { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.exploring .head-sub:not(:empty) { display: block; font-size: 13px; }
  body.exploring .frame-shell { flex: 1; min-height: 0; display: flex; }
  body.exploring .frame-wrap { height: auto; min-height: 0; margin: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
  body.exploring .frame-cover { display: none; }
  body.sheet-open .dock { visibility: hidden; }
  .mobile-row { display: flex; gap: 8px; }
  .mobile-row .pill { flex: 1; padding: 0 12px; }
  .mobile-plans { align-self: center; padding: 6px 0 0; font-size: 14px; color: var(--text-2); }
  body.exploring .mobile-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; padding: 14px max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }

  .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(25, 22, 16, 0.28); }
  .side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 90vh; overflow-y: auto; gap: 0; background: var(--card); border-radius: 28px 28px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(105%); transition: transform 0.28s ease; }
  .side.open { transform: none; }
  .side.booking { height: 90vh; }
  .sheet-bar { display: flex; justify-content: center; padding-top: 8px; }
  .sheet-bar span { width: 36px; height: 5px; border-radius: 3px; background: #D6D4CF; }
  .card { border-radius: 0; }
  .who { padding: 10px 20px 4px; flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .who img { display: none; }
  .who .circle { display: flex; }
  .side.booking .who { display: none; }
  .panel { gap: 4px; }
  .sub { padding: 12px 20px 4px; border-radius: 0; }
  .sub-cta { height: 44px; }
  .actions { margin-top: 6px; padding: 8px 20px 22px; border-radius: 0; }
  .actions-text { display: none; }
  .actions .pill.dark { background: var(--pill); color: var(--text); }
  .book { padding: 10px 20px 20px; }
}

/* ---------- Link builder (page opened with no ?site=) ---------- */
.builder { position: relative; z-index: 1; min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 48px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
.builder form { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: var(--radius); background: var(--card); }
.builder img { height: 22px; width: auto; align-self: flex-start; }
.builder h1 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.builder p { margin: 0; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13px; color: var(--muted); }
.field input { min-height: 48px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--soft); font: 400 15px/1 var(--font); color: var(--text); }
.error { margin: 0; font-size: 14px; font-weight: 500; color: #9A2B1F; }
.result { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--soft); }
.result code { font-size: 13px; word-break: break-all; }
.result-actions { display: flex; gap: 10px; }
.result-actions .pill { min-height: 48px; font-size: 15px; }

.expired { position: relative; z-index: 1; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.expired div { max-width: 420px; padding: 32px; border-radius: var(--radius); background: var(--card); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.expired h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.expired p { margin: 0; color: var(--muted); }
