/* TryCleaning assistant "Bubbly" (6 Oct 2026): the companion canvas, his speech bubble, the chat panel and the
   settings block. Loaded by the manager space only (careers-admin.html). Colours follow the page's own variables so
   the panel sits naturally on both themes. Source of truth: trycleaning-site\assistant.css */
#tca-canvas{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:95;image-rendering:pixelated;image-rendering:crisp-edges;}
#tca-hit{position:fixed;z-index:96;cursor:grab;touch-action:none;background:transparent;border-radius:12px;}
#tca-hit.held{cursor:grabbing;}
#tca-hit:focus-visible{outline:3px solid var(--sky);outline-offset:2px;}
#tca-bubble{position:fixed;z-index:97;max-width:min(300px,70vw);background:#fffef4;color:#0D1B4B;border:2px solid #163747;box-shadow:3px 3px 0 #163747;padding:0.55rem 0.8rem;font-family:'Inter',sans-serif;font-size:0.84rem;line-height:1.45;pointer-events:none;transform:translateX(-50%);}
#tca-bubble:after{content:'';position:absolute;bottom:-8px;left:calc(50% - 5px);width:10px;height:10px;background:#fffef4;border-right:2px solid #163747;border-bottom:2px solid #163747;transform:rotate(45deg);}
#tca-bubble[hidden]{display:none;}
:root[data-theme="dark"] #tca-bubble{background:#172642;color:#e9eefb;border-color:#7fd3fb;box-shadow:3px 3px 0 #7fd3fb;}
:root[data-theme="dark"] #tca-bubble:after{background:#172642;border-color:#7fd3fb;}

/* the chat panel: bottom right on a desktop, a bottom sheet on a phone */
.tca-panel{position:fixed;right:18px;bottom:18px;width:380px;max-width:calc(100vw - 24px);max-height:min(72vh,640px);display:flex;flex-direction:column;background:#fff;color:var(--navy);border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 60px rgba(8,15,46,0.28);z-index:98;font-family:'Inter',sans-serif;overflow:hidden;}
.tca-panel[hidden]{display:none;}
.tca-head{display:flex;align-items:center;gap:0.5rem;padding:0.7rem 0.8rem 0.6rem 1rem;border-bottom:1px solid var(--line);background:var(--off-white);}
.tca-head .tca-title{font-weight:800;font-size:1rem;letter-spacing:-0.01em;}
.tca-head .tca-sub{font-size:0.72rem;color:var(--grey);flex:1;}
.tca-ib{background:none;border:none;cursor:pointer;color:var(--navy);padding:0.3rem;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;}
.tca-ib:hover{background:rgba(13,27,75,0.08);}
.tca-ib svg{width:18px;height:18px;}
.tca-msgs{flex:1;overflow:auto;padding:0.8rem 0.9rem;display:flex;flex-direction:column;gap:0.55rem;scroll-behavior:smooth;min-height:160px;}
.tca-m{max-width:88%;padding:0.55rem 0.8rem;border-radius:14px;font-size:0.86rem;line-height:1.5;white-space:pre-wrap;word-wrap:break-word;}
.tca-m.me{align-self:flex-end;background:var(--navy);color:#fff;border-bottom-right-radius:4px;}
.tca-m.bot{align-self:flex-start;background:var(--off-white);border-bottom-left-radius:4px;}
.tca-m.note{align-self:center;background:none;color:var(--grey);font-size:0.76rem;text-align:center;max-width:100%;}
.tca-m.err{align-self:flex-start;background:#FDECEA;color:#A93226;}
.tca-m.wait{align-self:flex-start;background:var(--off-white);}
.tca-m.wait i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--navy);margin-right:4px;opacity:.3;animation:tca-dot 1s infinite;}
.tca-m.wait i:nth-child(2){animation-delay:.2s;}.tca-m.wait i:nth-child(3){animation-delay:.4s;}
@keyframes tca-dot{0%,80%,100%{opacity:.25}40%{opacity:1}}
.tca-card{align-self:stretch;border:1.5px solid var(--line);border-radius:12px;padding:0.6rem 0.75rem;background:#fff;font-size:0.82rem;}
.tca-card .tca-cl{font-weight:700;margin-bottom:0.35rem;display:flex;align-items:center;gap:0.4rem;}
.tca-card .tca-cl svg{width:16px;height:16px;}
.tca-card .tca-rows div{display:flex;justify-content:space-between;gap:0.8rem;padding:0.12rem 0;}
.tca-card .tca-rows div span:first-child{color:var(--grey);flex:0 0 38%;}
.tca-card .tca-rows div span:last-child{text-align:right;word-break:break-word;}
.tca-card .tca-btns{display:flex;gap:0.4rem;margin-top:0.5rem;flex-wrap:wrap;}
.tca-card .tca-btns button{font:inherit;font-size:0.8rem;font-weight:600;border-radius:8px;padding:0.4rem 0.7rem;cursor:pointer;border:1.5px solid var(--navy);display:inline-flex;align-items:center;gap:0.35rem;}
.tca-card .tca-ok{background:var(--navy);color:#fff;}
.tca-card .tca-no{background:#fff;color:var(--navy);}
.tca-card .tca-btns button:disabled{opacity:.5;cursor:default;}
.tca-card .tca-btns svg{width:14px;height:14px;}
.tca-card.done{border-color:var(--good);}
.tca-card.done .tca-res{color:var(--good);font-weight:600;margin-top:0.35rem;}
.tca-card.failed{border-color:#e0736a;}
.tca-card.failed .tca-res{color:#A93226;font-weight:600;margin-top:0.35rem;}
.tca-card .tca-guard{font-size:0.72rem;color:var(--grey);margin-top:0.35rem;}
.tca-chips{display:flex;gap:0.35rem;padding:0 0.9rem 0.5rem;flex-wrap:wrap;}
.tca-chips button{font:inherit;font-size:0.74rem;border:1px solid var(--line);background:#fff;color:var(--navy);border-radius:999px;padding:0.3rem 0.65rem;cursor:pointer;}
.tca-chips button:hover{background:var(--off-white);}
.tca-form{display:flex;align-items:flex-end;gap:0.4rem;padding:0.55rem 0.7rem 0.6rem;border-top:1px solid var(--line);background:#fff;}
.tca-form textarea{flex:1;resize:none;font:inherit;font-size:0.88rem;line-height:1.4;padding:0.5rem 0.7rem;border:1.5px solid var(--line);border-radius:12px;max-height:120px;min-height:40px;background:#fff;color:var(--navy);}
.tca-form textarea:focus{outline:none;border-color:var(--sky);}
.tca-form button{font:inherit;border:none;cursor:pointer;width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;}
.tca-panel [hidden]{display:none!important;}
.tca-form button svg{width:18px;height:18px;}
.tca-send{background:var(--navy);color:#fff;}
.tca-send:disabled{opacity:.45;cursor:default;}
.tca-mic{background:var(--off-white);color:var(--navy);touch-action:none;}
.tca-mic.on{background:#e0736a;color:#fff;animation:tca-pulse 1s infinite;}
@keyframes tca-pulse{0%,100%{box-shadow:0 0 0 0 rgba(224,115,106,.5)}50%{box-shadow:0 0 0 8px rgba(224,115,106,0)}}
.tca-foot{font-size:0.7rem;color:var(--grey);padding:0 0.9rem 0.55rem;text-align:center;min-height:0.9rem;}
.tca-foot b{color:#A93226;}

/* the switch in the top bar next to the online light */
#tca-top{display:inline-flex;align-items:center;gap:0.3rem;margin-left:0.45rem;padding:0.28rem 0.6rem;border-radius:999px;border:1px solid rgba(255,255,255,0.32);background:rgba(255,255,255,0.08);color:#fff;font:600 0.74rem 'Inter',system-ui,sans-serif;cursor:pointer;line-height:1;vertical-align:middle;}
#tca-top svg{width:14px;height:14px;}
#tca-top:hover{background:rgba(255,255,255,0.16);}
#tca-top[aria-pressed="true"]{background:var(--sky,#4FC3F7);border-color:var(--sky,#4FC3F7);color:#080F2E;}
@media (max-width:700px){ #tca-top span{display:none;} #tca-top{padding:0.3rem 0.45rem;} }

/* a small launcher where the companion is switched off (so the chat stays reachable) */
#tca-fab{position:fixed;right:18px;bottom:18px;z-index:96;width:46px;height:46px;border-radius:50%;border:none;background:var(--navy);color:#fff;cursor:pointer;box-shadow:0 10px 24px rgba(8,15,46,0.3);display:inline-flex;align-items:center;justify-content:center;}
#tca-fab svg{width:22px;height:22px;}
#tca-fab[hidden]{display:none;}

/* settings block (inside the page's Settings overlay) */
.tca-set{background:var(--off-white);border-radius:12px;padding:0.9rem 1rem;font-size:0.84rem;}
.tca-set .tca-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0.45rem 0;border-top:1px solid var(--line);}
.tca-set .tca-row:first-of-type{border-top:none;padding-top:0;}
.tca-set .tca-row b{font-size:0.86rem;display:block;}
.tca-set .tca-row small{display:block;color:var(--grey);font-size:0.74rem;line-height:1.4;}
.tca-set .tca-row input[type=checkbox]{width:20px;height:20px;accent-color:var(--navy);flex:0 0 20px;}
.tca-set .tca-head2{font-size:0.7rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--navy);margin:0.9rem 0 0.4rem;}
.tca-set input[type=text],.tca-set input[type=password],.tca-set input[type=number],.tca-set select,.tca-set textarea{width:100%;padding:0.5rem 0.65rem;border:1.5px solid var(--line);border-radius:9px;font-family:inherit;font-size:0.84rem;background:#fff;color:var(--navy);}
.tca-set textarea{min-height:90px;resize:vertical;}
.tca-set .tca-sbtn{font:inherit;font-size:0.8rem;font-weight:600;border-radius:8px;padding:0.45rem 0.8rem;cursor:pointer;border:1.5px solid var(--navy);background:var(--navy);color:#fff;margin-top:0.4rem;}
.tca-set .tca-msg{font-size:0.76rem;margin-top:0.35rem;min-height:1em;}
.tca-set .tca-msg.ok{color:var(--good);}
.tca-set .tca-msg.err{color:#A93226;}

:root[data-theme="dark"] .tca-panel{background:var(--tc-surface,#172642);color:var(--tc-text,#e9eefb);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-head{background:var(--tc-surface-2,#101d33);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-head .tca-sub,:root[data-theme="dark"] .tca-m.note,:root[data-theme="dark"] .tca-foot,:root[data-theme="dark"] .tca-card .tca-rows div span:first-child{color:var(--tc-muted,#9fb0cc);}
:root[data-theme="dark"] .tca-ib{color:var(--tc-text,#e9eefb);}
:root[data-theme="dark"] .tca-ib:hover{background:rgba(255,255,255,0.1);}
:root[data-theme="dark"] .tca-m.bot,:root[data-theme="dark"] .tca-m.wait{background:var(--tc-surface-2,#101d33);}
:root[data-theme="dark"] .tca-m.wait i{background:var(--tc-text,#e9eefb);}
:root[data-theme="dark"] .tca-m.me{background:var(--sky-ink,#1466a8);}
:root[data-theme="dark"] .tca-card{background:var(--tc-surface-2,#101d33);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-card .tca-btns button{border-color:#7fd3fb;}
:root[data-theme="dark"] .tca-card .tca-ok{background:#7fd3fb;color:#0a1526;}
:root[data-theme="dark"] .tca-card .tca-no{background:transparent;color:var(--tc-text,#e9eefb);}
:root[data-theme="dark"] .tca-chips button{background:var(--tc-surface-2,#101d33);color:var(--tc-text,#e9eefb);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-form{background:var(--tc-surface,#172642);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-form textarea{background:var(--tc-surface-2,#101d33);color:var(--tc-text,#e9eefb);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-send{background:#7fd3fb;color:#0a1526;}
:root[data-theme="dark"] .tca-mic{background:var(--tc-surface-2,#101d33);color:var(--tc-text,#e9eefb);}
/* v4 (8 Oct 2026): the microphone lights up while it listens in dark mode too (the rule above outranked .tca-mic.on) */
:root[data-theme="dark"] .tca-mic.on{background:#e0736a;color:#fff;}
:root[data-theme="dark"] .tca-set{background:var(--tc-surface-2,#101d33);}
:root[data-theme="dark"] .tca-set .tca-row{border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-set .tca-row small{color:var(--tc-muted,#9fb0cc);}
:root[data-theme="dark"] .tca-set .tca-head2{color:var(--tc-text,#e9eefb);}
:root[data-theme="dark"] .tca-set input[type=text],:root[data-theme="dark"] .tca-set input[type=password],:root[data-theme="dark"] .tca-set input[type=number],:root[data-theme="dark"] .tca-set select,:root[data-theme="dark"] .tca-set textarea{background:var(--tc-surface,#172642);color:var(--tc-text,#e9eefb);border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-set .tca-sbtn{background:#7fd3fb;color:#0a1526;border-color:#7fd3fb;}

@media (max-width:700px){
  .tca-panel{right:0;left:0;bottom:0;width:100%;max-width:100%;max-height:78vh;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom);}
  #tca-bubble{max-width:78vw;font-size:0.8rem;}
}
@media (prefers-reduced-motion:reduce){
  .tca-m.wait i{animation:none;opacity:.7;}
  .tca-mic.on{animation:none;}
  .tca-msgs{scroll-behavior:auto;}
}

/* the phone (7 Oct 2026): the connect code and the phones already connected, inside the settings block */
.tca-set .tca-note{font-size:0.78rem;color:var(--grey);line-height:1.5;margin:0 0 0.45rem;}
.tca-set .tca-pairrow{display:flex;align-items:center;gap:0.9rem;flex-wrap:wrap;}
.tca-set .tca-pairrow .tca-sbtn{display:inline-flex;align-items:center;gap:0.35rem;}
.tca-set .tca-pairrow .tca-sbtn svg{width:14px;height:14px;}
.tca-set .tca-code{font-size:0.8rem;color:var(--grey);}
.tca-set .tca-code b{display:block;font-family:ui-monospace,Consolas,'Courier New',monospace;font-size:1.7rem;letter-spacing:0.16em;font-weight:700;color:var(--navy);line-height:1.2;}
.tca-set .tca-code small{display:block;font-size:0.72rem;color:var(--grey);}
.tca-set .tca-devices{margin-top:0.5rem;font-size:0.76rem;color:var(--grey);}
.tca-set .tca-dev{display:flex;align-items:center;justify-content:space-between;gap:0.8rem;padding:0.4rem 0;border-top:1px solid var(--line);color:var(--navy);}
.tca-set .tca-dev b{font-size:0.84rem;display:block;}
.tca-set .tca-dev small{display:block;color:var(--grey);font-size:0.72rem;}
.tca-set .tca-dev button{font:inherit;font-size:0.76rem;font-weight:600;border-radius:8px;padding:0.35rem 0.6rem;cursor:pointer;border:1.5px solid var(--navy);background:#fff;color:var(--navy);flex:0 0 auto;}
.tca-set .tca-dev button:disabled{opacity:.5;cursor:default;}
:root[data-theme="dark"] .tca-set .tca-note,:root[data-theme="dark"] .tca-set .tca-code,:root[data-theme="dark"] .tca-set .tca-devices,:root[data-theme="dark"] .tca-set .tca-dev small{color:var(--tc-muted,#9fb0cc);}
:root[data-theme="dark"] .tca-set .tca-code b,:root[data-theme="dark"] .tca-set .tca-dev{color:var(--tc-text,#e9eefb);}
:root[data-theme="dark"] .tca-set .tca-dev{border-color:var(--tc-border,rgba(255,255,255,0.12));}
:root[data-theme="dark"] .tca-set .tca-dev button{background:transparent;color:var(--tc-text,#e9eefb);border-color:#7fd3fb;}
