/* Kid Lab help widget (help-widget.js). Everything is under .klh so it never touches the page's own styles.
   Light by default (the app's pages are light); dark with the page's data-theme="dark" (the website's theme switch),
   and with the system setting on pages that say data-theme="auto".
   The same file is copied to design/v2/assets/help-widget.css for the website build (a test keeps them identical). */
.klh{--klh-bg:#fff;--klh-bg2:#f5f5f7;--klh-ink:#1d1d1f;--klh-ink2:#5f5f66;--klh-ink3:#8e8e93;--klh-line:rgba(0,0,0,.09);--klh-blue:#0a84ff;--klh-blue-t:#0066cc;--klh-me:#0a84ff;--klh-me-ink:#fff;--klh-chip:#eef4ff;--klh-red:#d70015;--klh-green:#1a7f37;--klh-shadow:0 24px 70px -20px rgba(0,0,0,.35),0 0 0 .5px rgba(0,0,0,.08);--klh-inset:0px;
  font:15px/1.45 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--klh-ink);-webkit-font-smoothing:antialiased;letter-spacing:normal;text-align:left}
:root[data-theme=dark] .klh{--klh-bg:#1c1c1f;--klh-bg2:#2a2a2e;--klh-ink:#f5f5f7;--klh-ink2:#b4b4bb;--klh-ink3:#8e8e93;--klh-line:rgba(255,255,255,.12);--klh-blue-t:#4da3ff;--klh-chip:#1f3350;--klh-red:#ff6961;--klh-green:#30d158;--klh-shadow:0 24px 70px -16px rgba(0,0,0,.8),0 0 0 .5px rgba(255,255,255,.12)}
@media (prefers-color-scheme:dark){:root[data-theme=auto] .klh{--klh-bg:#1c1c1f;--klh-bg2:#2a2a2e;--klh-ink:#f5f5f7;--klh-ink2:#b4b4bb;--klh-ink3:#8e8e93;--klh-line:rgba(255,255,255,.12);--klh-blue-t:#4da3ff;--klh-chip:#1f3350;--klh-red:#ff6961;--klh-green:#30d158;--klh-shadow:0 24px 70px -16px rgba(0,0,0,.8),0 0 0 .5px rgba(255,255,255,.12)}}
.klh *,.klh *::before,.klh *::after{box-sizing:border-box}
.klh [hidden]{display:none!important}
.klh button,.klh input,.klh textarea{font:inherit;color:inherit;letter-spacing:inherit}
.klh button{cursor:pointer;background:none;border:0;margin:0}
.klh a{color:var(--klh-blue-t)}
.klh svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;display:block}
.klh .klh-ic{display:inline-grid;place-items:center;flex:none}
.klh-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.klh :focus-visible{outline:2px solid var(--klh-blue);outline-offset:2px}

/* the ball */
.klh .klh-ball{position:fixed;left:0;top:0;z-index:2147483002;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;
  background:var(--klh-blue)!important;color:#fff;box-shadow:0 12px 28px -10px rgba(10,132,255,.75),0 2px 6px rgba(0,0,0,.18);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;
  transition:opacity .2s,box-shadow .2s;will-change:transform}
.klh-ball svg{width:26px;height:26px;stroke-width:1.8}
.klh-ball:hover{box-shadow:0 14px 32px -10px rgba(10,132,255,.9),0 2px 8px rgba(0,0,0,.2)}
.klh-ball:focus-visible{outline:3px solid var(--klh-blue);outline-offset:3px}
.klh-ball.klh-anim{transition:transform .35s cubic-bezier(.32,.72,0,1),opacity .2s,box-shadow .2s}
.klh-dragging .klh-ball{cursor:grabbing;box-shadow:0 20px 40px -12px rgba(10,132,255,.9),0 4px 12px rgba(0,0,0,.25)}
/* open: the ball stays and turns into the close button (chevron down) */
.klh-ball .klh-ic{transition:transform .28s cubic-bezier(.32,.72,0,1),opacity .2s}
.klh-ball .klh-shut{position:absolute;inset:0;display:grid;place-items:center;opacity:0;transform:rotate(-90deg) scale(.6)}
.klh-ball .klh-shut svg{width:26px;height:26px;stroke-width:2.2}
.klh-open .klh-ball>.klh-ic:not(.klh-shut){opacity:0;transform:rotate(90deg) scale(.6)}
.klh-open .klh-ball .klh-shut{opacity:1;transform:none}
.klh-open.klh-closing .klh-ball>.klh-ic:not(.klh-shut){opacity:1;transform:none}
.klh-open.klh-closing .klh-ball .klh-shut{opacity:0;transform:rotate(-90deg) scale(.6)}
.klh-kb .klh-ball{opacity:0;pointer-events:none}
.klh-dot{position:absolute;top:3px;right:3px;width:12px;height:12px;border-radius:50%;background:#ff3b30;box-shadow:0 0 0 2px var(--klh-bg)}

/* the panel */
.klh-panel{position:fixed;z-index:2147483001;left:var(--klh-px,auto);top:var(--klh-py,auto);right:auto;bottom:auto;width:var(--klh-pw,384px);height:var(--klh-ph,min(620px,calc(100vh - var(--klh-inset) - 32px)));
  display:flex;flex-direction:column;background:var(--klh-bg);border-radius:22px;box-shadow:var(--klh-shadow);overflow:hidden;transform-origin:100% 100%;animation:klh-in .3s cubic-bezier(.32,.72,0,1)}
.klh-panel:focus{outline:0}
/* it grows out of the ball and slides back down into it */
.klh-panel.klh-down{transform-origin:100% 0}.klh-panel.klh-from-left{transform-origin:0 100%}.klh-panel.klh-down.klh-from-left{transform-origin:0 0}
.klh-closing .klh-panel{animation:klh-out .24s cubic-bezier(.4,0,1,1) forwards;pointer-events:none}
@keyframes klh-in{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
@keyframes klh-out{to{opacity:0;transform:translateY(22px) scale(.97)}}
.klh-head{display:flex;align-items:center;gap:10px;padding:14px 12px 12px 16px;border-bottom:.5px solid var(--klh-line);flex:none}
/* Kody: the same face as the children's AI helper in the app (blue-violet tile, two eyes) */
.klh-kody{position:relative;width:34px;height:34px;border-radius:11px;flex:none;background:linear-gradient(150deg,#0a84ff,#5e5ce6);box-shadow:0 6px 16px -6px rgba(10,132,255,.7)}
.klh-kody::before,.klh-kody::after{content:"";position:absolute;top:12px;width:5px;height:8px;border-radius:3px;background:#fff;animation:klh-blink 5s infinite}
.klh-kody::before{left:10px}.klh-kody::after{right:10px}
.klh-kody-sm{width:26px;height:26px;border-radius:9px;box-shadow:0 4px 10px -5px rgba(10,132,255,.7)}
.klh-kody-sm::before,.klh-kody-sm::after{top:9px;width:4px;height:6px;border-radius:2px}.klh-kody-sm::before{left:7px}.klh-kody-sm::after{right:7px}
@keyframes klh-blink{0%,46%,50%,100%{transform:none}48%{transform:scaleY(.15)}}
.klh-hello{display:flex;align-items:flex-end;gap:8px}
.klh-hello .klh-msg{max-width:calc(88% - 34px)}
.klh-sent{align-self:center;text-align:center;padding:4px 10px;border-radius:999px;background:var(--klh-bg2);font-weight:600}
.klh-titles{flex:1;min-width:0}
.klh-titles h2{margin:0;font-size:16px;font-weight:700;letter-spacing:-.01em;line-height:1.25;color:var(--klh-ink)}
.klh-titles p{margin:1px 0 0;font-size:12.5px;color:var(--klh-ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.klh .klh-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--klh-ink2);flex:none}
.klh-icon:hover{background:var(--klh-bg2);color:var(--klh-ink)}
.klh-back{margin-right:-6px}

.klh-view{flex:1;min-height:0;display:flex;flex-direction:column}
.klh-log{flex:1;overflow:auto;padding:16px 14px 8px;display:flex;flex-direction:column;gap:8px;overscroll-behavior:contain}
.klh-log:focus{outline:0}
.klh-msg{max-width:88%;padding:10px 13px;border-radius:18px;font-size:14.5px;line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap}
.klh-msg p{margin:0}
.klh-bot{align-self:flex-start;max-width:94%;background:var(--klh-bg2);border-bottom-left-radius:6px}
/* answers: a short lead, then a list ("• " lines) or steps ("1. " lines), built as DOM nodes by help-chat.js */
.klh-bot>p+p,.klh-bot>p+.klh-list,.klh-bot>.klh-list+p,.klh-bot>.klh-list+.klh-list{margin-top:6px}
.klh .klh-list{margin:4px 0 0;padding:0 0 0 20px;white-space:normal}
ul.klh-list{list-style:disc outside}ol.klh-list{list-style:decimal outside}
.klh .klh-list li{margin:3px 0 0;padding:0 0 0 2px;display:list-item}
.klh-list li::marker{color:var(--klh-ink3);font-weight:600}
.klh-me{align-self:flex-end;background:var(--klh-me);color:var(--klh-me-ink);border-bottom-right-radius:6px}
.klh-wait{color:var(--klh-ink2);animation:klh-pulse 1.2s ease-in-out infinite}
@keyframes klh-pulse{50%{opacity:.55}}
.klh-links{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px;white-space:normal}
.klh-link{display:inline-flex;align-items:center;max-width:100%;min-height:32px;padding:5px 11px;border-radius:999px;background:var(--klh-bg);color:var(--klh-blue-t)!important;font-size:13.5px;font-weight:600;text-decoration:none!important;box-shadow:inset 0 0 0 1px var(--klh-line)}
.klh-link:hover{box-shadow:inset 0 0 0 1px var(--klh-blue)}
.klh-src{margin-top:8px!important;font-size:12px;color:var(--klh-ink3);white-space:normal}
.klh-src a{color:inherit;text-decoration:underline}
.klh-ai{margin-top:8px!important;font-size:12px;color:var(--klh-ink3);white-space:normal}
.klh-hand{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px;font-size:13px;color:var(--klh-ink2);white-space:normal}
.klh-note{margin:6px 2px 0;font-size:12.5px;color:var(--klh-ink3)}

.klh-foot{flex:none;border-top:.5px solid var(--klh-line);padding:8px 12px 12px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.klh-person{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 10px 4px 6px;margin:0 0 8px;border-radius:999px;color:var(--klh-blue-t)!important;font-size:13.5px;font-weight:600}
.klh-person svg{width:18px;height:18px}
.klh-person:hover{background:var(--klh-bg2)}
.klh-ask{display:flex;align-items:flex-end;gap:8px}
.klh-input{flex:1;min-width:0;resize:none;min-height:44px;max-height:120px;padding:11px 14px;border-radius:22px;border:0;background:var(--klh-bg2)!important;box-shadow:inset 0 0 0 1px var(--klh-line);font-size:15px;line-height:1.4;outline:0}
.klh-input:focus{box-shadow:inset 0 0 0 2px var(--klh-blue)}
.klh .klh-send{width:44px;height:44px;border-radius:50%;background:var(--klh-blue)!important;color:#fff;display:grid;place-items:center;flex:none}
.klh-send:disabled{opacity:.5;cursor:default}

/* form, done, my questions */
.klh-other{overflow:auto;padding:18px 18px calc(18px + env(safe-area-inset-bottom,0px))}
.klh-h{margin:0 0 6px;font-size:19px;font-weight:700;letter-spacing:-.015em;line-height:1.25;color:var(--klh-ink)}
.klh-lead{margin:0 0 14px;font-size:14px;color:var(--klh-ink2);line-height:1.45}
.klh-form{display:flex;flex-direction:column;gap:12px}
.klh-field{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600;color:var(--klh-ink2)}
.klh-field input,.klh-field textarea{width:100%;padding:11px 13px;border-radius:12px;border:0;background:var(--klh-bg2)!important;box-shadow:inset 0 0 0 1px var(--klh-line);font-size:15px;font-weight:400;color:var(--klh-ink);outline:0;resize:vertical}
.klh-field input:focus,.klh-field textarea:focus{box-shadow:inset 0 0 0 2px var(--klh-blue)}
.klh-field input:focus-visible,.klh-field textarea:focus-visible,.klh-input:focus-visible{outline:0}
.klh-field [aria-invalid=true]{box-shadow:inset 0 0 0 2px var(--klh-red)}
.klh-err{color:var(--klh-red);font-size:12.5px;font-weight:500;margin:0}
.klh-consent{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--klh-ink2);line-height:1.4;cursor:pointer}
.klh-consent input{width:20px;height:20px;margin:0;flex:none;accent-color:var(--klh-blue)}
.klh-hp{position:absolute!important;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.klh-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 15px;border-radius:12px;background:var(--klh-bg)!important;box-shadow:inset 0 0 0 1px var(--klh-line);color:var(--klh-blue-t)!important;font-size:14px;font-weight:600;text-decoration:none!important}
.klh-bot .klh-btn{background:var(--klh-bg)!important}
.klh-primary{background:var(--klh-blue)!important;color:#fff!important;box-shadow:none;min-height:48px;font-size:15.5px;width:100%;margin-top:4px;border-radius:13px}
.klh-primary:disabled{opacity:.6}
.klh-done{display:flex;flex-direction:column;align-items:center;text-align:center;padding:22px 2px 4px;min-height:100%}
.klh-done .klh-h{font-size:24px;letter-spacing:-.025em;margin:16px 0 4px;outline:0}
.klh-done .klh-lead{margin:0 0 18px;max-width:300px}
.klh-check{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 50% 40%,rgba(48,209,88,.2),rgba(48,209,88,.08));animation:klh-pop .5s cubic-bezier(.32,1.4,.5,1) both}
.klh-check .klh-ic,.klh-check svg{width:56px;height:56px}
.klh-check svg{stroke:#30d158;stroke-width:3.2}
.klh-ring{stroke-dasharray:158;stroke-dashoffset:158;animation:klh-draw .6s .1s ease-out forwards;opacity:.35}
.klh-tick{stroke-dasharray:36;stroke-dashoffset:36;animation:klh-draw .4s .45s ease-out forwards}
@keyframes klh-draw{to{stroke-dashoffset:0}}
@keyframes klh-pop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
.klh-ref{display:flex;align-items:center;gap:12px;width:100%;padding:12px 12px 12px 16px;border-radius:16px;background:var(--klh-bg2);box-shadow:inset 0 0 0 1px var(--klh-line);text-align:left;animation:klh-rise .45s .35s cubic-bezier(.32,.72,0,1) both}
.klh-ref-t{flex:1;min-width:0}
.klh-ref-t small{display:block;font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--klh-ink3)}
.klh-ref-t b{display:block;font:700 22px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em;color:var(--klh-ink);margin-top:2px}
.klh .klh-copy{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:10px;background:var(--klh-bg)!important;box-shadow:inset 0 0 0 1px var(--klh-line);color:var(--klh-blue-t);font-size:13px;font-weight:600;flex:none}
.klh-copy svg{width:16px;height:16px}
.klh .klh-copy.klh-copied{color:var(--klh-green)}
.klh-next{width:100%;text-align:left;margin:18px 0 18px;animation:klh-rise .45s .45s cubic-bezier(.32,.72,0,1) both}
.klh-next-h{margin:0 0 8px;font-size:12.5px;font-weight:700;color:var(--klh-ink3)}
.klh-next ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.klh-next li{display:flex;align-items:flex-start;gap:12px;padding:9px 0;font-size:14px;line-height:1.4;color:var(--klh-ink2)}
.klh-next li+li{border-top:.5px solid var(--klh-line)}
.klh-next li .klh-ic{width:30px;height:30px;border-radius:9px;background:var(--klh-chip);color:var(--klh-blue-t);margin-top:-4px}
.klh-next li svg{width:17px;height:17px}
.klh-next li b{color:var(--klh-ink);font-weight:600;overflow-wrap:anywhere}
.klh-done .klh-primary{margin-top:auto}
@keyframes klh-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
/* talk to a person */
.klh-fhead{margin-bottom:16px}
.klh-fpic{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--klh-chip);color:var(--klh-blue-t);margin-bottom:12px}
.klh-fpic svg{width:22px;height:22px}
.klh-mine{display:flex;flex-direction:column;gap:4px}
.klh-row{display:flex;align-items:center;gap:10px;width:100%;padding:11px 10px;border-radius:14px;text-align:left}
.klh-row:hover{background:var(--klh-bg2)}
.klh-row-t{flex:1;min-width:0}.klh-row-t b{display:block;font-weight:600;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.klh-row-t small{color:var(--klh-ink3);font-size:12.5px}
.klh-tag{flex:none;font-size:11.5px;font-weight:700;padding:3px 8px;border-radius:7px;background:var(--klh-bg2);color:var(--klh-ink2)}
.klh-tag.klh-answered{background:rgba(10,132,255,.14);color:var(--klh-blue-t)}
.klh-thread{display:flex;flex-direction:column;gap:8px}
.klh-thread .klh-msg{max-width:92%}
.klh-who{display:block;font-size:11.5px;font-weight:600;opacity:.75;margin-bottom:2px}
.klh-replyf{margin-top:8px}

/* phones: a full-screen sheet (it is a dialog: it may cover the tab bar; the ball never does) */
@media (max-width:560px){
  /* a full-screen sheet with its own close button; with the keyboard up it takes the visible screen
     (help-widget.js measures visualViewport) */
  .klh-panel,.klh-left .klh-panel{border-radius:0 0 24px 24px;animation-name:klh-up}
  .klh-kb .klh-panel{border-radius:0}
  .klh-head{padding-top:calc(12px + env(safe-area-inset-top,0px))}
  /* talk to a person: everything sits low in the sheet, the send button right above the home bar (thumb reach) */
  .klh-other.klh-v-form,.klh-other.klh-v-done{display:flex;flex-direction:column}
  .klh-v-form .klh-fhead{margin-top:auto;padding-top:12px}
  .klh-v-form .klh-h{font-size:24px;letter-spacing:-.025em}
  .klh-v-form .klh-form{gap:10px}
  .klh-v-form .klh-field input,.klh-v-form .klh-field textarea{font-size:16px;padding:12px 14px}
  .klh-v-form .klh-primary{min-height:52px;font-size:16px;margin-top:6px}
  .klh-v-done .klh-done{flex:1;padding-top:28px}
  @keyframes klh-up{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
  .klh-closing .klh-panel{animation-name:klh-out}
}
/* phones up to 600px (help-widget.js sets .klh-sheet while the chat is open there): the sheet fills the screen, closes
   with the X at the top right of its header, and the ball hides until it closes, then is back where it was */
.klh-sheet .klh-panel{border-radius:0}
.klh-sheet .klh-head{padding-top:calc(12px + env(safe-area-inset-top,0px))}
.klh-sheet.klh-open:not(.klh-closing) .klh-ball{opacity:0;visibility:hidden;pointer-events:none}
@media (prefers-reduced-motion:reduce){
  .klh-panel,.klh-closing .klh-panel,.klh-ball .klh-ic,.klh-wait,.klh-check,.klh-ref,.klh-next,.klh-kody::before,.klh-kody::after{animation:none}
  .klh-ring,.klh-tick{animation:none;stroke-dashoffset:0}
  .klh-ball,.klh-ball.klh-anim{transition:none}
}
@media print{.klh{display:none}}
/* Phones: no starter suggestion chips in the open chat (owner review round 4) */
