/* =========================================================
   エコルド学び放題（2026-10-30 北村さん）
   ・ヘッダー：学のマーク・「使い方」
   ・使い方のポップアップ（1枚ずつ）
   ・わたしの研修（ダッシュボード）の AI 学びの相談
   ・オープニング：教室の扉が開く → 椅子と黒板 →「学び放題」
   ========================================================= */
:root { --mb: #2c8073; --mb2: #3a9e8f; --mb-chalk: #f4f1e6; }

/* KITASAN カラー（黒）で「わたしの研修を見る」の文字が白く消えていた（.tb-cta span の色が上書きしていた） */
.tb-cta .tb-pill span { color: inherit; font-size: inherit; }

/* ---- ヘッダー ---- */
.mb-logo { gap: 8px; }
.mb-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--mb); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1rem; line-height: 1; }
.tb-how { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #3a3a3a; background: transparent; cursor: pointer; font-size: .86rem; white-space: nowrap; }
.tb-how:hover { background: #272727; }
html[data-tb="ecold"] .tb-how, html[data-tb="light"] .tb-how { border-color: var(--tb-line); color: var(--tb-tx); }
html[data-tb="ecold"] .tb-how:hover, html[data-tb="light"] .tb-how:hover { background: var(--tb-sf2); }
.tb-logo.mb-logo > .mb-mark { display: grid !important; }
@media (max-width: 640px) { .tb-how { width: 40px; padding: 0; justify-content: center; border: 0; } .tb-how span { display: none; } .mb-logo > span:not(.mb-mark) { display: none; } }

/* ---- 使い方 ---- */
.tb-howto { border: 0; padding: 0; border-radius: 20px; width: min(440px, calc(100vw - 28px)); background: #fff; color: #1f2a35; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.tb-howto::backdrop { background: rgba(15,23,42,.55); }
.tb-howto-in { position: relative; padding: 26px 22px 18px; }
.tb-howto-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #64748b; font-size: 1.1rem; cursor: pointer; }
.tb-howto-k { margin: 0 0 8px; font-size: .78rem; font-weight: 700; color: var(--mb); letter-spacing: .04em; }
.tb-howto-s { text-align: center; animation: mbIn .35s ease; }
.tb-howto-i { width: 64px; height: 64px; border-radius: 20px; margin: 4px auto 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--mb), #1A9ED8); color: #fff; font-size: 1.6rem; }
.tb-howto-s h2 { font-size: 1.12rem; margin: 0 0 8px; }
.tb-howto-s p { font-size: .93rem; line-height: 1.8; color: #334155; margin: 0 0 16px; text-align: left; }
.tb-howto-act { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-howto .tb-pill { background: #f1f5f9; color: #1f2a35; border: 1px solid #e2e8f0; height: 44px; }
.tb-howto .tb-pill.primary { background: var(--mb); color: #fff; border-color: var(--mb); }
.tb-howto-dots { display: flex; gap: 5px; } .tb-howto-dots i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; } .tb-howto-dots i.on { width: 18px; border-radius: 4px; background: var(--mb); }
@keyframes mbIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- タブ ---- */
html[data-app] .tb-tabs a.on { font-weight: 700; }

/* ---- AI 学びの相談（ダッシュボードのいちばん上） ---- */
.mb-ai { margin: 16px 0 10px; border-radius: 22px; padding: 22px; background: linear-gradient(135deg, #e9f6f2 0%, #eaf4fb 100%); border: 1px solid #d3e8e2; color: #1f2a35; }
html[data-tb="dark"] .mb-ai { background: linear-gradient(135deg, #14262a, #141f2c); border-color: #23393b; color: #f1f1f1; }
.mb-ai-h { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.mb-ai-av { width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--mb), #1A9ED8); color: #fff; font-size: 1.4rem; box-shadow: 0 6px 16px rgba(44,128,115,.3); }
.mb-ai-h h2 { margin: 0; font-size: 1.25rem; line-height: 1.4; }
.mb-ai-h p { margin: 2px 0 0; font-size: .88rem; color: #4b5d5b; }
html[data-tb="dark"] .mb-ai-h p { color: #aab8b6; }
.mb-ai-f { display: flex; gap: 8px; align-items: flex-end; background: #fff; border: 2px solid #bfe0d8; border-radius: 18px; padding: 6px 6px 6px 14px; }
html[data-tb="dark"] .mb-ai-f { background: #0f1719; border-color: #2c4a46; }
.mb-ai-f:focus-within { border-color: var(--mb); box-shadow: 0 0 0 4px rgba(44,128,115,.15); }
.mb-ai-f textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: inherit; font: inherit; font-size: 16px; line-height: 1.6; padding: 8px 0; min-height: 44px; max-height: 160px; }
.mb-ai-send { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; border: 0; background: var(--mb); color: #fff; font-size: 1.05rem; cursor: pointer; }
.mb-ai-send:disabled { opacity: .5; cursor: default; }
.mb-ai-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mb-ai-chip { border: 1px solid #bfe0d8; background: #fff; color: #1f5a51; border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: .86rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.mb-ai-chip i { color: var(--mb); }
html[data-tb="dark"] .mb-ai-chip { background: #10201f; border-color: #2c4a46; color: #cfe9e3; }
.mb-ai-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: .78rem; color: #5b6e6b; }
html[data-tb="dark"] .mb-ai-foot { color: #93a5a2; }
.mb-ai-foot button { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; font-size: inherit; padding: 4px; }
.mb-ai-log { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; max-height: 560px; overflow: auto; padding: 2px; }
.mb-ai-log[hidden] { display: none; }
.mb-msg { max-width: 92%; padding: 12px 15px; border-radius: 16px; font-size: .95rem; line-height: 1.8; word-break: break-word; }
.mb-msg.me { align-self: flex-end; background: var(--mb); color: #fff; border-bottom-right-radius: 4px; }
.mb-msg.ai { align-self: flex-start; background: #fff; border: 1px solid #d9ebe6; border-bottom-left-radius: 4px; }
html[data-tb="dark"] .mb-msg.ai { background: #1b2526; border-color: #2a3a3b; }
.mb-msg.wait { opacity: .75; }
.mb-msg.wait .mb-dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mb); margin-right: 4px; animation: mbDot 1s infinite ease-in-out; }
.mb-msg.wait .mb-dots i:nth-child(2) { animation-delay: .15s; } .mb-msg.wait .mb-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mbDot { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-4px); opacity: 1; } }
.mb-msg.err { align-self: stretch; max-width: none; background: #fdecec; color: #8a1f1f; border: 1px solid #f5c2c2; }
.mb-scene, .mb-vid { display: inline-flex; align-items: center; gap: 6px; margin: 2px 2px; padding: 4px 10px; border-radius: 999px; background: #e3f2ee; color: #1f5a51; font-size: .86rem; font-weight: 700; text-decoration: none; vertical-align: middle; }
.mb-scene i { color: var(--mb); }
html[data-tb="dark"] .mb-scene, html[data-tb="dark"] .mb-vid { background: #173330; color: #bfe8df; }
.mb-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 10px; overflow-x: auto; padding: 2px 2px 8px; align-self: stretch; }
.mb-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #d9ebe6; text-decoration: none; color: inherit; }
html[data-tb="dark"] .mb-card { background: #1b2526; border-color: #2a3a3b; }
.mb-card-img { position: relative; aspect-ratio: 16/9; background: #dfeee9; }
.mb-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mb-card-t { position: absolute; left: 8px; bottom: 8px; background: rgba(15,23,42,.82); color: #fff; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center; }
.mb-card b { display: block; font-size: .86rem; line-height: 1.5; padding: 8px 10px 10px; }
.mb-next { display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; }
.mb-next small { width: 100%; font-size: .76rem; color: #5b6e6b; }
.mb-next button { border: 1px dashed #9ccfc3; background: transparent; color: inherit; border-radius: 999px; padding: 7px 12px; font-size: .85rem; cursor: pointer; min-height: 38px; }
.mb-paid { margin-top: 8px; font-size: .88rem; }
.mb-paid a { display: inline-flex; margin-top: 6px; }
@media (max-width: 640px) { .mb-ai { margin: 12px; padding: 16px; border-radius: 18px; } .mb-ai-h h2 { font-size: 1.08rem; } .mb-ai-av { width: 44px; height: 44px; border-radius: 14px; font-size: 1.2rem; } }

/* ---- オープニング：教室 ---- */
.mb-open { position: fixed; inset: 0; z-index: 3000; background: #1d2b29; display: grid; place-items: center; overflow: hidden; }
.mb-open[hidden] { display: none; }
.mb-open svg { width: 100%; height: 100%; display: block; }
.mb-open .mo-room { transform-origin: 50% 46%; transform: scale(1.35); animation: moZoom 2.1s cubic-bezier(.2,.7,.2,1) 1.0s forwards; }
.mb-open .mo-door-l { animation: moDoorL 1.0s cubic-bezier(.6,0,.2,1) .35s forwards; }
.mb-open .mo-door-r { animation: moDoorR 1.0s cubic-bezier(.6,0,.2,1) .35s forwards; }
.mb-open .mo-frame { animation: moFade .6s ease 1.5s forwards; }
.mb-open .mo-chalk { stroke-dasharray: 900; stroke-dashoffset: 900; animation: moWrite 1.3s ease 2.0s forwards; }
.mb-open .mo-chalk-fill { opacity: 0; animation: moFadeIn .5s ease 3.0s forwards; }
.mb-open .mo-sub { opacity: 0; animation: moFadeIn .6s ease 3.1s forwards; }
.mb-open.out { animation: moOut .55s ease forwards; }
.mb-open-skip { position: absolute; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.35); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: .9rem; cursor: pointer; min-height: 44px; }
@keyframes moDoorL { to { transform: translateX(-700px); } }
@keyframes moDoorR { to { transform: translateX(700px); } }
@keyframes moZoom { to { transform: scale(1); } }
@keyframes moFade { to { opacity: 0; } }
@keyframes moFadeIn { to { opacity: 1; } }
@keyframes moWrite { to { stroke-dashoffset: 0; } }
@keyframes moOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .mb-open { display: none !important; } }

/* ヘルプAI のボタン（2026-10-31）：AI のしるしは金 */
.tb-help i { color: #e0a800; }
