/* ============================================================
   BrainBite Field Guide
   Layer 1: BrainBite design tokens (verbatim from the system)
   Layer 2: BrainBite component primitives (.bb-*), used as-is
   Layer 3: Field Guide domain components, composed from 1 and 2
   No new colour architecture, type scale, radius set or shadow set.
   ============================================================ */

/* ---------- LAYER 1 · TOKENS ---------- */
@font-face {
  font-family: "OpenDyslexic";
  src: url("https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
:root {
  /* core brand shades */
  --pr10: #8b57a2;
  --sc-teal10: #47bac0;
  --sc-pink10: #f17eb2;
  --sc-yellow10: #f1e150;
  --purple: #704682;
  --purple-strong: #52315a;
  --purple-hover: #7e488f;
  --teal: #1b767f;
  --teal-hover: #185e63;
  --teal-strong: #004043;
  --pink: #c61857;
  --pink-strong: #820f39;
  --yellow: #f1e150;
  --yellow-ink: #7a5a00;

  --nr01: #ffffff; --nr02: #fafafa; --nr03: #f1f1f1; --nr04: #e8e8e8;
  --nr06: #d5d5d5; --nr08: #a8a8a8; --nr10: #787878; --nr12: #575757;
  --nr13: #454545; --nr15: #161616;

  --error: #dd3412; --error-strong: #bc280f; --success: #188834;
  --warning: #c64e0c; --warning-alt: #d35e0d; --info: #1744c1;

  --text-strong: #161616;
  --text-weak: #454545;
  --text-weaker: #5c5c5c;
  --text-disabled: #787878;
  --text-on-color: #ffffff;
  --text-primary: #8c57a2;
  --text-primary-selected: #704682;
  --text-secondary: #c61857;
  --text-teal: #1b767f;
  --text-error: #bc280f;
  --text-warning: #d35e0d;
  --text-success: #188834;
  --text-info: #1744c1;

  --bg-base: #ffffff;
  --bg-weaker: #fafafa;
  --bg-weak: #e8e8e8;
  --bg-placeholder: #fafafa;
  --bg-disabled: #f1f1f1;
  --surface-card: #ffffff;
  --surface-muted: #fafafa;

  --bg-primary: #8b57a2;
  --bg-primary-strong: #704682;
  --bg-primary-weak: #e8dded;
  --bg-primary-weaker: #f9f6fa;
  --bg-secondary: #c61857;
  --bg-secondary-weak: #fce5f0;
  --bg-teal: #1b767f;
  --bg-teal-weak: #cdf2f4;
  --bg-yellow: #f1e150;
  --bg-yellow-weak: #fbf6c9;
  --bg-error: #dd3412; --bg-error-weak: #fef6f5;
  --bg-success: #188834; --bg-success-weak: #f1fdf6;
  --bg-warning: #c64e0c; --bg-warning-weak: #fff9f3;
  --bg-info: #1744c1; --bg-info-weak: #f2f5fd;

  --border: #e6e1ea;
  --border-strong: #d5d5d5;
  --stroke-primary: #8b57a2;
  --stroke-primary-weak: #d9c7e2;
  --stroke-teal: #1b767f;
  --stroke-error: #dd3412;
  --stroke-success: #188834;
  --stroke-disabled: #e8e8e8;

  --icon-strong: #161616;
  --icon-weak: #5c5c5c;
  --icon-primary: #8b57a2;
  --icon-teal: #1b767f;
  --icon-disabled: #a8a8a8;
  --ring: #8b57a2;

  /* type */
  --font-display: "Baloo 2", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --tracking-display: -0.30px;
  --tracking-heading: -0.20px;

  --text-display-large: 36px;  --lh-display-large: 42px;
  --text-display-small: 26px;  --lh-display-small: 32px;
  --text-display-tiny: 24px;   --lh-display-tiny: 30px;
  --text-h1: 24px; --lh-h1: 30px;
  --text-h2: 20px; --lh-h2: 28px;
  --text-h3: 18px; --lh-h3: 26px;
  --text-h4: 16px; --lh-h4: 24px;
  --text-h5: 14px; --lh-h5: 20px;
  --text-body-default: 16px; --lh-body-default: 22px;
  --text-body-small: 14px;   --lh-body-small: 20px;
  --text-body-tiny: 12px;    --lh-body-tiny: 18px;
  --text-paragraph-small: 14px; --lh-paragraph-small: 24px;
  --text-caption-small: 12px;   --lh-caption-small: 16px;

  /* radius, space, shadow, motion */
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --radius-xl: 14px; --radius-2xl: 18px; --radius-3xl: 24px;
  --radius-pill: 999px;
  --radius-button: 12px; --radius-card: 12px; --radius-modal: 24px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;
  --tap-min: 44px;

  --shadow-xs: 0 1px 2px rgba(22, 22, 22, 0.06);
  --shadow-sm: 0 1px 3px rgba(22, 22, 22, 0.08), 0 1px 2px rgba(22, 22, 22, 0.04);
  --shadow-md: 0 4px 12px rgba(22, 22, 22, 0.08);
  --shadow-lg: 0 12px 28px rgba(22, 22, 22, 0.12);
  --shadow-xl: 0 24px 48px rgba(22, 22, 22, 0.16);
  --shadow-primary: 0 10px 24px rgba(112, 70, 130, 0.22);

  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms; --dur: 200ms; --dur-slow: 350ms;

  /* Field Guide aliases mapped to the shared Math / English course palette. */
  --stage-max: 1120px;
  --guide-paper: var(--bg-base);
  --journal-ground: var(--bg-primary-weaker);
  --journal-line: var(--border);
  --field-action: var(--bg-primary);
  --field-action-hover: var(--purple-hover);
  --field-action-edge: var(--purple-strong);
  --field-context: var(--bg-teal);
  --field-context-hover: var(--teal-hover);
  --field-context-edge: var(--teal-strong);
  --paper-shadow: var(--shadow-md);

  /* artwork plates (illustrations are dark-ink, so plates stay light in both themes) */
  --art-plate-teal: var(--bg-teal-weak);
  --art-plate-yellow: var(--bg-yellow-weak);
  --art-plate-purple: var(--bg-primary-weak);
  --art-plate-pink: var(--bg-secondary-weak);
  --art-plate-success: var(--bg-success-weak);

  /* Cards tinted by what they hold (home's books, places, the guide). Light,
     they are the art plates; dark, deep tints that keep white text readable.
     Anything drawn on a light art plate uses the fixed plate inks. */
  --card-teal: var(--art-plate-teal);
  --card-purple: var(--art-plate-purple);
  --card-yellow: var(--art-plate-yellow);
  --plate-ink: #1b767f;
  --plate-ink-purple: #704682;
  --plate-muted: #e9e4ed;
  --text-yellow: #7a5a00;
  --logo: #8b57a2;
  --text-danger: #bc280f;
  --stroke-danger: #dd3412;
  color-scheme: light;
}

/* BrainBite dark theme values, wired to the three viewer states */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text-strong: #ffffff;
    --text-weak: #cbc3d1;
    --text-weaker: #a99fb1;
    --text-disabled: #7c7285;
    --text-primary: #c9a6db;
    --text-primary-selected: #d9bde8;
    --text-secondary: #f18db4;
    --text-teal: #7fcdd4;
    --text-success: #6fd68d;
    --text-warning: #f0a86a;
    --text-error: #ff9a86;
    --bg-base: #1c1120;
    --bg-weaker: #241528;
    --bg-weak: #3b2b42;
    --bg-disabled: #3b2b42;
    --surface-card: #271830;
    --surface-muted: #2c1c31;
    --bg-primary-weak: #45264d;
    --bg-primary-weaker: #241528;
    --bg-teal-weak: #14383c;
    --bg-yellow-weak: #3d3410;
    --bg-secondary-weak: #45182c;
    --bg-success-weak: #16321f;
    --bg-warning-weak: #3a2313;
    --bg-error-weak: #3d1c16;
    --bg-info-weak: #1a2344;
    --border: #3a2b42;
    --border-strong: #4a3a52;
    --ring: #b98fce;
    --icon-strong: #ffffff;
    --icon-weak: #a99fb1;
    --guide-paper: var(--bg-base);
    --journal-ground: var(--bg-primary-weaker);
    --journal-line: var(--border);
    --art-plate-teal: #dcefef;
    --art-plate-yellow: #ece0c0;
    --art-plate-purple: #ebdff4;
    --art-plate-pink: #f8e1e9;
    --art-plate-success: #dcefe1;
    --bg-placeholder: #241528;
    --stroke-primary-weak: #5a3d66;
    --stroke-disabled: #3a2b42;
    --text-info: #93a9f0;
    --icon-primary: #c9a6db;
    --icon-teal: #7fcdd4;
    --icon-disabled: #7c7285;
    --text-yellow: #ecd27a;
    --text-danger: #ff9a86;
    --stroke-danger: #ff9a86;
    --stroke-primary: #a877bf;
    --stroke-teal: #4fa9b0;
    --card-teal: #14383c;
    --card-purple: #3a2143;
    --card-yellow: #3d3410;
    --logo: #c9a6db;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text-strong: #ffffff;
  --text-weak: #cbc3d1;
  --text-weaker: #a99fb1;
  --text-disabled: #7c7285;
  --text-primary: #c9a6db;
  --text-primary-selected: #d9bde8;
  --text-secondary: #f18db4;
  --text-teal: #7fcdd4;
  --text-success: #6fd68d;
  --text-warning: #f0a86a;
  --text-error: #ff9a86;
  --bg-base: #1c1120;
  --bg-weaker: #241528;
  --bg-weak: #3b2b42;
  --bg-disabled: #3b2b42;
  --surface-card: #271830;
  --surface-muted: #2c1c31;
  --bg-primary-weak: #45264d;
  --bg-primary-weaker: #241528;
  --bg-teal-weak: #14383c;
  --bg-yellow-weak: #3d3410;
  --bg-secondary-weak: #45182c;
  --bg-success-weak: #16321f;
  --bg-warning-weak: #3a2313;
  --bg-error-weak: #3d1c16;
  --bg-info-weak: #1a2344;
  --border: #3a2b42;
  --border-strong: #4a3a52;
  --ring: #b98fce;
  --icon-strong: #ffffff;
  --icon-weak: #a99fb1;
  --guide-paper: var(--bg-base);
  --journal-ground: var(--bg-primary-weaker);
  --journal-line: var(--border);
  --art-plate-teal: #dcefef;
  --art-plate-yellow: #ece0c0;
  --art-plate-purple: #ebdff4;
  --art-plate-pink: #f8e1e9;
  --art-plate-success: #dcefe1;
  --bg-placeholder: #241528;
  --stroke-primary-weak: #5a3d66;
  --stroke-disabled: #3a2b42;
  --text-info: #93a9f0;
  --icon-primary: #c9a6db;
  --icon-teal: #7fcdd4;
  --icon-disabled: #7c7285;
  --text-yellow: #ecd27a;
  --text-danger: #ff9a86;
  --stroke-danger: #ff9a86;
  --stroke-primary: #a877bf;
  --stroke-teal: #4fa9b0;
  --card-teal: #14383c;
  --card-purple: #3a2143;
  --card-yellow: #3d3410;
  --logo: #c9a6db;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-strong);
  background: var(--bg-primary-weaker);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-heading);
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
button { font: inherit; }
/* inline interface icons carry no class; artwork does (.sp, .marie, .thumb) */
svg:not([class]) { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.18em; }
.species-image { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
[hidden] { display: none !important; }

.bb-display-small { font-family: var(--font-display); font-weight: 800; font-size: var(--text-display-small); line-height: var(--lh-display-small); letter-spacing: var(--tracking-display); }
.bb-display-tiny  { font-family: var(--font-display); font-weight: 800; font-size: var(--text-display-tiny); line-height: var(--lh-display-tiny); letter-spacing: var(--tracking-display); }
.bb-h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-h1); line-height: var(--lh-h1); letter-spacing: var(--tracking-heading); }
.bb-h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-h2); line-height: var(--lh-h2); letter-spacing: var(--tracking-heading); }
.bb-h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--tracking-heading); }
.bb-h4 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-h4); line-height: var(--lh-h4); letter-spacing: var(--tracking-heading); }
.bb-body       { font-family: var(--font-sans); font-weight: 400; font-size: var(--text-body-default); line-height: var(--lh-body-default); }
.bb-body-small { font-family: var(--font-sans); font-weight: 400; font-size: var(--text-body-small); line-height: var(--lh-body-small); }
.bb-body-small-strong { font-family: var(--font-sans); font-weight: 600; font-size: var(--text-body-small); line-height: var(--lh-body-small); }
.bb-body-tiny  { font-family: var(--font-sans); font-weight: 400; font-size: var(--text-body-tiny); line-height: var(--lh-body-tiny); }
.bb-paragraph-small { font-family: var(--font-sans); font-weight: 400; font-size: var(--text-paragraph-small); line-height: var(--lh-paragraph-small); }
.bb-caption-small { font-family: var(--font-sans); font-weight: 600; font-size: var(--text-caption-small); line-height: var(--lh-caption-small); }
.bb-eyebrow { font-family: var(--font-sans); font-weight: 700; font-size: 12px; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-weaker); }

/* ---------- LAYER 2 · BrainBite primitives ---------- */
.bb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: 700; white-space: nowrap;
  border: 2px solid transparent; border-radius: var(--radius-button);
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color var(--dur) var(--ease-standard), border-color var(--dur) var(--ease-standard),
              color var(--dur) var(--ease-standard), transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur) var(--ease-standard);
}
.bb-btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.bb-btn:active { transform: translateY(1px); }
.bb-btn:disabled, .bb-btn[aria-disabled="true"] { pointer-events: none; opacity: .5; }
.bb-btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.bb-btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.bb-btn--md { min-height: 44px; padding: 10px 16px; font-size: 16px; }
.bb-btn--lg { min-height: 52px; padding: 14px 24px; font-size: 18px; }
.bb-btn--pill { border-radius: var(--radius-pill); }
.bb-btn--icon { padding: 0; width: 44px; min-height: 44px; }
.bb-btn--block { width: 100%; }
.bb-btn--primary { background: var(--bg-primary); color: var(--text-on-color); }
.bb-btn--primary:hover { background: var(--purple-hover); }
.bb-btn--primary:active { background: var(--purple-strong); }
.bb-btn--secondary { background: var(--bg-base); color: var(--text-primary-selected); border-color: var(--stroke-primary); }
.bb-btn--secondary:hover { background: var(--bg-primary-weak); }
.bb-btn--tertiary { background: var(--teal); color: var(--text-on-color); }
.bb-btn--tertiary:hover { background: var(--teal-hover); }
.bb-btn--neutral { background: var(--bg-disabled); color: var(--text-strong); }
.bb-btn--neutral:hover { background: var(--bg-weak); }
.bb-btn--ghost { background: transparent; color: var(--text-primary-selected); }
.bb-btn--ghost:hover { background: var(--bg-primary-weak); }

.bb-card {
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm); overflow: hidden; color: var(--text-strong);
  display: flex; flex-direction: column;
}
.bb-card--interactive { cursor: pointer; transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur) var(--ease-standard); }
.bb-card--interactive:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.bb-card--interactive:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.bb-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }

.bb-badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-sans);
  font-weight: 700; font-size: 12px; line-height: 1; padding: 5px 10px;
  border-radius: 999px; border: 1px solid transparent;
}
.bb-badge svg { width: 13px; height: 13px; }
.bb-badge--primary { background: var(--bg-primary-weak); color: var(--text-primary-selected); }
.bb-badge--teal { background: var(--bg-teal-weak); color: var(--text-teal); }
.bb-badge--yellow { background: var(--bg-yellow-weak); color: var(--text-yellow); }
.bb-badge--neutral { background: var(--bg-weak); color: var(--text-weak); }
.bb-badge--success { background: var(--bg-success-weak); color: var(--text-success); }
.bb-badge--warning { background: var(--bg-warning-weak); color: var(--text-warning); }

.bb-tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans);
  font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--bg-base); color: var(--text-strong);
  cursor: pointer; transition: background-color var(--dur), border-color var(--dur), color var(--dur);
}
.bb-tag:hover { border-color: var(--stroke-primary); background: var(--bg-primary-weaker); }
.bb-tag[data-selected="true"] { background: var(--bg-primary); border-color: var(--bg-primary); color: var(--text-on-color); }
.bb-tag:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.bb-avatar { display: inline-grid; place-items: center; border-radius: 999px; overflow: hidden; background: var(--bg-primary-weak); flex-shrink: 0; }
.bb-avatar--md { width: 44px; height: 44px; }
.bb-avatar--lg { width: 64px; height: 64px; }

.bb-progress__track { height: 12px; border-radius: 999px; background: var(--bg-weak); overflow: hidden; }
.bb-progress__fill { display: block; height: 100%; border-radius: 999px; background: var(--bg-success); transition: width var(--dur-slow) var(--ease-standard); }

.bb-modal__overlay {
  position: fixed; inset: 0; background: color-mix(in oklab, var(--nr15) 58%, transparent);
  display: grid; place-items: center; padding: 16px; z-index: 100;
  animation: bb-fade var(--dur) var(--ease-standard);
}
.bb-modal {
  position: relative; background: var(--bg-base); border-radius: var(--radius-modal);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 460px; max-height: 88vh;
  overflow: auto; padding: 24px; animation: bb-pop var(--dur-slow) var(--ease-spring);
}
.bb-modal__title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-h1); line-height: 1.15; letter-spacing: var(--tracking-heading); margin-bottom: 6px; }
.bb-modal__body { font-family: var(--font-sans); font-size: 15px; line-height: 1.6; color: var(--text-weak); }
.bb-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.bb-modal__actions .bb-btn { flex: 1 1 auto; }
@keyframes bb-fade { from { opacity: 0; } }
@keyframes bb-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }

.bb-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-xl); border: 1px solid transparent; }
.bb-alert__icon { flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center; }
.bb-alert__icon svg { width: 20px; height: 20px; }
.bb-alert__title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.bb-alert__msg { display: block; font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--text-weak); }
.bb-alert--success { background: var(--bg-success-weak); border-color: color-mix(in oklab, var(--success) 26%, transparent); color: var(--text-success); }
.bb-alert--warning { background: var(--bg-warning-weak); border-color: color-mix(in oklab, var(--warning) 26%, transparent); color: var(--text-warning); }
.bb-alert--info { background: var(--bg-info-weak); border-color: color-mix(in oklab, var(--info) 22%, transparent); color: var(--text-info); }

.bb-bubble-row { display: flex; gap: 10px; align-items: flex-end; }
.bb-bubble { padding: 11px 14px; border-radius: 18px; font-family: var(--font-sans); font-size: 15px; line-height: 1.5; }
.bb-bubble__speaker { display: block; font-family: var(--font-display); font-weight: 700; font-size: 12px; margin-bottom: 2px; opacity: .85; }
.bb-bubble--mentor { background: var(--bg-primary-weak); color: var(--text-strong); border-bottom-left-radius: 6px; }
.bb-bubble--user { background: var(--bg-primary); color: var(--text-on-color); border-bottom-right-radius: 6px; }

.bb-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.bb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.bb-switch__track { width: 46px; height: 28px; border-radius: 999px; background: var(--bg-weak); position: relative; transition: background-color var(--dur) var(--ease-standard); flex-shrink: 0; }
.bb-switch__thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-spring); }
.bb-switch input:checked + .bb-switch__track { background: var(--bg-primary); }
.bb-switch input:checked + .bb-switch__track .bb-switch__thumb { transform: translateX(18px); }
.bb-switch input:focus-visible + .bb-switch__track { outline: 3px solid var(--ring); outline-offset: 2px; }

.bb-field { display: flex; flex-direction: column; gap: 6px; }
.bb-field__label { font-family: var(--font-sans); font-weight: 600; font-size: 14px; color: var(--text-strong); }
.bb-field__hint { font-family: var(--font-sans); font-size: 12px; line-height: 16px; color: var(--text-weaker); }
.bb-input {
  font-family: var(--font-sans); font-size: 15px; color: var(--text-strong);
  min-height: 44px; width: 100%; padding: 10px 14px;
  background: var(--bg-placeholder); border: 2px solid var(--border); border-radius: var(--radius-xl);
  outline: none; transition: border-color var(--dur), box-shadow var(--dur);
}
.bb-input::placeholder { color: var(--text-weaker); }
.bb-input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 28%, transparent); }

.bb-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-disabled); border-radius: 999px; }
.bb-tab { font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 7px 14px; min-height: 40px; border-radius: 999px; border: none; background: transparent; color: var(--text-weak); cursor: pointer; }
.bb-tab[data-selected="true"] { background: var(--bg-base); color: var(--text-primary-selected); box-shadow: var(--shadow-sm); }
.bb-tab:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ---------- LAYER 3 · Field Guide ---------- */

.stage {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--guide-paper);
  position: relative;
  overflow: hidden;
}
@media (min-width: 1180px) {
  body { padding: 0; }
  .stage { min-height: 100dvh; border-radius: 0; box-shadow: none; border: 0; }
}

/* header */
.topbar {
  display: block;
  padding: 0; min-height: 60px;
  background: var(--bg-base); border-bottom: 1px solid var(--border);
  position: relative; z-index: 20; flex-shrink: 0;
}
.topbar__inner { width: min(100%, 1280px); min-height: inherit; margin-inline: auto; padding: 10px clamp(16px, 3vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.topbar__identity, .topbar__actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-home { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 0; background: transparent; color: var(--text-strong); cursor: pointer; }
.brand-home__mark { width: 36px; height: 36px; display: block; flex: 0 0 36px; color: var(--logo); transition: transform var(--dur) var(--ease-standard); }
.brand-home__mark .bb-logo { display: block; width: 100%; height: 100%; }
.brand-home:hover .brand-home__mark { transform: rotate(-6deg); }
.brand-home > span:last-child, .nav-brand b { font: 800 20px/1 var(--font-display); }
.brand-home:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: var(--radius-button); }
.nav-cta { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; border: 0; border-radius: var(--radius-pill); background: var(--bg-primary); color: var(--text-on-color); font: 700 15px/1 var(--font-display); box-shadow: var(--shadow-md); cursor: pointer; }
.nav-cta:hover { background: var(--purple-hover); }
.nav-cta:focus-visible, .nav-menu:focus-visible, .nav-close:focus-visible, .nav-quiet:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.nav-menu-wrap { position: relative; width: 48px; height: 48px; flex: 0 0 48px; }
.nav-menu-shadow { position: absolute; inset: 0; transform: translate(4px, 4px); border-radius: var(--radius-button); background: var(--bg-teal); transition: transform var(--dur); }
.nav-menu-wrap:hover .nav-menu-shadow { transform: translate(6px, 6px); }
.nav-menu { position: relative; width: 44px; height: 44px; border: 2px solid var(--purple-strong); border-radius: var(--radius-button); background: var(--bg-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.nav-menu i { display: block; width: 24px; height: 5px; border-radius: var(--radius-pill); background: var(--text-on-color); }
.overlay-open { overflow: hidden; }
.nav-drawer, .a11y-overlay { position: fixed; inset: 0; z-index: 200; }
.nav-drawer__scrim, .a11y-overlay__scrim { position: absolute; inset: 0; width: 100%; border: 0; background: color-mix(in oklab, var(--text-strong) 32%, transparent); backdrop-filter: blur(4px); cursor: default; }
.nav-drawer__layers { position: absolute; inset-block: 0; right: 0; width: min(100%, 466px); pointer-events: none; }
.nav-drawer__layers i { position: absolute; inset: 0; transform: scaleX(0); transform-origin: right; animation: nav-layer 650ms var(--ease-standard) forwards; }
.nav-drawer__layers i:nth-child(1) { background: var(--bg-primary); }
.nav-drawer__layers i:nth-child(2) { background: var(--bg-secondary); animation-delay: 60ms; }
.nav-drawer__layers i:nth-child(3) { background: var(--bg-teal); animation-delay: 120ms; }
@keyframes nav-layer { to { transform: scaleX(1); } }
.nav-panel { position: absolute; inset-block: 0; right: 0; width: min(100%, 448px); background: var(--bg-base); color: var(--text-strong); display: flex; flex-direction: column; box-shadow: var(--shadow-xl); opacity: 0; animation: nav-panel-in 260ms var(--ease-standard) 260ms forwards; }
@keyframes nav-panel-in { to { opacity: 1; } }
.nav-panel__head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-button); background: var(--surface-card); color: var(--icon-strong); cursor: pointer; }
.nav-close svg { width: 20px; height: 20px; }
.nav-panel__body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 24px; }
.nav-panel__body ul { list-style: none; padding: 4px 0 0; margin: 0; }
.nav-panel__body li { border-bottom: 1px solid var(--border); overflow: hidden; }
.nav-panel__body li button { position: relative; width: 100%; min-height: 58px; padding: 10px 12px 10px 16px; border: 0; background: transparent; color: var(--text-strong); text-align: left; font: 800 28px/1.15 var(--font-display); cursor: pointer; transform: translateY(100%); opacity: 0; animation: nav-item-in 520ms var(--ease-standard) calc(480ms + var(--nav-i) * 55ms) forwards; }
@keyframes nav-item-in { to { transform: translateY(0); opacity: 1; } }
.nav-panel__body li button::before { content: ""; position: absolute; left: 0; top: 50%; width: 4px; height: 28px; border-radius: var(--radius-pill); background: var(--bg-secondary); transform: translateY(-50%); opacity: 0; }
.nav-panel__body li button:hover, .nav-panel__body li button[aria-current="page"] { color: var(--text-secondary); }
.nav-panel__body li button[aria-current="page"]::before { opacity: 1; }
.nav-panel__body li button:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
.nav-panel__cta { margin-top: 24px; }
.nav-panel__foot { display: flex; flex-direction: column; gap: 10px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface-muted); }
.nav-language { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text-weaker); font-size: 13px; font-weight: 600; }
.nav-language__choices { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-base); }
.nav-language__choices button { min-width: 48px; min-height: 36px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-weaker); font-weight: 700; cursor: pointer; }
.nav-language__choices button[aria-checked="true"] { background: var(--bg-primary); color: var(--text-on-color); }
.nav-language__choices button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.nav-quiet { min-height: 44px; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--text-weaker); font-size: 13px; font-weight: 600; cursor: pointer; }
.nav-quiet:hover { color: var(--text-secondary); }

/* shared accessibility dialog */
.a11y-overlay { display: flex; align-items: center; justify-content: center; padding: 16px; }
.a11y-panel { position: relative; width: min(100%, 420px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-modal); background: var(--bg-base); color: var(--text-strong); box-shadow: var(--shadow-xl); animation: bb-pop var(--dur-slow) var(--ease-spring); }
.a11y-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.a11y-head h2 { font-size: var(--text-h2); }
.a11y-head p { margin-top: 2px; color: var(--text-weaker); font-size: 14px; line-height: 20px; }
.a11y-preview { margin-top: 16px; padding: 12px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card); background: var(--bg-placeholder); }
.a11y-preview b { display: block; margin-bottom: 3px; color: var(--text-weaker); font-size: 12px; text-transform: uppercase; }
.a11y-preview p { font-size: 15px; line-height: 1.5; }
.a11y-field { margin: 20px 0 0; padding: 0; border: 0; }
.a11y-field legend, .a11y-size > b { font-size: 14px; font-weight: 600; }
.a11y-theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.a11y-theme button, .a11y-size button, .a11y-reset { min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-disabled); color: var(--text-weak); font-weight: 600; cursor: pointer; }
.a11y-theme button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; font-size: 12px; }
.a11y-theme button[aria-pressed="true"] { border-color: var(--stroke-primary); background: var(--bg-primary); color: var(--text-on-color); }
.a11y-theme button:focus-visible, .a11y-size button:focus-visible, .a11y-switch:focus-visible, .a11y-reset:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.a11y-size { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a11y-size > div { display: flex; align-items: center; gap: 10px; }
.a11y-size button { width: 44px; display: grid; place-items: center; }
.a11y-size output { width: 54px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.a11y-toggles { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.a11y-row { display: flex; align-items: center; gap: 12px; }
.a11y-row__icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: var(--radius-card); background: var(--bg-primary-weaker); color: var(--icon-primary); }
.a11y-row__icon svg { width: 18px; height: 18px; }
.a11y-row__copy { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.a11y-row__copy b { font-size: 14px; }
.a11y-row__copy small { flex-basis: 100%; color: var(--text-weaker); font-size: 12px; line-height: 17px; }
.a11y-tag { padding: 2px 7px; border: 1px solid var(--bg-secondary); border-radius: var(--radius-pill); color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.a11y-switch { position: relative; width: 48px; height: 44px; flex: 0 0 48px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.a11y-switch::before { content: ""; position: absolute; left: 2px; top: 9px; width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--bg-disabled); transition: background-color var(--dur); }
.a11y-switch i { position: absolute; top: 11px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-base); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-spring); }
.a11y-switch[aria-checked="true"]::before { background: var(--bg-primary); }
.a11y-switch[aria-checked="true"] i { transform: translateX(18px); }
.a11y-reset { width: 100%; margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; }

html.a11y-high-contrast { --text-strong: #000; --text-weak: #000; --text-weaker: #000; --bg-base: #fff; --bg-weaker: #fff; --surface-card: #fff; --surface-muted: #fff; --border: #000; --border-strong: #000; --ring: #000; --bg-primary: #000; --text-on-color: #fff; --journal-line: #000; }
html.a11y-high-contrast[data-theme="dark"] { --text-strong: #fff; --text-weak: #fff; --text-weaker: #fff; --bg-base: #000; --bg-weaker: #000; --surface-card: #000; --surface-muted: #000; --border: #fff; --border-strong: #fff; --ring: #fff; --bg-primary: #fff; --text-on-color: #000; --journal-line: #fff; }
html.a11y-high-contrast *, html.a11y-high-contrast *::before, html.a11y-high-contrast *::after { text-shadow: none !important; box-shadow: none !important; }
html.a11y-reduce-motion *, html.a11y-reduce-motion *::before, html.a11y-reduce-motion *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
html.a11y-wide-spacing { letter-spacing: .08em; word-spacing: .16em; line-height: 1.7; }
html.a11y-dyslexia-font, html.a11y-dyslexia-font * { font-family: "OpenDyslexic", "Comic Sans MS", sans-serif !important; }
html.a11y-reading-ruler p:hover, html.a11y-reading-ruler li:hover, html.a11y-reading-ruler h1:hover, html.a11y-reading-ruler h2:hover, html.a11y-reading-ruler h3:hover, html.a11y-reading-ruler h4:hover, html.a11y-reading-ruler p:focus-visible, html.a11y-reading-ruler li:focus-visible { background-color: var(--bg-yellow-weak); border-radius: 4px; box-shadow: 0 0 0 4px var(--bg-yellow-weak); }
html.a11y-read-aloud p, html.a11y-read-aloud h1, html.a11y-read-aloud h2, html.a11y-read-aloud h3, html.a11y-read-aloud h4, html.a11y-read-aloud li { cursor: help; }
.topbar__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.topbar__title h1 { font-size: var(--text-h3); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title .sub { color: var(--text-weaker); font-size: 12px; line-height: 14px; }
.iconbtn {
  width: var(--tap-min); height: var(--tap-min); min-width: var(--tap-min);
  display: grid; place-items: center; border-radius: var(--radius-button);
  border: 2px solid transparent; background: var(--bg-disabled); color: var(--icon-strong);
  cursor: pointer; transition: background-color var(--dur);
}
.iconbtn:hover { background: var(--bg-weak); }
.iconbtn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.iconbtn svg { width: 20px; height: 20px; }

.tally {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-primary-weak); color: var(--text-primary-selected);
  border-radius: var(--radius-pill); padding: 6px 12px 6px 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tally svg { width: 17px; height: 17px; }
.tally .of { font-weight: 600; opacity: .75; font-size: 13px; }

.langswap { display: inline-flex; background: var(--bg-disabled); border-radius: var(--radius-pill); padding: 3px; }
.langswap button {
  border: none; background: transparent; cursor: pointer; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .04em;
  padding: 6px 9px; color: var(--text-weak); min-height: 32px;
}
.langswap button[aria-pressed="true"] { background: var(--bg-base); color: var(--text-primary-selected); box-shadow: var(--shadow-xs); }
.langswap button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

/* screens */
.screen { flex: 1; min-height: 0; display: none; flex-direction: column; }
.screen[data-active="true"] { display: flex; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: var(--space-5) var(--space-4) var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
@media (min-width: 720px) { .pad { padding: var(--space-6) var(--space-6) var(--space-10); } }

/* ---- shelf ---- */
.shelf-hero {
  display: grid; gap: var(--space-4);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 640px) { .shelf-hero { grid-template-columns: minmax(0, 1fr) 230px; } }

.book {
  position: relative; width: 100%; max-width: 260px; margin: 0 auto;
  aspect-ratio: 4 / 5; border-radius: 6px 16px 16px 6px;
  background: linear-gradient(105deg, var(--purple-strong) 0 16px, var(--bg-primary) 16px 100%);
  box-shadow: var(--shadow-lg); color: var(--text-on-color);
  padding: var(--space-5) var(--space-4) var(--space-4) var(--space-6);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.book::after {
  content: ""; position: absolute; inset: 10px 10px 10px 22px;
  border: 2px solid rgba(255, 255, 255, .28); border-radius: 4px 10px 10px 4px; pointer-events: none;
}
.book__title { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.1; letter-spacing: var(--tracking-display); }
.book__owner { font-size: 12px; opacity: .85; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.book__stack { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-end; }
.book__leaf { width: 13px; height: 17px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.book__leaf[data-on="true"] { background: var(--sc-yellow10); }
.book__spines { position: absolute; left: 0; top: 0; bottom: 0; width: 16px; display: flex; flex-direction: column; }
.book__spines i { flex: 1; border-bottom: 1px solid rgba(255, 255, 255, .12); }

.countline { display: flex; flex-direction: column; gap: var(--space-2); }
.countline__n { font-family: var(--font-display); font-weight: 800; font-size: var(--text-display-large); line-height: 1; letter-spacing: var(--tracking-display); color: var(--text-primary-selected); font-variant-numeric: tabular-nums; }

.marie-row { display: flex; gap: var(--space-3); align-items: flex-end; }
.marie-row .bb-avatar { background: var(--bg-primary-weak); }
svg.marie { width: 100%; height: 100%; display: block; }
.marie-eye { transform-origin: center; }
.blinking .marie-eye { animation: blink 6s var(--ease-standard) infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }

.doors { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.door {
  display: flex; align-items: center; gap: var(--space-3); text-align: left;
  padding: var(--space-3) var(--space-4); min-height: 66px;
  color: var(--text-strong);
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur), border-color var(--dur);
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--stroke-primary-weak); }
.door:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.door__ico { width: 40px; height: 40px; border-radius: var(--radius-lg); display: grid; place-items: center; flex-shrink: 0; background: var(--bg-primary-weak); color: var(--text-primary-selected); }
.door__ico svg { width: 21px; height: 21px; }
.door__ico[data-tone="teal"] { background: var(--bg-teal-weak); color: var(--text-teal); }
.door__ico[data-tone="yellow"] { background: var(--bg-yellow-weak); color: var(--yellow-ink); }
.door__t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.door__t b { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.door__t span { font-size: 12px; color: var(--text-weaker); line-height: 15px; }

/* ---- map ---- */
.places { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.place {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-card);
  overflow: hidden; background: var(--bg-base); box-shadow: var(--shadow-sm);
  cursor: pointer; text-align: left; padding: 0; color: var(--text-strong);
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur);
}
.place:hover { transform: translateY(-4px); box-shadow: var(--shadow-primary); }
.place:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.place__art { display: block; height: 118px; position: relative; overflow: hidden; }
.place__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.place__body { padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: 7px; }
.place__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.place__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pips { display: flex; gap: 3px; }
.pip { width: 10px; height: 10px; border-radius: 3px; background: var(--bg-weak); }
.pip[data-on="true"] { background: var(--bg-success); }
.tool--primary { background: var(--bg-primary); color: var(--text-on-color); margin-left: auto; }
.tool--primary:hover { background: var(--purple-hover); }

/* ---- guide grid ---- */
.grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); } }

.gcard {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0;
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden; color: var(--text-strong);
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur), border-color var(--dur);
}
.gcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gcard:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.gcard__art {
  aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 12px;
  background: var(--bg-primary-weaker); position: relative;
}
.gcard[data-found="true"] .gcard__art { background: var(--art-plate-success); }
.gcard__art .sp { width: 100%; height: 100%; }
.gcard[data-found="false"] .gcard__art svg.sp { color: color-mix(in oklab, var(--text-primary-selected) 46%, transparent); }
.gcard__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.gcard__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.2; }
.gcard__flag {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700;
  background: var(--bg-weak); color: var(--text-weak);
}
.gcard__flag svg { width: 12px; height: 12px; }
.gcard__flag[data-kind="found"] { background: var(--bg-success); color: var(--text-on-color); }
.gcard__flag[data-kind="amber"] { background: var(--bg-warning-weak); color: var(--text-warning); }
.gcard__count { position: absolute; bottom: 8px; left: 8px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; color: var(--text-weak); }

.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

/* ---- detail ---- */
.detail-art {
  aspect-ratio: 16 / 11; border-radius: var(--radius-2xl); display: grid; place-items: center;
  padding: var(--space-5); background: var(--bg-primary-weaker); border: 1px solid var(--border); position: relative;
}
.detail-art[data-found="true"] { background: var(--art-plate-success); }
.detail-art .sp { width: 100%; height: 100%; max-height: 240px; }
.detail-art[data-found="false"] svg.sp { color: color-mix(in oklab, var(--text-primary-selected) 46%, transparent); }
.factlist { display: flex; flex-direction: column; gap: var(--space-3); }
.factrow { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.factrow:first-child { border-top: none; padding-top: 0; }
.factrow__ico { width: 34px; height: 34px; border-radius: var(--radius-lg); display: grid; place-items: center; flex-shrink: 0; background: var(--bg-primary-weak); color: var(--text-primary-selected); }
.factrow__ico svg { width: 18px; height: 18px; }
.factrow__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.factrow__t b { font-family: var(--font-sans); font-weight: 600; font-size: 13px; color: var(--text-weaker); }

.myfinds { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.myfind {
  border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
  background: var(--bg-success-weak); display: flex; flex-direction: column;
}
.myfind__art { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 10px; }
.myfind__art .sp { width: 100%; height: 100%; }
.myfind__cap { padding: 8px 10px; background: var(--bg-base); border-top: 1px solid var(--border); }

/* ---- observation flow ---- */
.observe-art {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-2xl); overflow: hidden;
  border: 3px solid var(--bg-primary); background: var(--bg-primary-weaker);
  display: grid; place-items: center; padding: var(--space-4);
}
.observe-art .sp { width: 78%; height: 78%; }
.observe-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, transparent 46%, rgba(28, 17, 32, .3) 100%);
}
.observe-art .corner { position: absolute; width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, .85); }
.observe-art .corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.observe-art .corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.observe-art .corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.observe-art .corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.answers { display: grid; gap: var(--space-2); }
.answer {
  display: flex; align-items: center; gap: var(--space-3); text-align: left;
  min-height: 54px; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl); border: 2px solid var(--border); background: var(--bg-base);
  color: var(--text-strong); cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 16px;
  transition: border-color var(--dur), background-color var(--dur), transform var(--dur-fast);
}
.answer:hover { border-color: var(--stroke-primary); background: var(--bg-primary-weaker); }
.answer:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.answer[data-picked="true"] { border-color: var(--bg-primary); background: var(--bg-primary-weak); }
.answer__k { width: 30px; height: 30px; border-radius: 999px; background: var(--bg-primary-weak); color: var(--text-primary-selected); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.answer[data-picked="true"] .answer__k { background: var(--bg-primary); color: var(--text-on-color); }
.answer--quiet { font-family: var(--font-sans); font-weight: 600; font-size: 15px; color: var(--text-weak); }

.looks { display: flex; gap: 4px; align-items: center; }
.look-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--bg-primary); }
.look-dot[data-spent="true"] { background: var(--bg-weak); }

/* ---- reward ---- */

/* ---- journal ---- */
.entries { display: flex; flex-direction: column; gap: var(--space-3); }
.entry {
  display: flex; gap: var(--space-3); padding: var(--space-3);
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-card);
  align-items: flex-start;
}
.entry__art { width: 60px; height: 60px; border-radius: var(--radius-lg); background: var(--art-plate-success); display: grid; place-items: center; padding: 6px; flex-shrink: 0; }
.entry__art svg.sp { width: 100%; height: 100%; }
.entry__b { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.entry__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- empty state ---- */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; padding: var(--space-10) var(--space-4); }
.empty .bb-avatar { background: var(--bg-primary-weak); }

/* ---- settings ---- */
.setrow {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) 0; border-top: 1px solid var(--border);
}
.setrow:first-child { border-top: none; }
.setrow__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setrow__t b { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.setrow__t span { font-size: 13px; color: var(--text-weaker); line-height: 18px; }

/* ---- utility ---- */
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--space-3); }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-weak); }
.center { text-align: center; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sheet {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center;
  background: color-mix(in oklab, var(--nr15) 55%, transparent); padding: 0;
  animation: bb-fade var(--dur) var(--ease-standard);
}
@media (min-width: 640px) { .sheet { align-items: center; padding: var(--space-5); } }
.sheet__panel > * { flex: 0 0 auto; }
.reward-card > * { flex: 0 0 auto; }
.sheet__panel {
  background: var(--bg-base); width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto;
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  padding: var(--space-5) var(--space-4) var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
  animation: sheet-up var(--dur-slow) var(--ease-standard);
}
@media (min-width: 640px) { .sheet__panel > * { flex: 0 0 auto; }
.reward-card > * { flex: 0 0 auto; }
.sheet__panel { border-radius: var(--radius-modal); padding: var(--space-6); } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
.sheet__grab { display: flex; justify-content: center; align-items: center; height: 22px; margin: -14px 40px -6px; touch-action: none; cursor: grab; }
.sheet__grab i { width: 44px; height: 5px; border-radius: 999px; background: var(--border-strong); }
.sheet__close {
  position: sticky; top: 0; z-index: 4; align-self: flex-end;
  display: grid; place-items: center; width: 40px; height: 40px; margin: -22px -6px -44px 0;
  border-radius: 999px; border: 1px solid var(--journal-line); background: var(--bg-base); color: var(--text-weak);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.sheet__close svg { width: 18px; height: 18px; }
.sheet__close:focus-visible { outline: 3px solid var(--ring, var(--stroke-primary)); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================
   The real-world guide: camera, photographs, consent
   ============================================================ */

.bb-btn__spinner {
  width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: bb-spin .6s linear infinite; display: inline-block;
}
@keyframes bb-spin { to { transform: rotate(360deg); } }

.screen[data-screen="camera"] .scroll { display: flex; flex-direction: column; overflow: hidden; }

/* ---- camera ---- */
.cam { flex: 1; min-height: 0; position: relative; background: #14101a; display: flex; flex-direction: column; }
.cam__stage { position: absolute; inset: 0; overflow: hidden; background: #14101a; }
.cam__video, .cam__shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cam__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background:
    linear-gradient(to right, transparent 33.2%, #fff 33.2%, #fff 33.4%, transparent 33.4%,
                    transparent 66.5%, #fff 66.5%, #fff 66.7%, transparent 66.7%),
    linear-gradient(to bottom, transparent 33.2%, #fff 33.2%, #fff 33.4%, transparent 33.4%,
                    transparent 66.5%, #fff 66.5%, #fff 66.7%, transparent 66.7%);
}
.cam__flash { position: absolute; inset: 0; background: #fff; animation: camflash .3s ease-out forwards; pointer-events: none; }
@keyframes camflash { from { opacity: .85; } to { opacity: 0; } }

.cam__state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 16, 26, .78); z-index: 4; padding: var(--space-4); }
.cam__msg {
  background: var(--bg-base); border-radius: var(--radius-modal); padding: var(--space-5);
  max-width: 320px; text-align: center; display: flex; flex-direction: column; gap: var(--space-3);
  align-items: center; color: var(--text-strong); box-shadow: var(--shadow-xl);
}

.cam__top { position: absolute; top: 0; left: 0; right: 0; padding: var(--space-3); z-index: 3; }
.cam__target {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  background: color-mix(in oklab, var(--bg-base) 92%, transparent);
  border-radius: var(--radius-pill); padding: 7px 16px 7px 7px; box-shadow: var(--shadow-md);
  color: var(--text-strong);
}
.cam__target-art { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 999px; background: var(--art-plate-purple); color: var(--purple); padding: 4px; }
.cam__target-art svg { width: 100%; height: 100%; }
.cam__target b { display: block; font-family: var(--font-display); font-size: 15px; line-height: 1.2; }
.cam__target span span { display: block; font-size: 12px; line-height: 15px; color: var(--text-weak); }

.cam__safety {
  position: absolute; left: var(--space-3); right: var(--space-3); bottom: 112px; z-index: 3;
  display: flex; align-items: flex-start; gap: 9px;
  background: color-mix(in oklab, var(--nr15) 62%, transparent); color: #fff;
  border-radius: var(--radius-xl); padding: 10px 14px;
  font: 600 13px/18px var(--font-sans);
}
.cam__safety svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.cam__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-6) calc(var(--space-5) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(20, 16, 26, .82), transparent);
}
.cam__side {
  width: 52px; height: 52px; border-radius: 999px; border: none; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: color-mix(in oklab, var(--nr15) 55%, transparent);
}
.cam__side svg { width: 24px; height: 24px; }
.cam__side:focus-visible, .cam__shutter:focus-visible { outline: 3px solid var(--bg-yellow); outline-offset: 3px; }
.cam__shutter {
  width: 78px; height: 78px; border-radius: 999px; cursor: pointer;
  border: 5px solid #fff; background: transparent; display: grid; place-items: center;
  transition: transform var(--dur-fast) var(--ease-standard);
}
.cam__shutter span { width: 58px; height: 58px; border-radius: 999px; background: #fff; display: block; transition: background-color var(--dur); }
.cam__shutter:active { transform: scale(.94); }
.cam__shutter:active span { background: var(--bg-yellow); }

/* ---- the captured photograph ---- */
.shotframe {
  position: relative; width: 100%; flex: 0 0 auto; aspect-ratio: 4 / 3; border-radius: var(--radius-2xl); overflow: hidden;
  border: 3px solid var(--bg-primary); background: var(--bg-primary-weaker);
}
.shotframe__img { position: absolute; inset: 0; display: block; }
.shotframe__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shotframe .corner { position: absolute; width: 24px; height: 24px; border: 3px solid rgba(255, 255, 255, .9); }
.shotframe .corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.shotframe .corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.shotframe .corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.shotframe .corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

img.ownphoto { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.gcard__art[data-has-photo="true"] { padding: 0; }
.detail-art[data-has-photo="true"] { padding: 0; overflow: hidden; }
.entry__art { border: none; cursor: pointer; padding: 6px; }
.entry__art[data-has-photo="true"] { padding: 0; overflow: hidden; }
.myfind { position: relative; border: 1px solid var(--border); cursor: pointer; padding: 0; text-align: left; }
.myfind__art[data-has-photo="true"] { padding: 0; }
.myfind__zoom {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 999px;
  background: color-mix(in oklab, var(--nr15) 55%, transparent); color: #fff; display: grid; place-items: center;
}
.myfind__zoom svg { width: 14px; height: 14px; }

/* ---- something else, as a first-class path (PRD §12) ---- */
.elsecard {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
  padding: var(--space-4); border-radius: var(--radius-card); cursor: pointer;
  border: 2px dashed var(--stroke-primary-weak); background: var(--bg-primary-weaker);
  color: var(--text-strong);
  transition: border-color var(--dur), background-color var(--dur);
}
.elsecard:hover { border-color: var(--stroke-primary); background: var(--bg-primary-weak); }
.elsecard:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.elsecard__ico { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-primary); color: var(--text-on-color); }
.elsecard__ico svg { width: 22px; height: 22px; }
.elsecard__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.elsecard__t b { font-family: var(--font-display); font-size: 17px; }
.elsecard__t span { font-size: 13px; line-height: 17px; color: var(--text-weak); }
.elsecard > svg { width: 20px; height: 20px; color: var(--icon-weak); flex-shrink: 0; }

/* ---- looking closely at your own photograph ---- */
.zoomwrap {
  position: relative; aspect-ratio: 1 / 1; max-height: 52vh; border-radius: var(--radius-2xl);
  overflow: hidden; background: var(--bg-weak); cursor: zoom-in; touch-action: none;
}
.zoomwrap.is-zoom { cursor: zoom-out; }
.zoomimg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow) var(--ease-standard); }
.zoomimg.is-zoom { transform: scale(3); }
.zoomnone { display: grid; place-items: center; height: 100%; gap: 8px; padding: var(--space-6); color: var(--text-primary-selected); }
.zoomnone svg { width: 40%; height: auto; }

/* ---- panels and toast ---- */
.panel {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); background: var(--bg-base);
  border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 120;
  background: var(--text-strong); color: var(--bg-base); border-radius: var(--radius-pill);
  padding: 12px 18px; font: 600 14px var(--font-sans); box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none;
  transition: opacity var(--dur), transform var(--dur) var(--ease-standard);
}
.toast[data-on="true"] { opacity: 1; transform: translate(-50%, 0); }

.looks { display: flex; gap: 4px; align-items: center; }
.look-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--bg-primary); }
.look-dot[data-spent="true"] { background: var(--bg-weak); }

.center { text-align: center; }
@media (max-width: 460px) {
  .cam__safety { bottom: 104px; font-size: 12px; padding: 9px 12px; }
  .cam__bar { padding-inline: var(--space-4); }
  .cam__shutter { width: 70px; height: 70px; }
  .cam__shutter span { width: 52px; height: 52px; }
}

/* ============================================================
   Field journal classic · aligned with BrainBite course products
   ============================================================ */

body {
  background-color: var(--journal-ground);
  background-image:
    linear-gradient(color-mix(in oklab, var(--stroke-primary) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--stroke-primary) 5%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}

.stage {
  background: var(--guide-paper);
  isolation: isolate;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 60px auto 0 34px;
  width: 1px;
  z-index: 0;
  background: color-mix(in oklab, var(--sc-pink10) 22%, transparent);
  pointer-events: none;
}

.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 32px);
  border-bottom-color: var(--journal-line);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--nr15) 3%, transparent);
}

.topbar__title h1 {
  color: var(--text-primary-selected);
  font-size: var(--text-h2);
}

.iconbtn {
  border-color: var(--journal-line);
  background: var(--bg-base);
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-button);
}

.iconbtn:hover { color: var(--text-primary-selected); border-color: var(--stroke-primary); background: var(--bg-primary-weak); }
.tally { background: var(--bg-primary-weak); color: var(--text-primary-selected); }
.langswap { background: var(--bg-disabled); border: 1px solid var(--border); }
.langswap button[aria-pressed="true"] { color: var(--text-primary-selected); }

.screen, .scroll, .pad { position: relative; z-index: 1; }
.pad { width: min(100%, 1040px); margin-inline: auto; gap: clamp(18px, 2.2vw, 28px); padding: 24px clamp(18px, 4vw, 42px) 56px; }

.shelf-pad { animation: journal-enter 540ms var(--ease-standard) both; }
@keyframes journal-enter { from { opacity: 0; transform: translateY(12px); } }

.journal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, .55fr);
  align-items: center;
  gap: clamp(24px, 6vw, 72px);
  min-height: 260px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-modal);
  background: var(--bg-base);
  border: 1px solid var(--journal-line);
  box-shadow: var(--paper-shadow);
  overflow: hidden;
  position: relative;
}

.journal-intro::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 24px;
  right: 27%;
  top: 18px;
  transform: rotate(-3deg);
  background: color-mix(in oklab, var(--bg-yellow) 28%, transparent);
  border-block: 1px solid color-mix(in oklab, var(--yellow-ink) 12%, transparent);
}

.journal-intro__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.journal-intro__copy .bb-display-small { color: var(--text-primary-selected); font-size: clamp(30px, 4vw, 42px); line-height: 1.08; }
.journal-intro__copy .bb-paragraph-small { max-width: 48ch; }
.bb-eyebrow { color: var(--text-primary); }

.journal-progress { width: min(100%, 360px); display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.journal-progress__count { font-size: 13px; font-weight: 700; color: var(--text-success); font-variant-numeric: tabular-nums; }
.journal-progress__count b { font: 800 25px/1 var(--font-display); }
.bb-progress__track { height: 10px; background: var(--bg-weak); }
.bb-progress__fill { background: var(--bg-success); }

.book {
  width: min(100%, 190px);
  border-radius: 5px 18px 18px 5px;
  background: linear-gradient(96deg, var(--field-action-edge) 0 15px, var(--field-action) 15px 100%);
  box-shadow: 0 10px 0 color-mix(in oklab, var(--field-action-edge) 82%, var(--bg-base)), var(--shadow-lg);
  transform: rotate(2deg);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.journal-intro:hover .book { transform: rotate(0deg) translateY(-4px); }
.book::after { border-color: color-mix(in oklab, var(--bg-base) 34%, transparent); }
.book__mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-yellow); color: var(--yellow-ink); align-self: center; box-shadow: 0 4px 0 color-mix(in oklab, var(--yellow-ink) 28%, transparent); }
.book__mark svg { width: 27px; height: 27px; }
.book__stack { display: none; }

.expedition-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--radius-modal);
  background: var(--bg-primary-weaker);
  border: 1px solid var(--stroke-primary-weak);
}
.marie-row { align-items: center; }
.marie-row .bb-avatar { background: var(--bg-primary-weak); border: 3px solid var(--bg-base); box-shadow: var(--shadow-md); }
.bb-bubble--mentor { border-radius: var(--radius-xl); border-bottom-left-radius: var(--radius-sm); background: transparent; padding: 0; }
.bb-bubble__speaker { color: var(--text-primary-selected); font-size: 13px; }
/* the child's own bubble is solid purple: its label has to be light to be read */
.bb-bubble--user .bb-bubble__speaker { color: var(--text-on-color); opacity: .9; }
.go-looking {
  min-height: 64px;
  justify-content: space-between;
  padding-inline: 18px;
  background: var(--field-action);
  box-shadow: 0 7px 0 var(--field-action-edge), var(--shadow-md);
  color: var(--text-on-color);
}
.go-looking:hover { background: var(--field-action-hover); transform: translateY(-2px); box-shadow: 0 9px 0 var(--field-action-edge), var(--shadow-lg); }
.go-looking:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--field-action-edge); }
.go-looking__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--yellow-ink); background: var(--bg-yellow); }

.doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.door { min-height: 78px; border-radius: var(--radius-xl); border-width: 1.5px; box-shadow: var(--shadow-card, var(--shadow-sm)); }
.door > svg { width: 19px; height: 19px; color: var(--icon-weak); margin-left: auto; transition: transform var(--dur); }
.door:hover > svg { transform: translateX(3px); }

.places { gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.place, .gcard { border-radius: var(--radius-modal); box-shadow: var(--shadow-sm); border-color: var(--journal-line); }
.place__art { height: 150px; }
.place:hover, .gcard:hover { box-shadow: 0 8px 0 color-mix(in oklab, var(--field-context) 22%, transparent), var(--shadow-md); }
.place__body { padding: 16px 18px 18px; }
.gcard__art { background: var(--art-plate-teal); }
.gcard[data-found="false"] .gcard__art svg.sp { color: color-mix(in oklab, var(--field-context) 56%, transparent); }
.gcard__body { padding: 12px 14px 15px; }
.gcard__name { color: var(--text-strong); font-size: 17px; }
.elsecard { border-color: var(--stroke-teal); background: var(--bg-teal-weak); border-radius: var(--radius-xl); }
.elsecard:hover { border-color: var(--teal-strong); background: var(--bg-teal-weak); }
.elsecard__ico { background: var(--bg-teal); }

.detail-art, .shotframe, .observe-art, .zoomwrap { border-radius: var(--radius-modal); }
.detail-art { background: var(--art-plate-teal); border-color: var(--journal-line); }
.detail-art[data-found="false"] svg.sp { color: color-mix(in oklab, var(--field-context) 56%, transparent); }
.factrow__ico { background: var(--bg-teal-weak); color: var(--text-teal); }
.entry, .myfind, .panel { border-color: var(--journal-line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.answer:hover { border-color: var(--stroke-primary); background: var(--bg-primary-weaker); }
.answer[data-picked="true"] { border-color: var(--bg-primary); background: var(--bg-primary-weak); }
.answer__k, .answer[data-picked="true"] .answer__k { background: var(--bg-primary); color: var(--text-on-color); }

.sheet__panel, .bb-modal, .cam__msg { border: 1px solid var(--journal-line); box-shadow: var(--shadow-xl); }
.sheet__panel { background: var(--guide-paper); }

@media (min-width: 1180px) {
  body { padding: 0; }
  .stage { min-height: 100dvh; border-radius: 0; border: 0; box-shadow: none; }
}

@media (max-width: 760px) {
  .stage::before { left: 18px; }
  .topbar { min-height: 64px; padding: 0; }
  .topbar__inner { padding-inline: 14px; }
  .topbar .tally { display: none; }
  .topbar__title h1 { font-size: 18px; }
  .pad { padding: 18px 18px 42px; }
  .journal-intro { grid-template-columns: minmax(0, 1fr) 112px; min-height: 210px; padding: 22px; gap: 14px; }
  .journal-intro::after { width: 72px; right: 22%; top: 10px; }
  .journal-intro__copy .bb-display-small { font-size: 30px; }
  .book { width: 104px; min-height: 138px; padding: 16px 10px 12px 20px; }
  .book__title { font-size: 16px; }
  .book__mark { width: 40px; height: 40px; }
  .book__owner { font-size: 9px; }
  .expedition-card { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .go-looking { min-height: 58px; }

}

@media (max-width: 540px) {
  .brand-home > span:last-child, .nav-cta span { display: none; }
  .nav-cta { width: 44px; padding: 0; justify-content: center; }
  .topbar__title .sub { display: none; }
  .nav-panel__head, .nav-panel__body, .nav-panel__foot { padding-inline: 20px; }
  .a11y-overlay { align-items: flex-end; padding: 0; }
  .a11y-panel { max-height: 94dvh; border-radius: var(--radius-modal) var(--radius-modal) 0 0; padding: 20px 18px max(24px, env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .langswap button { min-width: 34px; padding-inline: 7px; }
  .journal-intro { grid-template-columns: 1fr; }
  .book { display: none; }
  .journal-intro::after { right: 18px; }
  .doors { gap: 10px; }
  .door { padding: 11px; }
  .door__ico { width: 36px; height: 36px; }
  .door__t b { font-size: 15px; }
  .door > svg { display: none; }

}

@media (prefers-reduced-motion: reduce) {
  .shelf-pad { animation: none; }
  .journal-intro:hover .book, .go-looking:hover { transform: none; }
}

/* ============================================================
   Real-world home: Steve, one big camera button, today's quests
   ============================================================ */
.coinpill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--stroke-yellow, var(--journal-line));
  border-radius: 999px;
  background: var(--art-plate-yellow);
  color: var(--yellow-ink, var(--text-strong));
  font-family: var(--font-display); font-size: 16px;
  transition: transform var(--dur) var(--ease-standard);
}
.coinpill .coin { width: 24px; height: 24px; }
.coinpill:hover { transform: translateY(-2px); }
.coinpill b { font-size: 17px; }

.home { gap: var(--space-6); }
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; padding: 26px 20px 28px;
  background: var(--guide-paper, var(--bg-base));
  border: 1px solid var(--journal-line);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-sm);
}
.shoot-cta {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 0 30px 0 16px; margin-top: 6px;
  border: none; border-radius: 999px;
  background: var(--bg-primary); color: var(--text-on-color);
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  box-shadow: 0 8px 0 var(--purple-strong), var(--shadow-lg);
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur);
}
.shoot-cta__ring {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.shoot-cta__ring svg { width: 28px; height: 28px; }
.shoot-cta:hover { transform: translateY(-3px); box-shadow: 0 11px 0 var(--purple-strong), var(--shadow-xl); }
.shoot-cta:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--purple-strong); }
.hero__quiet {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: none; border: none; color: var(--text-teal); font-weight: 600;
}
.hero__quiet svg { width: 20px; height: 20px; }
.hero__quiet:hover { text-decoration: underline; }

.quest-strip { display: flex; flex-direction: column; gap: 10px; }


/* proper silhouettes for anything not yet found */
.gcard[data-found="false"] .gcard__art img.sp,
.detail-art[data-found="false"] img.sp { filter: brightness(0) saturate(0); opacity: .62; }
.gcard[data-found="false"] .gcard__art svg.sp,
.detail-art[data-found="false"] svg.sp { color: rgba(22, 22, 22, .72); }
.gcard[data-found="false"] .gcard__name { color: var(--text-muted, inherit); }

@media (max-width: 600px) {
  .shoot-cta { width: 100%; justify-content: center; font-size: 20px; }
}
body.calm .shoot-cta:hover, body.calm .book-card:hover, body.calm .coinpill:hover { transform: none; }

/* ---- Steve, animated (steve.js) ------------------------------------------
   The drawing stays underneath until the Rive animation has a frame, so a
   slow or failed load never leaves an empty circle. */
.steve-figure { position: relative; display: block; width: 100%; height: 100%; }
.steve-figure > svg.marie { transition: opacity .25s var(--ease-standard); }
.steve-figure__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .25s var(--ease-standard); }
.steve-figure[data-rive="ready"] > .steve-figure__canvas { opacity: 1; }
.steve-figure[data-rive="ready"] > svg.marie { opacity: 0; }
/* with the runtime present, a re-rendered Steve waits for his animation
   instead of flashing the drawing; the drawing comes back only on failure */
html.steve-rive .steve-figure:not([data-rive="failed"]) > svg.marie { opacity: 0; transition: none; }
/* a round avatar is too small for the whole figure, so it frames head and shoulders */
.bb-avatar .steve-figure__canvas { inset: auto; left: -15%; top: -28%; width: 130%; height: 130%; }

.steve-say {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 4px 14px 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--stroke-primary-weak); background: var(--bg-base);
  color: var(--text-primary-selected); font: 600 13px/1 var(--font-sans); cursor: pointer;
}
.steve-say svg { width: 17px; height: 17px; }
.steve-say:focus-visible { outline: 3px solid var(--stroke-primary, currentColor); outline-offset: 2px; }

/* Steve explains a find (app.js: steveInfoOffer / showSteveInfo) */
.steve-info { display: flex; flex-direction: column; gap: var(--space-3); }
.steve-info__ask { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---- coins (app.js: coinBurst / countUp / flyCoins) ----------------------
   The still coin is BrainBite's approved gold coin; the burst is the shared
   coin-earned.riv, whose artboard is twice the coin so its sparkles spill
   past it without moving anything around it. */
.coin { display: block; flex: none; width: 1.25em; height: 1.25em; object-fit: contain; }
.factrow__ico .coin { width: 22px; height: 22px; }
.bb-badge .coin { width: 16px; height: 16px; }

.coin-earn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 10px; border-radius: var(--radius-pill);
  /* fixed light gold in both themes: it always sits on the purple reward card */
  background: #fff4b8; color: #5c4300;
  box-shadow: 0 4px 0 rgba(92, 67, 0, .35);
}
.coin-earn__coin { position: relative; display: block; width: 44px; height: 44px; flex: none; }
.coin-earn__coin .coin { width: 100%; height: 100%; transition: opacity .12s; }
.coin-earn__coin[data-burst="playing"] .coin { opacity: 0; }
.coin-burst { position: absolute; inset: -22px; width: 88px; height: 88px; pointer-events: none; }
.coin-earn__t { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); }
.coin-earn__t b { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.coin-earn__t > span:last-child { font-size: 17px; font-weight: 700; }

.coin-fly { position: fixed; left: 0; top: 0; width: 30px; height: 30px; z-index: 130; pointer-events: none; will-change: transform, opacity; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.coinpill--ghost { position: fixed; z-index: 125; margin: 0; pointer-events: none; box-shadow: var(--shadow-lg); justify-content: center; }

/* ---- Steve's sheets ---- */

/* Steve centre stage (app.js: steveStage). The artboard is 578x480 and leaves
   room round him for his gestures, so the figure keeps that shape. What he
   says reads like a caption under him, not a heading. */
.steve-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; text-align: center; }
/* the artboard's top is headroom for his gestures (a question mark, stars), so
   it is left clear rather than tucked under whatever sits above */
.steve-stage__figure { position: relative; display: block; width: min(100%, 280px); aspect-ratio: 578 / 480; margin-bottom: -6px; }
.steve-stage--big .steve-stage__figure { width: min(100%, 360px); }
.steve-stage__figure .steve-figure > svg.marie { position: absolute; inset: 0; margin: auto; width: 62%; height: auto; }
.steve-caption {
  margin: 0; max-width: 36ch;
  font-family: var(--font-sans); font-weight: 500; font-size: 15px; line-height: 21px;
  color: var(--text-weak);
}
.steve-caption { min-height: 42px; }
.steve-caption__line { display: inline-block; }
/* how far through what he is saying */
.steve-dots { display: flex; gap: 5px; justify-content: center; }
.steve-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--border-strong); transition: background-color var(--dur), transform var(--dur); }
.steve-dots i[data-on="true"] { background: var(--bg-primary); }
/* while he talks the button is the volume reminder, with a speaker that pulses */
.steve-say[data-speaking="true"] { cursor: default; border-color: transparent; background: var(--bg-primary-weaker); }
.steve-say[data-speaking="true"] svg { animation: steve-pulse 1.1s ease-in-out infinite; }
@keyframes steve-pulse { 50% { transform: scale(1.18); } }
body.calm .steve-say[data-speaking="true"] svg { animation: none; }
.steve-caption--busy { display: inline-flex; align-items: center; gap: 8px; }
.steve-caption--busy .bb-btn__spinner { width: 16px; height: 16px; color: var(--text-primary); }
.steve-caption:focus { outline: none; }

/* when Steve opens a sheet, his artboard's empty headroom tucks under the top edge */
.sheet__panel > .steve-stage:first-of-type .steve-stage__figure { margin-top: -12%; }

/* the child's answer as one chip; tapping it goes back to change it */
.your-answer {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px 8px 8px; cursor: pointer; text-align: left;
  background: var(--bg-primary-weaker); color: var(--text-strong);
  border: 1px solid var(--stroke-primary-weak); border-radius: var(--radius-xl);
}
.your-answer__art { display: grid; place-items: center; width: 48px; height: 48px; flex: none; overflow: hidden; border-radius: var(--radius-lg); background: var(--art-plate-teal); color: var(--plate-ink-purple); padding: 4px; }
.your-answer__art[data-has-photo="true"] { padding: 0; }
.your-answer__art .sp, .your-answer__art img { width: 100%; height: 100%; object-fit: contain; }
.your-answer__art svg:not(.sp) { width: 22px; height: 22px; }
.your-answer__t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.your-answer__t small { font-size: 12px; font-weight: 600; color: var(--text-weaker); }
.your-answer__t b { font-family: var(--font-display); font-size: 18px; line-height: 1.2; }
.your-answer__change { font-weight: 700; font-size: 14px; color: var(--text-primary-selected); }
.your-answer:focus-visible { outline: 3px solid var(--ring, var(--stroke-primary)); outline-offset: 2px; }

/* ---- first run: pick a language (app.js: renderLang) ---- */
body.picking-lang .topbar { display: none; }
.langpick { min-height: 100dvh; justify-content: center; align-items: center; text-align: center; gap: var(--space-6); }
.langpick__logo { display: block; width: 72px; height: 72px; flex: none; color: var(--logo); }
.langpick__logo .bb-logo { width: 100%; height: 100%; }
.langpick h1 { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.langpick__alt { font-family: var(--font-sans); font-weight: 600; font-size: 16px; line-height: 1; letter-spacing: 0; color: var(--text-weaker); }
.langpick__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(100%, 440px); }
.langpick__choice {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px 14px 16px; cursor: pointer;
  background: var(--bg-base); color: var(--text-strong);
  border: 2px solid var(--journal-line); border-radius: var(--radius-modal);
  box-shadow: 0 6px 0 var(--journal-line), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur), border-color var(--dur);
}
.langpick__choice:hover { border-color: var(--stroke-primary); transform: translateY(-2px); }
.langpick__choice:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--journal-line); }
.langpick__choice:focus-visible { outline: 3px solid var(--ring, var(--stroke-primary)); outline-offset: 3px; }
.langpick__choice b { font-family: var(--font-display); font-size: 20px; }
.langpick__flag { display: block; width: 100%; max-width: 132px; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), var(--shadow-sm); }
.langpick__flag svg { display: block; width: 100%; height: 100%; }
body.calm .langpick__choice:hover { transform: none; }

/* ---- picture answers (app.js: answerSheet) ---- */
.steve-stage--compact .steve-stage__figure { width: min(100%, 200px); }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 8px 12px; cursor: pointer; text-align: center;
  background: var(--bg-base); color: var(--text-strong);
  border: 2px solid var(--journal-line); border-radius: var(--radius-xl);
  box-shadow: 0 4px 0 var(--journal-line);
  transition: border-color var(--dur), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.pick:hover { border-color: var(--stroke-primary); }
.pick:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--journal-line); }
.pick:focus-visible { outline: 3px solid var(--ring, var(--stroke-primary)); outline-offset: 2px; }
.pick__art { display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-width: 120px; border-radius: var(--radius-lg); background: var(--art-plate-teal); padding: 8px; }
.pick__art .sp { width: 100%; height: 100%; object-fit: contain; }
.pick__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.15; }
.pick__flag { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--bg-primary); color: var(--text-on-color); }
.pick__flag svg { width: 14px; height: 14px; }
.answer__art { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-md, 10px); background: var(--art-plate-teal); padding: 3px; }
.answer__art .sp { width: 100%; height: 100%; object-fit: contain; }
body.calm .pick:active { transform: none; }
.pick[data-picked="true"] { border-color: var(--bg-primary); background: var(--bg-primary-weaker); }
.pick__who { font-size: 12px; font-weight: 600; color: var(--text-weaker); margin-top: -2px; }
.pick__art svg:not(.sp) { width: 36px; height: 36px; color: var(--plate-ink-purple); }

/* ---- flags next to a language name ---- */
.flag-chip { display: inline-block; width: 22px; height: 15px; margin-right: 6px; vertical-align: -2px; border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.flag-chip svg { display: block; width: 100%; height: 100%; }
.nav-language__choices button { display: inline-flex; align-items: center; padding-inline: 10px; }
.bb-tab { display: inline-flex; align-items: center; }
.settings-lang { flex-wrap: wrap; }


/* ---- quests: today's trail (app.js: trailStep / questNow / renderQuests) ---- */
.quests { gap: var(--space-6); }
.quest-coins {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 5px 10px 5px 6px; border-radius: 999px;
  background: #fff4b8; color: #5c4300;
  font: 700 14px/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.quest-coins .coin { width: 20px; height: 20px; }
.quest-coins[data-done="true"] { background: var(--bg-success-weak); color: var(--text-success); }

.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.trail__step { position: relative; display: flex; align-items: center; gap: 12px; }
/* the path joining the steps */
.trail__step:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: calc(50% + 18px); height: calc(100% - 24px);
  border-left: 3px dashed var(--journal-line);
}
.trail__step[data-state="done"]:not(:last-child)::after { border-left-style: solid; border-color: var(--success); }
.trail__node {
  position: relative; z-index: 1; display: grid; place-items: center; flex: none;
  width: 37px; height: 37px; border-radius: 999px;
  background: var(--bg-base); border: 3px solid var(--journal-line); color: var(--text-weaker);
  font: 800 16px/1 var(--font-display);
}
.trail__node svg { width: 18px; height: 18px; }
.trail__step[data-state="done"] .trail__node { background: var(--success); border-color: var(--success); color: #fff; }
.trail__step[data-state="current"] .trail__node { background: var(--bg-primary); border-color: var(--bg-primary); color: var(--text-on-color); box-shadow: 0 0 0 5px var(--bg-primary-weak); }
.trail__card {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-xl);
  background: var(--bg-base); border: 1px solid var(--journal-line); box-shadow: var(--shadow-sm);
}
.trail__step[data-state="current"] .trail__card { border: 2px solid var(--bg-primary); box-shadow: 0 5px 0 var(--bg-primary-weak), var(--shadow-sm); padding: 14px 12px; }
.trail__step[data-state="locked"] .trail__card { background: transparent; box-shadow: none; border-style: dashed; }
.trail__step[data-state="locked"] .trail__art, .trail__step[data-state="locked"] .trail__t b { opacity: .55; }
.trail__step[data-state="done"] .trail__t b { color: var(--text-weak); }
.trail__art { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--art-plate-teal); color: var(--field-context, var(--text-teal)); padding: 5px; }
.trail__step[data-state="current"] .trail__art { width: 60px; height: 60px; }
.trail__art .sp { width: 100%; height: 100%; object-fit: contain; }
.trail__art > svg:not(.sp) { width: 24px; height: 24px; }
.trail__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trail__t b { font-family: var(--font-display); font-size: 16px; line-height: 1.2; color: var(--text-strong); }
.trail__step[data-state="current"] .trail__t b { font-size: 18px; }
.trail__meta { font-size: 13px; font-weight: 600; color: var(--text-weaker); }

/* home: just the quest you are on */
.quest-now {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; text-align: left; cursor: pointer;
  background: var(--bg-base); color: var(--text-strong);
  border: 2px solid var(--bg-primary); border-radius: var(--radius-modal);
  box-shadow: 0 6px 0 var(--bg-primary-weak), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-standard);
}
.quest-now:hover { transform: translateY(-2px); }
.quest-now[data-state="done"] { border-color: var(--success); box-shadow: 0 6px 0 var(--bg-success-weak), var(--shadow-sm); }
.quest-now__art { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--art-plate-teal); color: var(--field-context, var(--text-teal)); padding: 6px; }
.quest-now[data-state="done"] .quest-now__art { background: var(--bg-success-weak); color: var(--text-success); }
.quest-now__art .sp { width: 100%; height: 100%; object-fit: contain; }
.quest-now__art > svg:not(.sp) { width: 28px; height: 28px; }
.quest-now__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.quest-now__t small { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-primary-selected); }
.quest-now__t b { font-family: var(--font-display); font-size: 18px; line-height: 1.2; }
.quest-now__dots { display: flex; gap: 5px; margin-top: 4px; }
.quest-now__dots i { width: 22px; height: 6px; border-radius: 999px; background: var(--journal-line); }
.quest-now__dots i[data-state="done"] { background: var(--success); }
.quest-now__dots i[data-state="current"] { background: var(--bg-primary); }
.quest-now__go svg { width: 22px; height: 22px; color: var(--icon-weak, var(--text-weaker)); }
body.calm .quest-now:hover { transform: none; }

/* collections: one short row each */
.coll-rows { display: flex; flex-direction: column; gap: 10px; }
.coll-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-base); border: 1px solid var(--journal-line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
}
.coll-row[data-done="true"] { border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.coll-row__pics { display: flex; flex: none; }
.coll-row__pic { display: grid; place-items: center; width: 38px; height: 38px; margin-left: -10px; padding: 3px; border-radius: 999px; background: var(--art-plate-teal); border: 2px solid var(--bg-base); }
.coll-row__pic:first-child { margin-left: 0; }
.coll-row__pic[data-found="false"] { background: var(--bg-weak); }
.coll-row__pic .sp { width: 100%; height: 100%; object-fit: contain; }
.coll-row__pic[data-found="false"] img.sp { filter: brightness(0) saturate(0); opacity: .45; }
.coll-row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.coll-row__t b { font-family: var(--font-display); font-size: 16px; line-height: 1.15; }
.coll-row__t small { font-size: 12px; font-weight: 600; color: var(--text-weaker); }
.coll-row .bb-progress__track { height: 7px; }
@media (max-width: 380px) { .coll-row__pic:nth-child(n+4) { display: none; } }
.trail__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 3px; }
.trail__row .quest-coins { padding: 3px 9px 3px 4px; font-size: 13px; }
.trail__row .quest-coins .coin { width: 18px; height: 18px; }

/* ---- home: the child's own books (app.js: guideCard / findCard) ---- */
.home-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.book-card {
  position: relative; display: flex; text-align: left; cursor: pointer; color: var(--text-strong);
  background: var(--bg-base); border: 2px solid var(--journal-line); border-radius: var(--radius-modal);
  box-shadow: 0 6px 0 var(--journal-line), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-standard), box-shadow var(--dur);
}
.book-card:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--journal-line), var(--shadow-md); }
.book-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--journal-line); }
.book-card:focus-visible { outline: 3px solid var(--ring, var(--stroke-primary)); outline-offset: 3px; }
.book-card__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.book-card__t b { font-family: var(--font-display); font-size: 18px; line-height: 1.15; }
.book-card__t small { font-size: 13px; font-weight: 600; color: var(--text-weaker); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the guide: a ring for how full it is, a strip of what is in it */
.book-card--guide {
  grid-column: 1 / -1; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--art-plate-teal); border-color: color-mix(in oklab, var(--teal) 30%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--teal) 30%, transparent), var(--shadow-sm);
}
.book-card--guide:hover { box-shadow: 0 8px 0 color-mix(in oklab, var(--teal) 30%, transparent), var(--shadow-md); }
.book-card--guide .book-card__t { flex: 1; }
.book-card__ring { position: relative; display: grid; place-items: center; flex: none; width: 68px; height: 68px; }
.book-card__ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.book-card__ring .ring-track { fill: var(--bg-base); stroke: color-mix(in oklab, var(--teal) 18%, transparent); stroke-width: 8; }
.book-card__ring .ring-fill { fill: none; stroke: var(--teal); stroke-width: 8; stroke-linecap: round; }
.book-card__ring b { position: relative; font: 800 22px/1 var(--font-display); color: var(--teal-strong, var(--text-strong)); }
.book-card__strip { display: flex; margin-top: 8px; }
.book-card__strip > span { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; padding: 4px; border-radius: 999px; background: var(--bg-base); border: 2px solid var(--art-plate-teal); box-shadow: var(--shadow-sm); }
.book-card__strip > span:first-child { margin-left: 0; }
.book-card__strip > span[data-found="false"] { background: color-mix(in oklab, var(--bg-base) 55%, transparent); box-shadow: none; }
.book-card__strip .sp { width: 100%; height: 100%; object-fit: contain; }
.book-card__strip > span[data-found="false"] img.sp { filter: brightness(0) saturate(0); opacity: .35; }
.book-card__go svg { width: 22px; height: 22px; color: var(--teal); }

body.calm .book-card:active { transform: none; }

/* Steve's stage, tighter: progress dots and the replay button share one quiet row */
.steve-stage { gap: 8px; }
.steve-stage__controls { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 36px; }
.steve-say { min-height: 32px; padding: 3px 12px 3px 8px; border-color: transparent; background: var(--bg-primary-weaker); font-size: 13px; }
.steve-info__ask .bb-btn { min-width: 128px; }

/* a sheet's own buttons stay in reach at the bottom while it scrolls */
.sheet__panel > .bb-modal__actions {
  position: sticky; bottom: calc(-1 * var(--space-6)); z-index: 3;
  margin: 0 calc(-1 * var(--space-4)) calc(-1 * var(--space-6));
  padding: 14px var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  background: var(--guide-paper, var(--bg-base));
  box-shadow: 0 -12px 16px -8px color-mix(in oklab, var(--guide-paper, var(--bg-base)) 90%, transparent);
  border-top: 1px solid var(--journal-line);
}
@media (min-width: 640px) {
  .sheet__panel > .bb-modal__actions { margin-inline: calc(-1 * var(--space-6)); padding-inline: var(--space-6); }
}
.book-card__t small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---- polaroids: the child's own photographs, in a white frame ---- */
.polaroid {
  display: block; padding: 5px 5px 14px; background: #fff; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 14px rgba(0, 0, 0, .12);
}
.polaroid__img { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; border-radius: 3px; background: var(--art-plate-teal); color: var(--plate-ink); padding: 12%; }
.polaroid__img[data-has-photo="true"] { padding: 0; }
.polaroid__img .sp { width: 100%; height: 100%; object-fit: contain; }
.polaroid__img img.ownphoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.polaroid__img > svg:not(.sp) { width: 40%; height: 40%; }
.polaroid--empty { background: color-mix(in oklab, #fff 70%, transparent); box-shadow: none; }
.polaroid--empty .polaroid__img { background: transparent; border: 2px dashed color-mix(in oklab, currentColor 35%, transparent); color: inherit; }

/* ---- reward: a card for the guide (app.js: addedSheet) ---- */
.reward-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 18px 18px 20px; border-radius: var(--radius-modal);
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-primary-weak) 0%, var(--bg-primary-weaker) 60%, var(--bg-base) 100%);
  border: 2px solid var(--stroke-primary-weak);
  box-shadow: 0 6px 0 var(--bg-primary-weak), var(--shadow-md);
}
.reward-card > * { flex: 0 0 auto; }
.reward-card__shot { position: relative; display: block; width: min(64%, 230px); margin: 6px 0 4px; }
.polaroid--big { padding: 8px 8px 26px; transform: rotate(-3deg); }
.reward-card__sticker {
  position: absolute; right: -14px; bottom: 6px; display: grid; place-items: center; width: 64px; height: 64px; padding: 7px;
  border-radius: 999px; background: #fff; border: 3px solid var(--bg-primary); box-shadow: var(--shadow-md); transform: rotate(8deg);
}
.reward-card__sticker .sp { width: 100%; height: 100%; object-fit: contain; }
.reward-card__sticker > svg:not(.sp) { width: 30px; height: 30px; color: var(--plate-ink); }
.reward-card__name { margin: 0; font: 800 30px/1.1 var(--font-display); color: var(--text-primary-selected); }
.coin-earn__split { margin: -2px 0 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-weaker); }
body.calm .polaroid--big, body.calm .reward-card__sticker { transform: none; }

/* ---- home: journal and found by me, as a little stack of the child's photos ---- */
.home-books { align-items: stretch; }
.book-card--finds {
  flex-direction: column; justify-content: space-between; gap: 10px; padding: 14px 12px 12px; overflow: hidden;
  background: var(--art-plate-purple); border-color: color-mix(in oklab, var(--purple) 22%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--purple) 22%, transparent), var(--shadow-sm);
  color: var(--purple);
}
.book-card--finds[data-tone="yellow"] {
  background: var(--art-plate-yellow); border-color: color-mix(in oklab, var(--yellow-ink) 22%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--yellow-ink) 22%, transparent), var(--shadow-sm);
  color: var(--yellow-ink);
}
.book-card__stack { position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; }
.book-card__stack .polaroid { position: absolute; top: 50%; left: 50%; width: 62%; transform: translate(-50%, -50%); }
.book-card__stack[data-n="2"] .polaroid:nth-child(1) { transform: translate(-62%, -52%) rotate(-8deg); }
.book-card__stack[data-n="2"] .polaroid:nth-child(2) { transform: translate(-40%, -48%) rotate(5deg); }
.book-card__stack[data-n="3"] .polaroid:nth-child(1) { transform: translate(-68%, -50%) rotate(-11deg); }
.book-card__stack[data-n="3"] .polaroid:nth-child(2) { transform: translate(-34%, -53%) rotate(9deg); }
.book-card__stack[data-n="3"] .polaroid:nth-child(3) { transform: translate(-50%, -47%) rotate(-2deg); }
.book-card__stack[data-n="1"] .polaroid { transform: translate(-50%, -50%) rotate(-4deg); }
.book-card__title { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.book-card--finds .book-card__t b { color: var(--text-strong); font-size: 17px; }
.book-card--finds .book-card__t small { color: var(--text-weak); -webkit-line-clamp: 1; }
.book-card__count {
  display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; flex: none;
  border-radius: 999px; background: var(--bg-base); color: var(--text-strong); font: 800 13px/1 var(--font-display);
}
body.calm .book-card__stack .polaroid { transition: none; }

/* ---- stamps on the photo (app.js: stampLabels) ---- */
.polaroid--big { position: relative; }
.stamp { position: absolute; z-index: 2; pointer-events: none; --ink: #704682; }
.stamp--place { left: 4%; bottom: 16%; transform: rotate(-8deg); --ink: #1b767f; }
.stamp--rarity { right: 2%; top: 6%; transform: rotate(9deg); }
.stamp--rarity[data-rarity="3"] { --ink: #185e63; }
.stamp--rarity[data-rarity="4"], .stamp--rarity[data-rarity="5"] { --ink: #c61857; }
.stamp__ink {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 6px 10px 5px; border: 3px solid var(--ink); border-radius: 8px;
  outline: 1.5px solid var(--ink); outline-offset: 2px;
  background: rgba(255, 255, 255, .78); color: var(--ink);
  font: 800 13px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.stamp__stars { letter-spacing: 0; font-size: 11px; }
.stamp[data-state="waiting"] .stamp__ink { opacity: 0; }
.stamp[data-state="inked"] .stamp__ink { animation: stamp-ink .38s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes stamp-ink {
  0% { opacity: 0; transform: scale(1.35); }
  35% { opacity: 1; transform: scale(.92); }
  100% { opacity: 1; transform: scale(1); }
}
.stamp__rive { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -75%); pointer-events: none; }
body.calm .stamp[data-state="inked"] .stamp__ink { animation: none; }

/* ---- reward card: NEW ribbon, tick on the sticker, what the find is ---- */
.reward-card__ribbon {
  position: absolute; top: -2px; left: -2px; z-index: 3; width: 118px; height: 118px; overflow: hidden;
  border-top-left-radius: var(--radius-modal); pointer-events: none;
}
.reward-card__ribbon > span {
  position: absolute; top: 30px; left: -44px; width: 180px; transform: rotate(-45deg);
  padding: 6px 0 5px; text-align: center;
  background: #c61857; color: #fff; font: 800 14px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 3px 0 #820f39, 0 6px 12px rgba(0, 0, 0, .18);
}
/* found before: a teal ribbon with how many times */
.reward-card__ribbon[data-kind="again"] > span { background: #1b767f; box-shadow: 0 3px 0 #004043, 0 6px 12px rgba(0, 0, 0, .18); font-size: 16px; letter-spacing: .04em; }
.reward-card__sticker[data-art="false"] { width: 40px; height: 40px; right: -8px; bottom: 16px; padding: 0; border-width: 0; background: transparent; box-shadow: none; }
.reward-card__tick {
  position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 999px; background: var(--success, #188834); color: #fff; border: 3px solid #fff; box-shadow: var(--shadow-sm);
}
.reward-card__tick svg { width: 13px; height: 13px; }
.reward-card__sticker[data-art="false"] .reward-card__tick { position: static; width: 40px; height: 40px; }
.reward-card__sticker[data-art="false"] .reward-card__tick svg { width: 20px; height: 20px; }

/* ---- dark theme: home cards and inks that were drawn for a light page ----
   applyA11y() always sets data-theme on <html>, so these follow system, light and dark.
   Artwork plates stay light (the drawings are dark-ink); the cards around them go dark. */
:root[data-theme="dark"] { --gold-ink: #ecd27a; }
:root[data-theme="dark"] .book-card--guide {
  background: var(--bg-teal-weak); border-color: color-mix(in oklab, var(--text-teal) 30%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--text-teal) 22%, transparent), var(--shadow-sm);
}
:root[data-theme="dark"] .book-card--guide:hover { box-shadow: 0 8px 0 color-mix(in oklab, var(--text-teal) 22%, transparent), var(--shadow-md); }
:root[data-theme="dark"] .book-card__ring .ring-track { stroke: color-mix(in oklab, var(--text-teal) 18%, transparent); }
:root[data-theme="dark"] .book-card__ring .ring-fill { stroke: var(--text-teal); }
:root[data-theme="dark"] .book-card__ring b { color: var(--text-strong); }
:root[data-theme="dark"] .book-card__go svg { color: var(--text-teal); }
:root[data-theme="dark"] .book-card__strip > span { background: var(--art-plate-teal); border-color: var(--bg-teal-weak); }
:root[data-theme="dark"] .book-card__strip > span[data-found="false"] { background: color-mix(in oklab, var(--bg-base) 55%, transparent); }
:root[data-theme="dark"] .book-card--finds {
  background: var(--bg-primary-weak); border-color: color-mix(in oklab, var(--text-primary) 26%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--text-primary) 18%, transparent), var(--shadow-sm);
  color: var(--text-primary);
}
:root[data-theme="dark"] .book-card--finds[data-tone="yellow"] {
  background: var(--bg-yellow-weak); border-color: color-mix(in oklab, var(--gold-ink) 26%, transparent);
  box-shadow: 0 6px 0 color-mix(in oklab, var(--gold-ink) 18%, transparent), var(--shadow-sm);
  color: var(--gold-ink);
}
:root[data-theme="dark"] .polaroid--empty { background: color-mix(in oklab, currentColor 12%, transparent); }
/* not-yet-found silhouettes: light shapes, since black ones vanish on a dark circle */
:root[data-theme="dark"] .coll-row__pic[data-found="false"] img.sp,
:root[data-theme="dark"] .book-card__strip > span[data-found="false"] img.sp { filter: brightness(0) invert(1); opacity: .28; }
:root[data-theme="dark"] .coll-row__pic[data-found="false"] svg.sp,
:root[data-theme="dark"] .book-card__strip > span[data-found="false"] svg.sp { color: color-mix(in oklab, var(--text-strong) 28%, transparent); }
:root[data-theme="dark"] .bb-badge--yellow,
:root[data-theme="dark"] .door__ico[data-tone="yellow"] { color: var(--gold-ink); }
:root[data-theme="dark"] .elsecard:hover { border-color: var(--text-teal); }

/* ============================================================
   Inner screens, built to the home page's standard
   (app.js: renderPlaces / renderGuide / renderDetail / snap / renderSettings)
   Chunky cards with a solid bottom edge, pictures before words, one big
   camera button, and colours that hold up in the dark theme.
   ============================================================ */

/* one header on every screen: the way back, the coins, the menu */
.topbar__actions { flex: none; }
@media (max-width: 760px) { .stage::before { display: none; } }

/* a silhouette is the real picture blacked out, wherever it is shown */
img.sp[data-mono="true"] { filter: brightness(0) saturate(0); opacity: .62; }
.gcard[data-found="false"] .gcard__art svg.sp { color: rgba(22, 22, 22, .72); }

/* ---- buttons that remove something ---- */
.bb-btn--danger { background: var(--error-strong); color: #fff; }
.bb-btn--danger:hover { background: var(--error); }
.bb-btn--danger-quiet { background: transparent; color: var(--text-danger); border-color: color-mix(in oklab, var(--stroke-danger) 55%, transparent); }
.bb-btn--danger-quiet:hover { background: var(--bg-error-weak); border-color: var(--stroke-danger); }
.sheet__panel > .bb-btn--danger-quiet { align-self: flex-start; }

/* ---- the chunky card edge home uses ---- */
.place, .gcard, .coll-row, .panel, .grownups {
  border: 2px solid var(--journal-line);
  box-shadow: 0 5px 0 var(--journal-line), var(--shadow-sm);
}
.place:active, .gcard:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--journal-line); }
.place:hover, .gcard:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--journal-line), var(--shadow-md); }
body.calm .place:hover, body.calm .gcard:hover, body.calm .place:active, body.calm .gcard:active { transform: none; }

/* ---- places ---- */
.places { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.place { display: flex; flex-direction: column; border-radius: var(--radius-modal); }
.place__art { height: 132px; }
.place__strip { position: absolute; left: 14px; bottom: 12px; display: flex; }
.place__strip > span {
  display: grid; place-items: center; width: 46px; height: 46px; margin-left: -10px; padding: 5px;
  border-radius: 999px; background: #fff; border: 3px solid #fff; box-shadow: var(--shadow-md);
}
.place__strip > span:first-child { margin-left: 0; }
.place__strip > span[data-found="false"] { background: var(--plate-muted); }
.place__strip .sp { width: 100%; height: 100%; object-fit: contain; }
.place__strip img.sp[data-mono="true"] { opacity: .45; }
.place__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.place__name { font: 700 20px/1.15 var(--font-display); color: var(--text-strong); }
.place__progress { display: flex; flex-direction: column; gap: 5px; }
.place__progress .bb-progress__track { height: 8px; }
.place__progress small, .guide-head__meta small { font-size: 13px; font-weight: 600; color: var(--text-weaker); }

/* ---- one place's guide ---- */
.guide-head {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center;
}
.guide-head__art { display: block; position: relative; width: 96px; height: 96px; border-radius: var(--radius-2xl); overflow: hidden; border: 2px solid var(--journal-line); }
.guide-head__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide-head__t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.guide-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.gcard { border-radius: var(--radius-2xl); }
.gcard__flag { box-shadow: var(--shadow-sm); }
.gcard__flag[data-kind="found"] { width: 28px; height: 28px; padding: 0; justify-content: center; }
.gcard__flag[data-kind="found"] svg { width: 15px; height: 15px; }
.elsecard { border-width: 2px; box-shadow: 0 5px 0 color-mix(in oklab, var(--stroke-teal) 35%, transparent); }
.elsecard__t span { color: var(--text-weak); }

/* ---- a card: built like home ---- */
.detail-hero { gap: 14px; padding: 16px 16px 24px; }
.detail-hero .detail-art { width: 100%; aspect-ratio: 4 / 3; padding: 16px; border-width: 0; overflow: hidden; }
.detail-hero .detail-art { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.detail-hero .detail-art .sp { width: 100%; height: 100%; max-height: none; min-height: 0; object-fit: contain; }
.detail-hero .detail-art[data-has-photo="true"] { padding: 0; }
.detail-head { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.detail-name { font: 800 32px/1.1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--text-strong); }
.detail-look { max-width: 34ch; font-size: 16px; line-height: 23px; color: var(--text-weak); }
.detail-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.detail-chips .bb-badge { font-size: 13px; padding: 6px 11px; }
.detail-hero .shoot-cta { margin-top: 4px; }

/* ---- a page's own heading, with a count ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-head .book-card__count { min-width: 32px; height: 30px; font-size: 15px; background: var(--bg-primary-weak); color: var(--text-primary-selected); }

/* ---- the child's finds as polaroids (journal, found by me, a card) ---- */
.snaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
.snap {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 0; min-width: 0;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--text-strong);
}
.snap .polaroid { padding: 7px 7px 20px; transform: rotate(-2deg); transition: transform var(--dur) var(--ease-standard); }
.snap:nth-child(even) .polaroid { transform: rotate(2deg); }
.snap:hover .polaroid { transform: rotate(0) translateY(-3px); }
.snap:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; border-radius: 8px; }
.snap__t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-inline: 2px; min-width: 0; }
.snap__t b { font: 700 17px/1.2 var(--font-display); overflow-wrap: anywhere; }
.snap__t small { font-size: 12px; font-weight: 600; color: var(--text-weaker); }
body.calm .snap .polaroid, body.calm .snap:nth-child(even) .polaroid, body.calm .snap:hover .polaroid { transform: none; }

/* ---- settings ---- */
.panel { border-radius: var(--radius-2xl); padding: 18px; }
.panel .bb-field { gap: 0; }
.grownups { border-radius: var(--radius-2xl); background: var(--bg-base); }
.grownups__summary {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  list-style: none; cursor: pointer; border-radius: inherit;
}
.grownups__summary::-webkit-details-marker { display: none; }
.grownups__summary:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.grownups__ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-lg); background: var(--bg-info-weak); color: var(--text-info); }
.grownups__ico svg { width: 20px; height: 20px; }
.grownups__t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.grownups__t b { font: 700 17px/1.2 var(--font-display); }
.grownups__t small { font-size: 13px; color: var(--text-weaker); }
.grownups__chev svg { width: 20px; height: 20px; color: var(--icon-weak); transition: transform var(--dur); }
.grownups[open] .grownups__chev svg { transform: rotate(90deg); }
.grownups__body { display: flex; flex-direction: column; gap: 14px; padding: 4px 12px 14px; }
.grownups__body .panel { box-shadow: none; border-width: 1px; }

/* ---- the answer sheet: pictures to choose from stay on screen ---- */
.shotframe--small { width: min(100%, 240px); align-self: center; }
.sheet__panel > .shotframe--small + .steve-stage .steve-stage__figure { width: min(100%, 150px); }

/* ---- camera unavailable: Steve says so ---- */
.cam__msg-steve { position: relative; display: block; width: 140px; aspect-ratio: 578 / 480; margin: -8px 0 -4px; }
.cam__msg-steve .steve-figure > svg.marie { position: absolute; inset: 0; margin: auto; width: 62%; height: auto; }

/* ---- quests: collection names line up, whatever the pictures ---- */
.coll-row { border-radius: var(--radius-2xl); }
.coll-row__pics { width: 122px; }
@media (max-width: 380px) { .coll-row__pics { width: 94px; } }
.coll-row__pic[data-found="false"] { background: var(--plate-muted); }

/* ---- menu: the camera button, as on home ---- */
.nav-panel__cta { width: 100%; justify-content: center; margin-top: 24px; min-height: 64px; font-size: 20px; }

/* ---- a find with no photo, up close: its picture on a light plate ---- */
.zoomnone { background: var(--art-plate-teal); align-content: center; }
.zoomnone .sp { width: 62%; height: auto; max-height: 72%; margin-inline: auto; object-fit: contain; }
.zoomnone p.muted { color: #575757; }

/* badge inks: the brand success and warning text is a touch light on its pale
   fills, and these badges carry the safety words, so they get a deeper ink */
:root { --badge-success-ink: #13702b; --badge-warning-ink: #a4420a; }
:root[data-theme="dark"] { --badge-success-ink: var(--text-success); --badge-warning-ink: var(--text-warning); }
.bb-badge--success, .quest-coins[data-done="true"] { color: var(--badge-success-ink); }
.bb-badge--warning, .gcard__flag[data-kind="amber"] { color: var(--badge-warning-ink); }
