.tb{max-width:46rem;margin-inline:auto;padding:0 max(16px,env(safe-area-inset-left,0px)) 130px;display:grid;gap:40px}
.tb h2{font-size:1.45rem;margin:0 0 14px}
.tb .muted{font-size:.95rem}
.tb-set{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tb-step{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 6px;display:grid;justify-items:center;gap:6px;text-align:center}
.tb-step .lab{font-size:.95rem;color:var(--ink-soft)}
.tb-step .val{font-family:var(--f-display);font-weight:700;font-size:1.6rem;line-height:1.2;display:flex;align-items:baseline;justify-content:center;gap:2px}
.tb-step .val input{width:3.2ch;font:inherit;color:inherit;text-align:center;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:2px 4px;min-height:44px}
.tb-step .val input:focus{outline:2px solid var(--focus);border-color:transparent}
.tb-step .val .u{font-size:1.1rem}
.tb-step .tb-row{display:flex;align-items:center;gap:6px}
.tb-round{width:44px;height:44px;border-radius:50%;border:2px solid var(--ink);background:transparent;color:var(--ink);font:600 1.4rem/1 var(--f-display);cursor:pointer;display:grid;place-items:center;padding:0}
.tb-round:disabled{opacity:.3;cursor:default}
.tb-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.tb-item{display:flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:4px 4px 4px 2px;position:relative;transition:transform .15s}
.tb-item.dragging{transition:none;z-index:2;border:2px solid var(--focus)}
.tb-item .tb-num{font-family:var(--f-display);font-weight:700;color:var(--tag);min-width:1.1em;text-align:center}
.tb-item svg.fig{width:60px;height:48px;flex:none}
.tb-item .nm{flex:1;font-weight:700;min-width:0;line-height:1.25}
.tb-handle{width:36px;height:44px;display:grid;place-items:center;cursor:grab;touch-action:none;color:var(--ink-soft);flex:none}
.tb-handle svg{width:20px;height:20px;fill:currentColor}
.tb-ic{width:40px;height:44px;border:none;background:transparent;color:var(--ink);border-radius:12px;cursor:pointer;display:grid;place-items:center;padding:0;flex:none}
.tb-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.tb-ic:disabled{opacity:.25;cursor:default}
.tb-empty{background:var(--surface);border:1px dashed var(--line);border-radius:16px;padding:18px;text-align:center;color:var(--ink-soft);margin:0}
.tb-lib{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));gap:10px}
.tb-card{width:100%;height:100%;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:10px 8px 12px;display:grid;justify-items:center;align-content:start;gap:4px;cursor:pointer;color:var(--ink);font:inherit;text-align:center}
.tb-card:hover{border-color:var(--ink-soft)}
.tb-card svg.fig{width:100%;max-width:160px;height:auto;aspect-ratio:108/86}
.tb-card .nm{font-weight:700;line-height:1.25}
.tb-card .mat{font-size:.85rem;color:var(--ink-soft)}
.tb-card .add{width:36px;height:36px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font:700 1.3rem/1 var(--f-display);margin-top:4px}
.tb-bar{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--bg);border-top:1px solid var(--line);padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));display:flex;justify-content:center}
.tb-bar .btn{width:100%;max-width:30rem;justify-content:center;font-size:1.1rem;padding:15px 20px}
.tb-bar .btn:disabled{opacity:.45;cursor:default}
.tb-bar small{font:inherit;opacity:.8}
/* Personnage */
.fig .f-floor{stroke:var(--line);stroke-width:2;stroke-linecap:round}
.fig .f-prop{stroke:var(--ink-soft);stroke-width:3;stroke-linecap:round;opacity:.55}
.fig polyline{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:5}
.fig .f-torso{stroke:var(--fig-ink,var(--elan-head));stroke-width:6}
.fig .f-head{fill:none;stroke:var(--fig-ink,var(--elan-head));stroke-width:4.5}
.fig .f-aN{stroke:#F08A3E}
.fig .f-aF{stroke:#F6C38A}
.fig .f-lN{stroke:var(--fig-leg,var(--elan-leg))}
.fig .f-lF{stroke:var(--fig-leg,var(--elan-leg));opacity:.5}
/* Écran du minuteur */
html.tb-lock,html.tb-lock body{overflow:hidden}
.tb-run{position:fixed;inset:0;z-index:100;background:#0F3A3C;color:#F6F1E9;display:flex;flex-direction:column;padding:max(12px,env(safe-area-inset-top,0px)) 16px max(16px,env(safe-area-inset-bottom,0px));--fig-ink:#F6F1E9;--fig-leg:#6CC3C4;--elan-head:#F6F1E9;--elan-leg:#6CC3C4;--ph:#B3C2C1}
.tb-run{transition:background-color .4s}
.tb-run[data-phase=work]{background:#F08A3E;color:#2A1606;--ph:#2A1606}
.tb-run[data-phase=rest]{background:#0F4C4F;--ph:#F08A3E}
.tb-dial-in{background:#FFFCF7;border-radius:50%;color:#0F3A3C;--fig-ink:#0F4C4F;--fig-leg:#3E9A9C;--elan-head:#0F4C4F;--elan-leg:#3E9A9C}
.tb-run .tb-dial-in .fig .f-floor{stroke:#E3D9CA}
.tb-run[data-phase=work] .tb-dial .bg{stroke:rgba(42,22,6,.18)}
.tb-run[data-phase=work] .tb-seg span{background:rgba(42,22,6,.15)}
.tb-run[data-phase=work] .tb-seg span.done{background:rgba(42,22,6,.45)}
.tb-run[data-phase=work] .tb-seg span.now{background:#2A1606}
.tb-run[data-phase=work] .tb-top button,.tb-run[data-phase=work] .tb-ctrl .sm{border-color:#2A1606}
.tb-run[data-phase=work] .tb-ctrl .lg{background:#2A1606;color:#FFFCF7}
.tb-run[data-phase=work] .tb-cue{color:#2A1606}
.tb-run[data-phase=work].is-paused .tb-phase::after{color:rgba(42,22,6,.75)}
.tb-run[data-phase=work] :focus-visible{outline-color:#2A1606}
.tb-run .fig .f-floor{stroke:rgba(246,241,233,.25)}
.tb-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tb-top button{min-height:44px;border:2px solid rgba(246,241,233,.35);background:transparent;color:inherit;border-radius:999px;padding:0 16px;font:600 .95rem var(--f-display);cursor:pointer;display:inline-flex;align-items:center;gap:8px}
.tb-top svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tb-top button[aria-pressed=false] .on,.tb-top button[aria-pressed=true] .off{display:none}
.tb-seg{display:flex;gap:4px;margin:14px auto 0;width:100%;max-width:30rem}
.tb-seg span{flex:1;height:6px;border-radius:999px;background:rgba(246,241,233,.18)}
.tb-seg span.done{background:#3E9A9C}
.tb-seg span.now{background:var(--ph)}
.tb-seg span.next{background:rgba(246,241,233,.45)}
.tb-live,.tb-end{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(8px,2vh,18px);text-align:center;min-height:0}
.tb-phase{font:700 clamp(1.8rem,7vw,2.6rem)/1.1 var(--f-display);color:var(--ph);margin:0}
.tb-dial{position:relative;width:min(84vw,44vh,340px);aspect-ratio:1}
.tb-dial>svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.tb-dial circle{fill:none;stroke-width:16}
.tb-dial .bg{stroke:rgba(246,241,233,.14)}
.tb-dial #tb-ring{stroke:var(--ph);stroke-linecap:round;stroke-dasharray:754;transition:stroke .3s}
.tb-dial-in{position:absolute;inset:9%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.tb-dial-in svg.fig{width:100%;height:auto;aspect-ratio:108/86;margin-top:6%}
.tb-sec{font:700 clamp(2.6rem,11vw,4rem)/1 var(--f-display);font-variant-numeric:tabular-nums}
.tb-name{font:700 clamp(1.3rem,5vw,1.7rem)/1.2 var(--f-display);margin:0}
.tb-cue{margin:0;max-width:26rem;color:rgba(246,241,233,.85)}
.tb-info{margin:0;font-size:.95rem;color:rgba(246,241,233,.7)}
.tb-ctrl{display:flex;align-items:center;justify-content:center;gap:clamp(18px,7vw,36px);padding-top:4px}
.tb-ctrl button{border-radius:50%;cursor:pointer;display:grid;place-items:center;padding:0}
.tb-ctrl .sm{width:56px;height:56px;border:2px solid #3E9A9C;background:transparent;color:inherit}
.tb-ctrl .sm:disabled{opacity:.3;cursor:default}
.tb-ctrl .lg{width:84px;height:84px;border:none;background:#F6F1E9;color:#0F3A3C}
.tb-ctrl svg{width:24px;height:24px;fill:currentColor}
.tb-ctrl .lg svg{width:34px;height:34px}
.tb-ctrl .lg[data-state=pause] .play,.tb-ctrl .lg[data-state=play] .pause{display:none}
.tb-run.is-paused .tb-phase::after{content:" · en pause";color:rgba(246,241,233,.7);font-size:.6em}
.tb-end h2{font:700 2.2rem/1.1 var(--f-display);margin:0;color:#F08A3E}
.tb-end .btn{border-color:#F6F1E9;color:#F6F1E9}
.tb-end .btn.primary{background:#F08A3E;border-color:#F08A3E;color:#2A1606}
.tb-run :focus-visible{outline:3px solid #7FD0D1;outline-offset:3px}
@media (prefers-reduced-motion:reduce){.tb-item,.tb-dial #tb-ring{transition:none}}
@media (max-width:479px){.tb-item .tb-ic[data-a=up],.tb-item .tb-ic[data-a=down]{display:none}.tb-item .nm{font-size:1rem}}
.tb-cue:empty{display:none}
.tb-install{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 6px 12px 12px}
.tb-install img{border-radius:12px;flex:none}
.tb-install div{flex:1;display:grid;gap:2px;font-size:.95rem;color:var(--ink-soft);min-width:0}
.tb-install b{font-family:var(--f-display);color:var(--ink);font-size:1.05rem}
.tb-install .btn{padding:10px 16px;flex:none}
.tb-share{display:inline-block;width:18px;height:18px;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.tb-nextfig{position:static;width:min(36vw,150px);aspect-ratio:108/86;border-radius:16px;padding:4px}
.tb-nextfig[hidden]{display:none}
.tb-run .tb-nextfig svg.fig{margin:0;width:100%;height:100%;display:block}
.fig .f-eye{fill:var(--fig-ink,var(--elan-head))}
.fig .f-bottle{fill:#5B9BD5;stroke:none}
.fig .f-bottle.f-far{opacity:.5}
.tb-cats{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;margin:0 0 4px;scrollbar-width:none}
.tb-cats::-webkit-scrollbar{display:none}
.tb-cats button{flex:none;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:600 1rem var(--f-body);cursor:pointer}
.tb-cats button[aria-pressed=true]{background:var(--court);border-color:var(--court);color:#FFFCF7}
.tb-lib li[hidden]{display:none}
