/*
 * SandwichBot design layer. Loaded after pico.min.css in the shared page shell
 * (src/server/html.ts). Pico gives us the typographic base, form controls,
 * tables and automatic light/dark theming; this file layers on the brand: a
 * warm, appetising, sandwich-flavoured identity where the ingredients map to
 * meaning - toasted amber is the brand/primary, lettuce green means "enabled",
 * tomato red means "danger". The 🥪 wordmark badge is the one signature flourish;
 * everything around it stays calm so the dense tables and forms read cleanly.
 *
 * Kept classless-friendly: everything keys off semantic elements or the same
 * small class names the markup already used, so no page HTML has to change.
 *
 * We scope the Pico variable overrides with the SAME selectors Pico uses for its
 * light/dark schemes (e.g. `:root:not([data-theme=dark])`), so they match Pico's
 * specificity and win on source order (this file loads second).
 */

/* --- Self-hosted fonts --------------------------------------------------- */
/* Rounded + friendly (Fredoka display / Nunito body). System stacks below cover
   any file that fails to load. SIL OFL, shipped from /assets/fonts. */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/fredoka-500.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/nunito-400.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/nunito-800.woff2") format("woff2");
}

/* --- Theme-independent tokens -------------------------------------------- */
:root {
  --sb-font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Segoe UI",
    system-ui, sans-serif;
  --pico-font-family: "Nunito", ui-rounded, system-ui, -apple-system,
    "Segoe UI", sans-serif;

  /* Rounder than Pico's default for the softer, friendlier feel. */
  --pico-border-radius: 0.7rem;

  /* Pico scales the root font up to 131% on wide screens, which reads oversized
     for these form-heavy pages. Cap it to a more compact ladder (below). */
  --pico-font-size: 100%;
}
@media (min-width: 1024px) {
  :root {
    --pico-font-size: 106.25%;
  }
}
@media (min-width: 1280px) {
  :root {
    --pico-font-size: 112.5%;
  }
}

/* --- Palette: light ------------------------------------------------------ */
:root:not([data-theme=dark]),
[data-theme="light"] {
  /* Brand ingredients. */
  --sb-toast: #e08a3c; /* toasted bread / mustard - buttons, badges, accents */
  --sb-toast-deep: #b5651d; /* readable amber - links, primary text */
  --sb-toast-hover: #c9722a;
  --sb-lettuce: #4ca05a; /* enabled / "on" */
  --sb-tomato: #dc4a3d; /* danger / remove */

  /* Warm butter page, cocoa-crust ink (warmer + lighter than the stock cream). */
  --pico-background-color: #fff9f0;
  --pico-color: #3a2e25;
  --pico-muted-color: #8a7a68;
  --pico-border-color: #ecdfcb;

  /* Primary group -> toast. Links use the deep amber for contrast; buttons keep
     the bright amber with dark crust text (a friendly "mustard button"). */
  --pico-primary: var(--sb-toast-deep);
  --pico-primary-background: var(--sb-toast);
  --pico-primary-hover: #99521a;
  --pico-primary-hover-background: var(--sb-toast-hover);
  --pico-primary-focus: rgba(224, 138, 60, 0.35);
  --pico-primary-underline: rgba(181, 101, 29, 0.4);
  --pico-primary-inverse: #3a2e25;

  /* Warm cards + a soft, buttery shadow so every article reads as a fresh stack. */
  --pico-card-background-color: #fffdf8;
  --pico-card-sectioning-background-color: #fbeeda;
  --pico-card-box-shadow: 0 1px 2px rgba(120, 84, 40, 0.06),
    0 6px 18px rgba(120, 84, 40, 0.08);
}

/* --- Palette: dark (pumpernickel) ---------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --sb-toast: #e89b52;
    --sb-toast-deep: #f0a65c;
    --sb-toast-hover: #f6bc7e;
    --sb-lettuce: #63c078;
    --sb-tomato: #ef6a5c;

    --pico-background-color: #231c16;
    --pico-color: #f3e9dc;
    --pico-muted-color: #b6a794;
    --pico-border-color: #3d332a;

    --pico-primary: var(--sb-toast-deep);
    --pico-primary-background: var(--sb-toast);
    --pico-primary-hover: var(--sb-toast-hover);
    --pico-primary-hover-background: var(--sb-toast-hover);
    --pico-primary-focus: rgba(240, 166, 92, 0.32);
    --pico-primary-underline: rgba(240, 166, 92, 0.4);
    --pico-primary-inverse: #241a10;

    --pico-card-background-color: #2b231b;
    --pico-card-sectioning-background-color: #33291f;
    --pico-card-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
      0 6px 18px rgba(0, 0, 0, 0.35);
  }
}
[data-theme="dark"] {
  --sb-toast: #e89b52;
  --sb-toast-deep: #f0a65c;
  --sb-toast-hover: #f6bc7e;
  --sb-lettuce: #63c078;
  --sb-tomato: #ef6a5c;

  --pico-background-color: #231c16;
  --pico-color: #f3e9dc;
  --pico-muted-color: #b6a794;
  --pico-border-color: #3d332a;

  --pico-primary: var(--sb-toast-deep);
  --pico-primary-background: var(--sb-toast);
  --pico-primary-hover: var(--sb-toast-hover);
  --pico-primary-hover-background: var(--sb-toast-hover);
  --pico-primary-focus: rgba(240, 166, 92, 0.32);
  --pico-primary-underline: rgba(240, 166, 92, 0.4);
  --pico-primary-inverse: #241a10;

  --pico-card-background-color: #2b231b;
  --pico-card-sectioning-background-color: #33291f;
  --pico-card-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
    0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Headings wear the rounded display face. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sb-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Page chrome --------------------------------------------------------- */
/* Header, main and footer all align to the same column, whose width the page
   shell sets per-page via the --sb-max custom property on <body>. */
.sb-wrap {
  width: 100%;
  max-width: var(--sb-max, 40rem);
  margin-inline: auto;
  padding-inline: 1rem;
}

.sb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-block: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--pico-border-color);
}

/* Signature: the 🥪 rides in a soft toasted badge next to the Fredoka wordmark. */
.sb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--pico-color);
  text-decoration: none;
}
.sb-brand:hover {
  text-decoration: none;
  color: var(--sb-toast-deep);
}
.sb-brand .sb-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-right: 0;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 0.6rem;
  background: rgba(224, 138, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 60, 0.28);
}

/* Header nav slot: links sit to the right of the wordmark (seed of a nav bar). */
.sb-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.9rem;
}
.sb-nav a {
  font-weight: 600;
  text-decoration: none;
  color: var(--pico-muted-color);
}
.sb-nav a:hover {
  color: var(--sb-toast-deep);
}

/* Signed-in identity + plan chip, shown in the header nav. */
.sb-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pico-muted-color);
}
.sb-plan {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(224, 138, 60, 0.16);
  color: var(--sb-toast-deep);
}

main.sb-wrap {
  padding-bottom: 2rem;
}
main.sb-wrap > h1:first-child {
  margin-top: 0;
}

/* A short amber tab under each section heading, for rhythm. */
main.sb-wrap h2 {
  padding-bottom: 0.35rem;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(
      90deg,
      var(--sb-toast) 0 2.5rem,
      transparent 2.5rem
    )
    1;
}

.sb-footer {
  margin-top: 2rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--pico-border-color);
  color: var(--pico-muted-color);
  font-size: 0.8rem;
}

/* --- Utilities ----------------------------------------------------------- */
.muted {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

/* Flash / status banner. Reads as a warm info card that adapts to the theme. */
.msg {
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-border-color);
  border-left: 4px solid var(--sb-toast);
  padding: 0.6rem 0.9rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
}

/* Wide tables scroll inside their own box instead of blowing out the page. */
.tablewrap {
  overflow-x: auto;
  margin-block: 0.5rem 1rem;
}

/* Drop the native number spinners - they crowd out the digits in the narrow
   cost cells and add little value here (type or paste the number instead). */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- Voice manager ------------------------------------------------------- */
/* Status tags read as little ingredient labels. */
.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill.on {
  background: #dff3e0;
  color: #1f7a2e;
}
.pill.disabled {
  background: var(--pico-card-sectioning-background-color);
  color: var(--pico-muted-color);
}
.pill.err {
  background: #fbe0dd;
  color: #a3271b;
}
.pill.warn {
  background: #fdefd3;
  color: #8a5a12;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .pill.on {
    background: rgba(76, 160, 90, 0.24);
    color: #8ee89a;
  }
  :root:not([data-theme]) .pill.err {
    background: rgba(220, 74, 61, 0.24);
    color: #f0a49a;
  }
  :root:not([data-theme]) .pill.warn {
    background: rgba(224, 138, 60, 0.24);
    color: #f0c383;
  }
}
[data-theme="dark"] .pill.on {
  background: rgba(76, 160, 90, 0.24);
  color: #8ee89a;
}
[data-theme="dark"] .pill.err {
  background: rgba(220, 74, 61, 0.24);
  color: #f0a49a;
}
[data-theme="dark"] .pill.warn {
  background: rgba(224, 138, 60, 0.24);
  color: #f0c383;
}

/* Greyed rows for disabled / unavailable offerings. */
tr.off td {
  opacity: 0.6;
}
tr.locked td {
  color: var(--pico-muted-color);
  background: var(--pico-card-sectioning-background-color);
}

/* Voice manager: one compact, fluid row per voice. Inputs fill their cell so the
   table shrinks to fit rather than scrolling; description takes the slack while
   cost/status/actions shrink to their content (`.col-fit` = width:1% trick). */
.voice-table {
  width: 100%;
  font-size: 0.85rem;
}
.voice-table th,
.voice-table td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
}
.voice-table input,
.voice-table textarea {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  font-size: 0.85rem;
  padding-block: 0.3rem;
}
.voice-table textarea {
  min-height: 2.4rem;
  resize: none;
}
.voice-table .col-cost {
  width: 7.5rem;
}
/* Expressiveness: a range slider with its live percentage read out beneath it,
   in a fixed-width column so the slider has room without crowding the row. */
.voice-table .col-expr {
  width: 9rem;
}
.voice-table .col-expr input[type="range"] {
  padding: 0;
}
.voice-table .col-expr output {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--pico-muted-color, #888);
}
.voice-table .col-fit {
  width: 1%;
  white-space: nowrap;
}
.voice-table button {
  font-size: 0.8rem;
  padding-block: 0.3rem;
}

/* Per-row hamburger menu: the actions column collapses to a ☰ toggle whose
   menu pops over on click (native <details>), keeping the row narrow. */
.rowmenu {
  margin: 0;
  position: relative;
}
.rowmenu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  line-height: 1;
  border-radius: var(--pico-border-radius);
  user-select: none;
}
.rowmenu > summary::-webkit-details-marker,
.rowmenu > summary::marker {
  display: none;
}
.rowmenu > summary::after {
  display: none;
}
.rowmenu > summary:hover {
  background: var(--pico-card-sectioning-background-color);
}
.rowmenu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 20;
  min-width: 9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-border-color);
  border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow);
}
.rowmenu-items form {
  margin: 0;
}
.rowmenu-items button {
  width: 100%;
  margin: 0;
  font-size: 0.8rem;
  padding-block: 0.4rem;
}

/* Test dialog (opened from a row menu). Pico styles the modal; just cap width
   and stop its footer buttons from stretching to full width (Pico's default). */
#voice-test-dialog article {
  max-width: 26rem;
}
#voice-test-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
#voice-test-dialog footer button {
  width: auto;
  margin-bottom: 0;
}

/* --- Compact inline forms ------------------------------------------------ */
/* Pico makes form controls full-width block elements with bottom margin, which
   is right for stacked forms but wrong for the little save/toggle forms that
   live inside table cells and action rows. Re-compact those. */
form.inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
form.inline input,
form.inline select,
form.inline textarea,
form.inline button {
  width: auto;
  margin-bottom: 0;
  padding-block: 0.35rem;
}
form.inline textarea {
  vertical-align: middle;
}

/* The tenant action bar: several inline forms sitting on one line. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* --- Admin voice editor -------------------------------------------------- */
/* Each managed voice is a card, matching the portal's look. */
.voice-card {
  margin: 0 0 1rem;
}
.voice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--pico-border-color);
}
.voice-card-head strong {
  margin-right: 0.5rem;
}

/* Responsive field grid: fields flow into as many columns as fit and fill their
   cell (no fixed pixel widths), so the form never overflows or scrolls. */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 0.6rem 0.8rem;
  align-items: end;
}
.field-grid .f-wide {
  grid-column: 1 / -1;
}
label.f {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pico-muted-color);
  margin: 0;
  gap: 0.25rem;
}
label.f input,
label.f select {
  width: 100%;
  margin-bottom: 0;
  font-size: 0.85rem;
  padding-block: 0.35rem;
  text-transform: none;
  letter-spacing: normal;
}
.f-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.1rem;
}
label.cb {
  font-size: 0.85rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
label.cb input {
  margin-bottom: 0;
}

/* Card action row (Save changes / Delete / Create): compact, auto-width. */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.9rem;
}
.card-actions button {
  width: auto;
  margin-bottom: 0;
  font-size: 0.85rem;
  padding-block: 0.4rem;
}

.grants {
  background: var(--pico-card-sectioning-background-color);
  border-radius: var(--pico-border-radius);
  padding: 0.6rem 0.85rem;
  margin-top: 0.85rem;
}
.grants form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}
.grants form select {
  margin-bottom: 0;
}
.grants button {
  width: auto;
  margin-bottom: 0;
  font-size: 0.8rem;
  padding-block: 0.3rem;
}
table.g {
  width: auto;
  margin: 0.5rem 0;
}
table.g td {
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
}

/* Destructive buttons (Delete / Remove) wear tomato. */
.danger {
  --pico-background-color: var(--sb-tomato);
  --pico-border-color: var(--sb-tomato);
  --pico-color: #fff;
}

/* --- Subscription alerts card -------------------------------------------- */
/* One feature card built around a real on/off switch and a spoken-preview
   bubble: the 🥪 speaks a sample resub line so the streamer hears, in the bot's
   own voice, exactly what the feature does on stream. */
.sub-alerts .sa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.sa-lead {
  margin: 0;
}
.sa-lead strong {
  display: block;
  font-family: var(--sb-font-display);
  font-size: 1.05rem;
}
.sa-lead .muted {
  display: block;
  margin-top: 0.15rem;
}

/* The switch is a submit button shaped into a track + knob, so it toggles with
   no JavaScript. It ripens from crust-grey to lettuce green when on, matching
   the "enabled" ingredient the voice pills already use. */
.sa-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: none;
  margin: 0;
}
/* `.sa-toggle .sa-switch` (0,2,0) so the width beats Pico's
   `button[type=submit]{width:100%}` (0,1,1), which would otherwise collapse the
   track to its content width. */
.sa-toggle .sa-switch {
  --track-w: 3.5rem;
  --track-h: 1.95rem;
  --pad: 0.26rem;
  --knob: calc(var(--track-h) - 2 * var(--pad) - 2px);
  position: relative;
  box-sizing: border-box;
  width: var(--track-w);
  height: var(--track-h);
  padding: 0;
  margin: 0;
  border-radius: 999px;
  /* Off state: a legible grey track in both themes (the sectioning fill alone is
     nearly invisible on a card), so it reads as an unlit switch, not a stray dot. */
  border: 1px solid color-mix(in srgb, var(--pico-muted-color) 34%, transparent);
  background: color-mix(in srgb, var(--pico-muted-color) 20%, var(--pico-card-background-color));
  cursor: pointer;
}
.sa-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--pad);
  width: var(--knob);
  height: var(--knob);
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(60, 40, 15, 0.35);
}
.sa-switch[aria-checked="true"] {
  background: var(--sb-lettuce);
  border-color: var(--sb-lettuce);
}
.sa-switch[aria-checked="true"]::after {
  left: calc(var(--track-w) - var(--knob) - var(--pad));
}
.sa-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.sa-state {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
}
.sa-state.on {
  color: var(--sb-lettuce);
}

/* Spoken-preview: the 🥪 avatar plus a speech bubble reading the sample line.
   The whole preview dims when alerts are off - the bot isn't announcing. */
.sa-preview {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
}
.sa-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 0.6rem;
  background: rgba(224, 138, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 60, 0.28);
}
.sa-bubble {
  position: relative;
  margin: 0;
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-border-color);
  border-radius: 0.2rem 0.8rem 0.8rem 0.8rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}
/* A little tail: a rotated square carrying the bubble's own top+left edges, so
   it reads as one shape pointing back at the avatar. */
.sa-bubble::before {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: -0.42rem;
  width: 0.8rem;
  height: 0.8rem;
  background: inherit;
  border-left: inherit;
  border-top: inherit;
  transform: rotate(45deg);
  border-radius: 0.15rem 0 0 0;
}
.sub-alerts.is-off .sa-preview {
  opacity: 0.5;
}

/* The voice picker is the card's one setting; a hairline sets it apart. */
.sa-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem 0.9rem;
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--pico-border-color);
}
.sa-settings label.f {
  flex: 1 1 13rem;
}
.sa-settings button {
  width: auto;
  margin: 0;
  font-size: 0.85rem;
  padding-block: 0.4rem;
}
.sub-alerts > .muted {
  margin-top: 0.7rem;
}

@media (prefers-reduced-motion: no-preference) {
  .sa-switch,
  .sa-switch::after {
    transition: background 0.18s ease, border-color 0.18s ease, left 0.18s ease;
  }
}

/* --- Landing page -------------------------------------------------------- */
/* The public marketing page at `/`. Built entirely from these `.lp-*` classes
   on top of the same tokens (toast amber, lettuce, Fredoka/Nunito) the product
   uses, so the front door and the app read as one place. The signature is the
   hero's stack of spoken redemptions - the 🥪 saying out loud, in speech
   bubbles, exactly what the bot does - reusing the sub-alerts bubble motif. */

.lp-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  padding-block: 1rem 2.5rem;
}
@media (min-width: 820px) {
  .lp-hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    padding-block: 2rem 3.5rem;
  }
}

.lp-eyebrow {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-toast-deep);
  margin: 0 0 0.75rem;
}
.lp-eyebrow::before {
  content: "🥪 ";
}

.lp-title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.02;
  margin: 0 0 1rem;
  /* Cancel the amber tab that main h2 gets; the hero title stands alone. */
  border: 0;
}
.lp-lead {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--pico-muted-color);
  margin: 0 0 1.6rem;
  max-width: 34rem;
}

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.lp-cta {
  width: auto;
  margin: 0;
  font-family: var(--sb-font-display);
  font-weight: 600;
  padding-inline: 1.4rem;
}
.lp-reassure {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  margin: 0;
}

/* Hero visual: a little "overlay" panel showing spoken redemptions stacking up. */
.lp-demo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.4rem 1.3rem 1.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(
    160deg,
    var(--pico-card-sectioning-background-color),
    var(--pico-card-background-color)
  );
  border: 1px solid var(--pico-border-color);
  box-shadow: var(--pico-card-box-shadow);
}
.lp-demo-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}
.lp-demo-label::before {
  content: "● ";
  color: var(--sb-tomato);
  font-size: 0.7em;
  vertical-align: middle;
}

/* Shared spoken-line unit: 🥪 avatar + a speech bubble. Same shape language as
   the sub-alerts preview inside the portal, so the metaphor carries across. */
.lp-say {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0;
}
.lp-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 0.6rem;
  background: rgba(224, 138, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 60, 0.28);
}
.lp-bubble {
  position: relative;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-border-color);
  border-radius: 0.2rem 0.9rem 0.9rem 0.9rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(120, 84, 40, 0.05);
}
.lp-bubble::before {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: -0.42rem;
  width: 0.8rem;
  height: 0.8rem;
  background: inherit;
  border-left: inherit;
  border-top: inherit;
  transform: rotate(45deg);
  border-radius: 0.15rem 0 0 0;
}
.lp-say-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.15rem;
}
.lp-say-meta strong {
  color: var(--sb-toast-deep);
}

/* --- Pillars: the five promises ------------------------------------------ */
.lp-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin: 0 0 3.5rem;
}
.lp-pillar {
  margin: 0;
  padding: 1.2rem 1.15rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-border-color);
  border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow);
}
.lp-pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.3rem;
  border-radius: 0.7rem;
  background: rgba(224, 138, 60, 0.14);
  margin-bottom: 0.7rem;
}
.lp-pillar h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.lp-pillar p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--pico-muted-color);
}

/* --- Plans --------------------------------------------------------------- */
.lp-plans-section {
  margin-bottom: 3rem;
}
.lp-plans-intro {
  margin: 0.4rem 0 1.5rem;
  max-width: 40rem;
}
.lp-plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 720px) {
  .lp-plans {
    grid-template-columns: 1fr 1fr;
  }
}
.lp-plan {
  position: relative;
  margin: 0;
  padding: 1.6rem 1.5rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-border-color);
  border-radius: 1rem;
  box-shadow: var(--pico-card-box-shadow);
}
/* Premium wears the brand: a toasted border + a corner flag, so the upgrade
   reads at a glance without shouting. */
.lp-plan-featured {
  border: 2px solid var(--sb-toast);
  box-shadow: 0 2px 4px rgba(120, 84, 40, 0.08),
    0 12px 30px rgba(224, 138, 60, 0.16);
}
.lp-plan-flag {
  position: absolute;
  top: -0.8rem;
  right: 1.25rem;
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pico-primary-inverse);
  background: var(--sb-toast);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(224, 138, 60, 0.35);
}
.lp-plan-head {
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
  background: none;
}
.lp-plan-head h3 {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}
.lp-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
}
.lp-price-num {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--pico-color);
}
.lp-price-per {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.lp-feature-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.lp-feature-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.4;
}
.lp-feature-list li::before {
  content: "🥪";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-size: 0.85rem;
}
.lp-plan-cta {
  width: 100%;
  margin: 0;
  font-family: var(--sb-font-display);
  font-weight: 600;
}

/* --- Closer -------------------------------------------------------------- */
.lp-closer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}
.lp-closer-say {
  align-items: center;
}
.lp-closer-say .lp-bubble {
  font-family: var(--sb-font-display);
  font-size: 1.15rem;
  padding: 0.7rem 1.1rem;
}
.lp-closer .lp-cta {
  padding-inline: 1.8rem;
}

/* --- Motion (only when the visitor is happy with it) --------------------- */
@media (prefers-reduced-motion: no-preference) {
  .sb-brand:hover .sb-mark {
    animation: sb-wiggle 0.5s ease;
  }
  @keyframes sb-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-9deg); }
    60% { transform: rotate(7deg); }
  }

  .voice-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .voice-card:hover {
    transform: translateY(-2px);
  }

  button,
  [type="submit"],
  [type="button"],
  [role="button"] {
    transition: transform 0.08s ease;
  }
  button:active,
  [type="submit"]:active,
  [type="button"]:active,
  [role="button"]:active {
    transform: translateY(1px);
  }

  /* Landing hero: the spoken redemptions arrive one after another, like they'd
     pop up live on the overlay. Staggered so the stack reads as a little feed. */
  .lp-demo .lp-say {
    animation: lp-pop 0.5s ease both;
  }
  .lp-demo .lp-say:nth-child(2) {
    animation-delay: 0.15s;
  }
  .lp-demo .lp-say:nth-child(3) {
    animation-delay: 0.5s;
  }
  @keyframes lp-pop {
    from {
      opacity: 0;
      transform: translateY(0.6rem) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .lp-pillar {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .lp-pillar:hover {
    transform: translateY(-3px);
  }
}
