:root { --bg: #f6f3ea; --panel: #fff; --ink: #1d2433; --muted: #6b7280; --accent: #f5a524; --accent-ink: #1a1200; --ok: #16a34a; --warn: #d97706; --line: #e5e1d6; --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Helvetica Neue", Arial, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
.hidden { display: none !important; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.center { text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .04em; }
.brand .sub { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.user { display: flex; gap: 6px; align-items: center; }
.user select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.icon { padding: 6px 10px; border-radius: 8px; font-size: 18px; }
.icon.round { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #f1ede2; flex: none; }
.icon.round.big { width: 64px; height: 64px; font-size: 28px; background: var(--accent); color: var(--accent-ink); }
.chip { padding: 8px 14px; border-radius: 999px; background: #efe9da; font-weight: 600; font-size: 14px; }
.chip.primary { background: var(--accent); color: var(--accent-ink); }
.chip.back { align-self: flex-start; margin: 12px 16px 0; }

.screen { flex: 1; display: flex; flex-direction: column; }
.lead { font-size: 20px; font-weight: 700; line-height: 1.5; padding: 22px 20px 10px; }
.books { padding: 6px 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.book { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 14px; padding: 14px; text-align: left; border: 1px solid var(--line); }
.book .n { width: 36px; height: 36px; border-radius: 10px; background: #efe9da; display: grid; place-items: center; font-weight: 800; flex: none; }
.book .t { flex: 1; min-width: 0; }
.book .t b { display: block; font-size: 15px; }
.book .t span { font-size: 12px; color: var(--muted); }
.book .st { font-size: 12px; color: var(--ok); font-weight: 700; }

.choose { padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.book-title { display: flex; flex-direction: column; margin-bottom: 8px; }
.book-title span { color: var(--muted); font-size: 13px; }
.book-title b { font-size: 20px; }
.big { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.big small { font-weight: 400; font-size: 13px; color: var(--muted); line-height: 1.4; }
.big.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.big.primary small { color: #5a4010; }
.big .rec { position: absolute; top: -10px; left: 14px; background: var(--ink); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }

/* 3 つの帯 */
.band { padding: 12px 16px; }
.top-band { display: flex; align-items: center; gap: 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.prog { flex: 1; }
.prog-title { font-size: 13px; font-weight: 700; }
.prog-bar { height: 6px; background: #efe9da; border-radius: 999px; margin-top: 6px; overflow: hidden; }
.prog-bar div { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }
.prog-pos { font-size: 13px; color: var(--muted); min-width: 44px; text-align: right; }
.mid-band { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.status { font-size: 12px; color: var(--muted); }
.ai-line { background: var(--panel); border-radius: 16px 16px 16px 4px; padding: 14px 16px; font-size: 17px; line-height: 1.6; border: 1px solid var(--line); min-height: 52px; }
.you-line { align-self: flex-end; background: #e8f1ff; border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 14px; max-width: 85%; color: #1e3a8a; }
.proposal { background: var(--panel); border-radius: 16px; padding: 14px; border: 2px solid var(--accent); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.p-row { display: flex; align-items: center; gap: 12px; }
.p-main { flex: 1; min-width: 0; }
.p-ja { font-size: 19px; font-weight: 700; line-height: 1.5; }
.p-nuance { font-size: 13px; color: var(--muted); margin-top: 4px; }
.p-row2 { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 32px; }
.p-en { font-size: 18px; font-weight: 700; color: #334155; }
.peek { color: var(--muted); font-size: 12px; padding: 6px 10px; border-radius: 999px; background: #f1ede2; }
.mic { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 2px; }
.mic .dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.mic[data-state="listen"] .dot { background: #ef4444; animation: pulse 1s infinite; }
.mic[data-state="speak"] .dot { background: var(--accent); }
.mic[data-state="think"] .dot { background: #94a3b8; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.bot-band { background: var(--panel); border-top: 1px solid var(--line); padding-bottom: calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; }
.g { padding: 16px 6px; border-radius: 14px; font-weight: 800; font-size: 15px; }
.g:disabled { opacity: .4; }
.g.again { background: #efe9da; }
.g.ok { background: #dcfce7; color: #14532d; }
.g.change { background: #fef3c7; color: #78350f; }
.typebox { display: flex; gap: 8px; }
.typebox input, .t-input input, .t-change input { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.t-input, .t-change { display: flex; gap: 8px; }
.t-change { margin-top: 12px; }
.log { font-size: 12px; color: var(--muted); }
.log summary { cursor: pointer; }
#v-log { max-height: 30vh; overflow: auto; margin-top: 6px; white-space: pre-wrap; line-height: 1.5; }
#v-log .you { color: #1e3a8a; } #v-log .ai { color: #92400e; } #v-log .tool { color: #475569; }

.r-list { display: flex; flex-direction: column; gap: 8px; }
.r-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 14px; padding: 12px; border: 1px solid var(--line); }
.r-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,165,36,.3); }
.r-item .n { width: 26px; height: 26px; border-radius: 50%; background: #efe9da; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.r-item .body { flex: 1; min-width: 0; }
.r-item .ja { font-size: 15px; font-weight: 600; line-height: 1.45; }
.r-item .en { font-size: 13px; color: #334155; margin-top: 2px; }
.r-item .q { font-size: 11px; color: var(--muted); }
.r-item .acts { display: flex; gap: 6px; }
.done { padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.done-title { font-size: 24px; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: 90vw; }
@media (min-width: 900px) { body { max-width: 520px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* 練習中の Book（既存画面の再現） */
.study { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 12px; background: #f3f4f6; flex: 1; }
.sec-head { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; margin-top: 6px; }
.sec-ico { width: 36px; height: 36px; border-radius: 10px; background: #fde68a; display: grid; place-items: center; font-size: 18px; }
.card-group { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; }
.group-title { padding: 13px 12px; font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eef0f3; }
.group-title .chev { color: #6b7280; }
.group-body { padding: 8px 12px 12px; position: relative; }
.lesson-label { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.lesson-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #1f3b6e; color: #fff; font-weight: 700; font-size: 16px; text-align: left; }
.lesson-row.story { background: #d9541c; }
.lesson-row .num { background: #fff; color: #1f3b6e; border-radius: 6px; padding: 5px 7px; font-size: 13px; }
.lesson-row.story .num { color: #d9541c; }
.lesson-row .ttl { flex: 1; }
.lesson-row .arrow { font-size: 22px; opacity: .9; }
.mb-current { position: relative; }
.mb-current .lesson-row.blur { filter: blur(3px); opacity: .6; pointer-events: none; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.overlay .ttl { font-weight: 700; font-size: 14px; color: #111827; text-shadow: 0 0 6px #fff, 0 0 10px #fff; }
.overlay .make { background: #1f3b6e; color: #fff; font-weight: 700; padding: 11px 18px; border-radius: 999px; font-size: 15px; box-shadow: 0 4px 14px rgba(31,59,110,.35); }
.past { padding: 0 12px 12px; font-size: 13px; color: #6b7280; }
.past summary { cursor: pointer; padding: 6px 0; }
.past .lesson-row { margin-top: 8px; background: #e8edf6; color: #1f3b6e; font-size: 14px; }
.past .lesson-row .num { background: #1f3b6e; color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plain-row { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 12px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.plain-row .arrow { font-size: 20px; color: #6b7280; }
.dev { margin-top: 10px; }
.linkish { color: #6b7280; text-decoration: underline; font-size: 12px; }
#progressSel { font: inherit; font-size: 12px; }

.menu { position: absolute; right: 12px; top: 56px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 30; min-width: 160px; overflow: hidden; }
.menu-item { display: block; width: 100%; text-align: left; padding: 12px 16px; font-weight: 700; }
.menu-item:hover { background: #f6f3ea; }
.r-item .sit { font-size: 11px; color: var(--muted); }
.r-item .star { font-size: 18px; color: #cbd5e1; padding: 4px; }
.r-item .star.on { color: var(--accent); }

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mode { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #e8edf6; color: #1f3b6e; border: 1px solid #c7d2e6; }
.mode.long { background: #fde68a; color: #78350f; border-color: #f5c84a; }
.r-item .ord { display: flex; flex-direction: column; gap: 2px; }
.r-item .ord button { width: 28px; height: 22px; border-radius: 6px; background: #f1ede2; font-size: 12px; line-height: 1; }
.r-item .ord button:disabled { opacity: .3; }

/* ---- My List: 見やすさ・練習 ---- */
.ml-top { flex-direction: column; align-items: stretch; gap: 8px; }
.ml-head { display: flex; align-items: center; gap: 10px; }
.count { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.25); color: #fff; font-size: 12px; margin-left: 4px; }
.ml-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.ml-stats b { color: var(--ink); font-size: 14px; }
.search { padding: 0; }
.search input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.chips-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row .chip { flex: none; font-size: 13px; padding: 7px 12px; }
.chips-row .chip.on { background: var(--accent); color: var(--accent-ink); }
.chips-row .sep { width: 1px; height: 22px; background: var(--line); flex: none; }
.sort { flex: none; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; }
.ghead { font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 2px 0; }
.stars { display: flex; gap: 1px; font-size: 12px; line-height: 1; margin-top: 4px; }
.stars span { color: #d9d4c7; }
.stars span.on { color: #f5a524; }
.r-item.due::after { content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #38bdf8; }
.r-item { position: relative; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .chip.on { background: var(--accent); color: var(--accent-ink); }
dialog { border: 0; border-radius: 16px; background: #fff; color: var(--ink); padding: 20px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h3 { margin: 0 0 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pr-card { background: #fff; border-radius: 20px; border: 1px solid var(--line); padding: 18px; cursor: pointer; animation: up .2s ease-out; }
.pr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pr-lv { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #efe9da; }
.pr-lv.lv5 { background: var(--accent); color: var(--accent-ink); }
.pr-sit { font-size: 12px; color: var(--muted); }
.pr-ja { font-size: 24px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.pr-step { min-height: 72px; }
.pr-ask { font-size: 16px; font-weight: 700; }
.pr-tap { color: var(--muted); font-size: 12px; margin-top: 8px; }
.pr-en-row { display: flex; align-items: center; gap: 12px; }
.pr-en-wrap { flex: 1; min-height: 44px; display: flex; align-items: center; }
.pr-en { font-size: 20px; font-weight: 700; }
.g.ng { background: #fee2e2; color: #7f1d1d; } .g.hmm { background: #fef3c7; color: #78350f; }
.pr-levelup { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 22px; padding: 14px 24px; border-radius: 999px; box-shadow: 0 10px 40px rgba(245,165,36,.5); animation: pop .9s ease-out forwards; z-index: 30; pointer-events: none; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1); opacity: 0; } }
.result { padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.result-title { font-size: 22px; font-weight: 700; }
.result-big { font-size: 64px; font-weight: 800; line-height: 1; color: var(--accent); }
.result-big .unit { font-size: 20px; margin-left: 6px; color: var(--ink); }
.result-row { display: flex; justify-content: space-between; padding: 10px 14px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.lu { padding: 10px 14px; background: linear-gradient(90deg, rgba(245,165,36,.25), transparent); border-radius: 12px; font-weight: 600; }

/* 既存アプリと同じ 2 タブ（Figma 3065-5574） */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-bottom: 1px solid var(--line); height: 56px; }
.tab { font-size: 16px; font-weight: 700; color: #b5bcc9; position: relative; }
.tab.on { color: #1f3b6e; }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #1f3b6e; }

.chip .info { display: inline-block; margin-left: 4px; font-size: 12px; opacity: .6; }
.chip.on .info { opacity: .8; }

/* 下のボタン帯は画面の下に固定（長い一覧でもスクロールせずに押せる） */
#mylist .bot-band, #list .bot-band, #review .bot-band { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 16px rgba(0,0,0,.06); }

/* 「今日の練習分」は、行の右上の点と同じ水色 */
#ml-filter .chip[data-v="due"].on { background: #38bdf8; color: #082f49; }
#ml-filter .chip[data-v="due"].on .info { opacity: .9; }

/* 始めるボタンと絞り込みチップを見た目で分ける */
.ml-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.start { width: 100%; padding: 14px; border-radius: 12px; background: #1f3b6e; color: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 4px 14px rgba(31,59,110,.25); }
.start .count { background: rgba(255,255,255,.25); color: #fff; font-size: 13px; }
.start.done { background: #e5e7eb; color: #6b7280; box-shadow: none; }
#mylist .linkish { font-size: 13px; color: #1f3b6e; text-decoration: underline; padding: 4px; }
#ml-filter .chip, #ml-scenes .chip { background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
#ml-filter .chip.on, #ml-scenes .chip.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
#ml-filter .chip[data-v="due"].on { background: #38bdf8; color: #082f49; }

#ml-filter, #ml-scenes { flex-wrap: wrap; overflow: visible; }
.sort-row { display: flex; align-items: center; gap: 8px; }

.p-note { margin-top: 8px; font-size: 12px; color: #92400e; background: #fff7e6; border-radius: 8px; padding: 6px 10px; line-height: 1.5; }
.p-note::before { content: "💡 "; }
