/* Stash app chrome — lp3 sticker-shop language.
   Fredoka display, Nunito body, Krona wordmark.
   Saturated panels, thick ink outlines, hard offset shadows. */

:root {
  --white: #FFFFFF;
  --red: #FF2E00;
  --yellow: #FFC931;
  --sky: #37B0FF;
  --pink: #FF5EA0;
  --ink: #141414;
  --cream: #FFF6E8;
  --bg-primary: #FFF6E8;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #FFC931;
  --text-primary: #141414;
  --text-secondary: #3a3a3a;
  --border: #141414;
  --accent: #FF2E00;
  --success: #128a3e;
  --error: #FF2E00;
  --header-h: 64px;
  /* Persona structure tokens — lp3 (sticker shop) defaults. Personas in
     stash-persona.css re-point these to swap the whole look, not just colors. */
  --font-body: 'Nunito', sans-serif;
  --font-display: 'Fredoka', sans-serif;
  --font-mark: 'Krona One', sans-serif;
  --display-weight: 700;
  --display-weight-soft: 600;
  --display-transform: none;
  --display-spacing: -0.01em;
  --display-line: 1.05;
  --bw: 3px;                          /* heavy outline width */
  --bw-thin: 2px;                     /* light outline width */
  --border-strong: var(--ink);        /* outline color */
  --rs: 1;                            /* radius scale (0 = square) */
  --radius-pill: 999px;
  --focus: var(--ink);
  --shadow-pop: 10px 10px 0 var(--ink);
  --shadow-card: 8px 8px 0 var(--ink);
  --shadow-step: 6px 6px 0 var(--ink);
  --shadow-tile: 5px 5px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-btn: 3px 3px 0 var(--ink);
  --shadow-xs: 2px 2px 0 var(--ink);
  --press: translate(2px, 2px);
  --press-sm: translate(1px, 1px);
  --press-shadow: 1px 1px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
img { max-width: 100%; display: block; }
/* The img/display:block reset above (and any similar rule) must never beat the
   hidden attribute — author element rules outrank the UA's [hidden] style. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wordmark {
  font-family: var(--font-mark);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  line-height: var(--display-line);
  letter-spacing: var(--display-spacing);
  text-transform: var(--display-transform);
}

/* header */
.st-header {
  background: var(--white);
  border-bottom: var(--bw) solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 40;
}
.st-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.st-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.st-nav a, .st-btn {
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.st-btn-yellow { background: var(--yellow); }
.st-btn-red { background: var(--red); color: var(--white); }
.st-btn-sky { background: var(--sky); color: var(--white); }
.st-nav a:hover, .st-btn:hover {
  transform: var(--press);
  box-shadow: var(--press-shadow);
}
/* The handle is a pill in the multify.co/{user} CTA's sky, so "who you are"
   reads as a button to your public page, not a stray label. */
.st-handle,
.st-nav a.st-handle {
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  background: var(--sky);
  color: var(--white);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  box-shadow: var(--shadow-btn);
  display: inline-flex;
  align-items: center;
}
a.st-handle:hover, .st-nav a.st-handle:hover { text-decoration: none; transform: var(--press); box-shadow: var(--press-shadow); }
/* Phone-only hamburger (see partials/header.ejs); hidden from 768px. */
.st-nav-toggle { display: none; }

/* Header search (home): a pill input + button, same chrome family as .sc-input. */
.st-search { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.st-search input {
  width: min(360px, 42vw);
  min-width: 200px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  min-height: 44px;
}
.st-search input::placeholder { color: var(--ink); opacity: 0.55; font-weight: 700; }
.st-search input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-search button { min-height: 44px; width: 44px; padding: 0; justify-content: center; }

/* layout */
.st-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem;
}
.st-auth {
  max-width: 480px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 3rem;
}

.st-card {
  background: var(--white);
  color: var(--ink);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(22px * var(--rs));
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.st-card h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.5rem;
}
.st-lead {
  font-weight: 700;
  margin: 0 0 1.25rem;
}

/* "We'll follow @x and take you back" — the deferred public-profile action a
   visitor started before they had an account. See stash/lib/pending-action.js. */
.st-pending-intent {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.7rem 0.85rem;
  margin: -0.5rem 0 1.25rem;
  border: var(--bw-thin, 2px) solid var(--border-strong, var(--border));
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.st-pending-intent strong { color: var(--text-primary); }

label.st-label {
  display: block;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

input.st-input, textarea.st-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  padding: 0.7rem 0.85rem;
  background: var(--cream);
  color: var(--ink);
}
textarea.st-input { min-height: 6rem; resize: vertical; }

.st-claim-field {
  display: flex;
  align-items: stretch;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  overflow: hidden;
  background: var(--cream);
}
.st-claim-field .prefix {
  font-weight: 800;
  padding: 0.7rem 0.2rem 0.7rem 0.85rem;
  white-space: nowrap;
}
.st-claim-field:focus-within { border-color: var(--accent); }
.st-claim-field input {
  border: 0;
  background: transparent;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 0.7rem 0.85rem 0.7rem 0;
}
.st-claim-field input:focus,
.st-claim-field input:focus-visible { outline: none; }
.st-error {
  color: var(--red);
  font-weight: 800;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
.st-ok { color: var(--success); font-weight: 800; font-size: 0.9rem; }

.st-field { margin-bottom: 1rem; }

.st-btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: calc(14px * var(--rs));
  box-shadow: var(--shadow-sm);
}

.st-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.st-or::before, .st-or::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--ink);
  opacity: 0.25;
}

.st-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.st-divider {
  border: 0;
  border-top: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
  margin: 1.15rem 0 0.35rem;
}
.st-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 1rem 0;
}
.st-muted { color: var(--text-secondary); font-size: 0.85rem; }

/* home / stash host */
#stash-tab-content { display: block; }
#stash-tab-host { min-height: 40vh; }

.st-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.st-page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); }
.st-page-head .st-btn { flex: none; }
/* Phone-only cluster on the home head (see views/home.ejs): + / search icons
   and the Timeline|Mosaic segment. Desktop shows the full search box and the
   segment in the view bar instead, so this is absent above 768px. */
.st-head-actions { display: none; }
.st-iconbtn {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  font-family: inherit;
}
.st-iconbtn:hover { transform: var(--press); box-shadow: var(--press-shadow); }
.st-iconbtn[aria-expanded="true"] { background: var(--sky); color: var(--white); }

/* chat */
.st-chat {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-h) - 3rem);
  max-width: 760px;
  margin: 0 auto;
}
.st-chat-context {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--yellow);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(18px * var(--rs));
  box-shadow: var(--shadow-tile);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  position: relative;
}
.st-chat-context[hidden] { display: none; }
.st-chat-context-thumb {
  flex: none;
  width: 72px;
  height: 72px;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(12px * var(--rs));
  overflow: hidden;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-chat-context-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.st-chat-context-thumb .bi { font-size: 1.5rem; }
.st-chat-context-body { min-width: 0; flex: 1; }
.st-chat-context-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.15rem;
  color: var(--text-secondary);
}
.st-chat-context-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.st-chat-context-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-chat-context-link {
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-block;
  margin-top: 0.2rem;
}
.st-chat-context-open,
.st-chat-context-x {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.st-chat-context-open:hover,
.st-chat-context-x:hover {
  transform: var(--press-sm);
  box-shadow: var(--press-shadow);
}
.st-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.st-msg {
  max-width: 85%;
  min-width: 0;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(18px * var(--rs));
  padding: 0.75rem 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.st-msg.user { align-self: flex-end; background: var(--yellow); }
.st-msg.assistant { align-self: flex-start; background: var(--white); }
.st-composer {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  position: relative;
}
.st-mention-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 0;
  padding: 0.35rem 0.75rem 0;
}
.st-mention-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  min-width: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--yellow);
  padding: 0.15rem 0.2rem 0.15rem 0.7rem;
}
.st-mention-chip-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-mention-chip-x {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.st-mention-chip-x:hover {
  background: var(--red);
  color: var(--white);
}
.st-mention-menu {
  position: absolute;
  left: 0;
  right: 3.5rem;
  bottom: 100%;
  background: var(--white);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  box-shadow: var(--shadow-sm);
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
}
.st-mention-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: var(--bw-thin) solid var(--border-strong);
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}
.st-mention-item:last-child { border-bottom: 0; }
.st-mention-item:hover { background: var(--yellow); }
.st-composer textarea {
  flex: 1;
  min-height: 52px;
  max-height: 160px;
}
#st-chat-widget .st-composer textarea.st-input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 120px;
  /* width:0 + flex:1 is the flex-row trick that stops the global
     textarea.st-input { width:100% } from overflowing past the Send button. */
  min-width: 0;
  width: 0;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  line-height: 1.35;
  font-size: 1rem;
  resize: none;
}
#st-chat-widget .st-composer .st-btn {
  flex: 0 0 auto;
}
#st-chat-widget .st-composer textarea.st-input::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  opacity: 0.7;
}

/* corner widget */
#st-chat-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(380px, calc(100% - 2rem));
  max-width: calc(100% - 2rem);
  height: min(520px, 70dvh);
  background: var(--white);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(22px * var(--rs));
  box-shadow: var(--shadow-card);
  z-index: 10020;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}
#st-chat-widget.open { display: flex; }
#st-chat-widget.minimized {
  height: auto;
  cursor: pointer;
}
#st-chat-widget.minimized .st-widget-head {
  border-bottom: 0;
}
#st-chat-widget.minimized .st-chat-context,
#st-chat-widget.minimized .st-chat-scroll,
#st-chat-widget.minimized .st-mention-chips,
#st-chat-widget.minimized .st-composer {
  display: none;
}
#st-chat-widget:not(.minimized) .st-widget-title {
  display: none;
}
.st-widget-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem 0.6rem;
  background: var(--red);
  color: var(--white);
  border-bottom: var(--bw) solid var(--border-strong);
  user-select: none;
}
.st-widget-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.st-widget-label {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
}
.st-widget-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}
.st-widget-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.st-widget-icon:hover {
  transform: var(--press-sm);
  box-shadow: var(--press-shadow);
}
.st-widget-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  opacity: 0.95;
}
#st-chat-widget .st-chat-scroll {
  padding: 0.75rem;
  min-width: 0;
  max-width: 100%;
}
#st-chat-widget .st-composer {
  padding: 0.75rem;
  border-top: var(--bw) solid var(--border-strong);
  min-width: 0;
  max-width: 100%;
}
#st-chat-widget .st-msg {
  max-width: min(85%, 100%);
}
#st-chat-widget .st-chat-context {
  margin: 0;
  border: 0;
  border-bottom: var(--bw) solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  padding: 0.55rem 0.7rem;
  gap: 0.6rem;
}
#st-chat-widget .st-chat-context-thumb {
  width: 48px;
  height: 48px;
  border-radius: calc(10px * var(--rs));
}
#st-chat-widget .st-chat-context-title {
  font-size: 0.92rem;
  -webkit-line-clamp: 1;
}
#st-chat-widget .st-chat-context-kicker { font-size: 0.65rem; }
#st-chat-widget .st-chat-context-open,
#st-chat-widget .st-chat-context-x {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.st-ad {
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  padding: 0.75rem;
  background: var(--sky);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
}
.st-ad a { color: var(--white); }
.st-ad-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.3rem;
}
.st-ad-body { display: flex; gap: 0.55rem; align-items: flex-start; }
.st-ad-fav {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex: none;
  margin-top: 0.15rem;
  background: #fff;
}
.st-ad-copy { min-width: 0; }
.st-ad-title { font-weight: 800; }
.st-ad-text { font-size: 0.85rem; font-weight: 700; opacity: 0.95; margin-top: 0.1rem; }
.st-ad-cta { display: inline-block; margin-top: 0.35rem; font-weight: 800; }

.st-settings-grid {
  display: grid;
  gap: 1.25rem;
}
/* Grid items default to min-width:auto, so a long `white-space: pre` snippet line
   would widen the whole card past the phone viewport. Let the card shrink and the
   snippet scroll instead. */
.st-settings-grid > section { min-width: 0; }
.st-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.st-theme-card {
  text-align: left;
  font-family: inherit;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(16px * var(--rs));
  background: var(--white);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 44px;
}
.st-theme-card span { font-size: 0.82rem; font-weight: 700; }
.st-theme-dots { display: flex; gap: 4px; }
.st-theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent);
}
.st-theme-current {
  align-self: flex-start;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.05rem 0.55rem;
  background: var(--white);
}
.st-theme-card.is-on { background: var(--yellow); }
.st-snippet {
  background: var(--cream);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre;
}
.st-snippet-wrap { position: relative; margin: 1em 0; }
.st-snippet-wrap > .st-snippet { margin: 0; padding-right: 3.25rem; }
.st-snippet-copy.st-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  justify-content: center;
  border-radius: calc(8px * var(--rs));
  box-shadow: var(--shadow-xs);
  font-size: 1rem;
  line-height: 1;
}
.st-snippet-copy.st-btn:active { transform: var(--press-sm); box-shadow: var(--press-shadow); }
.st-snippet-copy.is-copied { background: var(--success); color: var(--white); border-color: var(--success); }
.st-snippet-copy.is-failed { background: var(--error); color: var(--white); border-color: var(--error); }

/* Fallbacks so copied sc-stash.js (dashboard classes) still reads as lp3. */
.sc-card {
  background: var(--white);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(18px * var(--rs));
  padding: 1.15rem;
  box-shadow: var(--shadow-tile);
}
.sc-card-title, .stsh-side-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: var(--display-weight);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.btn-sc {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.2;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}
a.btn-sc { color: var(--ink); text-decoration: none; }
.btn-sc-primary { background: var(--red); color: var(--white); }
.btn-sc-secondary { background: var(--white); }
.btn-sc-danger { background: var(--red); color: var(--white); }
.btn-sc:hover, .st-btn:hover {
  transform: var(--press);
  box-shadow: var(--press-shadow);
}

.st-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(0.75rem);
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-pill);
  box-shadow: 4px 4px 0 var(--yellow);
  z-index: 10050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 2rem);
}
.st-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.st-toast.error { box-shadow: 4px 4px 0 var(--red); }
.st-toast.success { box-shadow: 4px 4px 0 var(--sky); }
.st-toast .st-toast-action { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; margin-left: 0.35rem; }

/* How-it-works (and similar) overlay: card on desktop, full screen on phone. */
.st-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10044;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.st-modal.open { display: flex; }
.st-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}
.st-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(80dvh, 720px);
  overflow: auto;
  background: var(--white);
  color: var(--ink);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(22px * var(--rs));
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.5rem 1.35rem;
  -webkit-overflow-scrolling: touch;
}
.st-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--yellow);
  box-shadow: var(--shadow-btn);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.st-modal-close:hover {
  transform: var(--press);
  box-shadow: var(--press-shadow);
}
.st-modal-dialog h2 { margin: 0 2.5rem 0.75rem 0; }
.st-modal-dialog ol {
  padding-left: 1.2rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
body.st-modal-open { overflow: hidden; }

@media (max-width: 767.98px) {
  .st-modal { padding: 0; }
  .st-modal-backdrop { display: none; }
  .st-modal-dialog {
    width: 100%;
    max-height: none;
    height: 100dvh;
    height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1.25rem + env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) calc(1.25rem + env(safe-area-inset-left, 0px));
  }
  .st-modal-close {
    top: calc(0.5rem + env(safe-area-inset-top, 0px));
    right: calc(0.5rem + env(safe-area-inset-right, 0px));
  }
}
.sc-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  padding: 0.6rem 0.8rem;
  background: var(--cream);
  color: var(--ink);
}
.stsh-item {
  border-radius: calc(14px * var(--rs)) !important;
  box-shadow: var(--shadow-btn);
  background: var(--white) !important;
}

@media (max-width: 767.98px) {
  .st-header .inner { padding: 0.6rem 1rem; }
  .st-wrap { padding: 0.75rem; }
  /* Hamburger: 44px target, same pill chrome as the nav buttons. */
  .st-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: var(--bw-thin) solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-btn);
    font-size: 1.35rem;
    cursor: pointer;
  }
  /* The nav folds into a panel pinned under the sticky header. Every item is a
     44px row; the handle (hidden on phones before) and MCP come back here. */
  .st-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.6rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    background: var(--white);
    border-bottom: var(--bw) solid var(--border-strong);
    box-shadow: var(--shadow-card);
  }
  .st-nav.is-open { display: flex; }
  .st-nav a, .st-nav .st-btn, .st-nav form { width: 100%; }
  .st-nav a, .st-nav .st-btn { justify-content: center; min-height: 44px; font-size: 0.95rem; }
  .st-nav-more { display: inline-flex; }
  .st-handle { justify-content: center; min-height: 44px; font-size: 0.95rem; }
  .st-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; min-height: 44px; }
  .st-page-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
  .st-page-head h1 { font-size: 1.6rem; }
  /* Home: the subtitle and the multify.co pill repeat what the menu's handle
     already says; the feed is the point of the page. */
  .st-page-head--home p.st-muted, .st-page-head--home .st-btn { display: none; }
  /* Home head is ONE row on phones: "Your stash" left, the + / search icons and
     the Timeline|Mosaic segment right-aligned beside it. The search field drops
     to a second row and only appears once the magnifier is on, so the first
     stash tile sits that much closer to the top of the screen. */
  .st-page-head--home { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.4rem; }
  .st-page-head--home > .st-page-head-title { flex: 1 1 auto; min-width: 0; }
  .st-page-head--home .st-head-actions { display: flex; align-items: center; gap: 0.35rem; flex: none; margin-left: auto; }
  .st-page-head--home .st-head-layout:empty { display: none; }
  .st-page-head--home .st-search { order: 3; flex-basis: 100%; width: 100%; display: none; }
  .st-page-head--home.is-searching .st-search { display: flex; }
  .st-page-head--home .st-search input { width: 100%; min-width: 0; font-size: 16px; }
  .st-page-head--home .st-search .st-btn { display: inline-flex; }
  .st-chat-context-thumb { width: 56px; height: 56px; }
  .st-chat-context-title { font-size: 1rem; }
  .st-page-head #st-new-chat { min-height: 44px; }
  .st-auth { margin-top: 1.25rem; }
  #st-chat-widget {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 70dvh;
    border-radius: calc(22px * var(--rs)) calc(22px * var(--rs)) 0 0;
    /* Full-bleed sheet: the hard offset shadow extends past the viewport and
       was clipping the Send button + right-aligned bubbles. Safe-area insets
       keep the composer inside the notch / home-indicator margins. */
    box-shadow: none;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #st-chat-widget .st-widget-icon,
  #st-chat-widget .st-chat-context-open,
  #st-chat-widget .st-chat-context-x {
    width: 44px;
    height: 44px;
  }
}

/* phone page (/phone) — value story + link form */
.st-phone-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2.5rem;
  align-items: start;
  margin: 0.75rem 0 2.25rem;
}
.st-phone-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 1rem;
}
.tilt {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  border-radius: calc(14px * var(--rs));
  padding: 0 0.5rem;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-tile);
}
.st-phone-lead {
  font-weight: 700;
  font-size: 1.1rem;
  max-width: 32rem;
  margin: 0 0 1.75rem;
}

.st-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.st-step {
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(20px * var(--rs));
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-step);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: 0;
}
.st-step.c1 { background: var(--white); }
.st-step.c2 { background: var(--sky); color: var(--white); }
.st-step.c3 { background: var(--pink); color: var(--white); }
.st-step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: var(--bw) solid var(--border-strong);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.15rem;
}
.st-step h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.15rem;
  margin: 0 0 0.2rem;
}
.st-step p { margin: 0; font-weight: 700; font-size: 0.92rem; }

/* iMessage-style demo */
.st-phone-mock {
  background: var(--white);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(26px * var(--rs));
  box-shadow: var(--shadow-pop);
  padding: 1.25rem;
  transform: rotate(1.5deg);
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}
.st-phone-mock .st-mock-badge {
  position: absolute;
  top: -20px;
  right: -12px;
  background: var(--pink);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 0.92rem;
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  transform: rotate(6deg);
  box-shadow: var(--shadow-sm);
}
.st-mock-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 3px dotted rgba(20, 20, 20, 0.2);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}
.st-mock-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  border: var(--bw) solid var(--border-strong);
  font-family: var(--font-mark);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-mock-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight-soft);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.2;
}
.st-mock-sub {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.st-mock-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.st-bubble {
  max-width: 85%;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(18px * var(--rs));
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
}
.st-bubble.out {
  align-self: flex-end;
  background: var(--sky);
  color: var(--white);
  border-bottom-right-radius: 6px;
}
.st-bubble.in {
  align-self: flex-start;
  background: var(--cream);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.st-bubble-linkcard {
  display: block;
  background: var(--white);
  color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(12px * var(--rs));
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.4rem;
}
.st-bubble-linkcard .t {
  display: block;
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.3;
}
.st-bubble-linkcard .d {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(20, 20, 20, 0.55);
}
.st-mock-caption {
  text-align: center;
  margin: 1rem 0 0;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* link-your-number card */
.st-phone-link {
  max-width: 560px;
  margin: 0 auto;
}
.st-phone-link h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 0 0 0.35rem;
}
.st-phone-link .sub {
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
}
.st-textnum {
  background: var(--yellow);
  color: var(--ink);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(16px * var(--rs));
  padding: 0.85rem 1rem;
  font-weight: 800;
  box-shadow: var(--shadow-tile);
  margin: 0 0 1.25rem;
}
.st-textnum strong {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.1rem;
  white-space: nowrap;
}
.st-num-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  background: var(--cream);
  padding: 0.55rem 0.6rem 0.55rem 0.9rem;
  margin-bottom: 0.6rem;
  font-weight: 800;
}
.st-num-row .st-num-check { color: var(--success); margin-right: 0.35rem; }
.st-phone-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.st-phone-alt {
  font-size: 0.85rem;
  font-weight: 800;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  text-decoration: underline;
}
.st-ftue-done {
  max-width: 560px;
  margin: 1.5rem auto 0;
  text-align: center;
}

@media (max-width: 991px) {
  .st-phone-hero { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .st-phone-mock { transform: rotate(0.75deg); }
}
@media (max-width: 575px) {
  .st-phone-hero { margin-top: 0.25rem; }
  .st-phone-mock { padding: 1rem; }
  .st-phone-mock .st-mock-badge { right: -6px; }
}

/* ── settings TOC (right rail on desktop, chip row on phones) ── */
.st-settings-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 2rem;
  align-items: start;
}
.st-settings-wrap > .st-settings-grid { grid-column: 1; grid-row: 1; min-width: 0; }
.st-toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.st-toc-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}
.st-toc a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-left: 3px solid transparent;
}
.st-toc a:hover { color: var(--ink); }
.st-toc a.is-active {
  color: var(--ink);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.st-settings-grid section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── chat page: actions, history panel ── */
.st-chat-actions { display: flex; gap: 0.6rem; flex: none; align-items: center; }
.st-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 10044;
}
.st-history-overlay[hidden] { display: none; }
.st-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}
.st-history-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--white);
  color: var(--ink);
  border-left: var(--bw) solid var(--border-strong);
  display: flex;
  flex-direction: column;
  animation: st-slide-in 0.22s ease;
}
@keyframes st-slide-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .st-history-panel { animation: none; } }
.st-history-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: var(--bw) solid var(--border-strong);
}
.st-history-head h2 { margin: 0; font-size: 1.4rem; }
/* The close button reuses .st-modal-close (persona-styled) but sits in the
   flex row here — absolute positioning made it hang off the panel edge. */
.st-history-head .st-modal-close {
  position: static;
  flex: none;
}
.st-history-panel:focus { outline: none; }
.st-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  -webkit-overflow-scrolling: touch;
}
.st-history-item {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: calc(12px * var(--rs));
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.st-history-item .bi { flex: none; opacity: 0.75; }
.st-history-item:hover { background: var(--cream); }
.st-history-item.is-current { background: var(--yellow); }
.st-history-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-history-time {
  flex: none;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.st-history-del {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.st-history-del:hover { background: var(--red); color: var(--white); }
.st-history-empty { margin: 0.35rem 0.5rem; font-weight: 700; }

/* ── confirm modal (delete chat / destructive actions) ── */
.st-modal.st-confirm { z-index: 10048; }
.st-confirm-dialog h2 { font-size: 1.35rem; margin: 0 0 0.5rem; }
.st-confirm-dialog p { font-weight: 700; margin: 0; color: var(--text-secondary); }
.st-confirm-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.4rem;
}
.st-confirm-actions .st-btn { min-height: 44px; }
@media (max-width: 767.98px) {
  /* A small decision doesn't need the full-screen sheet the how-it-works modal
     uses — keep the confirm as a centered card on phones too. */
  .st-modal.st-confirm { padding: 1.25rem; }
  .st-modal.st-confirm .st-modal-backdrop { display: block; }
  .st-modal.st-confirm .st-modal-dialog {
    width: min(420px, 100%);
    height: auto;
    border: var(--bw) solid var(--border-strong);
    border-radius: calc(22px * var(--rs));
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
  }
  .st-confirm-actions .st-btn { flex: 1; justify-content: center; }
}

/* ── typing indicator (chat page + widget) ── */
.st-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.st-spin {
  flex: none;
  width: 15px;
  height: 15px;
  border: 3px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: st-spin 0.7s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st-spin { animation: none; } }
.st-msg.is-typing { box-shadow: none; }

/* ── mention menu rows (icon + title + site) ── */
.st-mention-item { display: flex; gap: 0.5rem; align-items: center; }
.st-mention-item .bi { flex: none; opacity: 0.7; }
.st-mention-item .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-mention-item .s {
  flex: none;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

@media (max-width: 991px) {
  .st-settings-wrap { display: block; }
  .st-toc {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    background: var(--cream);
    padding: 0.6rem 0;
    margin: -0.5rem 0 1rem;
    scrollbar-width: none;
  }
  .st-toc::-webkit-scrollbar { display: none; }
  .st-toc-title { display: none; }
  .st-toc a {
    flex: none;
    border: var(--bw-thin) solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--ink);
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .st-toc a.is-active { background: var(--yellow); border-left: var(--bw-thin) solid var(--border-strong); }
  .st-chat-actions { width: 100%; }
  .st-chat-actions .st-btn { flex: 1; justify-content: center; }
}
@media (max-width: 767.98px) {
  .st-history-backdrop { display: none; }
  .st-history-panel {
    width: 100%;
    border-left: 0;
    animation: none;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .st-history-list { padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); }
}

/* ── public-page settings: avatar / socials / background / density ── */
.st-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.st-avatar-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  background: var(--cream);
  flex: none;
}
.st-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.st-bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.5rem;
}
.st-bg-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem;
  background: var(--white);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(12px * var(--rs));
  cursor: pointer;
  font-family: inherit;
  min-width: 0;
}
.st-bg-swatch-preview {
  display: block;
  height: 38px;
  border-radius: calc(8px * var(--rs));
  /* background-COLOR (not the shorthand) so pattern.css's background-image
     survives; the pattern draws with currentColor at a persona-safe tint. */
  background-color: var(--cream);
  color: color-mix(in srgb, var(--ink) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}
.st-bg-swatch-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-bg-swatch.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.st-bg-swatch.is-on .st-bg-swatch-label { color: var(--ink); }
.st-seg {
  display: inline-flex;
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  overflow: hidden;
}
.st-seg button {
  border: 0;
  border-right: var(--bw-thin) solid var(--border-strong);
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  min-height: 44px;
  cursor: pointer;
}
.st-seg button:last-child { border-right: 0; }
.st-seg button.is-on {
  background: var(--accent);
  color: var(--accent-fg, #fff);
}
@media (max-width: 575px) {
  .st-field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .st-bg-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* ── browser-window mock (extension page) — extends .st-phone-mock ── */
.st-browser-mock { max-width: 440px; }
.st-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 3px dotted rgba(20, 20, 20, 0.2);
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
}
.st-browser-dots { display: flex; gap: 5px; flex: none; }
.st-browser-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: var(--bw-thin) solid var(--border-strong);
}
.st-browser-dots i:nth-child(1) { background: var(--red); }
.st-browser-dots i:nth-child(2) { background: var(--yellow); }
.st-browser-dots i:nth-child(3) { background: var(--sky); }
.st-browser-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--cream);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
}
.st-browser-media {
  height: 92px;
  background: var(--cream);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(12px * var(--rs));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--ink);
}
.st-browser-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight-soft);
  font-size: 1.02rem;
  margin: 0.6rem 0 0;
}
.st-ctx-menu {
  width: max-content;
  max-width: 100%;
  margin: -0.35rem 0 0 auto;
  background: var(--white);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: calc(12px * var(--rs));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transform: rotate(1.5deg);
  position: relative;
}
.st-ctx-menu .row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}
.st-ctx-menu .row:last-child { border-bottom: 0; }
.st-ctx-menu .row.hot {
  background: var(--accent);
  color: var(--accent-fg, #fff);
  font-weight: 800;
}
.st-stashed-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  background: var(--yellow);
  color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.85rem;
  font-weight: 800;
  font-size: 0.85rem;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-xs);
}

/* ── assistant markdown prose (st-md on .st-msg.assistant) ── */
.st-msg.st-md { white-space: normal; }
.st-md > :first-child { margin-top: 0; }
.st-md > :last-child { margin-bottom: 0; }
.st-md p { margin: 0 0 0.6rem; }
.st-md h1, .st-md h2, .st-md h3, .st-md h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  line-height: 1.25;
  margin: 0.8rem 0 0.4rem;
}
.st-md h1 { font-size: 1.15rem; }
.st-md h2 { font-size: 1.05rem; }
.st-md h3 { font-size: 0.98rem; }
.st-md h4 { font-size: 0.92rem; }
.st-md ul, .st-md ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.st-md li { margin: 0.15rem 0; }
.st-md a { color: var(--accent); text-decoration: underline; font-weight: 800; overflow-wrap: anywhere; }
.st-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 0.05rem 0.3rem;
  border-radius: calc(6px * var(--rs));
}
.st-md pre {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border: var(--bw-thin) solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: calc(10px * var(--rs));
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  margin: 0 0 0.6rem;
  font-weight: 400;
}
.st-md pre code { background: transparent; padding: 0; }
.st-md blockquote {
  margin: 0 0 0.6rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
}
.st-md hr { border: none; border-top: var(--bw-thin) solid color-mix(in srgb, var(--ink) 25%, transparent); margin: 0.7rem 0; }
.st-md table { border-collapse: collapse; margin: 0 0 0.6rem; font-size: 0.85rem; display: block; overflow-x: auto; max-width: 100%; }
.st-md th, .st-md td { border: var(--bw-thin) solid color-mix(in srgb, var(--ink) 30%, transparent); padding: 0.25rem 0.55rem; }
.st-md img { max-width: 100%; border-radius: calc(10px * var(--rs)); }

/* ── MCP page: tool-call chip inside the agent mock ── */
.st-mcp-tool {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  background: var(--yellow);
  color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============================================================================
   Browser-extension lifecycle pages — /extension-installed, /extension-uninstalled
   (routes/extension.js). Everything is token-driven so the Look picker's live
   re-theme carries through the fun bits too. Vocabulary mirrors multify.co's
   lp3 landing (coloured step cards, source marks, the public toggle).
   ============================================================================ */
.ext-page { padding-bottom: 3rem; }
.ext-step[hidden] { display: none !important; }
/* Step headings take programmatic focus on a step change so screen readers
   announce where the user landed. The global focus ring is for pointer-
   reachable controls; on a heading it draws a box around the title. */
#extLookTitle:focus, #extTourTitle:focus { outline: none; }
.ext-kicker {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.ext-kicker-center { text-align: center; margin: 2.25rem 0 0.75rem; }
.ext-fine { text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--text-secondary); margin: 0.9rem 0 0; }
.ext-inline-link { color: inherit; font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; }
.ext-back {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 0; padding: 0.25rem 0; margin: 0 0 0.25rem;
  font-family: inherit; font-weight: 800; font-size: 0.9rem; color: var(--text-secondary); cursor: pointer;
}
.ext-back:hover { color: var(--ink); text-decoration: underline; }

/* ── step 1: pick your look ────────────────────────────────────────────── */
.ext-look-head { text-align: center; max-width: 40rem; margin: 1.5rem auto 2rem; }
.ext-look-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 0.75rem; }
.ext-look-head .st-lead { margin: 0; }
.ext-look-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  max-width: 1040px;
  margin: 0 auto;
}
@media (min-width: 900px) { .ext-look-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ext-look-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.55rem; text-align: left;
  background: var(--white); color: var(--ink);
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(20px * var(--rs));
  box-shadow: var(--shadow-step);
  padding: 1.25rem 1.2rem 1.35rem;
  font-family: inherit; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ext-look-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-card); }
.ext-look-card:focus-visible { outline: var(--bw) solid var(--accent); outline-offset: 3px; }
.ext-look-card.is-on { border-color: var(--accent); }
.ext-look-swatches { display: flex; gap: 0.4rem; }
.ext-look-dot { width: 20px; height: 20px; border-radius: 50%; border: var(--bw-thin) solid var(--border-strong); flex: none; }
.ext-look-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.2rem; line-height: 1.1; }
.ext-look-pitch { font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.45; }
.ext-look-check {
  position: absolute; top: -12px; right: -10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg, #fff);
  border: var(--bw-thin) solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  font-size: 0.95rem;
  transform: rotate(8deg);
}
.ext-look-card.is-on .ext-look-check { display: flex; }

/* ── step 2 head / try-it-now ──────────────────────────────────────────── */
.ext-tour-head { text-align: center; max-width: 48rem; margin: 0 auto 1rem; }
.ext-tour-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0 0 0.4rem; }
.ext-tour-head .st-lead { margin: 0; }
.ext-try {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.5rem;
  align-items: start;
  margin: 0.75rem 0 1rem;
}
.ext-try h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 0.75rem; }
.ext-try-steps { margin-top: 1.5rem; }
.ext-try-steps .st-step h3 { font-size: 1.1rem; }
.ext-try-steps .st-step p { font-size: 0.9rem; }
.ext-try-visual { padding-top: 1.5rem; }
@media (max-width: 991px) {
  .ext-try { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .ext-try-visual { padding-top: 0; }
}

/* ── carousel of horizontal tiles ─────────────────────────────────────── */
.ext-carousel-wrap { position: relative; }
.ext-carousel {
  display: flex; gap: 1.25rem; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 4px 4px 14px; /* room for the offset shadow */
}
.ext-carousel::-webkit-scrollbar { display: none; }
.ext-carousel:focus-visible { outline: var(--bw) solid var(--accent); outline-offset: 2px; border-radius: calc(24px * var(--rs)); }
.ext-pane {
  flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: center;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(24px * var(--rs));
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.4rem 1.6rem;
  min-height: 360px;
}
@media (min-width: 768px) {
  .ext-pane { flex-basis: 88%; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); padding: 1.9rem 2.2rem 2rem; min-height: 400px; }
}
.ext-pane.c1 { background: var(--white); color: var(--ink); }
.ext-pane.c2 { background: var(--sky); color: var(--white); }
.ext-pane.c3 { background: var(--pink); color: var(--white); }
.ext-pane.c4 { background: var(--yellow); color: var(--ink); }
.ext-pane .st-step-num { margin-bottom: 0.9rem; }
.ext-pane h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 0.7rem; }
/* The tilt highlight is the same yellow as the yellow tile — on c4 it vanished. */
.ext-pane.c4 .tilt { background: var(--white); }
.ext-pane-copy p { font-weight: 700; font-size: 1rem; line-height: 1.55; margin: 0 0 0.85rem; max-width: 30rem; }
.ext-pane-copy .ext-pane-note { font-size: 0.86rem; opacity: 0.82; margin: 0; }
.ext-pane kbd {
  font-family: inherit; font-size: 0.8em; font-weight: 800;
  background: var(--white); color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong); border-bottom-width: 3px;
  border-radius: calc(6px * var(--rs)); padding: 0.05rem 0.4rem;
}
.ext-pane-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; min-width: 0; }

.ext-carousel-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.4rem; }
.ext-nav {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong); box-shadow: var(--shadow-btn);
  font-size: 1.1rem; cursor: pointer;
}
.ext-nav:hover:not(:disabled) { transform: var(--press); box-shadow: var(--press-shadow); }
.ext-nav:disabled { opacity: 0.35; cursor: default; }
.ext-dots { display: flex; gap: 0.5rem; }
.ext-dot {
  width: 14px; height: 14px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--white); border: var(--bw-thin) solid var(--border-strong);
}
.ext-dot[aria-current="true"] { background: var(--accent); }

/* ── pane visuals ──────────────────────────────────────────────────────── */
.ext-sources { display: flex; flex-wrap: wrap; gap: 1.1rem 1.35rem; justify-content: center; list-style: none; margin: 0; padding: 0; }
.ext-sources-tight { gap: 0.7rem 0.9rem; justify-content: flex-start; margin-top: 0.75rem; }
.ext-sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 1rem 1.6rem; justify-content: center; }
.ext-source { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-decoration: none; color: inherit; }
.ext-source > span:last-child { font-size: 0.85rem; font-weight: 800; }
.ext-source-mark {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--ink);
  border: var(--bw) solid var(--border-strong); box-shadow: var(--shadow-sm);
  font-size: 1.6rem;
  transition: transform 0.15s ease;
}
.ext-sources-tight .ext-source-mark { width: 50px; height: 50px; font-size: 1.3rem; }
.ext-sources-tight .ext-source > span:last-child { font-size: 0.76rem; }
a.ext-source:hover .ext-source-mark, .ext-source:hover .ext-source-mark { transform: translateY(-4px) rotate(-4deg); }

.ext-toggle-card {
  background: var(--white); color: var(--ink);
  border: var(--bw) solid var(--border-strong); border-radius: calc(20px * var(--rs));
  box-shadow: var(--shadow-card); padding: 1.35rem; width: 100%; max-width: 360px;
  transform: rotate(1.5deg);
}
.ext-find-src { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.45rem; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.ext-find-title { font-weight: 800; font-size: 1.02rem; line-height: 1.35; margin: 0 0 0.3rem; }
.ext-find-note { font-weight: 700; font-size: 0.9rem; color: var(--red); margin: 0; }
.ext-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  border-top: var(--bw) dotted color-mix(in srgb, var(--ink) 20%, transparent);
  margin-top: 1.1rem; padding-top: 1.1rem;
}
.ext-toggle-state {
  font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1rem;
  background: var(--yellow); color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong); border-radius: var(--radius-pill); padding: 0.2rem 0.85rem;
}
.ext-switch { width: 56px; height: 30px; border-radius: 15px; background: var(--red); border: var(--bw) solid var(--border-strong); position: relative; flex: none; }
.ext-switch::after { content: ''; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); border: var(--bw-thin) solid var(--border-strong); }

.ext-panel-mock {
  background: var(--white); color: var(--ink);
  border: var(--bw) solid var(--border-strong); border-radius: calc(18px * var(--rs));
  box-shadow: var(--shadow-card); padding: 1.1rem 1.2rem; width: 100%; max-width: 340px;
  transform: rotate(-1.5deg);
}
.ext-panel-mock-head { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.6rem; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1rem; }
.ext-panel-mock-title { font-weight: 800; font-size: 0.92rem; line-height: 1.35; margin: 0 0 0.7rem; }
.ext-panel-mock-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.7rem; }
.ext-panel-mock-tags span { border: var(--bw-thin) solid var(--border-strong); border-radius: var(--radius-pill); padding: 0.1rem 0.6rem; font-size: 0.76rem; font-weight: 800; background: var(--yellow); }
.ext-panel-mock-tags span.add { background: transparent; border-style: dashed; color: var(--text-secondary); }
.ext-panel-mock-note { margin: 0 0 0.7rem; font-size: 0.88rem; font-weight: 700; color: var(--text-secondary); border-left: var(--bw) solid var(--border-strong); padding-left: 0.6rem; }
.ext-panel-mock-ask { margin: 0; display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); border: var(--bw-thin) solid var(--border-strong); border-radius: var(--radius-pill); padding: 0.4rem 0.8rem; background: var(--cream); }

.ext-tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; width: 100%; max-width: 340px; }
.ext-tools li {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--white); color: var(--ink);
  border: var(--bw-thin) solid var(--border-strong); border-radius: calc(12px * var(--rs));
  box-shadow: var(--shadow-xs); padding: 0.65rem 0.8rem; font-weight: 800; font-size: 0.92rem;
}
.ext-tools li i { font-size: 1.1rem; }

/* ── CTAs ──────────────────────────────────────────────────────────────── */
.ext-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.ext-cta-row-final { justify-content: center; margin-top: 1.1rem; }
.st-btn-lg { padding: 0.7rem 1.6rem; font-size: 1rem; border-radius: calc(14px * var(--rs)); box-shadow: var(--shadow-sm); }

/* ── uninstalled ───────────────────────────────────────────────────────── */
.ext-bye { max-width: 560px; }
.ext-bye .st-card h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.ext-reasons { border: 0; padding: 0; margin: 0 0 1.1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 1rem; }
.ext-reasons legend { padding: 0; margin-bottom: 0.4rem; }
.ext-reason { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; font-weight: 700; cursor: pointer; padding: 0.25rem 0; }
.ext-reason input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 2px; flex: none; }
@media (max-width: 479px) { .ext-reasons { grid-template-columns: minmax(0, 1fr); } }
.ext-bye-status { margin: 0.75rem 0 0; text-align: center; font-weight: 800; font-size: 0.9rem; min-height: 1.3em; color: var(--text-secondary); }
.ext-bye-status.is-ok { color: var(--success); }
.ext-bye-status.is-error { color: var(--red); }
.ext-bye-after { text-align: center; margin-top: 2rem; }
.ext-bye-after .ext-cta-row { justify-content: center; margin-top: 0.5rem; }

/* ── install page: try-it header, in-page auth modal, after-auth landing ── */
.ext-try-hdr {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  margin: 0 0 0.9rem; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.05rem;
}
.ext-try-hdr .tilt { transform: rotate(-3deg); }
.ext-try-hdr i { font-size: 1.5rem; line-height: 1; animation: ext-bob 1.6s ease-in-out infinite; }
@keyframes ext-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .ext-try-hdr i { animation: none; } }

/* The dialog's close button is absolutely positioned in the top-right (44px at
   0.75rem); give the content a clear band under it so the kicker and the
   Sign in / Sign up tabs never run into it. */
.ext-auth-dialog { max-width: 440px; padding-top: 3.75rem; max-height: min(calc(100dvh - 2.5rem), 820px); }
/* Keep the kicker clear of the close button (44px, top-right) without spending
   a whole band on it: it wraps short of the button, and the tabs start below. */
.ext-auth #extAuthWhy { padding-right: 3.25rem; }
/* The sign-up pane is the tall one (username + Google + email + terms). Keep it
   inside a laptop viewport without scrolling: tighter rhythm than the full-page
   form, which has the whole screen to itself. */
.ext-auth-dialog .st-lead { margin-bottom: 0.75rem; }
.ext-auth-dialog .st-field { margin-bottom: 0.7rem; }
.ext-auth-dialog .st-or { margin: 0.7rem 0; }
.ext-auth-dialog .st-divider { margin: 0.75rem 0 0.25rem; }
.ext-auth-dialog .st-check { margin: 0.6rem 0 0.8rem; }
.ext-auth-dialog .ext-auth-google { margin: 0.1rem 0 0; }
.ext-auth-dialog input.st-input, .ext-auth-dialog textarea.st-input { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.ext-auth-dialog h2 { font-size: clamp(1.4rem, 3vw, 1.65rem); margin: 0 0 0.5rem; }
.ext-auth-dialog .st-lead { margin-bottom: 1rem; }
.ext-auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin: 0 0 0.9rem;
  background: var(--cream); border: var(--bw-thin) solid var(--border-strong); border-radius: var(--radius-pill); padding: 0.3rem;
}
.ext-auth-tab {
  border: 0; background: transparent; color: var(--text-secondary); cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 0.9rem; padding: 0.45rem 0.8rem; border-radius: var(--radius-pill);
}
.ext-auth-tab.is-on { background: var(--accent); color: var(--accent-fg, #fff); }
.ext-auth-pane[hidden] { display: none; }
.ext-auth-google { display: flex; justify-content: center; margin: 0.25rem 0 0.25rem; }
.ext-auth-alt { margin: 1rem 0 0; }
.ext-linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; cursor: pointer; }
.ext-auth-fallback { margin: 1rem 0 0; text-align: center; font-size: 0.78rem; }
.ext-auth-fallback a { color: inherit; font-weight: 800; }
.ext-auth #extAuthWhy { margin: 0 0 0.6rem; text-transform: none; letter-spacing: 0; }

.ext-goto {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem;
  background: var(--yellow); color: var(--ink);
  border: var(--bw) solid var(--border-strong); border-radius: calc(18px * var(--rs));
  box-shadow: var(--shadow-step); padding: 0.9rem 1.1rem; margin: 0 0 1.25rem;
}
.ext-goto-text { font-weight: 700; font-size: 0.95rem; flex: 1 1 18rem; }
.ext-receipt {
  background: var(--white); color: var(--ink);
  border: var(--bw) solid var(--border-strong); border-radius: calc(18px * var(--rs));
  box-shadow: var(--shadow-step); padding: 0.9rem 1.1rem 0.6rem; margin: 0 0 1.25rem;
}
.ext-receipt .ext-kicker { margin-bottom: 0.4rem; }
.ext-receipt-item {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0;
  color: inherit; text-decoration: none; font-weight: 700; font-size: 0.92rem;
  border-top: 2px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.ext-receipt-item:first-of-type { border-top: 0; }
.ext-receipt-item:hover span { text-decoration: underline; }
.ext-receipt-item i { color: var(--success); flex: none; }
.ext-receipt-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings → Save from elsewhere: one row per channel, each with a real button. */
.st-save-ways { display: grid; gap: 1rem; }
.st-save-way p { margin: 0 0 0.6rem; font-weight: 700; }
.st-save-way p .st-muted { font-weight: 700; }
.st-save-way .st-btn { display: inline-flex; }
@media (min-width: 640px) { .st-save-ways { grid-template-columns: 1fr 1fr; } }

/* "Extension missing" FAB on the stash home — bottom-left (chat widget owns the right). */
.st-extfab {
  position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 35;
  width: min(320px, calc(100vw - 2.5rem));
  background: var(--yellow); color: var(--ink);
  border: var(--bw) solid var(--border-strong); border-radius: calc(18px * var(--rs));
  box-shadow: var(--shadow-step); padding: 1rem 1.1rem 1.1rem;
}
.st-extfab[hidden] { display: none; }
.st-extfab-title { display: flex; align-items: center; gap: 0.45rem; margin: 0 2rem 0.35rem 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.05rem; line-height: 1.2; }
.st-extfab-body { margin: 0 0 0.8rem; font-weight: 700; font-size: 0.88rem; line-height: 1.45; }
.st-extfab .st-btn { display: inline-flex; }
.st-extfab-close {
  position: absolute; top: 0.55rem; right: 0.55rem; width: 30px; height: 30px;
  border: var(--bw-thin) solid var(--border-strong); border-radius: 50%;
  background: var(--white); color: var(--ink); font-size: 1.1rem; font-weight: 800; line-height: 1; cursor: pointer; font-family: inherit;
}
.st-extfab-close:hover { transform: var(--press-sm); }
@media (max-width: 575px) { .st-extfab { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; width: auto; } }

/* Settings → Widget (embed configurator). Controls left, live preview right;
   the preview is the real loader mounted into a dashed well. */
.st-widget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.st-widget-controls { min-width: 0; }
.st-widget-hint { margin: 0.35rem 0 0; font-size: 0.78rem; }
.st-widget-num { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.st-widget-num .st-input { width: 6.5rem; flex: none; }
.st-widget-preview {
  min-height: 220px;
  padding: 0.5rem;
  border: var(--bw-thin) dashed color-mix(in srgb, var(--ink) 40%, transparent);
  border-radius: calc(14px * var(--rs));
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  overflow: auto;
}
.st-widget-preview iframe { margin: 0 auto; }
.st-widget-codehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.st-widget-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
  min-height: 7.5rem;
  resize: vertical;
}
select.st-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: var(--bw) solid var(--border-strong);
  border-radius: calc(14px * var(--rs));
  padding: 0.6rem 0.85rem;
  background: var(--cream);
  color: var(--ink);
}
/* Phones don't get the Widget card: configuring an embed from a phone is not
   worth the screen. Tablets (≥768px) keep it. The configurator script skips
   mounting the preview at this width too. */
@media (max-width: 767.98px) {
  #widget, .st-toc a[href="#widget"] { display: none; }
}
