/* =====================================================
   together.css — 「マナモンといっしょに解く」モード
   （2026-10-16 実験・数学だけ・はじめは関係者だけ）
   ・効くのは #tg（このモードの画面）と、入口のボタン .tg-entry だけ
   ・ふだんの問題画面（#app）の見た目は変えない
   ・見た目は A 案「赤ペン（紙のテスト）」：方眼の紙・赤ペンの◎・付箋のヒント
===================================================== */

/* ---------- 入口（ふだんの問題画面に出すボタン） ---------- */
.tg-entry{display:flex;align-items:center;gap:10px;width:100%;margin:0 0 14px;padding:8px 14px 8px 8px;border:0;border-radius:14px;
  background:#FFF8D9;color:#3B3108;font:inherit;font-size:14px;font-weight:700;text-align:left;cursor:pointer;
  box-shadow:0 0 0 1.5px #F1DE8E inset;min-height:48px}
.tg-entry .tg-face{width:34px;height:33px;flex:none}
.tg-entry .tg-face svg{width:100%;height:100%;display:block}
.tg-entry small{display:block;font-size:12px;font-weight:500;color:#6B5A1C}
.tg-entry .tg-go{margin-left:auto;font-size:18px;line-height:1}
.tg-entry[hidden]{display:none}
.tg-entry .tg-face .mood{display:none}
.tg-entry .tg-face .m-happy{display:inline}

/* ---------- ホームの一番上：モードの切りかえ（試験中の人だけ） ---------- */
.tg-modes{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0 0 14px;padding:5px;border-radius:16px;background:#EFE6D6;box-shadow:inset 0 0 0 1.5px #E2D7C4}
.tg-modes[hidden]{display:none}
.tg-mode{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:52px;padding:6px 8px;border:0;border-radius:12px;background:transparent;color:#6A5D52;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .15s,color .15s}
.tg-mode b{font-family:"M PLUS Rounded 1c","Noto Sans JP",sans-serif;font-weight:800;font-size:15px}
.tg-mode small{font-size:11.5px;font-weight:500;opacity:.85}
.tg-mode.on{background:#FFFDF8;color:#2B241F;box-shadow:0 3px 0 #D9CDB9,0 8px 14px -10px rgba(0,0,0,.3)}
.tg-mode:focus-visible{outline:3px solid #2FB39A;outline-offset:2px}
/* 結果画面：さかのぼりから もとの単元に もどる */
.tg-back-origin{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:60px;margin:0 0 14px;border:0;border-radius:16px;cursor:pointer;
  background:#C9E86B;color:#1B3304;font:inherit;font-weight:800;font-size:16px;box-shadow:0 5px 0 #93B33C,0 12px 18px -10px rgba(0,0,0,.3)}
.tg-back-origin small{font-weight:500;font-size:12.5px;opacity:.85}
.tg-back-origin[hidden]{display:none}
.tg-back-origin:active{transform:translateY(4px);box-shadow:0 1px 0 #93B33C}
@media (prefers-reduced-motion:reduce){.tg-mode{transition:none}}

/* ---------- ホーム：マナモンの「きょうは なにする？」（試験・原山さんだけ） ---------- */
.tg-home{position:relative;margin:4px 0 18px;padding:16px 14px 14px;border-radius:6px;background:#FFFDF8;
  background-image:linear-gradient(rgba(120,150,170,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(120,150,170,.12) 1px,transparent 1px);background-size:18px 18px;
  box-shadow:0 1px 0 rgba(0,0,0,.03),0 14px 28px -16px rgba(60,45,25,.35);display:grid;gap:12px}
.tg-home[hidden]{display:none}
.tg-home::before{content:"";position:absolute;top:-10px;left:50%;width:84px;height:20px;margin-left:-42px;transform:rotate(-2deg);background:rgba(201,232,107,.78)}
.tg-home .tg-hh{display:flex;align-items:center;gap:10px}
.tg-home .tg-ava{width:54px;height:52px;flex:none}
.tg-home .tg-ava svg{width:100%;height:100%;overflow:visible}
.tg-home .tg-ava .mood{display:none}
.tg-home .tg-ava.m-normal .m-normal,.tg-home .tg-ava.m-happy .m-happy,.tg-home .tg-ava.m-surprised .m-surprised,.tg-home .tg-ava.m-think .m-think{display:inline}
.tg-home .tg-hb{margin:0;background:#fff;padding:10px 14px;border-radius:18px 18px 18px 6px;font-size:17px;font-weight:800;font-family:"M PLUS Rounded 1c","Noto Sans JP",sans-serif;color:#2B241F;box-shadow:0 0 0 1.5px #E3D8C6}
.tg-home .tg-hme{justify-self:end;margin:0;background:#C9E86B;color:#1B3304;padding:8px 14px;border-radius:18px 18px 6px 18px;font-size:15px;font-weight:700}
.tg-home .tg-hlist{display:grid;gap:9px}
.tg-home .tg-hr{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:54px;padding:8px 16px;border:0;border-radius:16px;cursor:pointer;
  background:#fff;color:#2B241F;font:inherit;font-weight:800;font-size:16px;text-align:left;box-shadow:0 4px 0 #D9CDB9,0 10px 16px -12px rgba(0,0,0,.25);transition:transform .09s,box-shadow .09s;-webkit-tap-highlight-color:transparent}
.tg-home .tg-hr.main{background:#C9E86B;color:#1B3304;box-shadow:0 4px 0 #93B33C,0 10px 16px -12px rgba(0,0,0,.3)}
.tg-home .tg-hr:active{transform:translateY(3px);box-shadow:0 1px 0 #D9CDB9}
.tg-home .tg-hr small{font-weight:500;font-size:13px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:55%}
.tg-home .tg-hr:focus-visible{outline:3px solid #2FB39A;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.tg-home *{transition:none!important}}

/* ホームの会話（チャット）・いっしょモードでは下の広い一覧をたたむ */
body.tg-homechat:not(.tg-showlist) #home .home-layout{display:none}
/* 会話の中にマナモンがいるので、ホームでは右下に浮かぶマナモンを出さない（返事ボタンに重なるため） */
body.tg-homechat[data-screen="home"] #buddy,body.tg-homechat[data-screen="home"] #bubble{display:none!important}
.tg-home .tg-hlog{display:grid;gap:8px}
.tg-home .tg-hh.old .tg-ava{visibility:hidden}
.tg-home .tg-hh.old .tg-hb{font-size:15px;font-weight:700;opacity:.8}
.tg-home .tg-hlist.many{max-height:56vh;overflow-y:auto;padding:2px 2px 6px}
.tg-home .tg-hr.small{min-height:44px;font-size:14px;background:transparent;box-shadow:inset 0 0 0 1.5px #D9CDB9}
.tg-home .tg-hall{justify-self:center;margin-top:2px;padding:8px 10px;border:0;background:none;color:#6A5D52;font:inherit;font-size:13px;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer;min-height:44px}

/* ---------- 画面の土台 ---------- */
#tg{
  --bg:#F3EDE0; --card:#FFFDF8; --ink:#2B241F; --soft:#6A5D52; --line:#E3D8C6; --grid:rgba(120,150,170,.13);
  --main:#C9E86B; --main-ink:#1B3304; --main-edge:#93B33C; --sub:#FFFFFF; --sub-ink:#2B241F; --sub-edge:#D9CDB9;
  --ok:#03CD9C; --ok-ink:#04312A; --ok-edge:#029C77; --ng:#FF9D6B; --ng-ink:#4A2008; --ng-edge:#D9733F;
  --pen:#D2362A; --pen-soft:#FBE3DE; --tri:#E8772E; --hl:#FFE769; --me:#C9E86B; --me-ink:#1B3304;
  --disp:"M PLUS Rounded 1c","Noto Sans JP",sans-serif; --ease:cubic-bezier(.2,.8,.2,1);
  position:fixed;inset:0;z-index:70;background:var(--bg);color:var(--ink);
  font-family:"Noto Sans JP",system-ui,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden}
#tg[hidden]{display:none}
#tg .tg-in{position:relative;max-width:520px;height:100%;margin:0 auto;display:flex;flex-direction:column}
#tg .tg-art{position:absolute;left:0;right:0;bottom:0;height:42%;background:url(../together/bg_tsukue.webp) center bottom/cover no-repeat;pointer-events:none}
#tg .tg-art::after{content:"";position:absolute;inset:0;background:linear-gradient(var(--bg),rgba(243,237,224,0) 42%)}
body.tg-on #buddy,body.tg-on #bubble{display:none!important}
body.tg-on{overflow:hidden}
#tg em{font-style:normal;background:linear-gradient(transparent 58%,var(--hl) 58%)}
#tg button{font:inherit;color:inherit;border:0;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
#tg button:focus-visible{outline:3px solid #2FB39A;outline-offset:2px}

/* ---------- 上の帯 ---------- */
#tg .tg-hud{position:relative;z-index:3;display:flex;align-items:center;gap:8px;padding:calc(8px + env(safe-area-inset-top,0px)) 12px 2px}
#tg .tg-ib{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;flex:none;background:var(--card);box-shadow:0 2px 0 var(--sub-edge);color:var(--soft)}
#tg .tg-ib svg{width:22px;height:22px}
#tg .tg-ib.off{opacity:.45}
#tg .tg-ttl{flex:1;min-width:0;text-align:center;line-height:1.3}
#tg .tg-ttl small{display:block;font-size:12px;color:var(--soft);font-weight:700}
#tg .tg-ttl b{display:block;font-family:var(--disp);font-weight:800;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tg .tg-solo{width:auto;padding:0 10px;font-size:12px;font-weight:700;line-height:1.25;text-align:center}

/* ---------- 答案欄（上の◎△のマス） ---------- */
#tg .tg-slots{position:relative;z-index:3;display:flex;justify-content:center;gap:5px;padding:6px 10px 8px;flex-wrap:nowrap}
#tg .tg-slot{position:relative;width:36px;height:36px;flex:0 1 36px;border-radius:4px;display:grid;place-items:center;font-family:var(--disp);font-weight:800;font-size:13px;color:var(--soft);background:#FFFDF8;box-shadow:inset 0 0 0 1.5px #CFC2AE}
#tg .tg-slot.cur{box-shadow:inset 0 0 0 2.5px var(--ink);color:var(--ink)}
#tg .tg-slot .mk{position:absolute;inset:0;display:grid;place-items:center}
#tg .tg-slot .mk svg{width:28px;height:28px}
#tg .tg-slot.done .n{opacity:0}
#tg .tg-slot.pop{animation:tgPop .32s var(--ease)}
@keyframes tgPop{0%{transform:scale(.6)}60%{transform:scale(1.18)}100%{transform:none}}

/* ---------- 問題が流れたときの小さな帯 ---------- */
#tg .tg-mini{position:absolute;z-index:4;left:12px;right:12px;top:calc(100px + env(safe-area-inset-top,0px));padding:8px 12px;border-radius:12px;background:var(--card);
  box-shadow:0 6px 14px -10px rgba(0,0,0,.4),0 0 0 1.5px var(--line);font-size:14px;font-weight:700;display:flex;gap:10px;align-items:center;
  opacity:0;transform:translateY(-6px);transition:opacity .2s,transform .2s;pointer-events:none;white-space:nowrap;overflow:hidden}
#tg .tg-mini.on{opacity:1;transform:none}
#tg .tg-mini:empty{display:none}
#tg .tg-mini b{font-family:var(--disp);color:var(--soft);font-size:13px;flex:none}
#tg .tg-mini span{overflow:hidden;text-overflow:ellipsis}

/* ---------- 会話の流れ ---------- */
#tg .tg-scroll{position:relative;z-index:2;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 14px 150px}
#tg .tg-stream{display:flex;flex-direction:column;gap:10px}
#tg .tg-it{animation:tgRise .26s var(--ease) both}
@keyframes tgRise{from{opacity:0;transform:translateY(8px)}}

/* 問題カード（方眼の紙＋マスキングテープ） */
#tg .tg-card{position:relative;background:var(--card);border-radius:6px;padding:16px 16px 18px;margin-top:6px;
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);background-size:18px 18px;background-position:-1px -1px;
  box-shadow:0 1px 0 rgba(0,0,0,.03),0 14px 28px -16px rgba(60,45,25,.35)}
#tg .tg-card::before{content:"";position:absolute;top:-10px;left:50%;width:92px;height:22px;margin-left:-46px;transform:rotate(-2deg);background:rgba(201,232,107,.78)}
#tg .tg-card.out{animation:tgOut .2s ease-in forwards}
@keyframes tgOut{to{transform:translateX(-36px);opacity:0}}
#tg .tg-qhead{display:flex;align-items:center;gap:10px;margin-bottom:8px}
#tg .tg-qno{font-family:var(--disp);font-weight:800;font-size:19px}
#tg .tg-qno b{font-size:25px}
#tg .tg-badge{font-size:12px;font-weight:700;padding:2px 9px;border-radius:4px;color:var(--soft);box-shadow:inset 0 0 0 1.5px #CFC2AE}
#tg .tg-card .prompt{font-size:16px;line-height:1.75;margin:0}
#tg .tg-card .eqs{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:8px}
#tg .tg-card .eq{background:transparent;border:0;box-shadow:none;padding:4px 0;min-width:0;font-size:22px;max-width:100%;overflow-x:auto}
#tg .tg-card .wordq{background:transparent;border:0;box-shadow:none;padding:0;font-size:16px;line-height:1.85}
#tg .tg-card .wordq .ask{display:block;margin-top:6px;font-weight:700}
#tg .tg-card .gwrap{display:flex;justify-content:center;margin:6px 0}
#tg .tg-card .gwrap svg{max-width:100%;height:auto}
#tg .tg-goal{margin-top:10px;font-size:15px;font-weight:700}

/* 赤ペンの◎・△ */
#tg .tg-stamp{position:absolute;right:10px;top:16px;width:140px;height:140px;pointer-events:none;opacity:0}
#tg .tg-stamp path{fill:none;stroke-linecap:round;stroke-linejoin:round}
#tg .tg-stamp.on{opacity:.92}
#tg .tg-stamp .c1,#tg .tg-stamp .c2{stroke:var(--pen);stroke-width:7;stroke-dasharray:640;stroke-dashoffset:640}
#tg .tg-stamp .t1{stroke:var(--tri);stroke-width:7;stroke-dasharray:520;stroke-dashoffset:520}
#tg .tg-stamp.ok .c1{animation:tgDraw .26s ease-out forwards}
#tg .tg-stamp.ok .c2{animation:tgDraw .22s .2s ease-out forwards}
#tg .tg-stamp.ng .t1{animation:tgDraw .3s ease-out forwards}
#tg .tg-stamp.ok .t1,#tg .tg-stamp.ng .c1,#tg .tg-stamp.ng .c2{display:none}
#tg .tg-stamp.frozen path{animation:none!important;stroke-dashoffset:0}
@keyframes tgDraw{to{stroke-dashoffset:0}}

/* マナモンの吹き出し・自分の返事 */
#tg .tg-bot{display:flex;align-items:flex-end;gap:8px;max-width:92%}
#tg .tg-ava{width:38px;height:37px;flex:none}
#tg .tg-ava svg{width:100%;height:100%;overflow:visible}
#tg .tg-ava .mood{display:none}
#tg .tg-ava.m-normal .m-normal,#tg .tg-ava.m-happy .m-happy,#tg .tg-ava.m-surprised .m-surprised,#tg .tg-ava.m-think .m-think{display:inline}
#tg .tg-ava.hide{visibility:hidden}
#tg .tg-bb{background:var(--card);padding:10px 14px;border-radius:18px 18px 18px 6px;font-size:16px;line-height:1.65;font-weight:500;box-shadow:0 1px 0 rgba(0,0,0,.04),0 6px 14px -10px rgba(60,45,25,.35);min-width:0}
#tg .tg-bb.hint{background:#FFF1A8;color:#3B3108;border-radius:4px;transform:rotate(-.6deg)}
#tg .tg-me{align-self:flex-end;max-width:80%;background:var(--me);color:var(--me-ink);padding:9px 14px;border-radius:18px 18px 6px 18px;font-size:15px;font-weight:700;font-family:var(--disp)}
#tg .tg-typing{display:flex;gap:4px;padding:14px 16px}
#tg .tg-typing span{width:7px;height:7px;border-radius:50%;background:var(--soft);opacity:.35;animation:tgDot 1s infinite}
#tg .tg-typing span:nth-child(2){animation-delay:.15s}
#tg .tg-typing span:nth-child(3){animation-delay:.3s}
@keyframes tgDot{40%{opacity:1;transform:translateY(-3px)}}
#tg .tg-sn{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--pen-soft);color:var(--pen);font-family:var(--disp);font-weight:800;font-size:12px;margin-right:6px;vertical-align:2px}
#tg .tg-calc{margin-top:6px;padding:7px 12px;border-radius:10px;background:rgba(0,0,0,.045);font-weight:700;font-size:16px;overflow-x:auto}
#tg .tg-why{margin-top:6px;font-size:14px;color:var(--soft)}

/* 答えのカード */
#tg .tg-ans{margin-left:46px;background:var(--card);border-radius:6px;padding:12px 16px 14px;box-shadow:0 6px 14px -10px rgba(60,45,25,.35),inset 0 0 0 2px var(--pen-soft);
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);background-size:18px 18px}
#tg .tg-ansrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#tg .tg-lbl{font-size:12px;font-weight:700;color:var(--pen);border-radius:6px;padding:3px 8px;background:var(--pen-soft);flex:none}
#tg .tg-val.long{font-size:17px;line-height:1.55}
#tg .tg-val{font-size:22px;font-weight:800;color:var(--pen);font-family:var(--disp);min-width:0;overflow-x:auto}
#tg .tg-ans .gwrap{display:flex;justify-content:center;margin-top:8px;background:transparent}
#tg .tg-ans .gwrap svg{max-width:100%;height:auto}
#tg .tg-policy{margin:8px 0 0;font-size:15px;line-height:1.7;font-weight:500}
#tg .tg-policy b{font-size:12px;font-weight:700;color:var(--soft);margin-right:8px}
#tg .tg-kata{margin-left:46px;padding:11px 14px;border-radius:12px;background:#FFF8E1;font-size:15px;line-height:1.7;font-weight:500}
#tg .tg-kata b{display:block;font-size:12px;color:#9A6B00;margin-bottom:2px}

/* マナモンのノート（マナモンに教える） */
#tg .tg-sol{margin-left:46px;background:var(--card);border-radius:6px;padding:8px;display:grid;gap:6px;box-shadow:0 6px 14px -10px rgba(60,45,25,.35),inset 0 0 0 1.5px var(--line)}
#tg .tg-sol .sh{font-size:12px;font-weight:700;color:var(--soft);padding:4px 8px 0;margin:0}
#tg .tg-ln{position:relative;display:block;width:100%;text-align:left;padding:10px 12px;border-radius:10px;background:rgba(0,0,0,.035);font-size:16px;font-weight:700;line-height:1.5;min-height:48px}
#tg .tg-ln small{display:block;font-size:12px;font-weight:500;color:var(--soft)}
#tg .tg-ln.hit{background:var(--pen-soft)}
#tg .tg-ln.hit::after{content:"";position:absolute;inset:-4px -2px;border:3px solid var(--pen);border-radius:50%/60%;transform:rotate(-1.5deg)}
#tg .tg-ln.miss{opacity:.55}
#tg .tg-ln:disabled{cursor:default}

/* ---------- 下の返事ボタン ---------- */
#tg .tg-dock{position:absolute;z-index:6;left:0;right:0;bottom:0;padding:16px 14px calc(12px + env(safe-area-inset-bottom,0px));background:linear-gradient(rgba(243,237,224,0),var(--bg) 26%)}
#tg .tg-ask{text-align:center;font-size:14px;font-weight:700;color:var(--soft);margin:0 0 8px}
#tg .tg-ask:empty{display:none}
#tg .tg-replies{display:flex;gap:8px}
#tg .tg-r{flex:1;min-height:60px;border-radius:18px;font-family:var(--disp)!important;font-weight:800;font-size:17px;position:relative;transition:transform .09s,box-shadow .09s;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:6px 6px;line-height:1.25;text-align:center;white-space:nowrap}
#tg .tg-r:active{transform:translateY(4px)}
#tg .tg-r.main{flex:2;background:var(--main);color:var(--main-ink);box-shadow:0 5px 0 var(--main-edge),0 12px 18px -10px rgba(0,0,0,.35)}
#tg .tg-r.main:active{box-shadow:0 1px 0 var(--main-edge)}
#tg .tg-r.sub{flex:1.15;background:var(--sub);color:var(--sub-ink);box-shadow:0 5px 0 var(--sub-edge),0 12px 18px -12px rgba(0,0,0,.25);font-size:clamp(13px,3.9vw,15px)}
#tg .tg-r.ok{flex:1.2;background:var(--ok);color:var(--ok-ink);box-shadow:0 5px 0 var(--ok-edge),0 12px 18px -10px rgba(0,0,0,.3)}
#tg .tg-r.ng{flex:1.2;background:var(--ng);color:var(--ng-ink);box-shadow:0 5px 0 var(--ng-edge),0 12px 18px -10px rgba(0,0,0,.3)}
#tg .tg-r small{font-family:"Noto Sans JP",sans-serif;font-size:11px;font-weight:500;opacity:.85}
#tg .tg-replies.swap .tg-r{animation:tgRise .22s var(--ease) both}
/* 返事ボタンは少しずつずらして出す（21st.dev「AI Suggestions」の出入りを参考に・3つまで） */
#tg .tg-replies.swap .tg-r:nth-child(2){animation-delay:.05s}
#tg .tg-replies.swap .tg-r:nth-child(3){animation-delay:.1s}
#tg .tg-replies.swap .tg-r:nth-child(4){animation-delay:.15s}
#tg .tg-replies.swap .tg-r:nth-child(n+5){animation-delay:.2s}

/* 他教科：選択肢の返事ボタン（縦に並べる）・国語の本文・改行 */
#tg .tg-replies.col{flex-direction:column;gap:7px;max-height:46vh;overflow-y:auto}
#tg .tg-r.opt{flex:none;min-height:48px;justify-content:center;align-items:flex-start;text-align:left;white-space:normal;font-size:15px;line-height:1.45;padding:9px 14px;background:var(--sub);color:var(--sub-ink);box-shadow:0 4px 0 var(--sub-edge),0 10px 16px -12px rgba(0,0,0,.25)}
#tg .tg-r.opt:active{box-shadow:0 1px 0 var(--sub-edge)}
#tg .tg-passage{margin:2px 0 10px;border-radius:8px;background:rgba(0,0,0,.035);padding:6px 10px}
#tg .tg-passage summary{cursor:pointer;font-weight:700;font-size:13px;color:var(--soft);min-height:32px;display:flex;align-items:center}
#tg .tg-ptext{font-size:15px;line-height:1.85;white-space:pre-line;max-height:38vh;overflow-y:auto}
body:not([data-subject="math"]) #tg .tg-card .wordq{white-space:pre-line}

/* 記述：「ここが書けていれば ◎」（付箋に赤ペンのチェック） */
#tg .tg-pts{margin-left:46px;padding:10px 12px 12px;border-radius:4px;background:#FFF1A8;color:#3B3108;box-shadow:0 6px 10px -8px rgba(80,60,0,.5);transform:rotate(-.4deg)}
#tg .tg-pts-ttl{margin:0 0 6px;font-size:13px;font-weight:800}
#tg .tg-plist{list-style:none;margin:0;padding:0;display:grid;gap:6px}
#tg .tg-pt{display:flex;align-items:flex-start;gap:10px;width:100%;min-height:44px;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.65);text-align:left;font-size:15px;font-weight:500;line-height:1.55}
#tg .tg-box{flex:none;width:22px;height:22px;margin-top:1px;border-radius:5px;box-shadow:inset 0 0 0 2px #B9A24A;position:relative;background:#fff}
#tg .tg-pt.on .tg-box::after{content:"";position:absolute;left:5px;top:1px;width:8px;height:14px;border:solid var(--pen);border-width:0 3.5px 3.5px 0;transform:rotate(40deg)}
#tg .tg-pts-warn{margin:6px 0 0;font-size:13px;font-weight:700;color:#8A3B12}
#tg .tg-r.suggest{outline:3px solid var(--ink);outline-offset:3px}

/* ---------- マナモンのおすすめ英単語（いっしょモード・試験中の人だけ） ---------- */
#tg .tg-vcard{text-align:center;padding-bottom:22px}
#tg .tg-vcard .tg-qhead{justify-content:flex-start}
#tg .tg-again{color:#8A3B12;box-shadow:inset 0 0 0 1.5px #F2B48F}
#tg .tg-word{font-family:var(--disp);font-weight:800;font-size:clamp(32px,10.5vw,46px);line-height:1.2;margin:16px 0 6px;overflow-wrap:anywhere}
#tg .tg-kana{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;font-size:15px;font-weight:700;color:var(--soft)}
#tg .tg-say{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--sub);box-shadow:0 2px 0 var(--sub-edge);color:var(--soft);position:relative;z-index:1}
#tg .tg-say svg{width:22px;height:22px}
#tg .tg-qw{font-size:19px}
#tg .tg-hex{display:block;margin-top:4px;font-size:17px;font-weight:700;line-height:1.55}
#tg .tg-hex b,#tg .tg-vex b{background:linear-gradient(transparent 58%,var(--hl) 58%)}
#tg .tg-vm{display:grid;gap:6px}
#tg .tg-vmr{margin:0;display:flex;align-items:center;gap:10px;font-family:var(--disp);font-size:20px;line-height:1.45;color:var(--pen)}
#tg .tg-vmr b{font-weight:800;min-width:0}
#tg .tg-vex{margin:10px 0 0;font-size:16px;line-height:1.6;font-weight:500}
#tg .tg-vex small{display:block;margin-top:2px;font-size:14px;color:var(--soft)}
#tg .tg-forms{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0}
#tg .tg-forms span{font-size:13px;color:var(--soft);padding:3px 8px;border-radius:6px;background:rgba(0,0,0,.04)}
#tg .tg-forms span b{color:var(--ink);font-size:14px}
#tg .tg-forms span.irr{background:var(--pen-soft)}
#tg .tg-vsum{margin-left:46px;padding:12px 16px 14px;border-radius:6px;background:var(--card);box-shadow:0 6px 14px -10px rgba(60,45,25,.35),inset 0 0 0 1.5px var(--line)}
#tg .tg-vsum-t{margin:0;font-size:13px;font-weight:700;color:var(--soft)}
#tg .tg-vsum-n{margin:2px 0 6px;font-size:15px;font-weight:700}
#tg .tg-vsum-n b{font-family:var(--disp);font-size:28px;font-weight:800;color:var(--pen);margin-right:2px}
#tg .tg-vbar{height:10px;border-radius:6px;background:#EFE6D6;overflow:hidden}
#tg .tg-vbar i{display:block;height:100%;min-width:4px;border-radius:6px;background:var(--ok)}
#tg .tg-vsum-s{margin:8px 0 0;font-size:13px;color:var(--soft);line-height:1.6}
/* 意味→英語（書いて おぼえる）・英単語テスト */
#tg .tg-ja{font-family:var(--disp);font-weight:800;font-size:clamp(26px,8vw,34px);line-height:1.35;margin:14px 0 6px;overflow-wrap:anywhere}
#tg .tg-jex{margin:0;font-size:14px;color:var(--soft);line-height:1.6}
#tg .tg-spl{display:block;margin-top:4px;font-family:var(--disp);font-weight:800;font-size:22px;letter-spacing:.06em}
#tg .tg-spn{display:block;font-size:13px;color:#6B5A1C}
#tg .tg-ansen{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;margin-bottom:8px}
#tg .tg-ansen b{font-family:var(--disp);font-weight:800;font-size:30px;line-height:1.2;color:var(--pen);overflow-wrap:anywhere}
#tg .tg-ansen span{font-size:14px;font-weight:700;color:var(--soft)}
#tg .tg-vlist{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:4px}
#tg .tg-vlist li{display:flex;gap:10px;align-items:baseline;font-size:15px;flex-wrap:wrap}
#tg .tg-vlist b{font-family:var(--disp);font-weight:800;font-size:16px}
/* はじめる前に（これから やる単元のカード） */
#tg .tg-ucard{text-align:center}
#tg .tg-uname{font-family:var(--disp);font-weight:800;font-size:clamp(22px,6.5vw,28px);line-height:1.4;margin:10px 0 4px;overflow-wrap:anywhere}
/* ホームの下の一覧：アコーディオン（いっしょモードだけ） */
.tg-acc{display:none}
body.tg-homechat .tg-acc{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:60px;margin:6px 0 12px;padding:12px 18px;border:0;border-radius:16px;background:#FFFDF8;color:#2B241F;font:inherit;text-align:left;cursor:pointer;
  box-shadow:0 0 0 1.5px #E2D7C4,0 10px 18px -14px rgba(60,45,25,.4);-webkit-tap-highlight-color:transparent}
.tg-acc-t b{display:block;font-family:"M PLUS Rounded 1c","Noto Sans JP",sans-serif;font-weight:800;font-size:16px}
.tg-acc-t small{display:block;font-size:13px;color:#6A5D52;font-weight:500}
.tg-acc-i{width:11px;height:11px;flex:none;margin-right:4px;border-right:3px solid #6A5D52;border-bottom:3px solid #6A5D52;transform:translateY(-3px) rotate(45deg);transition:transform .22s}
.tg-acc.on .tg-acc-i{transform:translateY(3px) rotate(-135deg)}
.tg-acc:focus-visible{outline:3px solid #2FB39A;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.tg-acc-i{transition:none}}
/* ホーム：英単語帳のカードの下「英単語帳を 自由に つかう」 */
.tg-vfree{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:44px;margin:6px 0 0;padding:6px 10px;border:0;background:none;color:#5F5272;font:inherit;font-size:14px;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.tg-vfree[hidden]{display:none}
.tg-vfree:focus-visible{outline:3px solid #2FB39A;outline-offset:2px}

@media (prefers-reduced-motion:reduce){
  #tg *,#tg *::before,#tg *::after{animation:none!important;transition:none!important}
  #tg .tg-stamp path{stroke-dashoffset:0}
}
