/* The app: layout and controls. Type, colour, cards and buttons come from site.css. */

.app-container { max-width: 1320px; }
.app-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; padding-top: 24px; padding-bottom: 64px; align-items: start; }
@media (max-width: 960px) { .app-layout { grid-template-columns: 1fr; } }
.side { display: grid; gap: 16px; position: sticky; top: 88px; }
@media (max-width: 960px) { .side { position: static; } }
.side h3 { margin-bottom: 14px; font-size: 16px; }

.drop {
  position: relative; display: grid; gap: 6px; place-items: center; text-align: center; padding: 22px 14px; margin-bottom: 14px;
  border: 1.5px dashed rgba(17, 17, 17, 0.2); border-radius: 12px; cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: rgba(194, 65, 12, 0.04); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-title { font-weight: 500; word-break: break-word; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 0 14px; border: 0; border-radius: 999px; background: rgba(17, 17, 17, 0.06); }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented span { display: block; text-align: center; padding: 8px 0; border-radius: 999px; font: 500 13px/1 var(--sans); color: var(--body); }
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.progress { height: 6px; border-radius: 999px; background: rgba(17, 17, 17, 0.08); overflow: hidden; margin-bottom: 14px; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s linear; }
.upload-card .btn { width: 100%; }
.upload-card .small { margin-top: 10px; }
.desk-card form { display: grid; gap: 10px; margin-top: 12px; }
.desk-card textarea {
  width: 100%; resize: vertical; min-height: 88px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfbfb; font: 400 14px/1.45 var(--sans); color: var(--ink);
}
.desk-card textarea:focus-visible { outline: 2px solid var(--accent); border-color: transparent; }
.desk-card .btn { width: 100%; }
.desk-reply { margin-top: 12px; display: grid; gap: 6px; }
.desk-a { margin: 0; font: 400 14px/1.5 var(--sans); color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }

.library { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.library button {
  width: 100%; display: grid; gap: 6px; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent; background: none; font: inherit; color: inherit; cursor: pointer;
}
.library button:hover { background: rgba(17, 17, 17, 0.04); }
.library button[aria-current="true"] { background: rgba(17, 17, 17, 0.05); border-color: var(--line); }
.library .lib-title { font-weight: 500; font-size: 14px; }
.library .lib-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.empty { display: grid; gap: 14px; padding: 40px; }
.empty .btn { justify-self: start; }

.job-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.job-title { font-size: 36px; }
.player-card { padding: 0; overflow: hidden; }
.player-card video { width: 100%; max-height: 62vh; background: #000; }
.timeline { position: relative; height: 34px; background: #1b1b1b; cursor: pointer; }
.timeline .block { position: absolute; top: 8px; height: 18px; border-radius: 4px; background: #4ade80; opacity: 0.85; border: 0; padding: 0; cursor: pointer; }
.timeline .block.needs_review { background: #fbbf24; }
.timeline .block.approved { background: #93c5fd; }
.timeline .block.skipped, .timeline .block.pending { background: #555; }
.timeline .block:hover, .timeline .block:focus-visible { opacity: 1; outline: 2px solid #fff; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 0; pointer-events: none; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.downloads { display: flex; gap: 16px; font-size: 13px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 36px; height: 20px; border-radius: 999px; background: rgba(17, 17, 17, 0.2); position: relative; transition: background 0.2s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 28px; }
.stats div { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font: 400 28px/1.1 var(--display); }
.stats dd small { display: block; font: 400 12px/1.3 var(--sans); color: var(--muted); margin-top: 4px; }

.cues-head { display: grid; gap: 4px; margin-bottom: 14px; }
.cues { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cue { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid transparent; transition: border-color 0.2s var(--ease); }
.cue.playing { border-color: var(--ink); }
.cue-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.cue-head .time { font: 500 13px/1 var(--mono); color: var(--ink); }
.cue textarea {
  font: 400 19px/1.4 var(--display); color: var(--ink); width: 100%; resize: vertical; min-height: 54px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fbfbfb;
}
.cue textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.cue-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cue details { font-size: 13px; color: var(--body); }
.cue details ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.cue .problem { color: var(--bad); }
.cue.new { animation: pop 380ms var(--ease) both; }
.icon-btn { width: 34px; padding: 0; }
@media (prefers-reduced-motion: reduce) { .cue.new { animation: none; } }

/* Ask the lesson: a child pauses, asks about the picture, or hears where things are. */
.stage { position: relative; }
.map-layer { position: absolute; inset: 0 0 34px; pointer-events: none; }
.map-dot { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(17, 17, 17, 0.72); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; opacity: 0.55; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.map-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.map-dot.speaking { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
.ask { margin-top: 16px; padding: 20px; display: grid; gap: 14px; }
.ask-head h3 { font: 400 26px/1.1 var(--display); margin: 0 0 6px; }
.ask-head kbd { font: 500 12px/1 var(--mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fbfbfb; }
.ask-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ask-talk { min-width: 160px; }
.ask-talk.listening { background: var(--accent); }
.ask-type { display: flex; gap: 10px; }
.ask-type input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fbfbfb; font: 400 14px/1 var(--sans); }
.ask-type input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-answer { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.ask-q { margin: 0; font-size: 13px; color: var(--muted); }
.ask-a { margin: 0; font: 400 24px/1.3 var(--display); color: var(--ink); }
.ask-answer.thinking .ask-a { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
