/* =========================================================================
   Junior's First Coding Experience — styles
   Inherits the Moore house "editorial-luxury" system (DESIGN_SYSTEM.md),
   warmed up for a young maker: forest-green lead, brass + cream, lots of
   whitespace, big tap targets, calm motion. ADHD-friendly: one thing at a
   time, clear "you are here", gentle rewards.
   ========================================================================= */

:root {
  /* --- palette: maps to the canonical Moore tokens in brand.css --- */
  --green:        var(--moore-green);
  --green-deep:   var(--moore-forest);
  --green-soft:   #e9efe6;                  /* local: light sage panel tint */
  --brass:        var(--moore-gold);        /* one true gold */
  --brass-bright: var(--moore-gold-bright);
  --brass-dim:    var(--moore-gold-deep);
  --gold-grad:    var(--moore-gold-grad);
  --cream:        var(--moore-cream);
  --cream-2:      var(--moore-cream-2);
  --paper:        var(--moore-paper);
  --ink:          var(--moore-ink);
  --ink-soft:     #3a423a;
  --muted:        var(--moore-muted);
  --good:         var(--moore-good);
  --good-soft:    var(--moore-good-soft);
  --warn:         var(--moore-warn);
  --line:         var(--moore-line);
  --line-soft:    rgba(31, 38, 32, .08);

  /* --- type --- */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- shape --- */
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 14px 40px -22px rgba(31, 38, 32, .45), 0 2px 8px -4px rgba(31, 38, 32, .15);
  --shadow-soft: 0 6px 22px -16px rgba(31, 38, 32, .4);

  /* --- space --- */
  --gap: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--green-soft) 0%, transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar: monogram + progress ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(250, 246, 235, .85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .mark { width: 38px; height: 38px; flex: none; }
.topbar .brandline { display: flex; flex-direction: column; line-height: 1.1; }
.topbar .brandline b { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 29px); font-weight: 600; letter-spacing: .2px; line-height: 1.04; }
.topbar .brandline b .gilt { font-size: 1em; }
.topbar .brandline span {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--muted); margin-top: 1px; line-height: 1.2;
}
/* special family/people words wear the gold (metallic, like the portal's "Moore") */
.gilt {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; font-weight: 600;
}
.topbar .brandline b .gilt { font-size: 1em; }
.progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress-track {
  width: clamp(90px, 28vw, 240px); height: 9px; border-radius: 999px;
  background: rgba(176, 141, 87, .18); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--brass-bright));
  transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.progress-label { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- wizard shell: content + persistent stage rail ---------- */
.wizard {
  display: flex; align-items: flex-start; gap: clamp(18px, 3vw, 36px);
  max-width: 1080px; margin: 0 auto;
}
.stage {
  flex: 1 1 auto; min-width: 0; max-width: 720px;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 28px) 120px;
}
.railwrap { flex: none; width: 250px; position: sticky; top: 86px; padding: clamp(24px,4vw,44px) 14px 0 0; }
.rail .railnow {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--brass);
  border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-soft); margin-bottom: 14px;
}
.rail .rstep { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-dim); }
.rail .rtitle { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); margin: 3px 0 4px; line-height: 1.1; }
.rail .rdesc { font-size: 14px; color: var(--muted); line-height: 1.45; }
.rail .rnext { font-size: 13.5px; line-height: 1.4; color: var(--green-deep); font-weight: 600; margin-top: 10px; padding: 9px 11px; background: var(--cream-2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 8px; }
.rail .rnext:empty { display: none; }
.raillist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.railitem {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 9px 10px; border-radius: 10px; font-family: var(--sans);
  font-size: 14px; color: var(--muted); transition: background .15s, color .15s;
}
.railitem:hover { background: rgba(60,64,46,.1); color: var(--ink); }
.railitem .rn {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600; background: var(--cream-2); color: var(--muted); border: 1px solid var(--line);
}
.railitem.done .rn { background: var(--good); color: #fff; border-color: var(--good); }
.railitem.done .rn::after { content: "✓"; }
.railitem.done .rlabel { color: var(--ink-soft); }
/* Hâle 3-state vocabulary: done = green, current = gold, todo = grey */
.railitem.active { color: var(--ink); font-weight: 700; }
.railitem.active .rn { background: var(--brass); color: #fff; border-color: var(--brass); }
.railitem.done .rn .num { display: none; }

@media (max-width: 900px) {
  .wizard { display: flex; flex-direction: column; }
  .railwrap { order: -1; width: auto; padding: 12px clamp(16px,4vw,28px) 0; }
  .rail .railnow { margin-bottom: 0; }
  .raillist { display: none; }            /* on phones, just show the current-step card */
  .stage { max-width: 720px; margin: 0 auto; padding-top: 14px; }
}
.screen { display: none; position: relative; animation: rise .45s cubic-bezier(.22,.61,.36,1); }
.screen.active { display: block; }

/* ---------- Junior's own faces (his WhatsApp stickers) ---------- */
/* a warm "mood face" peeks from the top-right of each screen */
.moodface {
  position: absolute; top: -6px; right: 0; z-index: 5;
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  background: var(--paper); border: 3px solid #fff;
  box-shadow: var(--shadow-soft); transform: rotate(3deg);
  animation: facein .55s cubic-bezier(.2,1.2,.4,1);
}
@keyframes facein { from { opacity: 0; transform: rotate(3deg) scale(.55) translateY(-8px); } to { opacity: 1; transform: rotate(3deg) scale(1); } }

/* reaction face that pops at a happy moment (tick done, first commit, …) */
.facepop {
  position: fixed; z-index: 70; width: 70px; height: 70px; border-radius: 50%;
  object-fit: cover; object-position: center top; pointer-events: none;
  border: 3px solid #fff; box-shadow: var(--shadow); background: var(--paper);
  transition: opacity .4s ease;
}
.facepop.anim { animation: facepop .55s cubic-bezier(.2,1.4,.4,1); }
.facepop.big { width: 128px; height: 128px; }
@keyframes facepop { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 60% { transform: scale(1.12) rotate(4deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--brass-dim); margin: 0 0 10px;
}
h1.title { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 7vw, 52px); line-height: 1.05; margin: 0 0 16px; letter-spacing: .2px; }
h2.title { font-family: var(--serif); font-weight: 600; font-size: clamp(27px, 5.5vw, 38px); line-height: 1.12; margin: 0 0 14px; }
.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--ink-soft); margin: 0 0 18px; }
p { margin: 0 0 14px; }
strong { color: var(--ink); }

/* ---------- cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow);
  margin: 0 0 var(--gap);
}
.card.flush { padding: 0; overflow: hidden; }

/* little explainer rows ("meet your team") */
.tile-row { display: grid; gap: 12px; margin: 4px 0 20px; }
.tile {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-soft);
}
.tile .ico { font-size: 26px; line-height: 1; flex: none; width: 34px; text-align: center; }
.tile b { display: block; font-size: 18px; margin-bottom: 2px; }
.tile span { color: var(--muted); font-size: 16px; }

/* ---------- setup stages (checklist) ---------- */
.stagecard { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow-soft); }
.stagecard.done { border-color: rgba(79,174,94,.5); background: var(--good-soft); }
.stagehead {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 18px; text-align: left; color: var(--ink);
}
.stagehead:hover { background: rgba(60,64,46,.07); }
.stage-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600;
  background: var(--green-soft); color: var(--green-deep); border: 1px solid rgba(60,64,46,.5);
}
.stagecard.done .stage-num { background: var(--good); color: #fff; border-color: var(--good); }
.stage-num::after { content: attr(data-n); }
.stagecard.done .stage-num::after { content: "✓"; }
.stagehead .st-title { flex: 1; font-weight: 600; min-width: 0; }
.stagehead .chev { transition: transform .3s; color: var(--muted); flex: none; }
.stagecard.open .chev { transform: rotate(90deg); }
.stagebody { display: none; padding: 4px 18px 20px 62px; }
.stagecard.open .stagebody { display: block; animation: rise .3s ease; }
.stagebody ol { margin: 8px 0 16px; padding-left: 20px; }
.stagebody ol li { margin-bottom: 8px; }
.stagebody a { color: var(--green-deep); font-weight: 600; text-decoration: none; border-bottom: 2px solid rgba(60,64,46,.4); }
.stagebody a:hover { border-color: var(--green-deep); }

.hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--green-soft); border: 1px solid rgba(60,64,46,.4);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0; font-size: 16px;
}
.hint .ico { flex: none; }
.dadnote {
  background: linear-gradient(180deg, #fff8ec, #fdf0db);
  border: 1px solid var(--line); border-left: 4px solid var(--brass);
  border-radius: var(--r-sm); padding: 13px 16px; margin: 12px 0;
  font-size: 16px; color: var(--ink-soft);
}
.dadnote b { color: var(--brass-dim); }

/* copy-a-prompt box */
.promptbox { position: relative; margin: 12px 0; }
.promptbox pre {
  margin: 0; padding: 14px 16px; padding-right: 92px;
  background: #fbf4e6; border: 1px dashed var(--brass);
  border-radius: var(--r-sm); font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
  color: var(--ink-soft); white-space: pre-wrap; word-break: break-word;
}
.copybtn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--green); color: var(--cream); border: 0;
}
.copybtn:hover { background: var(--green-deep); }
.copybtn.copied { background: var(--good); }

/* tick row */
.tick {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 13px 16px; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: #fff; margin-top: 8px;
  font-weight: 600; user-select: none; transition: all .15s;
  min-height: 52px;
}
.tick:hover { border-color: var(--green); }
.tick input { position: absolute; opacity: 0; width: 0; height: 0; }
.tick .box {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--brass); display: grid; place-items: center;
  font-size: 16px; color: #fff; background: #fff; transition: all .15s;
}
.tick input:checked + .box { background: var(--good); border-color: var(--good); }
.tick input:checked + .box::after { content: "✓"; }
.tick input:checked ~ .lbl { color: var(--good); }
.tick:has(input:checked) { border-color: var(--good); background: var(--good-soft); }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 17px; }
.field .help { color: var(--muted); font-size: 15px; font-weight: 400; }
input[type=text], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 17px; color: var(--ink);
  padding: 13px 15px; border: 2px solid var(--line); border-radius: var(--r-sm);
  background: #fff; transition: border-color .15s;
}
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(60,64,46,.18); }
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }

/* chip choices (for "what kind of thing") */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 16px; padding: 11px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; user-select: none; transition: all .15s;
}
.chip:hover { border-color: var(--green); }
.chip.sel { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

/* ---------- quiz ---------- */
.quiz { margin: 6px 0; }
.q-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font-family: var(--sans); font-size: 17px; color: var(--ink);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; transition: all .15s;
}
.q-opt:hover { border-color: var(--green); }
.q-opt .key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; background: var(--green-soft); color: var(--green-deep); }
.q-opt.right { border-color: var(--good); background: var(--good-soft); }
.q-opt.right .key { background: var(--good); color: #fff; }
.q-opt.wrong { border-color: var(--warn); background: #fdeee9; }
.q-opt.wrong .key { background: var(--warn); color: #fff; }
.q-feedback { margin-top: 8px; font-size: 16px; font-weight: 600; min-height: 1px; }
.q-feedback.good { color: var(--good); }
.q-feedback.try { color: var(--warn); }

/* generated summary block */
.summary {
  background: var(--green-soft); border: 1px solid rgba(60,64,46,.45);
  border-radius: var(--r-md); padding: 18px 20px; margin: 14px 0;
}
.summary h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 23px; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.summary dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--green-deep); padding-top: 4px; }
.summary dd { margin: 0; font-weight: 600; }

/* ---------- buttons / nav ---------- */
.nav { display: flex; gap: 12px; align-items: center; margin-top: 26px; }
.btn {
  font-family: var(--sans); font-weight: 700; font-size: 18px; cursor: pointer;
  padding: 15px 28px; border-radius: 999px; border: 0; transition: transform .12s, box-shadow .2s, background .2s;
  min-height: 54px;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(180deg, var(--green), var(--green-deep)); color: #fff; box-shadow: 0 10px 24px -12px rgba(27,42,29,.9); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(27,42,29,.95); }
.btn-ghost { background: transparent; color: var(--muted); padding: 15px 18px; }
.btn-ghost:hover { color: var(--ink); }
.btn-brass { background: linear-gradient(180deg, var(--brass-bright), var(--brass)); color: #fff; box-shadow: 0 10px 24px -12px rgba(176,137,74,.9); }
.btn-green { background: linear-gradient(180deg, var(--green), var(--green-deep)); color: #fff; box-shadow: 0 8px 20px -12px rgba(27,42,29,.9); }
.btn-green:hover { box-shadow: 0 12px 26px -12px rgba(27,42,29,.95); }
.spacer { flex: 1; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* encouragement banner */
.cheer {
  font-family: var(--serif); font-style: italic; font-size: clamp(20px, 3vw, 26px);
  color: var(--brass-dim); text-align: center; margin: 18px 0;
}

/* ---------- celebration screen ---------- */
.bigwin { text-align: center; }
.bigwin .burstmark { font-size: 76px; line-height: 1; margin-bottom: 6px; animation: pop .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.recap { text-align: left; display: grid; gap: 10px; margin: 18px 0; }
.recap .done-row { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); }
.recap .done-row .ck { color: var(--good); font-weight: 800; flex: none; }

/* certificate */
.cert {
  position: relative; overflow: hidden;
  border: 3px double var(--brass); border-radius: var(--r-md);
  background: linear-gradient(180deg, #fffdf6, #fbf4e6);
  padding: 32px 26px; text-align: center; margin: 18px 0;
}
/* subtle chess-board flourish: a quiet nod to a game he loves */
.cert::before, .cert::after {
  content: ""; position: absolute; left: 0; right: 0; height: 12px;
  background-image: repeating-conic-gradient(var(--brass) 0% 25%, transparent 0% 50%);
  background-size: 12px 12px; opacity: .3;
}
.cert::before { top: 0; }
.cert::after { bottom: 0; }
.cert-portrait {
  display: block; width: 118px; height: 118px; margin: 0 auto 10px;
  border-radius: 50%; object-fit: cover; object-position: center top;
  border: 4px solid var(--brass); background: var(--paper);
  box-shadow: var(--shadow-soft); position: relative;
}
.cert .seal { width: 40px; height: 40px; margin: 0 auto 4px; }
.cert .k { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--brass-dim); }
.cert .who { font-family: var(--serif); font-size: 34px; font-weight: 600; margin: 4px 0; }
.cert .what { color: var(--ink-soft); }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- floating maker tools: Idea Box + Progress ---------- */
.fabs { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.fab {
  font-family: var(--sans); font-weight: 700; font-size: 14px; cursor: pointer;
  padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-soft); min-height: 44px;
}
.fab:hover { border-color: var(--brass); }
.fab.reading { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(27, 42, 29, .45); backdrop-filter: blur(3px); padding: 16px;
  animation: rise .25s ease;
}
.overlay[hidden] { display: none; }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 86vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 28px); box-shadow: var(--shadow);
}
.sheet h3 { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.sheet-lead { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; }
.sheet-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted);
}
.sheet-x:hover { color: var(--ink); border-color: var(--brass); }
.bigtoggle { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-weight: 600; cursor: pointer; }
.bigtoggle input { width: 20px; height: 20px; accent-color: var(--brass); }
.idea-group { margin-top: 18px; }
.idea-group h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-dim); margin: 0 0 8px; }
.idea-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; margin-bottom: 8px; }
.idea-row.big { background: linear-gradient(180deg, #fff8ec, #fdf0db); }
.idea-row.built .idea-txt { text-decoration: line-through; color: var(--muted); }
.idea-txt { flex: 1; min-width: 0; }
.idea-built { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-size: 12px; padding: 4px 10px; cursor: pointer; color: var(--muted); }
.idea-built:hover { border-color: var(--good); color: var(--good); }
/* Tell-my-family share rows */
.share-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.share-row:first-of-type { border-top: 0; }
.share-name { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); }
.share-go { padding: 9px 16px; min-height: 42px; font-size: 14px; }
.share-todo { font-size: 13px; color: var(--muted); font-style: italic; }
.share-rm { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream-2, #f6f0e0); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.share-rm:hover { background: #f7e3da; color: var(--warn, #e0653f); border-color: var(--warn, #e0653f); }
.addcontact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.addcontact input { flex: 1 1 130px; min-width: 0; padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--line); font-family: var(--sans); font-size: 15px; background: #fff; color: var(--ink); }
.addcontact input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.addcontact .btn-green { flex: none; padding: 11px 18px; min-height: 44px; font-size: 15px; }

.clockout .btn { width: 100%; margin-bottom: 8px; }
.clockout .btn-ghost { border: 1px solid var(--line); }
/* progress rows: each milestone in its own box; done = green box */
.winlist { display: grid; gap: 8px; }
.winrow {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--muted);
}
.winrow.done { background: var(--good-soft); border-color: rgba(79,174,94,.55); color: var(--ink-soft); }
.winrow .wk {
  flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; background: #ece7da; color: #bdb6a4;
}
.winrow.done .wk { background: var(--good); color: #fff; }
.winrow .wl { flex: 1; min-width: 0; font-weight: 600; }
.savejourney { margin-top: 16px; }
.savejourney .btn { width: 100%; margin-bottom: 8px; }
.savejourney .btn-ghost { border: 1px solid var(--line); }
.savehint { font-size: 13px; color: var(--muted); text-align: center; margin: 2px 0 0; }
.grownups { font-size: 12.5px; line-height: 1.5; color: var(--muted); max-width: 600px; margin: 18px auto 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.feelrow { display: flex; gap: 10px; }
.feelbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; background: var(--cream-2); border: 2px solid var(--line); border-radius: 14px; padding: 12px 6px; min-height: 64px; transition: border-color .15s, background .15s; }
.feelbtn .fe { font-size: 26px; line-height: 1; }
.feelbtn .fl { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink); }
.feelbtn:hover { border-color: var(--brass); }
.feelbtn.sel { border-color: var(--brass); background: #fff; }
.welcomeback { border-left: 4px solid var(--brass); }
.welcomeback #wbTitle { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--green); margin: 0 0 8px; line-height: 1.1; }
.welcomeback .wbnext { font-size: 14px; font-weight: 600; color: var(--green-deep); margin: 8px 0 0; padding: 9px 11px; background: var(--cream-2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 8px; }
.welcomeback .wbnext:empty { display: none; }

/* cheer-buddy (optional, fade-able companion) */
.buddy { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: flex; align-items: flex-end; gap: 8px; max-width: 320px; }
.buddy.anim.show { animation: buddyIn .35s cubic-bezier(.2,1.3,.4,1); }
@keyframes buddyIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.buddy-face { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brass); background: var(--cream-2); flex: none; box-shadow: 0 8px 20px -10px rgba(60,64,46,.5); }
.buddy-bubble { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 14px 14px 14px 4px; padding: 10px 13px; font-size: 14px; color: var(--ink); line-height: 1.35; box-shadow: 0 8px 22px -12px rgba(60,64,46,.5); }
.buddy-actions { display: flex; gap: 10px; margin-top: 7px; }
.buddy-actions button { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: transparent; border: 0; cursor: pointer; padding: 0; }
.buddy-actions button:hover { color: var(--brass-dim); }
.buddytoggle { display: flex; align-items: center; gap: 9px; margin: 14px 0 4px; font-size: 14px; color: var(--ink); cursor: pointer; }
.buddytoggle input { width: 18px; height: 18px; accent-color: var(--green); }
@media (max-width: 560px) { .buddy { max-width: calc(100vw - 32px); } .buddy-face { width: 48px; height: 48px; } }

/* live bus feed */
.liverow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.livestatus { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--green); }
.feedlist { display: grid; gap: 8px; margin: 8px 0 2px; }
.feeditem { display: flex; gap: 10px; align-items: flex-start; background: var(--cream-2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 10px; padding: 10px 12px; }
.feeditem .fi { font-size: 18px; line-height: 1.3; flex: none; }
.feeditem .ft { font-size: 14.5px; color: var(--ink); line-height: 1.4; }
/* badges (gamified achievements layered on the honest completion state) */
.prog-sub { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-dim); margin: 16px 0 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: var(--muted); }
.badge-chip .bi { font-size: 16px; filter: grayscale(1); opacity: .45; }
.badge-chip.earned { background: linear-gradient(180deg, #fff8ec, #fdf0db); border-color: var(--brass); color: var(--brass-dim); }
.badge-chip.earned .bi { filter: none; opacity: 1; }
@media (max-width: 540px) { .fab { font-size: 13px; padding: 10px 13px; } }

/* gentle, optional brain-break nudge */
.breaknudge {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 75;
  max-width: min(94vw, 520px); display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  background: var(--green); color: var(--cream); padding: 12px 18px; border-radius: 18px; box-shadow: var(--shadow); font-size: 14px;
}
.breaknudge[hidden] { display: none; }
.breaknudge .bn-btns { display: flex; gap: 8px; }
.breaknudge button {
  border: 1px solid rgba(239,231,211,.4); background: transparent; color: var(--cream);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 700; min-height: 38px;
}
.breaknudge button:hover { border-color: var(--brass-bright); }
@media (max-width: 540px) { .breaknudge { bottom: 12px; } }

/* footer */
.footnote { text-align: center; color: var(--muted); font-size: 14px; margin-top: 30px; }
.footnote .heart { color: #d9636b; }

/* ---------- small screens ---------- */
@media (max-width: 540px) {
  body { font-size: 17px; }
  .stagebody { padding-left: 18px; }
  .nav { flex-wrap: wrap; }
  .btn { width: 100%; }
  .btn-ghost { width: auto; }
  .spacer { display: none; }
  .progress-label { display: none; }
}

/* ---------- respect reduced motion (ADHD / accessibility) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- clear keyboard focus (pre-Junior QC #5) ----------
   Keyboard users must always see where focus is. One obvious brass ring on
   every interactive element, using a brand token (never blue). */
.btn:focus-visible,
.q-opt:focus-visible,
.stagehead:focus-visible,
.chip:focus-visible,
.fab:focus-visible,
.sheet-x:focus-visible,
.railitem:focus-visible,
.copybtn:focus-visible {
  outline: 3px solid var(--brass-bright);
  outline-offset: 3px;
}

/* ---------- top bar on very small screens (pre-Junior QC #6) ----------
   On iPhone-SE width the monogram + title/subtitle + progress track can crowd.
   Hide the progress track; Junior still has the step rail + step card to know
   where he is. Desktop is untouched. */
@media (max-width: 480px) {
  .progress-track { display: none; }
}

/* ---------- smoother background on mobile (pre-Junior QC #7) ----------
   background-attachment: fixed can be janky on mobile Safari. Scroll the
   background on small screens; desktop keeps the fixed look. */
@media (max-width: 700px) {
  body { background-attachment: scroll; }
}
