/* Bee Heard shared brand. Cream + marigold + charcoal; Fredoka + Nunito.
   The task canvas stays calm (no doodles) even though the brand is playful. */
:root{
  --bg:#f6f1e3; --surface:#fffdf6; --surface-2:#f1e9d6;
  --fg:#2e2d2b; --muted:#7c7566; --line:#e6dcc4;
  --accent:#f2b33d; --accent-ink:#2a2419; --accent-soft:#fbe7c1;
  --good:#2f8a4e; --good-soft:#dff0e2;
  --bad:#c9513a; --bad-soft:#f8e0d7;
  --focus:#cf9324;
  --shadow:0 1px 2px rgba(60,45,20,.07), 0 10px 26px rgba(60,45,20,.10);
  --bee-gold:#f2b33d; --bee-ink:#2e2d2b; --bee-face:#fffdf6;
  --r:18px;
  color-scheme:light;
  --font-head:"Fredoka",-apple-system,Segoe UI,Roboto,sans-serif;
  --font-body:"Nunito",-apple-system,Segoe UI,Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:var(--font-body); line-height:1.5;
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px));
  padding-block:24px 40px;
  display:flex; flex-direction:column; align-items:center; gap:20px;
}
h1,h2,h3{font-family:var(--font-head); font-weight:600; text-wrap:balance; margin:0}
a{color:var(--accent-ink)}

.wrap{width:100%; max-width:760px}

/* brand */
.brandbar{width:100%; max-width:760px; display:flex; align-items:center; justify-content:space-between; gap:12px}
.brand{display:flex; align-items:center; gap:11px}
.bee{display:inline-flex; flex:0 0 auto}
.bee svg{width:48px; height:39px; transform-origin:center}
@media (prefers-reduced-motion:no-preference){ .bee svg{animation:beehover 3.6s ease-in-out infinite} }
@keyframes beehover{0%,100%{transform:translateY(0) rotate(-2.5deg)}50%{transform:translateY(-2px) rotate(2.5deg)}}
.brand b{font-family:var(--font-head); font-size:1.7rem; font-weight:700; letter-spacing:.004em; color:var(--fg)}
.b-gold{color:var(--accent)}
.eyebrow{font-size:.72rem; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); font-weight:600}
.proto{font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--accent-ink); background:var(--accent); border-radius:999px; padding:5px 11px; font-weight:700; white-space:nowrap}

.card{
  width:100%; max-width:760px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); box-shadow:var(--shadow); padding:clamp(20px,4vw,34px);
}
.lead{color:var(--muted); margin:10px 0 0; max-width:60ch}
.hint{margin-top:16px; font-size:.86rem; color:var(--muted)}
.footnote{width:100%; max-width:760px; font-size:.8rem; color:var(--muted); text-align:center; padding:0 6px}

/* buttons */
.btn{cursor:pointer; font:inherit; font-weight:600; border-radius:12px; min-height:56px; padding:0 26px; border:1.5px solid transparent; font-size:1.05rem}
.btn.primary{background:var(--accent); color:var(--accent-ink)}
.btn.ghost{background:var(--surface); color:var(--fg); border-color:var(--line)}
.btn:disabled{opacity:.55; cursor:default}
.btn-row{margin-top:22px; display:flex; gap:12px; flex-wrap:wrap}
:focus-visible{outline:3px solid var(--focus); outline-offset:2px}

/* inputs */
label.field{display:block; font-weight:600; margin-bottom:8px}
input[type=text],input[type=email],input[type=password]{
  width:100%; min-height:52px; font:inherit; padding:0 16px; border-radius:12px;
  border:1.5px solid var(--line); background:var(--surface); color:var(--fg);
}
.code-input{font-family:var(--font-head); font-size:1.5rem; letter-spacing:.12em; text-align:center; text-transform:uppercase}

/* segmented controls */
.panel{margin-top:22px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:18px}
.panel .ptitle{font-family:var(--font-head); font-size:.82rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:600}
.ctrl-row{margin-top:14px}
.ctrl-row > span{display:block; font-size:.9rem; font-weight:600; margin-bottom:8px}
.seg{display:flex; gap:8px; flex-wrap:wrap}
.seg button{flex:1 1 auto; min-width:92px; min-height:48px; cursor:pointer; background:var(--surface); color:var(--fg); border:1.5px solid var(--line); border-radius:10px; font:inherit; font-weight:600; padding:0 14px}
.seg button[aria-pressed="true"]{background:var(--accent); color:var(--accent-ink); border-color:var(--accent)}

/* task */
.topline{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px}
.count{font-family:var(--font-head); font-weight:600; color:var(--muted); font-variant-numeric:tabular-nums}
.pill{font-size:.74rem; letter-spacing:.08em; text-transform:uppercase; font-weight:700; padding:5px 12px; border-radius:999px}
.pill.quiet{background:var(--accent-soft); color:var(--accent-ink)}
.pill.noisy{background:var(--bad-soft); color:var(--bad)}
.bar{height:8px; border-radius:999px; background:var(--line); overflow:hidden; margin-bottom:22px}
.bar > i{display:block; height:100%; background:var(--accent); width:0; transition:width .25s ease}
.stimulus{display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:10px 0 4px}
.stim-icon{width:112px; height:112px; display:grid; place-items:center; background:var(--surface-2); border:1px solid var(--line); border-radius:20px}
.stim-icon svg{width:72px; height:72px}
.stim-name{font-family:var(--font-head); font-size:1.7rem; font-weight:600; letter-spacing:-.01em}
.prompt{color:var(--muted); font-size:1rem}
.rooms{margin-top:22px; display:grid; grid-template-columns:repeat(2,1fr); gap:14px}
.room{cursor:pointer; min-height:120px; background:var(--surface); border:1.5px solid var(--line); border-radius:14px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; font:inherit; color:var(--fg); transition:transform .08s ease, border-color .12s ease, background .12s ease}
.room svg{width:40px; height:40px; color:var(--accent)}
.room span{font-family:var(--font-head); font-weight:600; font-size:1.1rem}
.room:hover{border-color:var(--accent)}
.room:active{transform:scale(.98)}
.room.correct{background:var(--good-soft); border-color:var(--good)}
.room.correct svg{color:var(--good)}
.room.wrong{background:var(--bad-soft); border-color:var(--bad)}
.room.wrong svg{color:var(--bad)}
.room:disabled{cursor:default}
.feedback{margin-top:16px; min-height:1.5em; text-align:center; font-weight:600}
.feedback.ok{color:var(--good)} .feedback.no{color:var(--bad)}

/* results */
.r-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap}
.bignum{font-family:var(--font-head); font-size:2.6rem; font-weight:600; font-variant-numeric:tabular-nums; line-height:1}
.blocks{margin-top:22px; display:grid; grid-template-columns:1fr 1fr; gap:14px}
.block{background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:16px}
.block h3{font-size:.8rem; letter-spacing:.07em; text-transform:uppercase; color:var(--muted)}
.block .n{font-family:var(--font-head); font-size:1.9rem; font-weight:600; font-variant-numeric:tabular-nums; margin-top:6px}
.block .sub{font-size:.85rem; color:var(--muted)}
.cost{margin-top:18px; background:var(--accent-soft); border:1px solid var(--accent); border-radius:12px; padding:18px}
.cost .ctitle{font-family:var(--font-head); font-weight:700; color:var(--accent-ink)}
.cost p{margin:8px 0 0; color:var(--fg)}
.cost b{font-variant-numeric:tabular-nums}

/* distractor overlay */
#vfx{position:fixed; inset:0; pointer-events:none; z-index:5; overflow:hidden}
.fleck{position:absolute; border-radius:50%; opacity:0; will-change:transform,opacity}

/* clinic */
.rowlist{margin-top:18px; display:flex; flex-direction:column; gap:10px}
.rowlink{display:flex; align-items:center; justify-content:space-between; gap:12px; text-decoration:none; color:var(--fg); background:var(--surface); border:1.5px solid var(--line); border-radius:12px; padding:14px 16px}
.rowlink:hover{border-color:var(--accent)}
.rowcode{font-family:var(--font-head); font-weight:700; letter-spacing:.06em; font-size:1.15rem}
.rowmeta{font-size:.85rem; color:var(--muted); text-align:right}
.tag{display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.04em; padding:3px 9px; border-radius:999px; background:var(--surface-2); color:var(--muted); border:1px solid var(--line)}
.err{color:var(--bad); font-weight:600; margin-top:12px; min-height:1.3em}
.warnbox{margin-top:16px; background:var(--accent-soft); border:1px solid var(--accent); border-radius:12px; padding:14px 16px; font-size:.9rem; color:var(--accent-ink)}
.trend{margin-top:18px}
.trend svg{width:100%; height:auto; display:block}
.muted{color:var(--muted)}
.spread{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}

@media (max-width:440px){
  .rooms{grid-template-columns:1fr} .blocks{grid-template-columns:1fr}
  .stim-icon{width:96px;height:96px} .stim-icon svg{width:60px;height:60px}
}
@media (prefers-reduced-motion:reduce){ *{transition:none!important} }
