/* Live teaching (#teach-live): edit น้องเก้า's draft, watch the change meter and the word diff update on every key, send,
   and teach her the way the extension asks. Same tokens as site.css; the chat panel reuses .case-chat from cases.css. */
.teach-live{padding:var(--space-section) var(--gutter);background:var(--surface)}
.teach-live [hidden]{display:none} /* .btn and the lesson card set display, which would otherwise beat the hidden attribute */
/* Named areas: the chat panel is .case-chat from cases.css, which places itself in the area called "chat". */
.live-desk{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-areas:"chat hud";gap:clamp(20px,3vw,40px);max-width:1120px;margin:0 auto;padding:clamp(18px,3vw,36px);border:var(--line);border-radius:32px;box-shadow:var(--drop-lg);background:radial-gradient(120% 90% at 100% 0%,#d9f6ff 0,transparent 55%),radial-gradient(90% 80% at 0% 100%,var(--peach) 0,transparent 60%),var(--rose-soft)}
.live-log{display:flex;flex-direction:column;gap:10px}
.live-log li{max-width:94%;padding:10px 14px;border-radius:18px;line-height:1.65;overflow-wrap:anywhere}
.live-log .live-them{align-self:flex-start;background:var(--white);border:1px solid var(--border);border-bottom-left-radius:6px}
.live-log .live-me{align-self:flex-end;background:var(--ink);color:var(--white);border-bottom-right-radius:6px}
.live-log .live-pic{padding:0;border:0;background:none}
.live-log .live-pic img{width:min(180px,60vw);height:auto;aspect-ratio:1;object-fit:cover;border:1px solid var(--border);border-radius:16px 16px 16px 6px;background:var(--rose-soft)}
.live-log .live-divider{align-self:center;padding:2px 12px;border:1px dashed var(--navy);border-radius:var(--r-pill);background:var(--white);font-size:.88rem;color:var(--navy)}

.live-hud{grid-area:hud;display:grid;gap:12px;align-content:start;padding:18px;background:rgb(255 255 255 / .7);border:var(--line);border-radius:var(--r-panel)}
.live-hud .ctx-chips{margin-top:0}
.live-field{width:100%;padding:12px 14px;border:var(--line);border-radius:var(--r-control);background:var(--white);color:var(--ink);font:400 1rem/1.7 var(--font-body);resize:vertical}
.live-field[readonly]{background:var(--surface);color:var(--navy)}
.live-bar{position:relative;height:12px;border:var(--line);border-radius:var(--r-pill);background:var(--white);overflow:hidden}
.live-fill{position:absolute;inset:0;background:var(--cyan);transform:scaleX(0);transform-origin:left;transition:transform 200ms var(--ease-out),background-color 200ms ease}
.teach-live.is-over .live-fill{background:var(--rose-deep)}
.live-mark{position:absolute;top:0;bottom:0;left:25%;width:2px;background:var(--ink)}
.live-meter p{margin-top:6px;font-size:.88rem;line-height:1.6;color:var(--navy)}
.live-diff{padding:10px 12px;border:1.5px dashed var(--navy);border-radius:var(--r-control);background:var(--white);font-size:.92rem;line-height:1.85;overflow-wrap:anywhere}
.live-diff b{font:500 .88rem/1 var(--font-display);color:var(--navy)}
.live-diff ins{text-decoration:none;background:#dcf7ea;box-shadow:inset 0 -2px 0 var(--ok);border-radius:3px}
.live-diff del{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--stop);text-decoration-thickness:2px}
.live-actions{display:flex;flex-wrap:wrap;gap:10px}
.live-lesson{display:grid;gap:10px;padding:14px;border:var(--line);border-radius:var(--r-card);background:var(--white);box-shadow:var(--drop)}
.live-lesson h3{font-size:1rem;line-height:1.5}
.live-lesson details{font-size:.88rem;color:var(--navy)}
.live-lesson summary{cursor:pointer}
.live-status{min-height:1.6em;font-size:.95rem;line-height:1.6}
.live-status:empty{min-height:0}
.teach-live .chat-note{max-width:1120px;margin:var(--space-4) auto 0;padding:0}
/* Without JavaScript the draft is still readable, but the buttons would do nothing. */
.teach-live:not(.is-live) .live-actions,.teach-live:not(.is-live) .live-meter{display:none}

@media (prefers-reduced-motion:no-preference){.live-log .is-new{animation:pop-in 420ms var(--ease-out)}}
@media (max-width:860px){.live-desk{grid-template-columns:minmax(0,1fr);grid-template-areas:"chat" "hud";border-radius:24px}}
@media (max-width:520px){.live-hud{padding:14px}}
