/* Learning together (public/together.js): the full-screen layer for sessions and challenges, the entry sheet,
   the People-tab panel and the "practising now" dot. Same tokens as base.css; calm, no colour beyond the accent
   and right/wrong. */
.tg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html.tg-open,html.tg-open body{overflow:hidden}
.tg-screen{position:fixed;inset:0;z-index:42;background:var(--bg);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.tg-top{position:sticky;top:0;z-index:2;background:var(--surface);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top,0px)}
.tg-top-in{max-width:900px;margin:0 auto;display:flex;align-items:center;gap:12px;min-height:60px}
.tg-ttl{flex:1;min-width:0;display:flex;flex-direction:column}
.tg-kind{font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--acc-text)}
.tg-ttl h1{font-family:var(--f-display);font-size:17px;margin:0;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tg-people{display:flex;align-items:center;flex:none}
.tg-pp{position:relative;display:block;margin-inline-start:-5px;border-radius:50%;box-shadow:0 0 0 2px var(--surface);transition:opacity .2s}
.tg-pp:first-child{margin-inline-start:0}
.tg-pp.marked+.tg-pp{margin-inline-start:3px}
.tg-pp .soc-av{display:block}
.tg-pp.away{opacity:.4}
.tg-pp.you{box-shadow:0 0 0 2px var(--surface),0 0 0 3.5px var(--acc-line)}
.tg-ok{position:absolute;right:-3px;bottom:-3px;width:16px;height:16px;border-radius:50%;background:var(--good);color:var(--surface);display:grid;place-items:center;box-shadow:0 0 0 2px var(--surface)}
.tg-ok svg{width:10px;height:10px}
.tg-body{padding-top:22px;padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
.tg-in{max-width:900px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.tg-in>.panel{margin-top:0}
.tg-net{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:3;margin:0;background:var(--ink);color:var(--surface);padding:8px 14px;border-radius:999px;font-size:13px;font-weight:600}
.tg-eyebrow{display:block;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--acc-text);margin-bottom:6px}
.tg-in h2{font-family:var(--f-display);font-size:24px;letter-spacing:-.015em;margin:0 0 6px;line-height:1.2}
.tg-in h3{font-family:var(--f-display);font-size:17px;margin:0 0 10px}
.tg-center{text-align:center;padding:30px 22px;display:flex;flex-direction:column;align-items:center}
.tg-center p{margin:6px 0;color:var(--muted);max-width:520px}
.tg-center .soc-av{margin-bottom:12px}
.tg-endbtns{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:16px}
.tg-fine{font-size:13px;color:var(--muted);margin:10px 0 0}
.tg-note{font-size:13.5px;background:var(--soft);border-radius:9px;padding:9px 12px;margin:8px 0 0;color:var(--ink)}
.tg-plan{font-size:13.5px;color:var(--muted);margin:12px 0 0;padding-inline-start:12px;border-inline-start:2px solid var(--acc-line)}
.tg-tag{font-size:12px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--acc-soft);color:var(--acc-text);white-space:nowrap}
.tg-tag.dim{background:var(--soft);color:var(--muted)}
.tg-in .sp,.tg-plist .sp,.tg-ctl .sp,.tg-bar .sp,.tg-exbar .sp{flex:1}

/* lobby */
.tg-lobby{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
.tg-lobby>.panel{margin:0}
.tg-intro{grid-row:span 2}
.tg-specs{margin:0;color:var(--muted)}
.tg-topics{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0}
.tg-topics .chip{font-family:var(--f-body);font-size:12.5px}
.tg-rules{margin:16px 0 0;padding:0;list-style:none;display:grid;gap:8px;font-size:14px}
.tg-rules li{position:relative;padding-inline-start:20px}
.tg-rules li::before{content:"";position:absolute;inset-inline-start:4px;top:.6em;width:6px;height:6px;border-radius:50%;background:var(--acc-line)}
.tg-center .tg-rules{text-align:start;max-width:520px;margin:14px auto 4px}
.tg-go{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.tg-go .muted{font-size:13px}
.tg-wait{display:flex;align-items:center;gap:10px;margin:0;color:var(--muted);font-weight:500}
.tg-pulse{width:9px;height:9px;border-radius:50%;background:var(--acc);flex:none}
@media (prefers-reduced-motion:no-preference){.tg-pulse{animation:tgPulse 1.6s ease-in-out infinite}}
@keyframes tgPulse{0%,100%{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}
.tg-plist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tg-plist li{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line);min-width:0}
.tg-plist li:first-child{border-top:0}
.tg-plist li.away{opacity:.55}
.tg-plist b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.tg-sub{font-size:13px;font-weight:600;color:var(--muted);margin:16px 0 4px}
.tg-link{display:flex;gap:8px;flex-wrap:wrap}
.tg-link input{flex:1 1 200px;min-width:0;border:1px solid var(--line);border-radius:9px;background:var(--sunk);padding:8px 10px;font-family:var(--f-mono);font-size:12.5px;color:var(--muted)}

/* switch (share my result, practising now) */
.tg-switch{display:flex;gap:12px;align-items:flex-start;margin-top:18px;cursor:pointer;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--sunk)}
.tg-switch input{position:absolute;opacity:0;width:1px;height:1px}
.tg-sw{flex:none;width:38px;height:22px;border-radius:999px;background:var(--line);position:relative;transition:background .15s;margin-top:1px}
.tg-sw::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.tg-switch input:checked+.tg-sw{background:var(--acc)}
.tg-switch input:checked+.tg-sw::after{transform:translateX(16px)}
[dir="rtl"] .tg-switch input:checked+.tg-sw::after{transform:translateX(-16px)}
.tg-switch input:focus-visible+.tg-sw{outline:2px solid var(--acc);outline-offset:2px}
.tg-switch>span:last-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.tg-switch small{color:var(--muted);font-size:13px;line-height:1.45}
#tgSettings .tg-switch{margin-top:0;align-items:center}

/* a problem */
.tg-bar,.tg-exbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px}
.tg-status{color:var(--muted);font-size:14px}
.tg-bench .diagram svg{min-width:0}
.tg-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.tg-card .tools{border-top:0;padding-top:0}
.tg-form{align-items:center}
.tg-msg{margin:0;font-size:13.5px;color:var(--bad)}
.tg-msg:empty{display:none}
.tg-locked{flex-direction:row;align-items:flex-start;gap:12px}
.tg-locked>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.tg-locked span{color:var(--muted);font-size:14px}
.tg-lock{flex:none;width:30px;height:30px;border-radius:50%;background:var(--acc-soft);color:var(--acc-text);display:grid;place-items:center}
.tg-lock svg{width:16px;height:16px}
.tg-lock.big{width:52px;height:52px;margin-bottom:12px}
.tg-lock.big svg{width:26px;height:26px}
.tg-result{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
.tg-result>span:first-child{flex:1 1 auto;min-width:0}
.tg-only{font-size:12.5px;font-weight:500;color:var(--muted);margin-inline-start:auto}
.tg-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.tg-ctl .muted{font-size:13.5px;flex:1 1 240px}
.tg-ctl:empty{display:none}
.tg-count h2{font-size:40px;font-variant-numeric:tabular-nums;margin:6px 0}
.tg-timer-sm{margin-top:14px!important}
.tg-dots{flex:none}
.tg-exbar .extimer{flex:none}

/* results */
.tg-vhead{margin-bottom:0}
.tg-vhead h2{margin:0}
.tg-rank{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tg-rank li{display:flex;align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--line);flex-wrap:wrap}
.tg-rank li:first-child{border-top:0}
.tg-rank li.you .tg-rn b{color:var(--acc-text)}
.tg-rn{flex:1 1 180px;min-width:0;display:flex;flex-direction:column;gap:3px}
.tg-nm{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.tg-rn small{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis}
.tg-rs{display:flex;flex-direction:column;align-items:flex-end;flex:none;font-variant-numeric:tabular-nums}
.tg-rs b{font-family:var(--f-display);font-size:20px;line-height:1.1}
.tg-rs small{color:var(--muted);font-family:var(--f-mono);font-size:12.5px}
.tg-marks{display:inline-flex;flex-wrap:wrap;gap:3px}
.tg-marks i{width:18px;height:18px;border-radius:5px;border:1px solid var(--line);display:grid;place-items:center;background:var(--surface)}
.tg-marks i svg{width:11px;height:11px}
.tg-marks i.ok{background:var(--good-soft);border-color:transparent;color:var(--good)}
.tg-marks i.no{background:var(--bad-soft);border-color:transparent;color:var(--bad)}
.tg-react{display:inline-flex;gap:4px;flex:none}
.tg-react button{border:1px solid var(--line);background:var(--surface);border-radius:999px;height:32px;min-width:40px;padding:0 9px;font-size:15px;display:inline-flex;align-items:center;gap:4px;line-height:1}
.tg-react button small{font-size:11.5px;font-weight:600;color:var(--muted);font-family:var(--f-mono)}
.tg-react button[aria-pressed="true"]{border-color:var(--acc-line);background:var(--acc-soft)}
.tg-react button:hover{border-color:var(--muted)}
.tg-got{display:inline-flex;gap:8px;font-size:14px;color:var(--muted);flex:none}
.tg-got span{white-space:nowrap}
.tg-rv{border-top:1px solid var(--line)}
.tg-rv summary{display:flex;align-items:center;gap:10px;padding:11px 0;cursor:pointer;list-style:none;flex-wrap:wrap}
.tg-rv summary::-webkit-details-marker{display:none}
.tg-rv summary>.muted{font-size:13.5px;margin-inline-start:auto}
.tg-rv .st{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;border:1.5px solid var(--line);flex:none}
.tg-rv .st svg{width:13px;height:13px;display:block}
.tg-rv .st.ok{background:var(--good-soft);border-color:transparent;color:var(--good)}
.tg-rv .st.bad{background:var(--bad-soft);border-color:transparent;color:var(--bad)}
.tg-rvt{font-weight:600;min-width:0}
.tg-rvb{padding:0 0 16px;display:flex;flex-direction:column;gap:12px}
.tg-rvq{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}
.tg-rvq .diagram svg{min-width:0}
.tg-ans{margin:0}
.tg-rvb .solution{border:0;padding:4px 0 0}

/* entry sheet */
.tg-sheet .sub{margin-bottom:8px}
.tg-on{font-weight:600;margin:0 0 14px}
.tg-opts{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tg-opt{border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:10px;background:var(--sunk)}
.tg-opt h3{font-family:var(--f-display);font-size:17px;margin:0}
.tg-opt p{margin:0;color:var(--muted);font-size:14px;flex:1}
.tg-opt .btn{justify-content:center}
.tg-optrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tg-optrow .muted{font-size:13px}
.tg-seg button{min-width:40px;padding:6px 10px;font-family:var(--f-mono)}
.tg-seg button:disabled{opacity:.35;cursor:not-allowed}
.tg-sheet .wall-btns{display:grid;gap:10px;margin-top:6px}
.tg-sheet .wall-btns .btn{justify-content:center}
.tg-btn{gap:7px;padding:7px 12px;font-size:13.5px}
.tg-btn svg{width:16px;height:16px}

/* Friends */
.tg-panel{margin-top:0}
.tg-panel h2{font-family:var(--f-display);font-size:19px;margin:0 0 6px}
.tg-panel .sub{margin:0;color:var(--muted);font-size:14px}
.tg-list{list-style:none;margin:6px 0 0;padding:0}
.tg-list li{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line);flex-wrap:wrap}
.tg-list li:first-child{border-top:0}
.tg-li{flex:1 1 200px;min-width:0;display:flex;flex-direction:column}
.tg-li small{color:var(--muted);font-size:13px}
.tg-libtns{display:flex;gap:6px;flex:none}
.tg-ic{width:34px;height:34px;border-radius:50%;background:var(--acc-soft);color:var(--acc-text);display:grid;place-items:center;flex:none}
.tg-ic svg{width:18px;height:18px}
a.soc-who,a.soc-fav{position:relative}
.tg-now{position:absolute;left:26px;top:26px;width:11px;height:11px;border-radius:50%;background:var(--good);box-shadow:0 0 0 2px var(--surface)}
a.soc-fav .tg-now{left:23px;top:22px}
[dir="rtl"] .tg-now{left:auto;right:26px}
[dir="rtl"] a.soc-fav .tg-now{left:auto;right:23px}

@media (max-width:760px){
  .tg-lobby{grid-template-columns:1fr}
  .tg-intro{grid-row:auto}
  .tg-opts{grid-template-columns:1fr}
}
@media (max-width:560px){
  .tg-top-in{gap:8px;min-height:56px}
  .tg-ttl h1{font-size:15.5px}
  .tg-pp:nth-child(n+5){display:none}
  .tg-body{padding-top:14px}
  .tg-in h2{font-size:21px}
  .tg-card{padding:14px}
  .tg-center{padding:24px 16px}
  .tg-rank li{gap:10px}
  .tg-react button{min-width:36px;padding:0 7px}
  .tg-exbar .btn{padding:8px 12px}
  .tg-btn span{display:none}
  .tg-btn{padding:7px 9px}
}
