/* Praxis — home, Shadowing and Impromptu. Register chips use the colours
 * Schema puts on the same two facts (ochre Casual, indigo Polite); speakers A
 * and B are deliberately one ink — A filled, B outlined — so they never compete
 * with the register pair. */

.praxis-home { max-width: 760px; margin: 0 auto; }
.praxis-home { padding-top: 6px; }
.praxis-cards { display: grid; gap: 12px; }
@media (min-width: 760px) { .praxis-cards { grid-template-columns: 1fr 1fr; } }
.praxis-card { display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 18px 18px 18px 20px; border-radius: 20px; box-shadow: none; text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.praxis-card:hover { border-color: var(--line-2); }
.praxis-card:active { background: var(--sunken); }
.pc-icon { width: 52px; height: 52px; border-radius: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--on-ink); background: var(--ink); }
.pc-icon svg { width: 24px; height: 24px; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pc-title { font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.pc-line { display: block; font-size: .88rem; color: var(--ink-mid); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-n { font-size: .74rem; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pc-ok { display: inline-flex; color: var(--green); vertical-align: -2px; margin-right: 4px; }
.pc-ok svg { width: 15px; height: 15px; stroke-width: 2.6; }
.pc-go { color: var(--ink-soft); flex: none; }
.pc-go svg { width: 20px; height: 20px; }

/* ── Shadowing ── */
.shadow-wrap { max-width: 760px; margin: 0 auto; }
/* ‹  3 / 8  タイトル ✓ ▾  ›  — a phone only; a desktop lists them in the rail. */
.sh-switch { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
@media (min-width: 900px) { .sh-switch { display: none; } }
.sw-arrow { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-mid); background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.sw-arrow svg { width: 18px; height: 18px; }
.sw-arrow.is-off { opacity: .35; }
.sw-mid {
  appearance: none; flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-align: left;
}
.sw-mid { justify-content: center; }
.sw-n { font-size: .86rem; font-weight: 700; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.sw-chev { display: inline-flex; color: var(--ink-soft); }
.sw-chev svg { width: 15px; height: 15px; }
.sh-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.sl-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.sl-row:hover { background: var(--sunken); }
.sl-row.is-on { background: var(--red-bg); }
.sl-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; background: var(--sunken); border: 1px solid var(--border); color: var(--ink-mid); }
.sl-row.is-on .sl-n { background: var(--red); border-color: var(--red); color: var(--on-red); }
.sl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-t { font-weight: 700; font-size: .95rem; }
.sl-g { font-size: .76rem; color: var(--ink-soft); text-transform: capitalize; }
.sl-ok { display: inline-flex; color: var(--green); flex: none; }
.sl-ok svg { width: 16px; height: 16px; }

.sh-app { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
@media (min-width: 600px) { .sh-app { padding: 20px 22px; } }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.sh-head .chip { text-transform: capitalize; flex: none; }
.sh-title { font-size: 1.3rem; font-weight: 800; color: var(--ink); min-width: 0; }
.lap-mark { font-size: .7rem; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Passed: one green line. The steps 1 — 2 — 3 — 4, each with a pip for each of its three goes. */
.sh-round { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.rd-title { font-size: .9rem; color: var(--ink-mid); }
.rd-title b { color: var(--ink); font-weight: 800; }
.rd-title { display: inline-flex; align-items: center; gap: 6px; }
.rd-ok { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: var(--on-ink); align-items: center; justify-content: center; }
.rd-ok svg { width: 12px; height: 12px; stroke-width: 3; }
.sh-round.is-passed { background: var(--green-bg); }
.sh-round.is-passed .rd-title b { color: var(--green); }
.rd-next { display: inline-flex; align-items: center; gap: 2px; font-size: .84rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.rd-next svg { width: 15px; height: 15px; }
.sh-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.sh-steps li { position: relative; }
.sh-steps li + li::before { content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--border); }
.sh-steps li.is-past + li::before { background: var(--ink); }
.sh-step { appearance: none; position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; padding: 0 2px; color: var(--ink-soft); }
.ss-dot {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--line-2); font-size: .8rem; font-weight: 800; color: var(--ink-soft);
  transition: background .15s, border-color .15s, color .15s;
}
.ss-dot svg { width: 14px; height: 14px; stroke-width: 3; }
.ss-lbl { font-size: .74rem; font-weight: 700; }
.ss-pips { display: inline-flex; gap: 3px; }
.ss-pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.ss-pips i.on { background: var(--ink); }
.sh-steps li.is-past .ss-pips i.on { background: var(--green); }
.sh-step:hover .ss-dot { border-color: var(--ink-soft); }
.sh-steps li.is-past .ss-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sh-steps li.is-past .ss-lbl { color: var(--ink-mid); }
.sh-steps li.is-on .ss-dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.sh-steps li.is-on:not(.is-past) .ss-dot { background: var(--red); color: var(--on-red); }
.sh-steps li.is-on .ss-lbl { color: var(--red); }

.sh-hint { margin: 14px 2px 10px; color: var(--ink-mid); font-size: .86rem; line-height: 1.5; text-align: center; }
.sh-reveal { margin: 0 auto 10px; display: flex; }
.sh-lines { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.sh-line { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.sh-line:hover { background: var(--sunken); }
.sh-line.cur { background: var(--red-bg); box-shadow: inset 3px 0 0 var(--red); }
.sh-sp { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 800; margin-top: 6px; }
.sp-A { background: var(--ink); color: var(--paper); }
.sp-B { border: 1.5px solid var(--ink); color: var(--ink); }
.sh-line-body { flex: 1; min-width: 0; }
.sh-jp { font-size: 1.02rem; line-height: 1.95; color: var(--ink); }
.sh-jp rt { font-size: .5em; }
.sh-en { font-size: .82rem; color: var(--ink-soft); line-height: 1.45; margin-top: -2px; }
.sh-app.hide-en .sh-en { display: none; }
.sh-app.hide-jp .sh-jp { filter: blur(7px); opacity: .55; -webkit-user-select: none; user-select: none; }
.sh-recnote { margin: 12px 2px 0; font-size: .86rem; color: var(--ink-mid); text-align: center; }

/* After a take: yours next to the model; then the next take, or the self-check. */
.sh-review { margin: 6px 0 14px; padding: 16px; border-radius: 16px; background: var(--sunken); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.rv-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; }
.rv-note { font-size: .86rem; color: var(--ink-mid); margin-top: -6px; }
.rv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-play { min-height: 52px; font-size: .95rem; }
.rv-play svg { width: 18px; height: 18px; }
.rv-checks { display: flex; flex-direction: column; gap: 8px; }
.rv-q { font-size: .88rem; font-weight: 700; color: var(--ink-mid); margin-top: 2px; }
.sc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; cursor: pointer; }
.sc-item input { width: 20px; height: 20px; flex: none; accent-color: var(--green); }
.sc-item:has(input:checked) { border-color: var(--green-ln); }
.rv-main { width: 100%; min-height: 50px; }
.rv-main svg, .rv-again svg { width: 18px; height: 18px; }
.rv-again { align-self: center; }

/* While a take is being recorded: the script stays, the rest steps back. */
.sh-app.is-taking .sh-steps, .sh-app.is-taking .sh-hint { opacity: .4; pointer-events: none; }
.rec-count { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-weight: 900; }

/* The bar in reach: play or record, and the speed. On a phone it sits just
   above the tab bar while the dialogue scrolls. */
.sh-bar {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 4;
  display: flex; align-items: center; gap: 6px;
  margin: 14px -6px 0; padding: 8px; border-radius: 16px;
  background: var(--glass-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow-2);
}
@media (min-width: 900px) { .sh-bar { bottom: 16px; } }
.sh-bar .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px; gap: 6px; }
.sh-bar .btn svg { width: 16px; height: 16px; flex: none; }
.sh-play, .sh-rec { flex-grow: 1.4 !important; }
.sh-rec.is-recording { background: var(--ink); color: var(--paper); animation: recPulse 1.2s ease-in-out infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 6px var(--red-bg); } }
.sh-speed {
  appearance: none; flex: none; min-width: 52px; height: 44px; padding: 0 10px; border-radius: var(--r-ctl);
  border: 1px solid var(--border); background: var(--sunken); color: var(--ink-mid);
  font-size: .84rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.sh-speed.is-slow { color: var(--ink); border-color: var(--line-2); }
@media (max-width: 420px) { .sh-bar .btn { padding: 0 6px; font-size: .84rem; } }

/* ── Impromptu ── */
.imp-wrap { max-width: 640px; margin: 0 auto; padding-top: 6px; }
.slot-card { padding: 14px 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.slot-lbl { align-self: flex-start; font-size: .78rem; font-weight: 700; color: var(--ink-soft); padding: 0 4px; }
.slot-window { position: relative; width: 100%; height: 132px; overflow: hidden; border-radius: 14px; background: var(--sunken); }
.slot-reel { will-change: transform; }
.slot-item { height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; text-align: center; }
.slot-jp { font-size: 1.55rem; font-weight: 700; color: var(--ink); line-height: 1.8; }
.slot-jp rt { font-size: .45em; }
.slot-en { font-size: .88rem; color: var(--ink-soft); }
.slot-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(var(--sunken), transparent 22%, transparent 78%, var(--sunken)); opacity: 0; transition: opacity .2s; }
.slot-window.spinning .slot-shade { opacity: 1; }
.imp-pick { color: var(--ink-mid); }
.imp-pick svg { width: 16px; height: 16px; }

/* Round 1 → 2 → 3, joined by a line; done ones ticked, the current one red. */
.imp-rounds { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.imp-rounds li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.imp-rounds li + li::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.imp-rounds li.is-done + li::before, .imp-rounds li.is-done + li.is-active::before { background: var(--ink); }
.ir-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 2px solid var(--line-2); color: var(--ink-soft); font-size: .82rem; font-weight: 800;
}
.ir-dot svg { width: 15px; height: 15px; stroke-width: 3; }
.ir-text { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.ir-n { font-size: .74rem; font-weight: 650; color: var(--ink-soft); }
.ir-t { font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-mid); }
.imp-rounds li.is-done .ir-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.imp-rounds li.is-active .ir-dot { background: var(--red); border-color: var(--red); color: var(--on-red); box-shadow: 0 0 0 4px var(--red-bg); }
.imp-rounds li.is-active .ir-t { color: var(--red); }

.imp-card { padding: 20px 18px; }
/* Before a set: no frame — just the button. */
.imp-card[data-state="idle"] { background: none; border: 0; box-shadow: none; padding: 0; }
.imp-state { display: none; text-align: center; flex-direction: column; align-items: center; gap: 10px; }
.imp-card[data-state="idle"] .s-idle, .imp-card[data-state="prep"] .s-prep, .imp-card[data-state="speaking"] .s-speaking,
.imp-card[data-state="gap"] .s-gap, .imp-card[data-state="review"] .s-review, .imp-card[data-state="done"] .s-done { display: flex; }
.imp-big { min-height: 54px; font-size: 1.02rem; border-radius: 14px; }
.imp-note { font-size: .84rem; color: var(--ink-soft); }
.imp-prep-lbl { font-weight: 750; color: var(--ink-mid); }
.imp-count { font-size: 4rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.imp-timer { font-size: 4.2rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.imp-timer.warning, .imp-timer.done { color: var(--red); }
.imp-rec-row { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--red); font-size: .9rem; width: 100%; max-width: 320px; }
.imp-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: bootPulse 1s ease-in-out infinite; }
.imp-mic { flex: 1; height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.imp-mic-bar { height: 100%; width: 0; background: var(--red); transition: width .05s linear; }
.imp-talk { font-size: .92rem; color: var(--ink-mid); }
.imp-talk b { color: var(--ink); }
.imp-takes { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.imp-take { padding: 10px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--border); text-align: left; }
.imp-take-lbl { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.imp-take audio, .imp-hist-take audio { width: 100%; height: 40px; }
#app .is-confirm { background: var(--ink); color: var(--paper); }

/* My recordings: a fold, closed until opened. */
.imp-history { margin-top: 28px; border-top: 1px solid var(--border); }
.imp-hist-head { display: flex; align-items: center; gap: 8px; padding: 14px 2px; cursor: pointer; list-style: none; color: var(--ink-mid); }
.imp-hist-head::-webkit-details-marker { display: none; }
.imp-hist-head:hover { color: var(--ink); }
.ih-title { font-size: .95rem; font-weight: 750; }
.imp-hist-n { font-size: .74rem; font-weight: 800; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--border); color: var(--ink-mid); }
.ih-chev { margin-left: auto; display: inline-flex; color: var(--ink-soft); transition: transform .2s var(--ease); }
.ih-chev svg { width: 18px; height: 18px; }
.imp-history[open] .ih-chev { transform: rotate(90deg); }
.imp-hist-body > .hint { margin: 0 2px 12px; }
.imp-hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.imp-hist-item { padding: 14px; }
.imp-hist-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.imp-hist-topic { font-weight: 700; font-size: 1rem; }
.imp-hist-meta { font-size: .76rem; color: var(--ink-soft); }
.imp-hist-en { font-size: .84rem; color: var(--ink-soft); }
.imp-hist-talk { font-size: .78rem; color: var(--ink-mid); font-weight: 650; margin-top: 4px; }
.imp-hist-take { margin-top: 8px; }
.imp-hist-take-lbl { display: block; font-size: .74rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
