/* Talk — this feature's styles. Use the tokens from style.css
   (--bg --surface --text --muted --line --accent --on-accent --user --ja --danger
   --high --mid --low --poor --font --font-ja --mono); never redefine them. */

.tk { padding-top: 14px; }
.tk-ja { font-family: var(--font-ja); font-weight: 400; letter-spacing: 0; text-transform: none; }
.tk-kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tk-kicker .tk-ja { margin-left: 6px; font-size: 11px; color: var(--muted); }
.tk-none { font-size: 18px; font-weight: 600; color: var(--text); }

/* ---------- before he starts ---------- */
.tk-intro { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.tk-intro .tk-kicker { margin-bottom: 6px; }
.tk-day { margin: 0; font-size: 22px; font-weight: 700; }
.tk-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.tk-plan-top { margin: 26px 2px 0; }
.tk-plan { margin: 12px 0 0; padding: 0 0 0 1.1em; display: grid; gap: 10px; font-size: 15px; }
.tk-plan li { padding-left: 4px; }
.tk-plan li::marker { color: var(--accent); font-weight: 700; font-size: 12px; }
.tk-theme { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.tk-plan-en { display: block; line-height: 1.45; overflow-wrap: anywhere; }
.tk-how {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.tk-how .tk-ja { display: block; margin-top: 6px; font-size: 13px; }

.tk-start {
  display: block;
  width: 100%;
  min-height: 68px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tk-start .tk-ja { display: block; margin-top: 3px; font-size: 12px; opacity: .82; }
.tk-start[disabled] { background: var(--line); color: var(--muted); cursor: default; }
.tk-start:focus-visible, .tk-key:focus-visible, .tk-speak:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tk-note { min-height: 1.3em; margin: 10px 2px 0; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.tk-note.ok { color: var(--accent); }
.tk-note.error { color: var(--danger); }
.tk-note.busy::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: tk-spin .8s linear infinite;
}
@keyframes tk-spin { to { transform: rotate(360deg); } }
.tk-link { color: var(--accent); }

/* ---------- the stage: always under his thumb ---------- */
/* The stage is fixed over the foot of the page; the thread has to be able to clear it. */
.tk.live { padding-bottom: 200px; }
.tk-stage {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.tk-state { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tk-phase { font-size: 15px; font-weight: 700; color: var(--muted); }
.tk-phase .tk-ja { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.tk-phase.listening { color: var(--accent); }
.tk-phase.speaking { color: var(--text); }
.tk-phase.done { color: var(--high); }
.tk-clock { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-meter { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--ja); overflow: hidden; }
.tk-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .07s linear;
}
.tk-meter i.on { background: var(--accent); }
.tk-stage .tk-note { margin: 7px 2px 0; }
.tk-keys { display: flex; gap: 10px; margin-top: 10px; }
.tk-key {
  flex: 1 1 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tk-key.wide { flex: 2 1 0; }
.tk-key.stop { border-color: var(--danger); color: var(--danger); }
.tk.live.busy .tk-key.stop { background: var(--danger); color: var(--on-accent); }

/* ---------- the conversation so far ---------- */
.tk-thread { margin: 0; padding: 0; list-style: none; }
.tk-turn {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  scroll-margin-top: 62px;
  scroll-margin-bottom: 240px;
}
.tk-turn.now { border-color: var(--accent); }
.tk-ask { margin: 6px 0 0; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.tk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tk-speak {
  flex: none;
  min-width: 56px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tk-speak.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
/* While the microphone is open a ▶ would land in the recording. */
.tk.live.busy .tk-speak { opacity: .4; pointer-events: none; }

.tk-said {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--user);
}
.tk-said p { margin: 0; flex: 1 1 auto; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.tk-pct { flex: none; font-size: 19px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tk-pct i { font-size: 12px; font-style: normal; font-weight: 700; }
.tk-pct.high, .tk-fix-pct.high, .tk-sums b.high { color: var(--high); }
.tk-pct.mid, .tk-fix-pct.mid, .tk-sums b.mid { color: var(--mid); }
.tk-pct.low, .tk-fix-pct.low, .tk-sums b.low { color: var(--low); }
.tk-pct.poor, .tk-fix-pct.poor, .tk-sums b.poor { color: var(--poor); }

.tk-coach:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-verdict { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--danger); }
.tk-fix + .tk-fix { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-fix-pct { float: right; font-size: 13px; font-weight: 800; letter-spacing: 0; }
.tk-fix-en { margin: 6px 0 0; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.tk-keep { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tk-keep li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--ja);
  font-size: 15px;
}
.tk-keep li.said { background: var(--user); }
.tk-keep li.said b::after { content: " ✓"; color: var(--high); }
.tk-keep li b { flex: 1 1 auto; }
.tk-keep .tk-ja { flex: 1 1 100%; font-size: 12px; color: var(--muted); }

/* ---------- when he stops ---------- */
.tk-done { margin: 4px 0 14px; padding: 16px; border: 1px solid var(--accent); border-radius: 18px; background: var(--surface); }
.tk-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.tk-sums li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--ja);
}
.tk-sums b { font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tk-sums span { font-family: var(--font-ja); font-size: 11px; color: var(--muted); }
.tk-gave { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tk-gave .tk-keep { margin-top: 8px; }
