/* 阿吽 物語：物語だけの部品（docs/66 §1）。
   値は ui/tokens.css、共通の部品（画面の型・戻る・タブ・ボタン・行・カード・ダイアログ・シート・トースト・空の状態）は ui/components.css。
   ここに置くのは、阿吽の部品に無い物（会話・表紙・読み物・練習）と、ページの中の並べ方だけ。色・文字の段・角丸・影は tokens の名前で使う。 */
p{margin:0}
button{cursor:pointer}
svg.ic{width:var(--icon);height:var(--icon);flex-shrink:0;fill:none;stroke:currentColor;stroke-width:var(--icon-stroke);stroke-linecap:round;stroke-linejoin:round}
svg.ic.s{width:20px;height:20px}

/* ---- ページの中身（.content の中）：上から並べる。近い物は 12、塊と塊は 24 ---- */
.flow{min-width:0}
.flow h2{margin:24px 0 12px}
.flow>h2:first-child{margin-top:0}
.flow .card,.flow .list{margin-bottom:12px}
.flow .card:last-child,.flow .list:last-child{margin-bottom:0}
.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.fx{display:flex;gap:8px;align-items:center}
.fx.top{align-items:flex-start}
.fx.mid{justify-content:center;flex-wrap:wrap}
.label{font-size:var(--fs-sub);color:var(--c-sub);font-weight:var(--fw-bold);margin-bottom:8px}
.big{font-size:var(--fs-head);line-height:var(--lh-body)}
.t-sub.block,.t-note.block{display:block}
.empty svg.ic{width:56px;height:56px}
.pre{white-space:pre-line}
.oops{margin:0 0 12px;font-weight:var(--fw-bold);color:var(--c-danger)}
.sel{user-select:all;-webkit-user-select:all;word-break:break-all;font-size:var(--fs-sub)}

/* ---- 画面の型に足す物 ---- */
/* 上のバーの右端（進み・メモ）。題は中央のまま */
.bar-title:not(:last-child){margin-right:0}
.bar-end{min-width:var(--hit);min-height:var(--hit);display:flex;align-items:center;justify-content:flex-end;font-size:var(--fs-sub);color:var(--c-sub);white-space:nowrap}
/* 表紙のある画面（作品・シリーズ）：スマホでは絵が上まで届き、戻るは絵の上に浮く */
.screen.has-hero>.bar{position:fixed;top:0;left:0;right:0;z-index:5;pointer-events:none}
.screen.has-hero>.bar .back{pointer-events:auto}
.screen.has-hero>.bar .back::before{background:var(--c-surface);box-shadow:var(--shadow-1)}
.screen.has-hero>.content{padding-top:0}
/* 会話の画面：上（戻る・題・場面）と下（入力）は動かない */
.screen.chat>.top{position:sticky;top:0;z-index:5;background:var(--c-bg)}
.screen.chat>.content{padding-top:8px;padding-bottom:16px}
.scene{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:8px var(--side)}
.scene::-webkit-scrollbar{display:none}
.scene:empty{display:none}
.inputbar{position:sticky;bottom:0;z-index:4;background:var(--c-bg);padding:8px 12px calc(8px + var(--safe-bottom))}
/* 主ボタンの横に並べる物（前へ・再生） */
.dock .fx .btn{flex:1}
.dock .fx .btn.narrow{width:auto;flex:0 0 auto}
.dock .btn .ic{margin-right:4px}
/* カード：ボタンとして置く時の地ならし、押せない面、行の中の絵 */
button.card{border:0}
.card.flat{background:var(--c-surface-2);box-shadow:none}
.cont img{width:56px;height:56px;border-radius:var(--r-s);object-fit:cover;object-position:50% 20%;flex:none}
.cont .kick{font-size:var(--fs-note);font-weight:var(--fw-bold);color:var(--c-result)}
.who img{width:72px;height:72px;border-radius:var(--r-s);object-fit:cover;object-position:50% 12%;flex:none;background:var(--c-surface-2)}
.cont .grow>*,.who .grow>*{display:block}
/* 行：番号・印の丸、まだ押せない行 */
.row-ic.num{font-size:var(--fs-sub);font-weight:var(--fw-bold)}
.row-ic.soft{background:var(--c-surface-2);color:var(--c-text)}
.row-ic.now{background:var(--c-action)}
.row:disabled{color:var(--c-sub);cursor:default}
.row:disabled:active{background:none}
.row .ic.go{color:var(--c-sub);width:18px;height:18px}

/* ---- 丸いボタン（印だけ。見た目 40、押せる広さ 48。戻ると同じ丸） ---- */
.round{position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:center;width:var(--hit);height:var(--hit);flex:none;border:0;background:none;padding:0;color:var(--c-text);border-radius:var(--r-full)}
.round::before{content:"";position:absolute;inset:4px;border-radius:var(--r-full);background:var(--c-surface-2);z-index:-1}
.round:active::before{background:var(--c-line)}
.round.plain::before{background:transparent}
.round.plain:active::before,.round.plain.on::before{background:var(--c-surface-2)}
.round.accent{color:var(--c-on-action)}
.round.accent::before{inset:2px;background:var(--c-action)}
.round:disabled{opacity:.45}
.round.small{width:32px;height:32px}
.round.small::before{inset:0}
.round.small::after{content:"";position:absolute;inset:-8px}

/* ---- 小さいボタン（聞く・声に出す・選ぶ）。主ボタンではない操作 ---- */
.sbtn{border:0;background:var(--c-surface-2);border-radius:var(--r-full);padding:0 16px;font-size:var(--fs-sub);font-weight:var(--fw-bold);line-height:var(--lh-tight);min-height:var(--hit);display:inline-flex;align-items:center;gap:8px;color:var(--c-text)}
.sbtn:active{background:var(--c-line)}
.sbtn.accent{background:var(--c-action);color:var(--c-on-action)}
.sbtn.on{background:var(--c-text);color:var(--c-bg)}
.sbtn:disabled{opacity:.45}
.seg{display:flex;gap:8px;flex-wrap:wrap}
.field{flex:1;min-width:0;border:0;box-shadow:inset 0 0 0 1px var(--c-control);border-radius:var(--r-s);padding:12px;min-height:var(--hit);background:var(--c-surface)}
.field.wide{width:100%;display:block}
.field.sel{flex:0 0 auto;width:auto;padding:0 12px;margin-left:8px;font-weight:var(--fw-bold)}
.write{display:flex;gap:8px;align-items:flex-end;margin-top:12px}
.write textarea,.inputrow textarea{flex:1;min-width:0;border:0;padding:12px 16px;font:inherit;resize:none;background:var(--c-surface);box-shadow:inset 0 0 0 1px var(--c-control);line-height:1.5;color:var(--c-text)}
.write textarea{border-radius:var(--r-m)}
.write textarea:focus,.inputrow textarea:focus,.field:focus{outline:none;box-shadow:inset 0 0 0 1.5px var(--c-text)}

/* ---- ホーム：表紙の並び ---- */
.tops{display:grid;gap:12px;margin:0 0 12px}
.tops:empty{display:none}
.flow .tops .card{margin:0}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.cover{position:relative;display:block;width:100%;padding:0;border:0;background:var(--c-surface-2);border-radius:var(--r-m);overflow:hidden;aspect-ratio:3/4;box-shadow:var(--shadow-1);text-align:left;color:var(--c-on-action)}
.cover img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover}
.cover .shade{position:absolute;inset:0;background:linear-gradient(to top,rgba(10,12,16,.88) 0%,rgba(10,12,16,.35) 42%,rgba(10,12,16,0) 62%)}
.cover .txt{position:absolute;left:12px;right:12px;bottom:12px}
.cover .g{font-size:var(--fs-note);font-weight:var(--fw-bold);opacity:.9}
.cover .t{font-size:var(--fs-body);font-weight:var(--fw-bold);line-height:1.35}
.cover .corner-tag{top:8px;left:8px;right:auto;background:var(--c-surface);color:var(--c-result-ink);box-shadow:none}
.cover .corner-tag.plain{color:var(--c-sub)}
.prog{display:flex;gap:4px;margin-top:8px}
.prog i{width:16px;height:4px;border-radius:2px;background:rgba(255,255,255,.4)}
.prog i.on{background:var(--c-on-action)}
.grid .cover:only-child{grid-column:1/-1;aspect-ratio:4/3}
.grid .cover:only-child .t{font-size:var(--fs-head)}
.grid .cover:only-child img{object-position:50% 30%}
.older{margin-top:24px}
.older summary{list-style:none;padding-left:0}
.older summary::-webkit-details-marker{display:none}
.more{font-size:var(--fs-sub);font-weight:var(--fw-bold);color:var(--c-action);min-height:var(--hit);display:inline-flex;align-items:center;padding:0 12px}

/* ---- 作品のページ ---- */
.hero{position:relative;margin:0 calc(var(--side) * -1);height:min(64vh,560px);background:var(--c-surface-2);overflow:hidden}
.hero img{width:100%;height:100%;object-fit:cover;object-position:50% 25%}
.hero .fade{position:absolute;left:0;right:0;bottom:0;height:96px;background:linear-gradient(to top,var(--c-bg),rgba(244,245,247,0))}
.flow .hero+.t-title{padding:16px 0 8px}
.tags{color:var(--c-sub);font-size:var(--fs-sub);line-height:1.8}
.facts{display:flex;gap:8px;flex-wrap:wrap}
.fact{background:var(--c-surface-2);border-radius:var(--r-s);padding:4px 12px;font-size:var(--fs-sub);color:var(--c-text);white-space:nowrap}
.fact .k{color:var(--c-sub);margin-right:8px}
button.fact{border:0;min-height:40px}
.bul{margin:0;padding:0;list-style:none}
.bul li{position:relative;padding-left:16px}
.bul li::before{content:"・";position:absolute;left:0}
.sent{padding:12px 0;border-top:1px solid var(--c-line)}
.sent:first-child,.label+.sent{border-top:0;padding-top:0}
.sent:last-child{padding-bottom:0}

/* ---- 登場人物（シートの中） ---- */
.portrait{width:100%;max-height:52vh;aspect-ratio:4/5;object-fit:cover;object-position:50% 12%;border-radius:var(--r-m);background:var(--c-surface-2)}
.say{background:var(--c-surface-2);border:0;border-radius:4px var(--r-m) var(--r-m) var(--r-m);padding:8px 12px;display:inline-block;margin:0 8px 8px 0;min-height:40px;text-align:left}

/* ---- 会話 ---- */
.log{padding:0 0 8px}
.setup{background:var(--c-surface-2);border-radius:var(--r-m);padding:16px;margin:8px 0 24px;line-height:1.8}
.setup p+p{margin-top:12px}
.msg{margin:0 0 24px}
.evpic{width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:var(--r-m);margin:0 0 12px;background:var(--c-surface-2)}
.ending .evpic{margin-bottom:16px}
.nar{margin:0 0 16px;padding:4px 0 4px 16px;border-left:3px solid var(--c-line);line-height:1.8}
.line{display:flex;gap:8px;align-items:flex-start}
.ava{width:48px;height:48px;margin:-4px;flex-shrink:0;background:transparent;border:0;padding:4px;display:block}
.ava img{width:40px;height:40px;border-radius:var(--r-full);object-fit:cover;object-position:50% 14%;background:var(--c-surface-2)}
span.ava.ini{width:40px;height:40px;margin:0;padding:0;border-radius:var(--r-full);background:var(--c-surface-2);display:flex;align-items:center;justify-content:center;font-weight:var(--fw-bold);color:var(--c-sub)}
.spk{font-size:var(--fs-sub);color:var(--c-sub);font-weight:var(--fw-bold);margin-bottom:4px}
.bubble{background:var(--c-surface);border-radius:4px var(--r-m) var(--r-m) var(--r-m);box-shadow:var(--shadow-1);padding:12px 16px;display:inline-block;max-width:100%}
.card .bubble{background:var(--c-surface-2);box-shadow:none}
.ja{color:var(--c-sub);font-size:var(--fs-sub);margin-top:8px}
.thought{color:var(--c-sub);font-style:italic;margin:8px 0 0 4px}
.thought.own{font-style:normal;margin-left:0}
.nar.own p+p{margin-top:8px}
.nar.after{margin:16px 0 0}
.bubble .act,.bubble .said{display:block}
.bubble .act{color:var(--c-sub)}
.bubble>span+span{margin-top:8px}
.ja .act{opacity:.75}
.ja .act,.ja .said{display:block}
.ja>span+span{margin-top:4px}
.line .ja,.nar .ja{background:var(--c-surface-2);border-radius:var(--r-s);padding:8px 12px;line-height:1.7}
.nar .tools{margin-bottom:-8px}
.mini{display:inline-flex;align-items:center;flex-shrink:0}
.tools .mini{margin:0 0 0 4px}
.mini button{position:relative;border:0;background:transparent;color:var(--c-sub);font-size:var(--fs-note);font-weight:var(--fw-bold);min-width:0;height:40px;padding:0 8px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--r-s)}
.mini button::after{content:"";position:absolute;inset:-4px 0}
.mini button:active{background:var(--c-surface-2)}
.mini svg.ic.s{width:18px;height:18px}
.tools{display:flex;margin:0 0 0 -12px;min-height:40px}
.tools .reroll{position:relative;margin-left:auto;border:0;background:transparent;color:var(--c-sub);width:36px;height:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--r-s);opacity:.7}
.tools .reroll:active{background:var(--c-surface-2)}
.tools .reroll::after{content:"";position:absolute;inset:-4px}
.tools .reroll svg.ic.s{width:18px;height:18px}
.line+.line{margin-top:12px}
.got{display:inline-flex;gap:8px;align-items:center;background:var(--c-ok-bg);color:var(--c-text);border:0;border-radius:var(--r-full);padding:0 16px;min-height:var(--hit);margin:12px 8px 0 0;font-size:var(--fs-sub);font-weight:var(--fw-bold)}
.got svg{color:var(--c-ok)}
.log.past .tools,.log.past .got{display:none}
/* ノート（前に言えなかった文）：この会話で言ってみる文の入口と、ヒントなしで言えた時の印。緑は「伝わった」の色（tokens の --c-ok） */
.saidit{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;text-align:left}
button.fact.try{position:relative;isolation:isolate;display:inline-flex;align-items:center;gap:8px;flex:none;min-height:var(--hit);margin:-9px 0;padding:0 12px;background:none;color:var(--c-ok);font-weight:var(--fw-bold)}
button.fact.try::before{content:"";position:absolute;inset:9px 0;border-radius:var(--r-s);background:var(--c-ok-bg);z-index:-1}
.log.past .saidit{display:flex}
.you{text-align:right}
.you .bubble{background:var(--c-result-soft);color:var(--c-text);border-radius:var(--r-m) 4px var(--r-m) var(--r-m);text-align:left;box-shadow:none;max-width:85%}
.you .tools.end{justify-content:flex-end;margin:0 -8px 0 0;min-height:36px}
.you .tools.end .mini button{height:36px}
.you .tools.end .mini button::after{inset:-6px 0}
.you [data-tip] .dot{display:inline-block;width:8px;height:8px;border-radius:var(--r-full);background:var(--c-action);margin-right:6px}
.you [data-tip].more{color:var(--c-text);min-height:0;padding:0 8px;font-size:var(--fs-note)}
.you [data-tip].fine{color:var(--c-ok);gap:4px}
.you [data-tip].fine svg.ic.s{width:16px;height:16px}
.kd{display:inline-block;font-size:var(--fs-note);font-weight:var(--fw-bold);line-height:1;padding:4px 8px;border-radius:var(--r-full);background:var(--c-surface);box-shadow:inset 0 0 0 1px var(--c-line);color:var(--c-sub);margin-left:8px;vertical-align:middle}
.kds{margin:0 0 4px}.kds .kd{margin:0 4px 0 0}
.tip{text-align:left;background:var(--c-surface-2);border-radius:var(--r-s);padding:12px 16px;margin:0 0 0 15%;line-height:1.7}
.tip .label{margin-bottom:4px}
.tip .point{background:var(--c-surface)}
.tip .tools{margin-left:-8px}
.w{cursor:pointer;border-radius:4px}
.w:active,.w.sel{background:var(--c-result-soft)}
.w.tagged{text-decoration:underline;text-decoration-color:var(--c-action);text-decoration-thickness:2px;text-underline-offset:4px}
.w.gl{font-weight:var(--fw-bold);border-bottom:1.5px dotted var(--c-action)}
.inputrow{display:flex;gap:4px;align-items:flex-end}
.inputrow textarea{border-radius:var(--r-l);min-height:var(--hit);max-height:136px}
.recstate{display:flex;align-items:center;gap:8px;min-height:var(--hit);padding:0 12px;font-weight:var(--fw-bold);background:var(--c-surface);border-radius:var(--r-l);box-shadow:inset 0 0 0 1.5px var(--c-action)}
.recdot{width:12px;height:12px;border-radius:var(--r-full);background:var(--c-action);animation:pulse 1.2s ease-in-out infinite;flex-shrink:0}
@media (prefers-reduced-motion:reduce){.recdot{animation:none}}
.scenebreak .rule{display:flex;align-items:center;gap:12px;color:var(--c-sub);font-size:var(--fs-sub);font-weight:var(--fw-bold);margin:8px 0 12px}
.scenebreak .rule::before,.scenebreak .rule::after{content:"";flex:1;height:1px;background:var(--c-line)}
.scenebreak .setup{margin-bottom:8px}
.livebox .tools,.livebox .ja,.livebox .mini{display:none}
.above{padding:0 8px 8px}
.above.mid{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
/* ログインの案内・今日はここまで：文とボタンの1塊（会話の下、シート、アカウントの画面で同じ） */
.gate{display:flex;flex-direction:column;gap:12px}
.inputbar .gate{padding:4px 8px 12px;text-align:center}
.gate .agree{text-align:center}
.gate .agree a{color:inherit;text-decoration:underline}
.fading{opacity:.4}
.typing{color:var(--c-sub);font-size:var(--fs-sub);display:flex;align-items:center;gap:8px;min-height:var(--hit);padding:0 8px}
.panel{background:var(--c-surface);border-radius:var(--r-m);box-shadow:var(--shadow-1);padding:16px;margin:0 8px 8px}
.panel .fx .label{margin-bottom:0}
.opt{display:block;width:100%;text-align:left;background:var(--c-surface-2);border:0;border-radius:var(--r-s);padding:12px;margin-top:8px;min-height:var(--hit)}
.opt.fx{display:flex;padding:4px 4px 4px 0}
.optgo{border:0;background:transparent;text-align:left;padding:8px 12px;min-height:var(--hit)}

.lvask{padding:4px 0 8px}
.lvask .fx{min-height:32px}
.lvask .seg{margin-top:4px}
.ending{background:var(--c-text);color:var(--c-bg);border-radius:var(--r-m);padding:24px 16px;margin:0 0 24px;text-align:center}
.ending .k{font-size:var(--fs-note);letter-spacing:.2em;opacity:.7}
.ending .t{font-size:var(--fs-head);font-weight:var(--fw-bold);margin:4px 0 12px}
.ending p{text-align:left;opacity:.95}
.ending p+p{margin-top:8px}
.ending .said{margin-top:16px;padding-top:16px;border-top:1px solid rgba(255,255,255,.2);text-align:left}
.ending .said .label{color:var(--c-bg);opacity:.7;margin-bottom:4px}
.ending .said .q{font-size:var(--fs-body);font-weight:var(--fw-bold)}
.ending .said ul{margin:0;padding-left:20px}
.ending .said li{margin-top:4px;opacity:.95}
.after-end{display:flex;flex-direction:column;gap:8px}

/* ---- 人との間（バー） ---- */
.rel{display:flex;gap:8px;margin-top:8px}
.relp{flex:1;min-width:0;display:flex;align-items:center;gap:8px;border:0;background:var(--c-surface);border-radius:var(--r-full);padding:4px 12px 4px 4px;min-height:var(--hit);box-shadow:var(--shadow-1)}
.relp img{width:32px;height:32px;border-radius:var(--r-full);object-fit:cover;object-position:50% 14%;flex-shrink:0}
.relv{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.relv b{font-size:var(--fs-sub);line-height:1}
.relbar{display:block;width:100%;height:4px;border-radius:2px;background:var(--c-line);overflow:hidden}
.relbar i{display:block;height:100%;background:var(--c-action);border-radius:2px;transition:width .6s ease}
.card .relbar{margin-top:8px}
.relp.up b{color:var(--c-ok)}
.relp.down b{color:var(--c-action)}
@media (prefers-reduced-motion:reduce){.relbar i{transition:none}}
.meter{display:flex;gap:4px;margin-top:8px}
.meter i{flex:1;height:4px;border-radius:2px;background:var(--c-line)}
.meter i.on{background:var(--c-action)}
.tally{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.tl{flex:1 1 72px;background:var(--c-surface);border-radius:var(--r-m);padding:12px 8px;text-align:center;box-shadow:var(--shadow-1)}
.tl b{display:block;font-size:var(--fs-head);line-height:1.2}
.tl span{display:block;font-size:var(--fs-note);color:var(--c-sub);font-weight:var(--fw-bold);margin-top:4px}
.tl.ok b{color:var(--c-ok)}
.tallynote{margin:-4px 0 12px}

/* ---- 学ぶ・振り返る ---- */
.steps{display:flex;gap:4px;margin:0 0 16px}
.steps i{flex:1;height:4px;border-radius:2px;background:var(--c-line)}
.steps i.on{background:var(--c-action)}
.rec{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.rec.mid{justify-content:center}
.hidden-line{display:block;width:100%;border:0;background:var(--c-surface-2);border-radius:var(--r-s);padding:12px;color:var(--c-sub);text-align:center;min-height:var(--hit);margin-top:12px}
.hidden-line.open{text-align:left;color:var(--c-text)}
.fb,.heard{background:var(--c-surface-2);border-radius:var(--r-s);padding:16px;margin-top:12px}
.fbhead{display:flex;align-items:center;gap:8px;font-weight:var(--fw-bold)}
.fb.ok .fbhead,.fbhead.ok{color:var(--c-ok)}
.fb.try .fbhead{color:var(--c-action)}
.fb .label,.heard .label{margin-bottom:4px}
.fb .point{background:var(--c-surface)}
/* 赤ペン：消した言葉と、足した言葉 */
.pen{line-height:1.7;overflow-wrap:anywhere}
.pen.fix{font-weight:var(--fw-bold)}
.pen del{color:var(--c-sub);text-decoration:line-through;text-decoration-color:var(--c-action);text-decoration-thickness:2px}
.pen ins{text-decoration:none;color:var(--c-ok);background:var(--c-ok-bg);border-radius:4px;padding:0 4px}
.pen.sub2{color:var(--c-sub);font-size:var(--fs-sub)}
.h.ok{color:var(--c-ok);font-weight:var(--fw-bold)}
.h.miss{text-decoration:underline wavy var(--c-action);text-underline-offset:4px}
.point{display:flex;gap:8px;align-items:baseline;margin-top:12px;padding:8px 12px;border-radius:var(--r-s);background:var(--c-surface-2);font-weight:var(--fw-bold)}
.point .k{font-size:var(--fs-note);color:var(--c-sub);font-weight:var(--fw-bold);white-space:nowrap}
.kind{display:inline-block;font-size:var(--fs-note);font-weight:var(--fw-bold);border-radius:var(--r-full);padding:4px 12px;background:var(--c-surface-2);color:var(--c-sub)}
.ctx{margin-top:12px;color:var(--c-sub);font-size:var(--fs-sub);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ctx .who{font-weight:var(--fw-bold);margin-right:8px}
.mark{width:24px;height:28px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--c-action)}
.mark.ok{color:var(--c-ok)}
.lead{margin:-4px 0 12px}
.card .lead{margin:0}

/* ---- テーマ・読み物 ---- */
.sayseg{margin:12px 0 16px}
.sayseg .sbtn{min-height:40px}
.pic{width:100%;aspect-ratio:3/2;border-radius:var(--r-m);background:var(--c-surface-2);margin:0 0 12px;object-fit:cover}
.pic.wait{display:flex;align-items:center;justify-content:center;gap:12px;color:var(--c-sub);font-size:var(--fs-sub);flex-wrap:wrap}
.pic.small{max-width:420px;margin:0 auto 12px}
.hint{color:var(--c-sub);font-size:var(--fs-sub);margin:0 0 12px}
.article .atitle{font-size:var(--fs-head);font-weight:var(--fw-bold);line-height:1.4;margin:0 0 12px}
.article p.para,.article .ln{font-family:Georgia,"Iowan Old Style","Times New Roman",serif;font-size:var(--fs-head);line-height:1.7}
.article p.para{margin:0}
.article .ln .ja{font-family:var(--font);line-height:1.6;margin-top:4px}
.article .para+.para{margin-top:16px}
.article .s.playing,.article .ln.playing{background:var(--c-result-soft);border-radius:4px}
.article .ln{display:flex;gap:4px;align-items:flex-start;padding:8px 0;cursor:pointer}
.article .ln+.ln{border-top:1px dashed var(--c-line)}
.lnplay{position:relative;width:44px;height:44px;margin:-4px 0 -8px -12px;border:0;background:transparent;color:var(--c-sub);flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:var(--r-full)}
.lnplay:active{background:var(--c-surface-2)}
.lnja{position:relative;border:0;background:transparent;color:var(--c-sub);font-size:var(--fs-note);font-weight:var(--fw-bold);min-width:44px;height:44px;margin:-4px -12px -8px 0;border-radius:var(--r-s);flex-shrink:0}
.lnja.on{color:var(--c-action)}
.lnplay::after,.lnja::after{content:"";position:absolute;inset:-2px}

/* ---- 単語帳 ---- */
.wd{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--c-line)}
.wd:first-child{border-top:0;padding-top:0}
.wd:last-child{padding-bottom:0}
.lv{font-size:var(--fs-note);border-radius:var(--r-full);padding:2px 8px;background:var(--c-surface-2);color:var(--c-sub);white-space:nowrap}
.lv.k{background:var(--c-ok-bg);color:var(--c-ok)}
.flash{text-align:center;padding:32px 16px}
.hw{font-size:var(--fs-title);font-weight:var(--fw-bold);line-height:var(--lh-tight)}

/* ---- 待っている印 ---- */
.spin{display:inline-block;width:16px;height:16px;border:2px solid var(--c-line);border-top-color:var(--c-action);border-radius:var(--r-full);animation:spin .8s linear infinite;flex-shrink:0}
.btn .spin{border-color:rgba(255,255,255,.4);border-top-color:var(--c-on-action)}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}
[data-say].say-wait{position:relative;color:transparent}
[data-say].say-wait>*{visibility:hidden}
[data-say].say-wait::after{content:"";position:absolute;left:50%;top:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid var(--c-line);border-top-color:var(--c-action);border-radius:var(--r-full);animation:spin .8s linear infinite}
[data-say].say-on{color:var(--c-action)}
@media (prefers-reduced-motion:reduce){[data-say].say-wait::after{animation:none;border-color:var(--c-action)}}

/* ---- 幅の広い画面（PC・タブレット）。流れ・詳しい画面は components.css が中央の1列（600）にする ---- */
@media (min-width:720px){
  .screen>.top,.screen>.inputbar{width:100%;max-width:600px;margin-left:auto;margin-right:auto}
  /* 表紙は、切らずに1枚のカードとして見せる。戻るは、ほかの画面と同じ上のバーに */
  .screen.has-hero>.bar{position:sticky;pointer-events:auto;background:var(--c-bg)}
  .screen.has-hero>.bar .back::before{background:var(--c-surface-2);box-shadow:none}
  .hero{width:min(100%,360px);height:auto;aspect-ratio:2/3;margin:8px auto 0;border-radius:var(--r-m)}
  .hero img{object-position:50% 50%}
  .hero .fade{display:none}
}
/* タブの画面（ホーム・単語帳・設定）：タブは左に立ち、3つの画面は同じ列・同じ左端に並ぶ */
@media (min-width:900px){
  .tabbar{top:0;right:auto;width:88px;height:auto;flex-direction:column;justify-content:flex-start;gap:8px;padding:24px 0 0;border-top:0;border-right:1px solid var(--c-line)}
  .tabbar .tab{flex:none;width:100%;height:72px}
  .screen.tab{padding-left:88px}
  .screen.tab>.bar,.screen.tab>.content{width:100%;max-width:1040px;margin-left:auto;margin-right:auto;padding-left:32px;padding-right:32px}
  .screen.tab>.content{padding-bottom:48px}
  .screen.tab .narrow-col{max-width:600px}
  .screen.tab .grid{grid-template-columns:repeat(4,1fr);gap:16px}
  .screen.tab .tops{grid-template-columns:repeat(2,1fr)}
  .screen.tab .narrow-col .tops{grid-template-columns:1fr}
  .ui-toast{bottom:24px}
}

/* ---- テーマのタブ・記事を選ぶ・読み物の段 ---- */
/* テーマを書く欄：欄と「探す」が1つの行（会話の入力と同じ並び） */
.ask{display:flex;gap:4px;align-items:center;margin:0 0 12px}
.ask .field{border-radius:var(--r-l);padding:12px 16px}
.row .lv{flex-shrink:0}
.facts+.tops{margin-top:24px}
.ask+.facts button.fact{min-height:var(--hit);padding:4px 16px}
.spin.l{width:32px;height:32px;border-width:3px}
/* 段の印（細い線）：押せる段は、線の上下に押せる広さを取る */
.steps.tap{margin:0 0 8px}
.steps.tap button{position:relative;flex:1;height:20px;border:0;background:transparent;padding:0;display:flex;align-items:center}
.steps.tap button::after{content:"";position:absolute;inset:-14px 0}
.steps.tap button i{display:block;width:100%;height:4px;border-radius:2px;background:var(--c-line)}
.steps.tap button.on i{background:var(--c-action)}
.steps.tap button[aria-current] i{box-shadow:0 0 0 2px var(--c-result-soft)}
.steps.under{margin:0;padding:0 var(--side) 8px}
/* 聞く・音読の段の道具（1文ずつ・訳・速さ・聞いた回数） */
.rtools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
.rtools .sbtn{min-height:40px;position:relative}
.rtools .sbtn::after{content:"";position:absolute;inset:-4px 0}
.rtools .cnt{margin-left:auto}
/* 下のバーの中の録音 */
.dock .rec{margin:0;flex:1;flex-wrap:nowrap}
.btn.rec-on{border-color:var(--c-action);color:var(--c-action)}

/* ---------- home as a dashboard; rows with a picture; the settings' child pages (NT 2026-11-20) ---------- */
.row-pic{width:48px;height:48px;border-radius:var(--r-s);object-fit:cover;object-position:50% 20%;flex:none}
.flow .list+.t-sub{margin:-4px 4px 16px}
.flow label.label{display:block;margin:16px 4px 0}
.flow .write+.t-note{min-height:1.5em;margin:4px 4px 0}
/* a sheet on a wide screen: a box in the middle (the canonical sheet is a phone's: from the bottom, as wide as the screen) */
@media (min-width:720px){
  .ui-sheet-scrim{align-items:center;padding:24px}
  .ui-sheet{max-width:480px;border-radius:var(--r-l);padding-bottom:0;transform:translateY(12px)}
  .ui-sheet.large{height:auto;max-height:calc(100dvh - 96px)}
  .ui-sheet .grab{display:none}
  .ui-sheet .head{padding-top:12px}
}
/* the wait mark in the input bar while a reply is typed out is a button that shows the rest */
button.typing{border:0;background:none;font:inherit;color:inherit;cursor:pointer;min-height:var(--hit);text-align:left}
/* good / not good about a reply: two small marks at the end of its row of tools; the chosen one is dark and filled */
.tools .mini.vote{margin-left:auto}
.tools .mini.vote+.reroll{margin-left:0}
.mini.vote button{min-width:0;padding:0 8px}   /* (side by side, like the three on the left: NT 2026-11-20 「隣同士はちゃんとくっつけてください」) */
.mini.vote button:disabled{opacity:.5}
.mini.vote button[aria-pressed="true"]{color:var(--c-text)}
.mini.vote button[aria-pressed="true"] svg{fill:var(--c-line)}
.tools.alone{margin:0}

/* ---------- which level a page is on (NT 2026-11-20: a series and its first episode looked the same) ---------- */
.kick-line{padding:16px 0 0;font-size:var(--fs-sub);font-weight:var(--fw-bold);color:var(--c-result)}
.flow .kick-line+.t-title{padding:4px 0 8px}
.list.eps .row-pic{width:56px;height:56px}
.lv.now{background:var(--c-result-soft);color:var(--c-result-ink);font-weight:var(--fw-bold)}
.row-pic.face{border-radius:var(--r-full);width:40px;height:40px}
.side,.chatside{display:none}

/* ---------- a wide screen (a PC), from 1024px: the phone's screens set in the middle of a big window are not a PC app
   (NT 2026-11-20 「PC版のUIめっちゃしょぼいし使いづらくないですか？」). A side bar that is always there; from 1200px a story's
   page in two columns (the picture stays, the text scrolls) and the talk with what the story stands at beside it; things
   answer the pointer. (Classes put on by app.js, not :has(): an older browser gets the same layout.) ---------- */
@media (min-width:1024px){
  .tabbar{display:none}
  .side{display:flex;flex-direction:column;gap:4px;position:fixed;left:0;top:0;bottom:0;width:232px;padding:20px 12px;background:var(--c-surface);border-right:1px solid var(--c-line);z-index:20;overflow-y:auto}
  .side>*{flex-shrink:0}
  .side .brand{padding:4px 12px 20px;text-decoration:none;color:var(--c-text)}
  .side a:not(.brand){display:flex;align-items:center;gap:12px;min-height:var(--hit);padding:0 12px;border-radius:var(--r-s);color:var(--c-sub);font-weight:var(--fw-bold);text-decoration:none}
  .side a:not(.brand):hover{background:var(--c-surface-2);color:var(--c-text)}
  .side a[aria-current="page"],.side a[aria-current="page"]:hover{background:var(--c-result-soft);color:var(--c-result-ink)}
  .side svg.ic{width:22px;height:22px;flex:none}
  #app{margin-left:232px}
  .ui-toast{left:calc(50% + 116px)}
  /* the tab screens: the side bar carries the name of the app, the page starts with its own things */
  .screen.tab{padding-left:0}
  .screen.tab>.bar .brand{display:none}
  .screen.tab.t-home>.bar{min-height:24px;padding-top:0}
  .screen.tab>.bar,.screen.tab>.content{max-width:1120px;padding-left:40px;padding-right:40px}
  .screen.tab.narrow>.bar,.screen.tab.narrow>.content{max-width:760px}
  .screen.tab .narrow-col{max-width:none}
  .screen.tab .grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:20px}
  .screen.tab .tops{grid-template-columns:minmax(0,560px)}
  /* flow and detail screens: a wider column */
  .screen:not(.tab)>.bar,.screen:not(.tab)>.content,.screen:not(.tab)>.dock{max-width:760px;padding-left:40px;padding-right:40px}
  .screen>.top,.screen>.inputbar{max-width:760px}
  .screen:not(.tab)>.dock .btn{max-width:360px;align-self:center}
  .screen:not(.tab)>.dock .fx{justify-content:center}
  .you .bubble{max-width:70%}
  /* things answer the pointer */
  .cover,.card.cont,button.row,a.row{transition:transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
  .cover:hover{transform:translateY(-2px);box-shadow:var(--shadow-2)}
  .card.cont:hover{box-shadow:var(--shadow-2)}
  button.row:hover:not(:disabled),a.row:hover{background:var(--c-surface-2)}
  .mini button:hover,.tools .reroll:hover,button.fact:hover,.round.plain:hover{background:var(--c-surface-2)}
  button,[data-href],a,.w{cursor:pointer}
  button:disabled{cursor:default}
}
/* two columns need room for the text: from 1200px (at 1024px the second column would be about 340px wide) */
@media (min-width:1200px){
  /* a story's or a series' page: the picture on the left stays, what is written scrolls on the right */
  .screen.has-hero>.bar,.screen.has-hero>.content,.screen.has-hero>.dock{max-width:1040px}
  .screen.has-hero .flow{display:grid;grid-template-columns:320px minmax(0,1fr);column-gap:48px;align-items:start}
  .screen.has-hero .flow>*{grid-column:2}
  .screen.has-hero .flow>.hero{grid-column:1;grid-row:1 / span 60;position:sticky;top:72px;width:320px;margin:0}
  .screen.has-hero .flow>.kick-line{padding-top:0}
  .screen.has-hero .flow>.t-title:nth-child(2){padding-top:0}
  .screen.has-hero>.dock{padding-left:calc(40px + 320px + 48px)}
  .screen.has-hero>.dock .btn{align-self:flex-start}
  /* the talk: the conversation, and beside it where the story stands and who is in it */
  .screen.chat.with-side{display:grid;grid-template-columns:minmax(0,760px) 300px;grid-template-rows:auto 1fr auto;justify-content:center;column-gap:8px}
  .screen.chat.with-side>.top{grid-column:1;grid-row:1;margin:0}
  .screen.chat.with-side>.content{grid-column:1;grid-row:2;width:100%}
  .screen.chat.with-side>.inputbar{grid-column:1;grid-row:3;margin:0}
  .chatside{display:flex;flex-direction:column;gap:12px;grid-column:2;grid-row:1 / span 3;position:sticky;top:0;align-self:start;max-height:100vh;overflow-y:auto;padding:72px 24px 24px 16px}
  .chatside>*,.chatside #sideFacts>*{flex-shrink:0}
  .chatside .kick-line{padding:0 4px}
  .chatside .label{margin:8px 4px 0}
  .chatside .row{min-height:var(--hit);padding-top:8px;padding-bottom:8px}
  .screen.chat.with-side .scene>span.fact{display:none}   /* (they are in the panel beside the talk) */
}
@media (min-width:1024px) and (prefers-reduced-motion:reduce){.cover,.card.cont,button.row,a.row{transition:none}.cover:hover{transform:none}}

/* ---------- the hint: a named button on its own short line above the box; help in two steps (what to say, then how) ---------- */
.hintrow{display:flex;padding:0;margin-left:-12px}
#hintSpot .panel{margin:8px 0 0}
#hintSpot .typing{padding-left:12px}
.hintpill{position:relative;display:inline-flex;align-items:center;gap:4px;min-height:36px;padding:0 12px;border:0;border-radius:var(--r-full);background:none;color:var(--c-sub);font-size:var(--fs-sub);font-weight:var(--fw-bold)}
.hintpill::after{content:"";position:absolute;inset:-6px 0}
.hintpill:active{background:var(--c-surface-2)}
.panel.hints{padding:8px 8px 8px 16px}
.panel.pack{padding:8px}
.pkdock:empty{display:none}
.pkdock{margin-top:8px}
.pkdock .panel.pack{margin:0;padding:0;background:none;box-shadow:none}
.pkdock .typing{padding:12px 8px}
.pkdock .pklist{min-height:calc(160px * var(--ts))}
.pkdock .pklist.tall{min-height:calc(216px * var(--ts))}
@media (max-height:720px){.pkdock .pklist{min-height:0}.pkdock .pklist.tall{min-height:0;max-height:calc(160px * var(--ts));overflow-y:auto}}   /* (a short screen: the panel is only as tall as what it holds, and a fourth choice is reached by scrolling, so the talk keeps its room. Codex 2026-11-21) */   /* (as tall as its three choices whatever is shown: the box and the send button do not jump from tap to tap) */
html.kb .pkdock{display:none}   /* (the keyboard is up to write in the box: the pieces wait until it goes down) */
.hintpill[aria-pressed="true"]{color:var(--c-text);background:var(--c-surface-2)}
.pklist{display:grid;grid-template-columns:1fr;gap:8px;align-content:start}   /* (three choices, one to a row (four at the hardest level): an ending of four words stands on one line) */
.pklist .typing{padding:12px 8px}
.pk{display:flex;align-items:center;width:100%;min-width:0;min-height:var(--hit);padding:8px 12px;border:0;border-radius:var(--r-m);background:var(--c-surface-2);color:var(--c-text);text-align:left;font:inherit}
.pk b{font-size:var(--fs-body);font-weight:var(--fw-bold);line-height:var(--lh-tight)}
.pk:active{background:var(--c-line)}
.pkfoot{display:flex;align-items:center;justify-content:space-between;margin-top:4px;min-height:var(--hit)}
.pkfoot .sbtn{background:none;color:var(--c-sub);padding:0 12px}
.pkfoot .sbtn:active{background:var(--c-surface-2)}
.pkfoot .sbtn[disabled]{opacity:.35}
.pkfoot .round[disabled]{opacity:.35}
.hopt+.hopt{border-top:1px solid var(--c-line)}
.hq{display:flex;align-items:center;gap:8px;width:100%;min-height:var(--hit);padding:8px 8px 8px 0;border:0;background:none;text-align:left;font:inherit;color:var(--c-text)}
.hq svg{flex:none;color:var(--c-sub);transform:rotate(90deg);transition:transform var(--dur-fast) var(--ease)}
.hq[aria-expanded="true"] svg{transform:rotate(-90deg)}
.ha{padding:0 0 8px}
.ha .fx{margin-top:4px;gap:8px}
@media (prefers-reduced-motion:reduce){.hq svg{transition:none}}

/* ---- the notebook: a pattern (型) ---- */
.frame-big{font-size:var(--fs-head);line-height:var(--lh-tight)}

/* ---- writing a line: the place above the box where an expression is offered for a piece typed in Japanese (no height until then) ---- */
.sg{display:flex;gap:8px;min-height:var(--hit);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;margin:0 -12px 8px;padding:0 12px;overscroll-behavior-x:contain}
.sg::-webkit-scrollbar{display:none}
.sg[hidden]{display:none}
.sg-chip{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;flex:none;min-height:var(--hit);min-width:var(--hit);padding:2px 14px;border:0;border-radius:var(--r-s);background:var(--c-surface);color:var(--c-text);font:inherit;font-weight:var(--fw-bold);line-height:1.2;white-space:nowrap;box-shadow:inset 0 0 0 1px var(--c-line)}
.sg-chip small{font-size:var(--fs-note);font-weight:var(--fw-regular);color:var(--c-sub)}
.sg-chip:active{background:var(--c-surface-2)}
.sg-wait{display:inline-flex;align-items:center;min-height:var(--hit);padding:0 12px}
@media (hover:hover){.sg-chip:hover{background:var(--c-surface-2)}}
/* ---- the keyboard of a phone lies over the page: the title bar stays at the top of what is seen, the box right above the keyboard, a sheet ends where the keyboard begins (--vt, --kb: see kbSync in app.js) ---- */
.kbprobe{position:fixed;top:0;bottom:0;left:0;width:0;visibility:hidden;pointer-events:none}   /* (as tall as the frame a pinned bar is pinned to: kbSync measures the keyboard against it) */
.screen.chat>.top{top:var(--vt,0px)}
.inputbar{bottom:var(--kb,0px)}
.toend{position:sticky;bottom:calc(var(--kb,0px) + var(--barh,72px) + 12px);height:0;z-index:3;pointer-events:none}   /* (the button back to the end of the talk: it rides 12px above the box, whatever the box holds and also when the keyboard is up) */
.toend .round{position:absolute;right:12px;bottom:0;pointer-events:auto;background:var(--c-surface);box-shadow:var(--shadow-1)}
.toend .round[hidden]{display:none}
html.kb .inputbar{padding-bottom:4px}
html.kb .screen.chat>.content{margin-top:calc(var(--safe-bottom) + 4px)}   /* (with the keyboard up the room kept under the box for the home bar is not needed. iOS does not settle the page again when its end gets shorter, so what the box gives up is put back at the top: the page keeps its height, and the talk and the box come down onto the keyboard together) */
html.kb .inputbar::after{content:"";position:absolute;left:0;right:0;top:100%;height:240px;background:var(--c-bg)}   /* (nothing of the talk shows between the box and the keyboard) */
.ui-sheet-scrim{top:var(--vt,0px);bottom:var(--kb,0px)}
.ui-sheet{max-height:calc(100dvh - var(--kb,0px) - var(--vt,0px) - var(--safe-top) - var(--sp-6))}
@media (max-width:719px){.ui-sheet.large{height:calc(100dvh - var(--kb,0px) - var(--vt,0px) - var(--safe-top) - var(--sp-6))}}
.saybook{display:flex;flex-direction:column;gap:12px}
.saybook #sayQ{position:sticky;top:0;z-index:1;flex:none}
.saybook #sayList{display:flex;flex-direction:column;gap:8px}
