/* Tosco 2.0 — widget (24/10/2026). Jetons du thème (--color-*) avec repli. Préfixe tosco- (aucun suffixe visé par les règles du thème). */
:root{--to-ink:var(--color-ink-900,#14110E);--to-ink2:var(--color-ink-700,#241F19);--to-mut:var(--color-mute-500,#6B5F52);--to-bg:var(--color-parch-50,#FCFBF8);--to-soft:var(--color-parch-200,#F2EDE4);
  --to-line:rgba(20,17,14,.1);--to-gold:var(--color-gold-500,#C9973A);--to-gold2:var(--color-gold-700,#9C7226);--to-gold3:var(--color-gold-300,#F0D58A);--to-disp:var(--font-display,"Cormorant Garamond",Georgia,serif);--to-sans:var(--font-sans,Inter,system-ui,sans-serif)}

/* bouton flottant (bas gauche, comme l'ancien Tosco) */
.tosco-launch{position:fixed;left:20px;bottom:20px;z-index:9990;display:grid;place-items:center;width:60px;height:60px;padding:0;border:0;border-radius:50%;cursor:pointer;
  background:radial-gradient(circle at 30% 25%,#2a231c,#14110E);box-shadow:0 0 0 2px var(--to-gold),0 12px 30px -8px rgba(0,0,0,.55);transition:transform .2s,box-shadow .2s,bottom .35s}
.tosco-launch:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 0 0 2px var(--to-gold3),0 16px 36px -8px rgba(0,0,0,.6)}
.tosco-launch-img{width:52px;height:52px;border-radius:50%;object-fit:cover;display:block}
.tosco-launch .tosco-av--emoji{font-size:28px}
.tosco-launch-dot{position:absolute;right:3px;top:3px;width:12px;height:12px;border-radius:50%;background:#4F7A4A;box-shadow:0 0 0 2px #14110E}
.tosco-launch.is-on{transform:scale(.92)}
@media (max-width:767px){.tosco-launch{left:16px;bottom:88px;width:54px;height:54px}.tosco-launch-img{width:46px;height:46px}body.tc-header-hidden .tosco-launch{bottom:16px}}
html.tcq-open .tosco-launch,html.tcq-open .tosco-invite{visibility:hidden}

/* invitation */
.tosco-invite{position:fixed;left:20px;bottom:92px;z-index:9989;display:flex;align-items:flex-start;gap:10px;max-width:310px;padding:12px 38px 12px 12px;border-radius:18px;background:#fff;color:var(--to-ink);
  box-shadow:0 0 0 1px rgba(201,151,58,.35),0 20px 40px -18px rgba(0,0,0,.45);font:400 13.5px/1.45 var(--to-sans);cursor:pointer;opacity:0;transform:translateY(8px);transition:opacity .2s,transform .2s}
.tosco-invite.is-on{opacity:1;transform:none}
.tosco-invite[hidden]{display:none}
.tosco-inv-av{flex:none;width:38px;height:38px;border-radius:50%;object-fit:cover}
.tosco-invite p{margin:0}
.tosco-invite p b{display:block;margin-top:4px;color:var(--to-gold2);font-weight:700}
.tosco-invite button{position:absolute;right:6px;top:6px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:none;color:var(--to-mut);cursor:pointer}
.tosco-invite::after{content:"";position:absolute;left:24px;bottom:-7px;width:14px;height:14px;background:#fff;transform:rotate(45deg);box-shadow:3px 3px 0 0 rgba(201,151,58,.12)}
@media (max-width:767px){.tosco-invite{left:12px;right:12px;max-width:none;bottom:150px}}

/* panneau */
.tosco{position:fixed;left:20px;bottom:92px;z-index:9991;font-family:var(--to-sans);color:var(--to-ink)}
.tosco[hidden]{display:none}
.tosco *,.tosco *::before,.tosco *::after{box-sizing:border-box}
.tosco-panel{display:flex;flex-direction:column;width:min(420px,calc(100vw - 40px));height:min(680px,calc(100vh - 120px));border-radius:24px;overflow:hidden;background:var(--to-bg);
  border:1px solid rgba(201,151,58,.3);box-shadow:0 30px 80px -24px rgba(0,0,0,.6);opacity:0;transform:translateY(12px) scale(.98);transform-origin:bottom left;transition:opacity .2s,transform .2s cubic-bezier(.2,.8,.2,1)}
.tosco.is-open .tosco-panel{opacity:1;transform:none}
.tosco-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 10px 12px 14px;background:var(--to-ink);background-image:radial-gradient(80% 140% at 100% 0%,rgba(201,151,58,.32),transparent 60%);color:#FAF8F5}
.tosco-head-av{flex:none;width:44px;height:44px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px var(--to-gold)}
.tosco-head-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.tosco-head-tx b{font:600 21px/1.05 var(--to-disp);color:var(--to-gold3)}
.tosco-head-tx b em{margin-left:4px;padding:1px 6px;border-radius:6px;background:rgba(255,255,255,.1);font:700 9.5px/1.4 var(--to-sans);letter-spacing:.08em;color:rgba(250,248,245,.75);font-style:normal;vertical-align:middle}
.tosco-head-tx small{display:flex;align-items:center;gap:6px;font-size:12px;color:rgba(250,248,245,.72)}
.tosco-head-tx small i{width:7px;height:7px;border-radius:50%;background:#8FB08A;box-shadow:0 0 0 3px rgba(143,176,138,.25)}
.tosco-ic{flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.07);color:#FAF8F5;cursor:pointer}
.tosco-ic:hover{background:rgba(255,255,255,.16)}

.tosco-msgs{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px 8px;display:flex;flex-direction:column;gap:14px;scroll-behavior:smooth}
.tosco-m{display:flex;gap:8px;align-items:flex-start}
.tosco-m-av{flex:none;width:30px;height:30px;border-radius:50%;object-fit:cover;margin-top:2px}
.tosco-m-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.tosco-bub{padding:10px 13px;border-radius:4px 16px 16px 16px;background:#fff;box-shadow:0 0 0 1px var(--to-line);font-size:14px;line-height:1.55;color:var(--to-ink2)}
.tosco-bub p{margin:0 0 6px}.tosco-bub p:last-child{margin:0}
.tosco-bub b{color:var(--to-ink);font-weight:650}
.tosco-m--me{justify-content:flex-end}
.tosco-m--me .tosco-bub{max-width:85%;border-radius:16px 4px 16px 16px;background:var(--to-ink);color:#FAF8F5;box-shadow:none}
.tosco-typing{display:flex;align-items:center;gap:4px}
.tosco-typing span{width:6px;height:6px;border-radius:50%;background:var(--to-gold);animation:tosco-dot 1s infinite ease-in-out}
.tosco-typing span:nth-child(2){animation-delay:.15s}.tosco-typing span:nth-child(3){animation-delay:.3s}
.tosco-typing em{margin-left:6px;font-size:12.5px;color:var(--to-mut)}
@keyframes tosco-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* cards (format ligne du thème) dans la conversation */
.tosco-cards{display:flex;flex-direction:column;gap:6px}
.tosco-cards .tcx-row{margin:0;background:#fff;border-radius:14px;box-shadow:0 0 0 1px var(--to-line)}
.tosco-cards .tcx-row:hover{box-shadow:0 0 0 1px rgba(201,151,58,.5),0 8px 20px -12px rgba(0,0,0,.35)}
.tosco-acts{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.tosco-acts>span{width:100%;font:700 10.5px var(--to-sans);letter-spacing:.08em;text-transform:uppercase;color:var(--to-mut)}
.tosco-acts a{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px 0 4px;border-radius:999px;background:#fff;box-shadow:0 0 0 1px var(--to-line);color:var(--to-ink2);font:500 12px var(--to-sans);text-decoration:none}
.tosco-acts a b{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--h);color:#fff;font-size:10.5px}
.tosco-acts a:hover{box-shadow:0 0 0 1px var(--to-gold)}
.tosco-plan{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;background:var(--to-ink);color:#FAF8F5;text-decoration:none}
.tosco-plan>span:first-child{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:linear-gradient(180deg,#E3BB6C,#C9973A);color:#1A1612}
.tosco-plan>span:nth-child(2){flex:1;display:flex;flex-direction:column}
.tosco-plan b{font:600 16px/1.1 var(--to-disp);color:var(--to-gold3)}
.tosco-plan small{font-size:11.5px;color:rgba(250,248,245,.72)}
.tosco-more{align-self:flex-start;display:inline-flex;align-items:center;gap:5px;font:600 12.5px var(--to-sans);color:var(--to-gold2);text-decoration:none}
.tosco-sugg{display:flex;flex-wrap:wrap;gap:6px}
.tosco-sugg button{max-width:100%;padding:7px 11px;border:1px solid rgba(201,151,58,.45);border-radius:999px;background:rgba(240,213,138,.14);color:var(--to-ink2);font:500 12.5px/1.3 var(--to-sans);text-align:left;cursor:pointer;transition:all .15s}
.tosco-sugg button:hover{background:#fff;border-color:var(--to-gold)}

.tosco-form{flex:none;display:flex;align-items:flex-end;gap:8px;margin:6px 12px 4px;padding:6px 6px 6px 14px;border-radius:18px;background:#fff;box-shadow:0 0 0 1.5px var(--to-line);transition:box-shadow .2s}
.tosco-form:focus-within{box-shadow:0 0 0 1.5px var(--to-gold),0 0 0 5px rgba(201,151,58,.13)}
.tosco-form textarea{flex:1;min-width:0;max-height:120px;margin:0;padding:8px 0;border:0;outline:0;resize:none;background:none;box-shadow:none;font:400 15px/1.4 var(--to-sans);color:var(--to-ink)}
.tosco-form button{flex:none;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:13px;background:linear-gradient(180deg,#E3BB6C,#C9973A);color:#1A1612;cursor:pointer}
.tosco-ai{flex:none;margin:0;padding:2px 14px 10px;font-size:10.5px;color:var(--to-mut);text-align:center}

@media (max-width:767px){
  .tosco{left:0;right:0;top:0;bottom:0}
  .tosco-panel{width:100%;height:100%;border-radius:0;border:0}
  .tosco-head{padding-top:max(12px,env(safe-area-inset-top))}
  .tosco-form textarea{font-size:16px}
  .tosco-ai{padding-bottom:max(10px,env(safe-area-inset-bottom))}
  html.tosco-open .tosco-launch{display:none}
  html.tosco-open,html.tosco-open body{overflow:hidden}
}
@media (prefers-reduced-motion:reduce){.tosco-panel,.tosco-invite,.tosco-launch{transition:none}.tosco-typing span{animation:none}}

/* lignes du thème dans un panneau étroit : nom sur 2 lignes, sans libellé de niveau ni flèche (comme la colonne des circuits) */
.tosco-cards .tcx-row-txt b{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:1rem;line-height:1.22}
.tosco-cards .tcx-row-score .tcx-level,.tosco-cards .tcx-row-go{display:none}
.tosco-cards .tcx-row-score .tcx-ring{width:34px;height:34px}
