/* ─────────────────────────────────────────────────────────────────────────────
   Big Foot — design system
   Hand-drawn paper aesthetic · warm ink on aged paper · one teal-green accent
   ───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Caveat:wght@500;600;700&family=Kalam:wght@300;400;700&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  /* Paper */
  --paper:    #f1ead9;
  --card:     #fbf8ef;
  --card2:    #f4eee0;

  /* Ink */
  --ink:      #2a241c;
  --ink-soft: #6a5f51;
  --line:     #2f281f;

  /* Accent */
  --accent:      #2f8f86;
  --accent-soft: #cfe6e1;
  --accent-ink:  #1d6b63;

  /* Semantic */
  --warn:     #c46a2f;

  /* Typography */
  --hand:   'Patrick Hand', 'Comic Sans MS', cursive;
  --scrawl: 'Caveat', cursive;
  --note:   'Kalam', cursive;

  /* Wonky border-radius trick */
  --wonky:  255px 12px 225px 14px / 14px 225px 14px 255px;
  --wonky2: 14px 235px 16px 255px / 255px 16px 245px 14px;

  /* Legacy aliases — keep old token names pointing to new values */
  --sand:       var(--paper);
  --sand-2:     var(--card2);
  --cream:      var(--card);
  --cream-2:    var(--card2);
  --teal:       var(--accent);
  --teal-dark:  var(--accent-ink);
  --teal-light: #8ab6b3;
  --teal-wash:  var(--accent-soft);
  --teal-text:  var(--accent-ink);
  --amber:      var(--warn);
  --red:        #b84040;
  --ink-2:      var(--ink-soft);
  --ink-3:      #9a8e82;
  --ink-4:      #c8c0b6;
  --ink-5:      #ddd8d0;

  /* Font aliases */
  --font-hand:  var(--scrawl);
  --font-sans:  var(--hand);
  --font-mono:  ui-monospace, 'JetBrains Mono', 'Cascadia Code', monospace;

  /* Shape (kept for backward compat) */
  --radius:     13px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Flat marker-style shadows */
  --shadow:     3px 3px 0px var(--ink);
  --shadow-sm:  2px 2px 0px var(--ink);
  --shadow-xs:  1px 1px 0px var(--ink);
}

/* ── Motion ────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Focus — WCAG 2.4.11 visible focus indicator ───────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Elements that define their own focus style suppress the global outline */
.field-input:focus-visible,
.btn:focus-visible {
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
/* html/body sizing lives with the layout rules near the bottom — kept
   together so the dvh + overflow:hidden scene/panel layout is in one place. */
body {
  font-family: var(--hand);
  /* base bumped from 16px so any unsized text reads bigger across the app */
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* subtle linen/paper texture */
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(80, 60, 40, 0)    0px,
      rgba(80, 60, 40, 0)   18px,
      rgba(80, 60, 40, 0.022) 19px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(80, 60, 40, 0)    0px,
      rgba(80, 60, 40, 0)   18px,
      rgba(80, 60, 40, 0.022) 19px
    );
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKETCH PATTERNS
   ══════════════════════════════════════════════════════════════════════════ */

/* diagonal hatch — used on canvas/placeholder zones */
.hatch {
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 7px,
    rgba(47,143,134,0.14) 7px,
    rgba(47,143,134,0.14) 8.5px
  );
}

/* dashed border box — hand-drawn feel */
.dashed-box {
  border: 2px dashed var(--ink-3);
  border-radius: 14px 10px 13px 11px / 11px 13px 10px 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT — centered phone-width column
   ══════════════════════════════════════════════════════════════════════════ */

.screen {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
}

.screen-center {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════════════════════ */

.t-hand      { font-family: var(--scrawl); }
.t-mono      { font-family: var(--font-mono); }
.t-muted     { color: var(--ink-3); }
.t-teal      { color: var(--accent-ink); }

/* Hero / daily focus — biggest, most emotional */
.t-hero {
  font-family: var(--scrawl);
  font-weight: 700;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.0;
}

/* Section heading */
.t-heading {
  font-family: var(--scrawl);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.1;
}

/* Body — default */
.t-body {
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.4;
}

/* Declarative / supportive copy — never a command */
.t-declar {
  font-family: var(--note);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* All-caps overline / section kicker */
.t-kicker {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Kicker label — tiny mono all-caps (legacy class, kept for wizard) */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Hand-style heading */
.hand-heading {
  font-family: var(--scrawl);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.hand-heading-sm {
  font-family: var(--scrawl);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD  — wonky hand-drawn border, no shadow, no pseudo-element
   ══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--card);
  border: none;
  border-radius: 20px 15px 18px 16px / 16px 18px 15px 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: inherit;
  filter: url(#roughen-edge);
  pointer-events: none;
}

.card.alt { border-radius: var(--wonky2); }
.card.dashed::after { border-style: dashed; }

.card-sm {
  background: var(--card);
  border: none;
  border-radius: 14px 10px 13px 11px / 11px 13px 10px 14px;
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  position: relative;
}
.card-sm::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: inherit;
  filter: url(#roughen-edge);
  pointer-events: none;
}

.card-teal {
  background: var(--accent);
  border: none;
  border-radius: 20px 15px 18px 16px / 16px 18px 15px 20px;
  box-shadow: var(--shadow);
  color: #fff;
  padding: 16px;
  position: relative;
}
.card-teal::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: inherit;
  filter: url(#roughen-edge);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGO CIRCLE
   ══════════════════════════════════════════════════════════════════════════ */

.logo-circle {
  width: 72px;
  height: 72px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  flex-shrink: 0;
}

.logo-circle-text {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
}

.logo-circle-sm {
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */

.btn {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  padding: 12px 20px;
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 26px 22px 24px 22px / 22px 24px 22px 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
  filter: url(#roughen);
}

/* Hover only on real pointers — on touch, :hover sticks after a tap and
   masks the :active press feedback. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--card2); }
}

.btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink) !important;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Primary — accent fill */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--ink);
  box-shadow: var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: var(--accent-ink); }
}

/* Ghost — transparent with accent border */
.btn-ghost {
  background: var(--card);
  border-color: var(--ink-3);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

/* Inline text link */
.btn-link {
  background: none;
  border: none;
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--hand);
  padding: 4px 0;
  width: auto;
  cursor: pointer;
  display: inline;
}
.btn-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM FIELDS
   ══════════════════════════════════════════════════════════════════════════ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-input {
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card2);
  border: 2px solid var(--ink-4);
  border-radius: 13px 9px 11px 11px / 9px 11px 11px 13px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input::placeholder { color: var(--ink-4); }
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FEEDBACK
   ══════════════════════════════════════════════════════════════════════════ */

.feedback-error {
  font-size: 0.85rem;
  color: var(--red);
  padding: 8px 10px;
  border-left: 3px solid var(--red);
  line-height: 1.5;
}

.feedback-warn {
  font-size: 0.85rem;
  color: var(--amber);
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  line-height: 1.5;
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  padding: 8px 0;
}

.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid var(--ink-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   SPACING HELPERS
   ══════════════════════════════════════════════════════════════════════════ */

.gap-xs  { gap: 8px; }
.gap-sm  { gap: 12px; }
.gap-md  { gap: 20px; }
.gap-lg  { gap: 32px; }

.mt-xs   { margin-top: 8px; }
.mt-sm   { margin-top: 14px; }
.mt-md   { margin-top: 24px; }
.mt-lg   { margin-top: 40px; }
.mt-xl   { margin-top: 56px; }

.stack   { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════════════════════════════
   PILL SELECT  (segmented control — e.g. AI preference)
   ══════════════════════════════════════════════════════════════════════════ */

.pill-select {
  display: flex;
  border: 2.5px solid var(--ink);
  border-radius: 26px 22px 24px 22px / 22px 24px 22px 26px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
  filter: url(#roughen);
}

.pill-option {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-right: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.pill-option:last-child { border-right: none; }

.pill-option.active {
  background: var(--accent);
  color: #fff;
}

.pill-option:active:not(.active) {
  background: var(--card2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand-name {
  font-family: var(--scrawl);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.login-tagline {
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--ink-3);
  font-weight: 400;
}

.login-panel { display: flex; flex-direction: column; gap: 12px; }
.login-panel.hidden { display: none; }

.passkey-explainer {
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.55;
  max-width: 280px;
  margin: 0 auto 20px;
}

/* hand-drawn dashed divider line */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-family: var(--hand);
  font-size: 1rem;
  margin: 4px 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink-4) 0px,
    var(--ink-4) 5px,
    transparent 5px,
    transparent 9px
  );
}

.ai-pref-section { display: flex; flex-direction: column; gap: 8px; }

.ai-note {
  font-size: 0.9rem;
  color: var(--ink-3);
  font-family: var(--hand);
  text-align: center;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP PLACEHOLDER PAGES
   ══════════════════════════════════════════════════════════════════════════ */

.placeholder-screen {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTPRINT TRAIL  (progress indicators, used across app)
   ══════════════════════════════════════════════════════════════════════════ */

.footprint-trail {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footprint {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.footprint.filled { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   CHECKBOX ITEM  (task list)
   ══════════════════════════════════════════════════════════════════════════ */

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-check {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--ink-soft);
  border-radius: 6px 4px 6px 5px / 5px 6px 4px 6px;
  flex-shrink: 0;
  margin-top: 1px;
  background: transparent;
  cursor: pointer;
}

.task-check.done {
  background: var(--accent);
  border-color: var(--accent);
}

.task-title       { font-size: 1rem; font-weight: 500; color: var(--ink); }
.task-title.done  { text-decoration: line-through; color: var(--ink-3); }
.task-sub         { font-size: 0.8rem; color: var(--ink-3); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTPRINT SVG — the progress glyph
   ══════════════════════════════════════════════════════════════════════════ */

.fp { width: 22px; height: 28px; }
.fp ellipse, .fp circle {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
/* States */
.fp.done ellipse, .fp.done circle {
  fill: var(--accent);
  stroke: var(--accent);
}
.fp.dim ellipse, .fp.dim circle {
  stroke: color-mix(in srgb, var(--line) 30%, transparent);
}
.fp.rest ellipse {
  fill: none;
  stroke: var(--warn);
  stroke-dasharray: 3 3;
}
.fp.rest circle { stroke: var(--warn); }

/* Trail row */
.trail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TASK ROW
   ══════════════════════════════════════════════════════════════════════════ */

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 2.5px solid var(--ink);
  border-radius: var(--wonky);
  background: var(--card2);
  box-shadow: var(--shadow-sm);
}
.task-row.done .task-label {
  color: var(--ink-soft);
}
.task-label { font-size: 16px; line-height: 1.15; }
.task-meta  { font-family: var(--note); font-size: 11px; color: var(--ink-soft); }

.break-btn {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 12px;
  padding: 5px 10px;
  border: 1.4px solid var(--accent);
  color: var(--accent-ink);
  border-radius: 14px;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
}

/* Subtask indent */
.subtask-list {
  margin: 2px 0 10px 22px;
  padding-left: 14px;
  border-left: 2px dotted color-mix(in srgb, var(--line) 40%, transparent);
}
.subtask-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  margin: 6px 0;
  border: 1.4px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 14px;
  background: var(--card);
  font-size: 14px;
}
.subtask-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP BAR — persistent focus + chat fab
   ══════════════════════════════════════════════════════════════════════════ */

.appbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.focus-chip .t-kicker { margin-bottom: 2px; }
.focus-chip .focus-text {
  font-family: var(--scrawl);
  font-weight: 700;
  font-size: clamp(22px, 6vw, 32px);
  line-height: .98;
}
.focus-chip .focus-text.empty {
  color: var(--ink-soft);
  font-size: clamp(18px, 5vw, 24px);
}
.chat-fab {
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border-radius: 50% 48% 52% 50% / 50% 52% 48% 50%;
  border: 1.8px solid var(--line);
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}
.chat-fab.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRAIL BAR — streak readout
   ══════════════════════════════════════════════════════════════════════════ */

.trail-bar {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--wonky);
  background: var(--card2);
}
.streak-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--note);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 8px;
}
.firmness-dial {
  display: inline-flex;
  border: 1.4px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.firmness-dial span {
  font-family: var(--hand);
  font-size: 10.5px;
  padding: 3px 9px;
  color: var(--ink-soft);
}
.firmness-dial span.active {
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT BUBBLES
   ══════════════════════════════════════════════════════════════════════════ */

.bubble {
  max-width: 82%;
  padding: 10px 13px;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.27;
  border: 2.5px solid var(--ink);
}
.bubble.from-foot {
  background: var(--card2);
  border-radius: 4px 18px 18px 18px;
}
.bubble.from-me {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  border-radius: 18px 18px 4px 18px;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════ */

.divider {
  border: none;
  border-top: 1.5px dashed color-mix(in srgb, var(--line) 40%, transparent);
  margin: 16px 0;
}
.section-label {
  font-family: var(--note);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .5px;
  margin: 18px 2px 4px;
}
.accent-block {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 10px 10px 0;
  font-family: var(--note);
  font-size: 13px;
  color: var(--ink-soft);
}

/* Striped placeholder — for images / scene art */
.ph {
  border: 1.5px dashed color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 12px;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 7px,
    color-mix(in srgb, var(--line) 7%, transparent) 7px 8px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--ink-soft);
  padding: 8px;
}

/* Canvas scene (weather / time-of-day background) */
.scene {
  position: relative;
  border: 1.6px solid var(--line);
  border-radius: var(--wonky2);
  background:
    repeating-linear-gradient(135deg, transparent 0 9px,
      color-mix(in srgb, var(--line) 8%, transparent) 9px 10px),
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 12%, var(--card)) 0%,
      var(--card) 100%);
  overflow: hidden;
}

/* marker-drawn filter utilities — pair with #drawn-* SVG filter defs in drawn_filters.php */
.drawn-subtle { filter: url(#drawn-subtle) }
.drawn-medium { filter: url(#drawn-medium) }
.drawn-bold   { filter: url(#drawn-bold) }

.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 480px) {
  .screen-center { padding: 0 20px; }
}

/* ── Jumbo button + choice stack ─────────────────────────
   Use when Big Foot presents a small set of big decisions.
   bf_btn('Yes', ['variant'=>'primary', 'size'=>'lg']) etc. */
.btn-lg {
  font-size: 1.08rem;
  padding: 12px 18px;
  min-height: 50px;
}
.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
/* Vertical centering wrapper for a "single decision" screen below the scene. */
.choice-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  min-height: calc(100dvh - 260px);
}

/* ── Flow nav: back/next bar pinned bottom of the choice-screen ──────
   JS controls visibility and labels per step via window.BFFlow. */
.flow-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgba(241,234,217,0));
  z-index: 10;
}
.flow-nav .btn { width: auto; flex: 1; min-height: 48px; font-size: 1rem; padding: 10px 16px; }
.flow-nav .flow-back  { flex: 0 0 32%; }
.flow-nav .flow-next  { flex: 1; }
.flow-nav.hidden,
.flow-nav [hidden] { display: none; }

/* ── Layout: scene 33% / panel 67% with internal scroll ────────────────
   The page itself never scrolls; long content scrolls inside the main
   panel. Bottom padding leaves room for the fixed flow-nav. */
html, body { height: 100dvh; overflow: hidden; }
body { display: flex; flex-direction: column; }
main.choice-screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* 32px top so the mascot's feet (which hang 24px into this panel) don't
     overlap content. 96px bottom keeps the fixed flow-nav from covering
     the last input. */
  padding: 32px 20px 96px;
}
/* Keyboard up — give focused inputs room to clear the fixed bottom nav. */
body.kb-up main.choice-screen { padding-bottom: 140px !important; }

/* ── Settings FAB: top-right, parked just below the status bar / notch.
   Tucked into the corner — small enough to disappear when ignored, big
   enough that the safe-area inset alone doesn't make it impossible to
   reach. */
.bf-fab-settings {
  position: fixed;
  right: 8px;
  top: calc(6px + env(safe-area-inset-top));
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, box-shadow .08s;
}
.bf-fab-settings:hover { background: var(--card2); }
.bf-fab-settings:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink) !important;
}
.bf-fab-settings svg { width: 20px; height: 20px; }

/* Default panel layout inside .choice-screen:
   - vertically and horizontally centered
   - generous padding so content never crowds the edges
   - hidden panels stay out of the layout (don't fight for height) */
.choice-screen .q-panel {
  min-height: 0 !important;
  width: 100%;
  max-width: 420px;
  padding: 4px 20px 20px;
  display: flex;
  flex-direction: column;
  /* Center content vertically WITHIN the panel — empty space splits
     evenly above and below the question + answers. */
  justify-content: center;
  gap: 14px;
  /* auto top + auto bottom = vertically centered within choice-screen
     too, so the question floats nicely in the middle of available space. */
  margin: auto 0;
  flex: 1 1 auto;
}
.choice-screen .q-panel.hidden { display: none; }

/* ── "Looking for Big Foot" connection fallback ─────────────────
   Full-screen scrim. Shows when an auth.* call can't reach the
   server. Lays footprints across the card while we retry. */
.bf-net-scrim {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(241, 234, 217, 0.92);  /* var(--paper) at ~92% */
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.bf-net-scrim.hidden { display: none; }
.bf-net-card {
  width: 100%;
  max-width: 380px;
  background: var(--card, #fbf8ef);
  border: 2.2px solid var(--line, #2f281f);
  border-radius: 18px 22px 17px 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
.bf-net-tracks {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  min-height: 36px;
}
.bf-net-tracks span {
  width: 22px; height: 30px;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  background: var(--accent-soft, #cfe6e1);
  border: 2px solid var(--accent-ink, #1d6b63);
  opacity: 0;
  animation: bf-net-step 1.6s ease-in-out infinite;
}
.bf-net-tracks span:nth-child(1) { animation-delay:    0ms; transform: translateY(0)    rotate(-6deg); }
.bf-net-tracks span:nth-child(2) { animation-delay:  200ms; transform: translateY(4px)  rotate( 4deg); }
.bf-net-tracks span:nth-child(3) { animation-delay:  400ms; transform: translateY(-2px) rotate(-3deg); }
.bf-net-tracks span:nth-child(4) { animation-delay:  600ms; transform: translateY(3px)  rotate( 5deg); }
@keyframes bf-net-step {
  0%, 100% { opacity: 0; }
  40%, 60% { opacity: 1; }
}
.bf-net-title {
  font-family: var(--scrawl, 'Caveat', cursive);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 4px;
  color: var(--ink, #2a241c);
}
.bf-net-sub {
  font-family: var(--note, 'Kalam', cursive);
  font-size: 1rem;
  color: var(--ink-soft, #6a5f51);
  margin: 0 0 18px;
}
.bf-net-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bf-net-actions.hidden { display: none; }

/* ── Welcome-page legal footer — required by App Review. Quiet but
   present, always reachable. */
.welcome-legal-footer {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgba(241,234,217,0));
  text-align: center;
  font-family: var(--note);
  font-size: .82rem;
  color: var(--ink-soft);
  z-index: 9;
  pointer-events: auto;
}
.welcome-legal-footer a {
  color: var(--accent-ink);
  text-decoration: underline;
}
.welcome-legal-sep {
  margin: 0 8px;
  opacity: .55;
}
/* Hide the legal footer once the flow-nav appears (in-flow steps), so
   the two don't stack on top of each other. */
.flow-nav:not([hidden]) ~ .welcome-legal-footer,
body:has(.flow-nav:not([hidden])) .welcome-legal-footer {
  display: none;
}

/* Settings-sheet legal links — quiet, bottom-anchored. App Review wants
   these reachable; the user doesn't care unless they need them. */
.bf-settings-row.bf-settings-legal {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--ink-soft);
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  font-family: var(--note);
  font-size: 0.85rem;
}
.bf-settings-row.bf-settings-legal a {
  color: var(--accent-ink);
  text-decoration: underline;
  white-space: nowrap;
}
.bf-settings-row.bf-settings-legal span {
  display: none;
}

/* Toggle rows in the settings sheet — label on the left, switch hard
   right. Uses flex with the switch shoved to the trailing edge. */
.bf-settings-toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  cursor: pointer;
  user-select: none;
}
.bf-settings-toggle-row > span:first-child {
  flex: 1 1 auto;
  text-align: left;
  font-family: var(--note);
  font-size: 1.02rem;
  color: var(--ink);
}
.bf-settings-toggle-row > .bfw-switch {
  flex: 0 0 auto;
  margin-left: auto;
}
.bf-haptics-intensity {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.bf-haptics-intensity .bf-intensity-opt {
  flex: 1 1 0;
  padding: 8px 6px;
  font-size: .85rem;
  font-family: var(--note);
  background: var(--card2);
  border: 1.8px solid var(--ink);
  border-radius: 10px 12px 11px 13px;
  color: var(--ink);
  cursor: pointer;
}
.bf-haptics-intensity .bf-intensity-opt.sel {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-ink);
}

/* Generic segmented control — connected pills that act as a single
   choice. Used by the haptics intensity, sounds on/off, autolock
   minutes. The first/last buttons get the outer border-radius; inner
   buttons share a 1px divider. */
.bf-segment {
  display: flex;
  border: 2px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card2);
  width: 100%;
  margin-top: 6px;
}
.bf-segment button {
  flex: 1 1 0;
  padding: 9px 6px;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--ink);
  font-size: 0.86rem;
  font-family: var(--note);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease, color .12s ease;
}
.bf-segment button:last-child { border-right: none; }
.bf-segment button.sel {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.bf-segment button:active {
  background: var(--accent-soft);
}

/* Disable text selection on draggable / tappable game elements — drag
   gestures shouldn't trigger the iOS magnifying glass or highlight a
   word. Inputs and the legal pages are exempt. */
.deck-card, .deck-card *, .deck-actions, .deck-edge,
.bfw-page, .bfw-page *, .bfw-chip,
.mascot-slot, .bf-bubble, .panel-scene *,
.bf-settings-sheet, .bf-settings-sheet *,
.bf-signout-confirm, .bf-signout-confirm *,
.flow-nav, .flow-nav * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* But never block selection in inputs or on legal pages. */
.field-input, textarea,
body[class*="legal-page"] * {
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-touch-callout: default !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GOAL DECK — the four-direction card UI.
   Edge labels are quiet, static, always visible (design bible). Tap the
   matching action button to act; swipe gestures land later.
   ═════════════════════════════════════════════════════════════════════════ */

#deck-mount { width: 100%; }

.deck-card-frame {
  position: relative;
  padding: 36px 18px 40px;
  margin: 8px auto;
  max-width: 360px;
}

/* Edge affordances — corner-anchored, no card decoration of their own.
   Big enough to read, small enough to never compete with the card. */
.deck-edge {
  position: absolute;
  display: flex;
  align-items: center;
  font-family: var(--note);
  font-size: 0.78rem;
  color: var(--ink-soft);
  opacity: 0.7;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}
.deck-edge span { line-height: 1; }
.deck-edge-up    { top: 0;    left: 50%; transform: translateX(-50%); gap: 6px; }
.deck-edge-down  { bottom: 0; left: 50%; transform: translateX(-50%); gap: 6px; }
.deck-edge-right {
  right: 0; top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
}
.deck-edge-left {
  left: 0; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
}

/* The card itself — paper card with marker outline + doubled stroke. */
.deck-card {
  background: var(--card);
  border: 2.6px solid var(--ink);
  border-radius: 18px 22px 17px 20px;
  padding: 22px 18px 18px;
  box-shadow:
    1.5px 2px 0 var(--ink),
    3px 5px 0 rgba(47, 40, 31, 0.18);
  text-align: center;
}
.deck-card-category {
  font-family: var(--scrawl);
  font-size: 0.95rem;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  margin-bottom: 6px;
}
.deck-card-text {
  font-family: var(--note);
  font-size: 1.18rem;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 22px;
}

/* Action buttons — laid out 2 cols x 2 rows to fit a phone width.
   Up + Right are primary intents (done / add); Down + Left are softer. */
.deck-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.deck-actions .deck-btn {
  min-height: 46px;
  font-size: 0.96rem;
  padding: 10px 8px;
  font-family: var(--note);
}
.deck-actions .deck-btn-right { grid-column: 1 / 2; }
.deck-actions .deck-btn-up    { grid-column: 2 / 3; }
.deck-actions .deck-btn-left  { grid-column: 1 / 2; }
.deck-actions .deck-btn-down  { grid-column: 2 / 3; }

.deck-empty {
  text-align: center;
  padding: 40px 20px;
}
.deck-empty .hand-heading-sm {
  margin-bottom: 8px;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRAIL — today's task list + footprint row.
   The footprint row sits at the top: one print per committed task,
   filled teal once completed. The task rows below are tap-to-done.
   ═══════════════════════════════════════════════════════════════════════════ */

.trail-mount {
  margin-top: 24px;
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.trail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.trail-print {
  width: 18px;
  height: 24px;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  border: 2px solid var(--accent-ink);
  background: transparent;
  transition: background-color .35s cubic-bezier(.2, .9, .3, 1.12),
              transform .35s cubic-bezier(.2, .9, .3, 1.12);
}
.trail-print.done {
  background: var(--accent);
  transform: scale(1.08) rotate(-3deg);
}

/* Stamp slam — fires on the print that just got completed. The print
   drops from above, slightly oversized, bounces once, and settles. */
.trail-print.just-stamped {
  animation: trail-stamp 520ms cubic-bezier(.2, .9, .3, 1.12) both;
}
@keyframes trail-stamp {
  0%   { transform: translateY(-30px) scale(1.6) rotate(-12deg); opacity: 0; }
  40%  { transform: translateY(2px)   scale(1.45) rotate(-5deg); opacity: 1; }
  65%  { transform: translateY(-2px)  scale(1.0)  rotate(-2deg); }
  100% { transform: scale(1.08) rotate(-3deg); opacity: 1; }
}
/* Optional dust puff on a sibling pseudo-element. */
.trail-print.just-stamped::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -4px;
  width: 28px; height: 6px;
  border-radius: 50%;
  background: rgba(47, 40, 31, 0.18);
  transform: translateX(-50%) scaleX(0);
  animation: trail-stamp-dust 520ms ease-out both;
}
@keyframes trail-stamp-dust {
  0%, 30% { transform: translateX(-50%) scaleX(0); opacity: 0; }
  40%     { transform: translateX(-50%) scaleX(1); opacity: 0.65; }
  100%    { transform: translateX(-50%) scaleX(1.4); opacity: 0; }
}
.trail-print { position: relative; }

/* ── Count-tiered stamp animations ──────────────────────────────────
   One distinct landing per footprint count, 1..10. They escalate from a
   soft settle (1) to a thundering multi-bounce slam (10). The end state
   of every tier matches .done (scale 1.08 / rotate -3deg) so the print
   rests identically once the animation finishes. data-stamp-count is set
   by deck.js on the print that just landed; >4 also shakes the whole row
   (the "stampede"). */
.trail-print.just-stamped[data-stamp-count="1"]  { animation: ts1  460ms cubic-bezier(.2,.9,.3,1.10) both; }
.trail-print.just-stamped[data-stamp-count="2"]  { animation: ts2  500ms cubic-bezier(.2,.9,.3,1.12) both; }
.trail-print.just-stamped[data-stamp-count="3"]  { animation: ts3  540ms cubic-bezier(.2,.9,.3,1.14) both; }
.trail-print.just-stamped[data-stamp-count="4"]  { animation: ts4  560ms cubic-bezier(.2,.9,.3,1.16) both; }
.trail-print.just-stamped[data-stamp-count="5"]  { animation: ts5  600ms cubic-bezier(.18,.9,.3,1.18) both; }
.trail-print.just-stamped[data-stamp-count="6"]  { animation: ts6  640ms cubic-bezier(.18,.9,.3,1.20) both; }
.trail-print.just-stamped[data-stamp-count="7"]  { animation: ts7  680ms cubic-bezier(.16,.9,.3,1.22) both; }
.trail-print.just-stamped[data-stamp-count="8"]  { animation: ts8  720ms cubic-bezier(.16,.9,.3,1.24) both; }
.trail-print.just-stamped[data-stamp-count="9"]  { animation: ts9  760ms cubic-bezier(.14,.9,.3,1.26) both; }
.trail-print.just-stamped[data-stamp-count="10"] { animation: ts10 820ms cubic-bezier(.12,.9,.3,1.30) both; }

/* 1 — soft settle, no overshoot */
@keyframes ts1 {
  0%   { transform: translateY(-16px) scale(1.2); opacity: 0; }
  60%  { transform: translateY(0) scale(1.05); opacity: 1; }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 2 — drop + single small bounce */
@keyframes ts2 {
  0%   { transform: translateY(-22px) scale(1.3) rotate(-6deg); opacity: 0; }
  55%  { transform: translateY(2px) scale(1.12) rotate(-2deg); opacity: 1; }
  78%  { transform: translateY(-2px) scale(1.0) rotate(-3deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 3 — higher drop + bounce + lean */
@keyframes ts3 {
  0%   { transform: translateY(-30px) scale(1.45) rotate(-10deg); opacity: 0; }
  45%  { transform: translateY(3px) scale(1.2) rotate(-4deg); opacity: 1; }
  70%  { transform: translateY(-3px) scale(.98) rotate(-2deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 4 — drop + double bounce */
@keyframes ts4 {
  0%   { transform: translateY(-34px) scale(1.5) rotate(8deg); opacity: 0; }
  40%  { transform: translateY(4px) scale(1.24) rotate(3deg); opacity: 1; }
  60%  { transform: translateY(-4px) scale(1.0) rotate(-2deg); }
  80%  { transform: translateY(2px) scale(1.05) rotate(-3deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 5 — slam + wobble (stampede begins) */
@keyframes ts5 {
  0%   { transform: translateY(-40px) scale(1.6) rotate(-12deg); opacity: 0; }
  38%  { transform: translateY(5px) scale(1.3) rotate(5deg); opacity: 1; }
  56%  { transform: translateY(-4px) scale(.96) rotate(-5deg); }
  74%  { transform: translateY(2px) scale(1.06) rotate(2deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 6 — heavier slam + shake */
@keyframes ts6 {
  0%   { transform: translateY(-44px) scale(1.65) rotate(10deg); opacity: 0; }
  36%  { transform: translateY(6px) scale(1.34) rotate(-6deg); opacity: 1; }
  52%  { transform: translateX(-3px) scale(.95) rotate(4deg); }
  66%  { transform: translateX(3px) scale(1.05) rotate(-4deg); }
  80%  { transform: translateX(-1px) scale(1.02); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 7 — slam + two bounces + wobble */
@keyframes ts7 {
  0%   { transform: translateY(-48px) scale(1.7) rotate(-14deg); opacity: 0; }
  34%  { transform: translateY(7px) scale(1.38) rotate(6deg); opacity: 1; }
  50%  { transform: translateY(-6px) scale(.94) rotate(-6deg); }
  64%  { transform: translateY(4px) scale(1.08) rotate(3deg); }
  82%  { transform: translateY(-2px) scale(1.0) rotate(-2deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 8 — big slam + recoil + shake */
@keyframes ts8 {
  0%   { transform: translateY(-54px) scale(1.8) rotate(12deg); opacity: 0; }
  32%  { transform: translateY(8px) scale(1.44) rotate(-7deg); opacity: 1; }
  46%  { transform: translate(-4px,-6px) scale(.92) rotate(6deg); }
  60%  { transform: translate(4px,4px) scale(1.1) rotate(-5deg); }
  76%  { transform: translateX(-2px) scale(1.0) rotate(2deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 9 — huge slam + heavy shake */
@keyframes ts9 {
  0%   { transform: translateY(-60px) scale(1.9) rotate(-16deg); opacity: 0; }
  30%  { transform: translateY(9px) scale(1.5) rotate(8deg); opacity: 1; }
  44%  { transform: translate(-5px,-7px) scale(.9) rotate(-8deg); }
  58%  { transform: translate(5px,5px) scale(1.14) rotate(6deg); }
  72%  { transform: translate(-3px,-2px) scale(.98) rotate(-3deg); }
  86%  { transform: translateX(2px) scale(1.04); }
  100% { transform: scale(1.08) rotate(-3deg); }
}
/* 10 — the whole herd: massive slam, overshoot, multi-bounce */
@keyframes ts10 {
  0%   { transform: translateY(-68px) scale(2.05) rotate(16deg); opacity: 0; }
  28%  { transform: translateY(11px) scale(1.58) rotate(-9deg); opacity: 1; }
  42%  { transform: translate(-6px,-9px) scale(.88) rotate(9deg); }
  56%  { transform: translate(6px,6px) scale(1.2) rotate(-7deg); }
  70%  { transform: translate(-4px,-3px) scale(.96) rotate(5deg); }
  84%  { transform: translate(3px,2px) scale(1.06) rotate(-3deg); }
  100% { transform: scale(1.08) rotate(-3deg); }
}

/* Stampede — for counts >4 the whole footprint row rumbles as the print
   lands, like a herd thundering across the trail. */
.trail-row.stampede { animation: trail-stampede 620ms ease-out both; }
@keyframes trail-stampede {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-3px); }
  30% { transform: translateX(3px); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  80% { transform: translateX(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .trail-print.just-stamped,
  .trail-print.just-stamped[data-stamp-count] { animation: none; }
  .trail-print.just-stamped::after { display: none; }
  .trail-row.stampede { animation: none; }
}

.trail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trail-task {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 2.2px solid var(--ink);
  border-radius: 14px 18px 15px 17px;
  font-family: var(--note);
  font-size: 1.02rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 1px 1.5px 0 var(--ink);
  transition: background-color .1s ease, color .1s ease, box-shadow .1s ease;
}
.trail-task-check {
  flex: 0 0 auto;
  font-size: 1.2rem;
  color: var(--accent-ink);
  font-weight: 700;
  width: 1.1em;
  text-align: center;
}
.trail-task-text {
  flex: 1 1 auto;
}
.trail-task.done {
  background: var(--accent-soft);
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: var(--ink-soft);
}
.trail-task.done .trail-task-check {
  color: var(--accent);
}

/* Task row + sparkle. Sparkle floats to the right of the task button. */
.trail-task-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.trail-task-row .trail-task { flex: 1 1 auto; }
.trail-task-bid {
  flex: 0 0 auto;
  width: 44px;
  border: 2px dashed var(--accent-ink);
  background: var(--card);
  border-radius: 12px 14px 11px 13px;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--accent-ink);
  padding: 0;
  transition: background-color .12s ease, transform .12s ease;
}
.trail-task-bid:hover  { background: var(--accent-soft); }
.trail-task-bid:active { transform: scale(0.95); }
.trail-task-bid:disabled { opacity: 0.5; cursor: default; }

/* Custom task add row — single line input + plus button. */
.trail-task-add {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.trail-task-add-input {
  flex: 1 1 auto;
  font-size: 1rem !important;
  padding: 12px 14px !important;
}
.trail-task-add-btn {
  flex: 0 0 auto;
  width: 44px;
  border: 2.5px solid var(--ink);
  background: var(--accent);
  color: #fff;
  border-radius: 14px 18px 13px 17px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 1px 1.5px 0 var(--ink);
}
.trail-task-add-btn:active {
  transform: translateY(1px);
  box-shadow: 0.5px 0.5px 0 var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOCK SCREEN — fullscreen overlay when auto-lock fires.
   ═══════════════════════════════════════════════════════════════════════════ */
#bf-lockscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
#bf-lockscreen .bf-lock-inner {
  text-align: center;
  max-width: 320px;
  color: var(--ink);
}
#bf-lockscreen svg {
  display: block;
  margin: 0 auto 16px;
  color: var(--accent-ink);
}
#bf-lockscreen .bf-lock-title {
  font-family: var(--scrawl);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}
#bf-lockscreen .bf-lock-sub {
  font-family: var(--note);
  color: var(--ink-soft);
  margin-bottom: 22px;
}
#bf-lockscreen .bf-lock-unlock {
  width: 100%;
}
#bf-lockscreen .bf-lock-err {
  margin-top: 14px;
  color: var(--warn);
  font-size: 0.92rem;
  font-family: var(--note);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KNOT runner — the unified flow engine's visual contract.
   These are first-class app components (the knot system is half the app),
   not a wizard-specific override.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Page panel — keep last input clear of the bottom nav bar. */
.bfw-page {
  padding-bottom: 110px !important;
}

.bfw-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* ── Chips — single & multi share the same look ───────────────────────
   The :hover scope is "not selected" so the green sticks the instant you
   tap (on desktop the hover state was masking the click). A persistent
   left "check column" is reserved at all times so adding a ✓ on select
   never shifts the text. */
.bfw-chip {
  position: relative;
  text-align: center;
  padding: 10px 20px;
  min-height: 0;
  font-size: 1.02rem;
  border: 2.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  /* Doubled-stroke marker effect: a second darker line offset by
     (1px, 1.5px) reads as "marker passed twice, slightly off."
     Plus a soft drop so the chip sits on the paper, not floating. */
  box-shadow:
    1px 1.5px 0 var(--ink),
    2px 3px 0 rgba(47, 40, 31, 0.18);
  /* Each chip gets its own variant from the JS seed (see wizard.js).
     CSS vars: --bfw-rot, --bfw-rot-rest, --bfw-scale, --bfw-r-tl, --bfw-r-tr, --bfw-r-br, --bfw-r-bl. */
  border-radius:
    var(--bfw-r-tl, 14px)
    var(--bfw-r-tr, 18px)
    var(--bfw-r-br, 15px)
    var(--bfw-r-bl, 17px);
  transform: rotate(var(--bfw-rot-rest, 0deg)) scale(var(--bfw-scale, 1));
  transition:
    background-color .08s ease,
    color .08s ease,
    border-color .08s ease,
    box-shadow .12s ease,
    transform .12s ease;
}
.bfw-chip:active {
  /* Press-into-paper: the doubled stroke collapses to a single line and
     the chip dips. Reads physical, not digital. */
  box-shadow: 0.5px 0.5px 0 var(--ink);
  transform: rotate(var(--bfw-rot-rest, 0deg)) scale(calc(var(--bfw-scale, 1) * 0.97)) translateY(1px);
}
/* Selection indicator removed — background change alone is enough,
   the ✓ shifted text and added visual noise (testing feedback). */
.bfw-chip::before { content: none !important; }
.bfw-chip::after  { content: none !important; }

@media (hover: hover) {
  .bfw-chip:not(.sel):hover {
    background: var(--card2);
    border-color: var(--accent-ink);
  }
}

.bfw-chip.sel,
.bfw-chip.sel:hover,
.bfw-chip.sel:active,
.bfw-chip.sel:focus,
.bfw-chip.sel:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-ink);
}

/* ── Real toggle switch — pill track + sliding knob.
   Paper-and-marker version of the iOS switch — not "Liquid Glass". */
.bfw-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 14px;
  border: 2.4px solid var(--ink);
  border-radius: 16px 20px 17px 19px;
  background: var(--card);
}
.bfw-toggle-label {
  font-family: var(--note);
  font-size: 1.05rem;
  color: var(--ink);
  flex: 1 1 auto;
}
.bfw-switch {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card2);
  cursor: pointer;
  padding: 0;
  transition: background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.bfw-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.12), background-color .18s ease;
}
.bfw-switch[aria-pressed="true"]            { background: var(--accent); }
.bfw-switch[aria-pressed="true"]::before    { transform: translateX(24px); background: #fff; }
.bfw-switch:focus-visible {
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}
/* Disabled switch — grayed out, no interaction. */
.bfw-toggle-row.is-disabled { opacity: 0.5; }
.bfw-switch:disabled { cursor: not-allowed; }
/* Optional sub-label note (e.g. "coming soon") under the toggle label. */
.bfw-toggle-text { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; }
.bfw-toggle-note {
  font-family: var(--note);
  font-size: 0.82rem;
  opacity: 0.7;
}

/* Scale — 5 footprint pips, tap to set. */
.bfw-scale {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px auto;
}
.bfw-scale-step {
  width: 38px;
  height: 44px;
  border: 2.5px solid var(--accent-ink);
  background: transparent;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  cursor: pointer;
  padding: 0;
  transition: background-color .14s ease, transform .14s ease;
}
.bfw-scale-step.sel {
  background: var(--accent);
  transform: scale(1.05) rotate(-3deg);
}

/* Slider — marker line + thumb, label above shows current value. */
.bfw-slider-wrap {
  width: 100%;
  max-width: 380px;
  margin: 12px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bfw-slider-label {
  text-align: center;
  font-family: var(--scrawl);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.bfw-slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--ink);
  outline: none;
}
.bfw-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 1px 1.5px 0 var(--ink);
  cursor: pointer;
}
.bfw-slider-input::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--ink);
  cursor: pointer;
}

/* ── Info screen */
.bfw-info { padding: 20px 0; }
.bfw-info p {
  font-family: var(--note);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ink);
}

/* Single-choice chips → full-width stacked buttons (the yes/no kind).
   Multi-choice chips → pills that wrap 2-3 per row. Distinct shapes so
   the user reads "pick one" vs "pick any" at a glance. */
.bfw-chips {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
.bfw-chips .bfw-chip {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1rem;
  min-height: 52px;
}

.bfw-chips-multi {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.bfw-chips-multi .bfw-chip {
  flex: 0 1 auto;
  width: auto !important;
  max-width: none !important;
  padding: 8px 16px;
  font-size: 0.98rem;
}
.bfw-chips-multi .bfw-chip {
  flex: 0 1 auto;
  padding: 8px 16px 8px 16px;
  min-height: 40px;
  font-size: 1rem;
  border-radius: 22px 26px 24px 20px;
}
/* In pill mode the ✓ slot is right-side and small (we have the bg
   change to signal selected, so a check is supportive not required). */
.bfw-chips-multi .bfw-chip {
  padding-left: 16px;
  padding-right: 16px;
}
.bfw-chips-multi .bfw-chip::before { content: none; }
.bfw-chips-multi .bfw-chip.sel::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-left: 8px;
  vertical-align: 2px;
}

/* ── Progress dots — one per page, current is filled, done are filled
   teal, upcoming are hollow ink. Sits above the question content. */
/* Progress dots — absolute-positioned so they sit at the top of the
   panel without pushing content. The q-panel itself centers naturally;
   dots float on top. */
.bfw-page { position: relative; }
.bfw-progress {
  position: relative;     /* in flow now — top of the panel without absolute offset */
  margin: 0 auto 8px;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.bfw-progress .bfw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  transition: background-color .2s ease;
}
.bfw-progress .bfw-dot-done   { background: var(--accent); border-color: var(--accent-ink); }
.bfw-progress .bfw-dot-active { background: var(--ink); }

/* ── Text field — with enter-hint affordance on the right.
   The ↵ glyph hints "hit enter to continue" without taking up label
   space. Pure CSS so it tags along with any text field in a knot. */
.bfw-field {
  position: relative;
}
.bfw-field .field-input {
  font-size: 1.1rem;
  padding: 14px 44px 14px 16px;   /* extra right padding for the hint */
}
.bfw-field::after {
  content: '↵';
  position: absolute;
  right: 14px;
  /* Bias toward the input row, not the label above. */
  bottom: 14px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--ink-soft);
  opacity: .55;
  pointer-events: none;
  transition: opacity .15s ease, color .15s ease;
}
.bfw-field:focus-within::after {
  opacity: 1;
  color: var(--accent-ink);
}

/* ── Multi-question pages: each question sits in its own .bfw-q box so
   show_if can hide one without disturbing siblings. Stacked with a gap. */
.bfw-questions { display: flex; flex-direction: column; gap: 16px; }
.bfw-q { width: 100%; }
.bfw-hidden { display: none !important; }
/* Required-but-empty highlight — a soft marker tint on the offending box. */
.bfw-missing .field-input,
.bfw-missing .bfw-chips,
.bfw-missing .bfw-chips-multi { border-radius: 14px 16px 13px 15px; }
.bfw-missing .field-input { border-color: var(--accent-ink); }

/* ── Number field — the ↵ hint glyph would collide with the native
   spinner, so suppress it; otherwise mirrors the text field. */
.bfw-number-field::after { content: none; }
.bfw-number {
  font-size: 1.1rem;
  text-align: center;
  max-width: 160px;
  margin: 0 auto;
}

/* ── allow_other "something else" — a reveal box under the chips.
   Hidden until its chip is tapped; marker-on-paper input. */
.bfw-other {
  display: none;
  width: 100%;
  max-width: 380px;
  margin: 6px auto 0;
}
.bfw-other.show { display: block; }
.bfw-other-input {
  font-size: 1.05rem;
  padding: 12px 16px;
}
.bfw-chips .bfw-other-chip { margin-top: 4px; }

/* ─────────────────────────────────────────────────────────────────────
   KNOT — page transitions + element stagger
   Sketchbook feel: leave-then-enter (never crossfade), with a slight
   rotation that signals direction. Elements stagger in one-by-one with
   a tiny overshoot, settling into a resting tilt derived from a stable
   per-element seed (see button randomness, wizard.js variantsFor()).
   ───────────────────────────────────────────────────────────────────── */
.bfw-page {
  /* Default = the resting visual. Animations override via class flags. */
  transform-origin: center;
  will-change: opacity, transform;
}
.bfw-page.bfw-leave {
  animation: bfw-page-leave 260ms cubic-bezier(.45, 0, .55, 0) both;
  pointer-events: none;
}
.bfw-page.bfw-enter {
  animation: bfw-page-enter 380ms cubic-bezier(.2, .9, .3, 1.12) both;
}
/* Back-press inverts the rotation direction so direction reads
   intuitively without thinking. */
.bfw-page.bfw-leave.bfw-back  { animation-name: bfw-page-leave-back;  }
.bfw-page.bfw-enter.bfw-back  { animation-name: bfw-page-enter-back;  }

@keyframes bfw-page-leave {
  to { opacity: 0; transform: translateX(-14px) rotate(-0.4deg); }
}
@keyframes bfw-page-leave-back {
  to { opacity: 0; transform: translateX(14px)  rotate( 0.4deg); }
}
@keyframes bfw-page-enter {
  from { opacity: 0; transform: scale(.94) rotate(.6deg)  translateX(14px);  }
  60%  { opacity: 1; transform: scale(1.02) rotate(0.18deg) translateX(0);    }
  to   { opacity: 1; transform: scale(1)    rotate(0deg)   translateX(0);    }
}
@keyframes bfw-page-enter-back {
  from { opacity: 0; transform: scale(.94) rotate(-0.6deg) translateX(-14px); }
  60%  { opacity: 1; transform: scale(1.02) rotate(-0.18deg) translateX(0);   }
  to   { opacity: 1; transform: scale(1)    rotate(0deg)   translateX(0);    }
}

/* Element stagger — every direct child of .bfw-questions and .choice-stack
   gets its own pop. `--bfw-i` is set inline by the engine (0..N). Cap
   the practical delay at the 8th so 20-option lists don't take 1 second. */
.bfw-page.bfw-enter .bfw-questions > *,
.bfw-page.bfw-enter .choice-stack    > * {
  animation: bfw-button-pop 180ms cubic-bezier(.2, .9, .3, 1.1) both;
  animation-delay: calc(min(var(--bfw-i, 0), 8) * 48ms + 80ms);
  /* The page-enter is the parent context; staggered children begin 80ms
     in so they pop as the panel finishes settling. */
}
@keyframes bfw-button-pop {
  0%   { opacity: 0;  transform: translateY(8px) rotate(var(--bfw-rot, 0deg))      scale(calc(var(--bfw-scale, 1) * 0.93)); }
  75%  { opacity: 1;  transform: translateY(0)   rotate(var(--bfw-rot-rest, 0deg)) scale(calc(var(--bfw-scale, 1) * 1.02)); }
  100% { opacity: 1;  transform: translateY(0)   rotate(var(--bfw-rot-rest, 0deg)) scale(var(--bfw-scale, 1));              }
}

/* Page "drawn-on" reveal — the card edge sweeps in from upper-left like
   a pencil. clip-path is GPU-cheap and respects rounded corners. */
.bfw-page.bfw-enter::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, transparent 40%, var(--card2) 50%, transparent 60%);
  opacity: 0;
  animation: bfw-page-pencil 220ms cubic-bezier(.3, .7, .4, 1) both;
}
@keyframes bfw-page-pencil {
  0%   { opacity: .35; transform: translateX(-30%) translateY(-10%); }
  100% { opacity: 0;   transform: translateX(30%)  translateY(10%);  }
}

/* Reduced motion: collapse everything to a quick fade + 0 stagger. */
@media (prefers-reduced-motion: reduce) {
  .bfw-page.bfw-leave { animation: none; opacity: 0; }
  .bfw-page.bfw-enter { animation: bfw-page-enter-rm 100ms ease both; }
  .bfw-page.bfw-enter .bfw-questions > *,
  .bfw-page.bfw-enter .choice-stack    > * {
    animation: bfw-button-pop-rm 100ms ease both;
    animation-delay: 0ms !important;
  }
  .bfw-page.bfw-enter::before { display: none; }
  @keyframes bfw-page-enter-rm  { from { opacity: 0; } to { opacity: 1; } }
  @keyframes bfw-button-pop-rm  { from { opacity: 0; } to { opacity: 1; } }
}
.reduced-motion .bfw-page.bfw-leave,
.reduced-motion .bfw-page.bfw-enter,
.reduced-motion .bfw-page.bfw-enter .bfw-questions > *,
.reduced-motion .bfw-page.bfw-enter .choice-stack    > * {
  animation: none !important;
}

/* ── "Ask me later" — third slot in the bottom nav, only when the
   current knot is skippable_to_inbox. Visually distinct from back: a
   marker-underlined affordance, not a button shape. */
.flow-nav .flow-later {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-family: var(--note);
  font-size: .95rem;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--ink-soft);
  text-underline-offset: 4px;
  padding: 10px 8px;
  min-height: 48px;
  cursor: pointer;
}
.flow-nav .flow-later:hover { color: var(--ink); }

/* ═════════════════════════════════════════════════════════════════════════
   GOAL DECK — SWIPE LAYER
   Drag transforms, stamp pseudo-content, edge highlight pulse. The base
   GOAL DECK block above stays intact; these rules only kick in during a
   pointer drag (.deck-dragging) or via the inline transforms JS writes.
   ═════════════════════════════════════════════════════════════════════════ */

/* Card is the gesture target — block native panning so iOS doesn't yank
   the body scroll mid-drag. The card itself owns its transform; we don't
   want CSS transitions during a live drag (JS sets transition:none then),
   so the default here is the "released" state. */
.deck-card {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
  will-change: transform;
  transform-origin: center center;
}
.deck-card.deck-dragging { cursor: grabbing; }

/* While the user is actively dragging, fade the tap buttons so the
   gesture feels like the primary affordance. Keyboard users (focus-visible)
   never see this state — the deck-dragging class only appears on real
   pointer drags. */
.deck-card.deck-dragging .deck-actions {
  opacity: 0.18;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.deck-card .deck-actions {
  transition: opacity 180ms ease;
}

/* Edge labels react to the drag — the pulse var is set 0..1 from JS as
   the user approaches that direction's commit threshold. */
.deck-edge {
  transition: opacity 120ms ease;
}
.deck-edge-up,
.deck-edge-down {
  transform: translateX(-50%) scale(calc(1 + var(--deck-edge-pulse, 0) * 0.18));
  opacity: calc(0.7 + var(--deck-edge-pulse, 0) * 0.30);
  color: color-mix(in srgb, var(--ink-soft) calc(100% - var(--deck-edge-pulse, 0) * 100%), var(--accent-ink) calc(var(--deck-edge-pulse, 0) * 100%));
}
.deck-edge-right {
  transform: translateY(-50%) rotate(90deg) scale(calc(1 + var(--deck-edge-pulse, 0) * 0.18));
  opacity: calc(0.7 + var(--deck-edge-pulse, 0) * 0.30);
  color: color-mix(in srgb, var(--ink-soft) calc(100% - var(--deck-edge-pulse, 0) * 100%), var(--accent-ink) calc(var(--deck-edge-pulse, 0) * 100%));
}
.deck-edge-left {
  transform: translateY(-50%) rotate(-90deg) scale(calc(1 + var(--deck-edge-pulse, 0) * 0.18));
  opacity: calc(0.7 + var(--deck-edge-pulse, 0) * 0.30);
  color: color-mix(in srgb, var(--ink-soft) calc(100% - var(--deck-edge-pulse, 0) * 100%), var(--accent-ink) calc(var(--deck-edge-pulse, 0) * 100%));
}

/* The stamp — center-anchored overlay that says DONE / ADDED / NOT TODAY /
   ANOTHER. Wonky border + marker double-stroke, opacity controlled by JS,
   tinted by the swipe direction so the user previews the action's flavor.
   Pure pseudo-element-style div; no SVG / filter:url(). */
.deck-card { position: relative; }
.deck-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg) scale(0.7);
  padding: 10px 22px;
  font-family: var(--scrawl, var(--note));
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.55);
  border: 3px solid var(--ink);
  border-radius: var(--wonky2);
  /* Doubled-stroke marker effect — same vocabulary as deck-card itself. */
  box-shadow:
    1.5px 2px 0 var(--ink),
    3px 5px 0 rgba(47, 40, 31, 0.18);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  white-space: nowrap;
  text-align: center;
}
/* Direction-specific tinting — each action has its own visual flavor so
   the user knows what they're about to commit to without reading. */
.deck-stamp[data-dir="up"] {
  color: var(--accent-ink, #1f6a3d);
  border-color: var(--accent-ink, #1f6a3d);
}
.deck-stamp[data-dir="right"] {
  color: var(--accent-ink, #1f6a3d);
  border-color: var(--accent-ink, #1f6a3d);
  background: rgba(220, 240, 222, 0.6);
}
.deck-stamp[data-dir="left"] {
  color: #8a3a2a;
  border-color: #8a3a2a;
  background: rgba(245, 228, 218, 0.6);
}
.deck-stamp[data-dir="down"] {
  color: var(--ink-soft, #555);
  border-color: var(--ink-soft, #555);
}

@media (prefers-reduced-motion: reduce) {
  .deck-edge,
  .deck-card .deck-actions {
    transition: none;
  }
  .deck-stamp { transition: opacity 80ms linear; }
}

/* ── Auth sign-in knot layout ──────────────────────────────────────────── */
.bfw-auth-method,
.bfw-auth-check-email,
.bfw-auth-merge {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* Apple/Google 50/50 row */
.bfw-auth-social-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.bfw-auth-apple,
.bfw-auth-google {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 120ms;
}
.bfw-auth-apple {
  background: var(--ink);
  color: var(--paper);
}
.bfw-auth-apple:active  { opacity: 0.82; }
.bfw-auth-google {
  background: var(--paper);
  color: var(--ink);
}
.bfw-auth-google:active { opacity: 0.82; }

/* send button — matches btn-primary btn-lg */
.bfw-auth-send {
  width: 100%;
}

/* Check-email panel */
.bfw-auth-sent-label {
  font-size: 1.05rem;
  text-align: center;
  margin: 0;
}
.bfw-auth-sent-label strong {
  display: block;
  font-weight: 700;
  word-break: break-all;
}
.bfw-auth-timer {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 0;
}

/* Merge prompt */
.bfw-auth-merge-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}
.bfw-auth-merge-body {
  text-align: center;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0;
}
.bfw-auth-merge-go   { width: 100%; }
.bfw-auth-merge-back {
  width: 100%;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* Loading / error shared across auth pages */
.bfw-auth-loading { justify-content: center; }
.bfw-auth-error   { text-align: center; }

/* ── Paint hold: kill transitions/animations until the page has settled.
   Set by the inline head script on first load and removed after window
   load + 2 rAF. Without this the panel-scene JS swaps phase/weather
   classes after the initial paint and every CSS transition fires, giving
   the load-time triple flash. */
html.bf-paint-hold,
html.bf-paint-hold *,
html.bf-paint-hold *::before,
html.bf-paint-hold *::after {
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* ── auth-pick button overrides ──────────────────────────────────────────
   The three sign-in buttons carry `.btn` for the shared marker styling, but
   the .btn defaults clash on a few specifics; these targeted overrides put
   them right without touching anything else. */

/* Apple/Google share the email button's wonky radius so the three read as
   one set. .btn is 26/22/24/22 — match that here too. */
.bfw-auth-apple,
.bfw-auth-google {
  border-radius: 26px 22px 24px 22px / 22px 24px 22px 26px;
  border-width: 3px;
  min-height: 56px;
}

/* The plain .btn:hover swaps background to var(--card2), which on the
   Apple button (ink/black) reads as "the black just vanished". Lock each
   provider button's hover to its own colors. */
.bfw-auth-apple:hover:not(:disabled)  { background: var(--ink);   color: var(--paper); }
.bfw-auth-google:hover:not(:disabled) { background: var(--paper); color: var(--ink); }

/* The #roughen filter on the colored Google G and the Apple glyph
   shimmers them; strip the filter on the provider buttons only. The email
   button keeps its marker edge. */
.bfw-auth-apple,
.bfw-auth-google { filter: none; }

/* When the "one moment" loading row toggles in, the column grows and the
   vertically-centered panel pushes everything up. Reserve its space from
   first render — hidden hides only ink, not layout. */
.bfw-auth-method .bfw-auth-loading.hidden,
.bfw-auth-email-input .bfw-auth-loading.hidden {
  display: flex !important;
  visibility: hidden;
}
