/* Emotibears Calm Toolbox (10 Nov 2026) - toolbox.js. Big, picture-led, touch-friendly (targets 48px+),
   readable contrast, still versions with "reduce motion". Uses the styles.css tokens with fallbacks. */
.tb-card-wrap{background:#fff; border:1px solid var(--line,#E7DCC8); border-radius:24px; padding:clamp(16px,3vw,28px); margin:0 0 24px; box-shadow:0 14px 30px -24px rgba(46,42,36,.4);}
.tb-head{display:flex; gap:16px; align-items:center; margin-bottom:12px;}
.tb-head > img, .tb-head > .tb-head__pic{width:84px; height:84px; flex:0 0 84px; border-radius:50%; object-fit:cover; background:var(--cream,#FBF3E7); border:3px solid #fff; box-shadow:0 4px 12px rgba(46,42,36,.15); display:flex; align-items:center; justify-content:center; font-size:2.6rem;}
.tb-head h2{margin:0 0 4px; color:var(--navy,#233A5C); font-size:clamp(1.35rem,3vw,1.75rem);}
.tb-head p{margin:0; color:#584f40;}
.tb-tool{margin-top:8px;}
.tb-say{font-size:1.08rem; font-weight:700; color:var(--ink,#2E2A24); line-height:1.5;}
.tb-small{font-size:.92rem; color:#584f40;}
.tb-safe{margin-top:16px; padding:12px 16px; border-radius:14px; background:#FFF4D6; border:2px solid var(--gold,#E0A937); font-weight:700; color:var(--ink,#2E2A24);}
.tb-link{display:inline-block; margin-top:12px; font-weight:800; color:var(--coral-deep,#A74B2B); text-decoration:underline; text-underline-offset:3px;}
.tb-emoji{font-size:2.4rem; line-height:1;}
.tb-progress{font-weight:800; color:var(--coral-deep,#A74B2B); margin:0 0 6px; min-height:1.4em;}

/* ---- Read to me ---- */
.tb-read{display:inline-flex; align-items:center; gap:6px; margin:8px 0 4px; padding:8px 14px; min-height:44px; border-radius:999px;
  border:2px solid var(--navy,#233A5C); background:#fff; color:var(--navy,#233A5C); font:inherit; font-weight:800; cursor:pointer;}
.tb-read:hover{background:#FDF3DC;}
.tb-read[aria-pressed="true"]{background:var(--navy,#233A5C); color:#fff;}
.tb-read:focus-visible, .tb-choice:focus-visible, .tb-swatch:focus-visible, .tb-sticker:focus-visible, .tb-tray__item:focus-visible,
.tb-bubble:focus-visible, .tb-tile:focus-visible, .tb-hub a:focus-visible{outline:3px solid var(--coral-deep,#A74B2B); outline-offset:3px;}

/* ---- Toolbox home: big picture tiles ---- */
.tb-hub{list-style:none; margin:18px 0 8px; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:16px;}
.tb-hub a{display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; height:100%; padding:18px 12px 16px; border-radius:22px;
  background:var(--tile,#FFF4D6); border:3px solid transparent; color:var(--navy,#233A5C); text-decoration:none; box-shadow:0 8px 0 rgba(46,42,36,.08); transition:transform .15s ease, border-color .15s ease;}
.tb-hub a:hover{transform:translateY(-3px); border-color:var(--navy,#233A5C);}
.tb-hub__pic{width:96px; height:96px; border-radius:50%; background:#fff; display:flex; align-items:center; justify-content:center; font-size:3rem; overflow:hidden; box-shadow:inset 0 0 0 3px rgba(255,255,255,.8);}
.tb-hub__pic img{width:100%; height:100%; object-fit:cover;}
.tb-hub__name{font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.18rem; line-height:1.15;}
.tb-hub__who{font-size:.86rem; font-weight:700; color:#584f40;}
.tb-hub li:nth-child(6n+1) a{--tile:#FFE7DC;} .tb-hub li:nth-child(6n+2) a{--tile:#E3F2EF;} .tb-hub li:nth-child(6n+3) a{--tile:#FFF1C2;}
.tb-hub li:nth-child(6n+4) a{--tile:#EFE4F1;} .tb-hub li:nth-child(6n+5) a{--tile:#E1ECF7;} .tb-hub li:nth-child(6n+6) a{--tile:#F9E1EA;}
@media (max-width:480px){ .tb-hub{grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px;} .tb-hub__pic{width:72px; height:72px; font-size:2.3rem;} .tb-hub__name{font-size:1.02rem;} }

/* ---- choices ---- */
.tb-pick{display:flex; flex-wrap:wrap; gap:10px; margin:12px 0;}
.tb-pick--col{flex-direction:column; flex-wrap:nowrap;}
.tb-choice{display:inline-flex; align-items:center; gap:8px; min-height:48px; padding:8px 16px; border-radius:16px; border:3px solid var(--line,#E7DCC8);
  background:#fff; color:var(--navy,#233A5C); font:inherit; font-weight:800; font-size:1rem; cursor:pointer; text-align:left; transition:transform .12s ease, border-color .12s;}
.tb-choice:hover{border-color:var(--navy,#233A5C);}
.tb-choice:active{transform:scale(.97);}
.tb-choice[aria-pressed="true"]{border-color:var(--coral,#E8734A); background:#FFF0E8; box-shadow:0 0 0 3px rgba(232,115,74,.25);}
.tb-choice:disabled{opacity:.45; cursor:default;}
.tb-choice--big{flex-direction:column; min-width:118px; padding:12px; text-align:center;}
.tb-choice__pic{font-size:2.4rem; line-height:1;}
.tb-choice__word{font-size:1rem; line-height:1.2;}
.tb-choice__word small{display:block; font-weight:600; font-size:.82rem; color:#584f40;}
.tb-ctrl{display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:14px 0 4px;}
.tb-ctrl .btn{min-height:48px;}
.tb-row{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:10px 0;}
.tb-done{margin-top:16px; padding:16px; border-radius:18px; background:#E3F2EF;}
.tb-done__q{font-weight:800; font-size:1.15rem; color:var(--navy,#233A5C); margin:0 0 6px;}
.tb-done__reply{font-weight:700; min-height:1.4em;}

/* ---- breathing buddies ---- */
.tb-breathe__stage{max-width:420px; margin:8px auto 0; background:linear-gradient(180deg,#F4FBFD,#FFF8EC); border-radius:24px; padding:8px;}
.tb-breathe__stage svg{width:100%; height:auto; display:block;}
.tb-breathe__word{text-align:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:clamp(1.3rem,3.4vw,1.8rem); color:var(--navy,#233A5C); margin:12px 0 0; min-height:2.4em;}
.tb-breathe__count{text-align:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:2.6rem; line-height:1; color:var(--coral-deep,#A74B2B); min-height:1em; margin:4px 0;}
.tb-dots{list-style:none; display:flex; justify-content:center; gap:10px; padding:0; margin:8px 0;}
.tb-dots li{width:22px; height:22px; border-radius:50%; border:3px solid var(--navy,#233A5C); background:#fff;}
.tb-dots li.is-done{background:var(--gold,#E0A937);}
[data-tool="breathe"] .tb-ctrl{justify-content:center;}
.tb-flower.is-active ellipse{filter:drop-shadow(0 0 6px rgba(242,169,194,.9));}

/* ---- feelings ---- */
.tb-faces{display:grid; grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); gap:10px; margin:12px 0;}
.tb-face{flex-direction:column; justify-content:center; padding:10px 6px; text-align:center;}
.tb-face img{width:84px; height:84px; object-fit:contain; border-radius:14px;}
.tb-face .tb-emoji{font-size:3.2rem;}
.tb-bodymap{display:grid; grid-template-columns:minmax(160px,260px) 1fr; gap:18px; align-items:center;}
@media (max-width:560px){ .tb-bodymap{grid-template-columns:1fr;} .tb-body--map{max-width:200px; margin:0 auto;} }
.tb-body{width:100%; height:auto; display:block; overflow:visible;}
.tb-body--map [data-part]{cursor:pointer;}
.tb-body [data-part]{transition:filter .2s ease;}
.tb-body [data-part].is-on{filter:drop-shadow(0 0 0 #F4C542) drop-shadow(0 0 7px #F4C542) drop-shadow(0 0 3px #E8734A);}
.tb-body--map [data-part].is-on{animation:tb-glow 1.6s ease-in-out 3;}
@keyframes tb-glow{50%{filter:drop-shadow(0 0 12px #F4C542) drop-shadow(0 0 5px #E8734A);}}
.tb-card{display:grid; grid-template-columns:120px 1fr 110px; gap:16px; align-items:center; padding:18px; border-radius:22px; background:#FFF8EC; border:3px dashed var(--gold,#E0A937); margin:10px 0 16px;}
.tb-card__face img{width:120px; height:120px; object-fit:contain; border-radius:16px;}
.tb-card__face .tb-emoji{font-size:5rem;}
.tb-card__big{font-family:'Baloo 2',sans-serif; font-size:1.6rem; color:var(--navy,#233A5C); margin:0;}
.tb-card .tb-say{margin:4px 0;}
@media (max-width:560px){ .tb-card{grid-template-columns:90px 1fr;} .tb-card .tb-body--mini{display:none;} .tb-card__face img{width:90px; height:90px;} }
.tb-tiles{list-style:none; padding:0; margin:8px 0; display:flex; flex-wrap:wrap; gap:10px;}
.tb-tile{display:inline-flex; align-items:center; gap:10px; min-height:56px; padding:8px 16px 8px 10px; border-radius:18px; background:#E1ECF7; color:var(--navy,#233A5C); font-weight:800; text-decoration:none;}
.tb-tile:hover{background:#cfe0f1;}
.tb-tile__pic{font-size:2rem;}

/* ---- worry box ---- */
.tb-worry{display:grid; grid-template-columns:1.4fr 1fr; gap:22px; align-items:start;}
@media (max-width:700px){ .tb-worry{grid-template-columns:1fr;} }
.tb-worry__label{margin:0 0 8px;}
.tb-worry__write{display:block; margin-top:10px; font-weight:700; font-size:.92rem;}
.tb-worry__write textarea{display:block; width:100%; margin-top:6px; padding:10px 12px; font:inherit; font-size:1.05rem; border:2px solid var(--line,#E7DCC8); border-radius:14px; resize:vertical;}
.tb-worry__write textarea:focus{outline:3px solid var(--coral-deep,#A74B2B); outline-offset:2px;}
.tb-worry__box{display:flex; flex-direction:column; align-items:center; text-align:center; gap:12px;}
.tb-box{position:relative; width:190px; height:170px; margin-top:20px;}
.tb-box__body{position:absolute; left:0; right:0; bottom:0; height:120px; border-radius:10px 10px 18px 18px; background:repeating-linear-gradient(90deg,#B07A4A 0 22px,#A26D40 22px 26px); box-shadow:inset 0 -10px 0 rgba(0,0,0,.08);}
.tb-box__label{position:absolute; left:50%; top:50%; transform:translate(-50%,-30%); background:#FFF4D6; color:var(--navy,#233A5C); font-weight:900; padding:4px 10px; border-radius:8px; font-size:.95rem; white-space:nowrap;}
.tb-box__lid{position:absolute; left:-8px; right:-8px; top:20px; height:36px; border-radius:12px; background:#8C5A32; transform-origin:10% 100%; transition:transform .45s cubic-bezier(.4,1.4,.6,1); display:flex; align-items:center; justify-content:center; color:#F2A9C2; font-size:1.2rem; z-index:2;}
.tb-box.is-open .tb-box__lid{transform:rotate(-38deg) translate(-6px,-10px);}
.tb-box.is-closed .tb-box__lid{animation:tb-lid .5s ease-out;}
@keyframes tb-lid{0%{transform:rotate(-38deg);} 70%{transform:rotate(4deg);} 100%{transform:rotate(0);}}
.tb-box.is-closed{animation:tb-boxglow 1.4s ease-out;}
@keyframes tb-boxglow{30%{filter:drop-shadow(0 0 16px #F4C542);}}
[data-tool="worrybox"]{position:relative;}
.tb-flying{position:absolute; z-index:20; background:#fff; border-radius:10px; box-shadow:0 8px 20px rgba(46,42,36,.25); padding:6px; pointer-events:none;
  animation:tb-fly 1.3s cubic-bezier(.5,0,.6,1) forwards;}
.tb-flying img{display:block; width:100%; height:auto; border-radius:6px;}
.tb-flying p{margin:4px 0 0; font-weight:700; font-size:.85rem;}
@keyframes tb-fly{0%{transform:translate(0,0) scale(1) rotate(0);} 35%{transform:translate(0,-10px) scale(.6,.55) rotate(-25deg); border-radius:40%;}
  100%{transform:translate(var(--dx),var(--dy)) scale(.08) rotate(260deg); opacity:.2; border-radius:50%;}}

/* ---- drawing pads ---- */
.tb-pad{position:relative; border-radius:18px; overflow:hidden; border:3px solid var(--line,#E7DCC8); background:#fff;}
.tb-canvas{display:block; width:100%; height:440px; touch-action:none; cursor:crosshair;}
.tb-pad--small .tb-canvas{height:240px;}
@media (max-width:640px){ .tb-canvas{height:340px;} .tb-pad--small .tb-canvas{height:210px;} }
.tb-swatches{display:flex; flex-wrap:wrap; gap:8px;}
.tb-swatch{width:44px; height:44px; border-radius:50%; border:3px solid #fff; box-shadow:0 0 0 2px var(--line,#E7DCC8); cursor:pointer; padding:0;}
.tb-swatch[aria-pressed="true"]{box-shadow:0 0 0 3px var(--navy,#233A5C); transform:scale(1.08);}
.tb-swatch--rainbow{background:conic-gradient(#E04B4B,#F4C542,#5E9E5A,#4BA3C7,#845686,#E04B4B);}
.tb-size{justify-content:center; min-width:56px;}
.tb-size__dot{display:block; border-radius:50%; background:var(--navy,#233A5C);}

/* ---- bubbles ---- */
.tb-sky{position:relative; height:380px; border-radius:22px; overflow:hidden; background:linear-gradient(180deg,#BFE6F5 0%,#E9F7FB 60%,#FFF8EC 100%);}
.tb-bubble{position:absolute; bottom:-120px; width:var(--s); height:var(--s); border-radius:50%; border:0; padding:0; cursor:pointer;
  background:radial-gradient(circle at 32% 30%, rgba(255,255,255,.95) 0 8%, rgba(255,255,255,.25) 22%, color-mix(in srgb, var(--c) 55%, transparent) 70%, var(--c) 100%);
  box-shadow:inset 0 0 12px rgba(255,255,255,.8), 0 2px 8px rgba(46,42,36,.12);
  animation:tb-rise var(--rise) linear forwards, tb-sway 3.2s ease-in-out infinite alternate;}
@keyframes tb-rise{to{bottom:calc(100% + 20px);}}
@keyframes tb-sway{from{translate:calc(var(--sway) * -1) 0;} to{translate:var(--sway) 0;}}
.tb-sky.is-paused .tb-bubble{animation-play-state:paused;}
.tb-bubble.is-popped{animation:tb-pop .38s ease-out forwards !important;}
@keyframes tb-pop{to{transform:scale(1.6); opacity:0;}}
.tb-word{position:absolute; transform:translate(-50%,-50%); font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.4rem; color:var(--navy,#233A5C);
  text-shadow:0 2px 0 #fff; pointer-events:none; animation:tb-wordup 1.6s ease-out forwards; white-space:nowrap;}
@keyframes tb-wordup{0%{opacity:0; transform:translate(-50%,-30%) scale(.7);} 20%{opacity:1;} 100%{opacity:0; transform:translate(-50%,-160%) scale(1.1);}}

/* ---- happy place ---- */
.tb-scene{position:relative; aspect-ratio:4/3; max-height:560px; width:100%; border-radius:22px; overflow:hidden; border:3px solid var(--line,#E7DCC8); touch-action:none;
  background-size:cover; background-position:center; -webkit-print-color-adjust:exact; print-color-adjust:exact;}
.tb-scene--woods{background-image:var(--woods, linear-gradient(#cfeaf7,#e7f5dc 60%,#7bbf6a 60%));}
.tb-scene--meadow{background:radial-gradient(120% 60% at 50% 110%, #7bbf6a 0 45%, transparent 46%), radial-gradient(60% 40% at 20% 58%, transparent 60%, rgba(232,115,74,.5) 61% 63%, rgba(244,197,66,.5) 63% 65%, rgba(94,158,90,.5) 65% 67%, rgba(75,163,199,.5) 67% 69%, rgba(132,86,134,.5) 69% 71%, transparent 72%), linear-gradient(#bfe6f5,#f3fbff);}
.tb-scene--beach{background:linear-gradient(#bfe6f5 0 45%, #4ba3c7 45% 62%, #f3dfb0 62%);}
.tb-scene--snow{background:radial-gradient(90% 40% at 30% 100%, #fff 0 60%, transparent 61%), radial-gradient(90% 40% at 80% 105%, #eef5fb 0 60%, transparent 61%), linear-gradient(#7d93c8,#c9d8f0);}
.tb-scene--space{background:radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 20%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 45% 70%, #fff 0 1px, transparent 2px), radial-gradient(circle at 85% 65%, #fff 0 1px, transparent 2px), radial-gradient(circle at 10% 80%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 60% 45%, #fff 0 1px, transparent 2px), linear-gradient(#1b2547,#3b2e66);}
.tb-sticker{position:absolute; transform:translate(-50%,-50%); font-size:calc(var(--size) * 1cqw); width:auto; line-height:1; padding:0; border:0; background:none; cursor:grab; touch-action:none; user-select:none;}
.tb-scene{container-type:inline-size;}
.tb-sticker--bear{width:calc(var(--size) * 1cqw); height:calc(var(--size) * 1cqw); border-radius:50%; overflow:hidden; border:3px solid #fff; box-shadow:0 3px 8px rgba(46,42,36,.3);}
.tb-sticker--bear img{width:100%; height:100%; object-fit:cover; display:block;}
.tb-sticker.is-selected{outline:3px dashed var(--coral-deep,#A74B2B); outline-offset:4px; border-radius:10px;}
.tb-sticker--bear.is-selected{border-radius:50%;}
.tb-tray{display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; padding:10px; border-radius:18px; background:var(--cream,#FBF3E7);}
.tb-tray__item{width:52px; height:52px; border-radius:14px; border:2px solid transparent; background:#fff; font-size:1.9rem; line-height:1; cursor:pointer; padding:0; display:flex; align-items:center; justify-content:center;}
.tb-tray__item:hover{border-color:var(--navy,#233A5C);}
.tb-tray__bear img{width:44px; height:44px; border-radius:50%; object-fit:cover;}
.tb-stickbar{margin-top:10px;}

/* ---- printing one thing ---- */
.tb-print-box{display:none;}
@media print{
  html.tb-printing body *{visibility:hidden !important;}
  html.tb-printing .tb-print-target, html.tb-printing .tb-print-target *{visibility:visible !important;}
  html.tb-printing .tb-print-target{display:block !important; position:fixed; left:0; top:0; width:100%; max-height:none; margin:0; border:0; box-shadow:none;}
  html.tb-printing .tb-print-target.tb-card{display:grid !important;}
  .tb-print-pic{width:100%; height:auto;}
  .tb-read{display:none !important;}
}

/* ---- pictures on the Club activities' choices (wellbeing.js) ---- */
.wb-chips--pics{display:grid !important; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px;}
.wb-chips--pics > li{display:flex;}
.wb-chips--pics .wb-chip{display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; width:100%; min-height:110px; padding:10px; border-radius:18px; font-size:.98rem; line-height:1.2;}
.wb-pic{font-size:2.3rem; line-height:1;}
.wb-pic img{width:64px; height:64px; object-fit:contain; border-radius:12px; display:block;}
/* feelings thermometer: colours and faces for each size */
.wb-thermo-step{position:relative;}
.wb-thermo-step[data-level="5"]{background:#F6B2A6;} .wb-thermo-step[data-level="4"]{background:#F9CBA0;} .wb-thermo-step[data-level="3"]{background:#FBE39A;}
.wb-thermo-step[data-level="2"]{background:#CDE8B9;} .wb-thermo-step[data-level="1"]{background:#BFE3EE;}
.wb-thermo-step::before{font-size:1.8rem; line-height:1; margin-right:8px;}
.wb-thermo-step[data-level="5"]::before{content:"😫";} .wb-thermo-step[data-level="4"]::before{content:"😣";} .wb-thermo-step[data-level="3"]::before{content:"😕";}
.wb-thermo-step[data-level="2"]::before{content:"🙂";} .wb-thermo-step[data-level="1"]::before{content:"😌";}
/* squeeze and let go: the bear shows the part */
.wb-pmr.has-body .wb-pmr-bear{display:none;}
.wb-pmr .tb-body--pmr{width:150px; flex:0 0 150px;}
.tb-body--pmr [data-part].is-on{filter:drop-shadow(0 0 6px #F4C542) drop-shadow(0 0 2px #E8734A);}
.is-squeeze .tb-body--pmr [data-part].is-on{animation:tb-squeeze 1s ease-in-out infinite;}
.is-letgo .tb-body--pmr [data-part].is-on{filter:drop-shadow(0 0 4px #7BC4B7); transition:filter 1s;}
@keyframes tb-squeeze{50%{transform:scale(.92); filter:drop-shadow(0 0 10px #E8734A);}}
.tb-body--pmr [data-part]{transform-box:fill-box; transform-origin:center;}

@media (prefers-reduced-motion: reduce){
  .tb-hub a, .tb-choice, .tb-box__lid{transition:none;}
  .tb-body--map [data-part].is-on, .is-squeeze .tb-body--pmr [data-part].is-on, .tb-box.is-closed, .tb-box.is-closed .tb-box__lid{animation:none;}
  .tb-flying{animation:none; opacity:0;}
  .tb-bubble{position:relative !important; bottom:auto; animation:none; display:inline-block; margin:10px;}
  .tb-sky{height:auto; min-height:220px; display:flex; flex-wrap:wrap; align-content:center; justify-content:center; padding:16px;}
  .tb-bubble.is-popped{animation:none !important; opacity:0;}
  .tb-word{animation:none; opacity:0;}
}

/* Activities room: big pictures on the feel-good activity cards */
.wb-index__pic{display:block; font-size:2.8rem; line-height:1; margin-bottom:8px;}

/* ---- circle of control ---- */
.tb-control{position:relative; width:min(100%,460px); aspect-ratio:1; margin:10px auto;}
.tb-control__outer{position:absolute; inset:0; border-radius:50%; border:4px dashed #9AA7BD; background:#EEF3FA; cursor:pointer; padding:0;}
.tb-control__inner{position:absolute; inset:24%; border-radius:50%; border:4px solid #5E9E5A; background:#E6F4DF; cursor:pointer; padding:0; z-index:2;}
.tb-control__outer:hover{background:#e3ebf6;} .tb-control__inner:hover{background:#d9efcf;}
.tb-control__outer:focus-visible, .tb-control__inner:focus-visible{outline:3px solid var(--coral-deep,#A74B2B); outline-offset:4px;}
.tb-control__label{position:absolute; left:50%; top:12%; transform:translateX(-50%); white-space:nowrap; font-weight:900; color:#2F6B2C; font-size:1rem;}
.tb-control__label--out{top:3%; color:#3D4B66;}
.tb-control__spots{position:absolute; left:12%; right:12%; top:30%; bottom:10%; display:flex; flex-wrap:wrap; align-content:flex-start; justify-content:center; gap:4px;}
.tb-control__spots--out{left:4%; right:4%; top:auto; bottom:3%; height:20%; align-content:flex-end;}
.tb-control__chip{font-size:2rem; line-height:1; animation:tb-pop-in .35s ease-out;}
@keyframes tb-pop-in{from{transform:scale(.3); opacity:0;}}
.tb-control.is-nudge{animation:tb-nudge .4s ease-in-out;}
@keyframes tb-nudge{25%{transform:translateX(-6px);} 75%{transform:translateX(6px);}}
.tb-control__say{text-align:center; min-height:3em;}
.tb-control__card{min-width:112px;}

/* ---- mood booster moves ---- */
.tb-moves{display:flex; flex-wrap:wrap; gap:20px; align-items:center; justify-content:center; padding:18px; border-radius:22px; background:linear-gradient(135deg,#FFF1C2,#FFE7DC);}
.tb-dice{font-size:4.5rem; line-height:1; width:120px; height:120px; border-radius:26px; border:4px solid #fff; background:#fff; cursor:pointer; box-shadow:0 8px 0 rgba(46,42,36,.12);}
.tb-dice:focus-visible{outline:3px solid var(--coral-deep,#A74B2B); outline-offset:3px;}
.tb-dice.is-rolling{animation:tb-roll .8s cubic-bezier(.3,1.4,.6,1);}
@keyframes tb-roll{0%{transform:rotate(0) scale(1);} 40%{transform:rotate(200deg) scale(1.15);} 100%{transform:rotate(360deg) scale(1);}}
.tb-moves__card{display:grid; grid-template-columns:auto 1fr auto; gap:14px; align-items:center; flex:1 1 320px; background:#fff; border-radius:20px; padding:14px 18px;}
.tb-moves__pic{font-size:4rem; line-height:1;}
.tb-moves__words{font-family:'Baloo 2',sans-serif; font-weight:800; font-size:clamp(1.15rem,2.6vw,1.45rem); color:var(--navy,#233A5C); margin:0;}
.tb-ring{position:relative; width:96px; height:96px;}
.tb-ring svg{width:100%; height:100%;}
.tb-ring svg circle:last-child{transition:stroke-dashoffset 1s linear;}
.tb-ring__num{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.8rem; color:var(--coral-deep,#A74B2B);}
@media (max-width:520px){ .tb-moves__card{grid-template-columns:auto 1fr;} .tb-ring{grid-column:1 / -1; justify-self:center;} }

/* ---- sleepy bear ---- */
.tb-night{position:relative; height:300px; border-radius:22px; overflow:hidden; background:linear-gradient(#1b2547,#3b2e66); transition:filter 1.2s;}
.tb-night.is-asleep{filter:brightness(.8);}
.tb-night__moon{position:absolute; right:7%; top:8%; font-size:3.4rem; filter:drop-shadow(0 0 14px rgba(255,240,180,.7));}
.tb-night__stars{position:absolute; left:6%; top:8%; display:flex; gap:12px; flex-wrap:wrap; max-width:55%;}
.tb-night__star{font-size:1.9rem; color:rgba(255,255,255,.2); transition:color .6s, text-shadow .6s;}
.tb-night__star.is-lit{color:#FFE29A; text-shadow:0 0 12px #FFE29A;}
.tb-body--sleep{position:absolute; left:50%; bottom:-6px; width:180px; transform:translateX(-50%); filter:brightness(.92);}
.tb-body--sleep [data-part].is-on{filter:drop-shadow(0 0 8px #FFE29A) drop-shadow(0 0 3px #FFE29A);}
.tb-night__title{font-family:'Baloo 2',sans-serif; font-size:1.6rem; color:var(--navy,#233A5C); margin:6px 0 0;}

/* ---- talk time cards ---- */
.tb-talk{display:flex; flex-direction:column; gap:14px; justify-content:center; width:min(100%,520px); min-height:230px; margin:12px auto; padding:26px; border-radius:26px; border:0;
  cursor:pointer; text-align:center; color:var(--navy,#233A5C); background:#FFF1C2; box-shadow:0 10px 0 rgba(46,42,36,.1);}
.tb-talk--feel{background:#FFE7DC;} .tb-talk--kind{background:#E3F2EF;} .tb-talk--fun{background:#EFE4F1;} .tb-talk--calm{background:#E1ECF7;}
.tb-talk:focus-visible{outline:3px solid var(--coral-deep,#A74B2B); outline-offset:4px;}
.tb-talk__kind{font-weight:900; font-size:.95rem; text-transform:uppercase; letter-spacing:.06em;}
.tb-talk__q{font-family:'Baloo 2',sans-serif; font-weight:800; font-size:clamp(1.4rem,3.4vw,1.9rem); line-height:1.25;}
.tb-talk.is-flip{animation:tb-flip .45s ease-out;}
@keyframes tb-flip{0%{transform:perspective(800px) rotateY(80deg); opacity:.3;} 100%{transform:none; opacity:1;}}
[data-tool="talkcards"] .tb-ctrl{justify-content:center;}
[data-tool="talkcards"] > .tb-small{text-align:center;}

@media (prefers-reduced-motion: reduce){
  .tb-control__chip, .tb-control.is-nudge, .tb-dice.is-rolling, .tb-talk.is-flip{animation:none;}
  .tb-ring svg circle:last-child, .tb-night, .tb-night__star{transition:none;}
}

/* ---- helpful places for grown-ups (Parents' Lounge) ---- */
.tb-links{list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px;}
.tb-links a{display:block; height:100%; padding:14px 16px; border-radius:16px; background:#fff; border:1px solid var(--line,#E7DCC8); color:var(--navy,#233A5C); text-decoration:none;}
.tb-links a:hover{border-color:var(--navy,#233A5C);}
.tb-links strong{display:block; margin-bottom:4px;}
.tb-links span{color:#584f40; font-size:.92rem;}

/* an author display rule beats the hidden attribute: keep hidden things hidden inside the tools */
.tb-tool [hidden], [data-tool] [hidden]{display:none !important;}
/* the sleepy bear closes its eyes at "Goodnight!" */
.tb-body--sleep circle{transform-box:fill-box; transform-origin:center; transition:transform .8s ease;}
.tb-night.is-asleep .tb-body--sleep [data-part="face"] circle{transform:scaleY(.12);}
.tb-night.is-asleep::after{content:"Z z z"; position:absolute; left:calc(50% + 70px); bottom:200px; color:#FFE29A; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.4rem; letter-spacing:.2em;}
@media (prefers-reduced-motion: reduce){ .tb-body--sleep circle{transition:none;} }
.tb-read[hidden]{display:none !important;}
