/* §309 The Tutor: the learner's screen (phone first), the teacher's Tutor tab, the operator's section. Colours only through
   the platform's tokens, so the dark theme follows. */
#tutor-root { max-width: 720px; }
.tt-head { margin: 0 0 12px; }
.tt-sub { margin: 0; color: var(--muted); font-size: .95rem; }
.tt-sub b { color: var(--ink); }
.tt-course { display: flex; margin: 0 0 12px; max-width: 420px; }
.tt-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 12px; min-width: 0; }
.tt-card > .eyebrow { display: block; margin: 0 0 8px; }
.tt-start { display: grid; gap: 12px; }
.tt-start .ia-field { margin: 0; }
.tt-go { justify-self: start; min-height: 48px; padding: 0 22px; font-size: 1.05rem; }
.tt-hint { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }
.tt-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); color: var(--ink); font-size: .92rem; }
.tt-empty { margin: 0; color: var(--muted); font-size: .9rem; }
.tt-list { list-style: none; margin: 0; padding: 0; }
.tt-list li + li { border-top: 1px solid var(--line-soft); }
.tt-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tt-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt-row-main strong { color: var(--ink); line-height: 1.3; }
.tt-row-main small { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.tt-row-go { flex: none; color: var(--muted); font-size: 1.3rem; }
@media (hover: hover) { .tt-row:hover strong { color: var(--accent); } }
.tt-back { margin: 0 0 10px; }
.tt-title { margin: 0 0 10px; color: var(--ink); font-size: 1.15rem; line-height: 1.3; }
.tt-title small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.tt-summary { margin: 0 0 10px; color: var(--ink); line-height: 1.5; }
.tt-notes-block { margin: 12px 0 0; }
.tt-notes-block > strong { display: block; color: var(--ink); margin: 0 0 4px; }
.tt-notes-block p, .tt-notes-block ul { margin: 0; color: var(--ink); line-height: 1.5; }
.tt-notes-block ul { padding-left: 1.2em; }
.tt-fixes { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.tt-fixes li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--canvas); }
.tt-said { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--danger); }
.tt-better { color: var(--ink); font-weight: 600; }
.tt-words { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tt-w { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.tt-who { font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; }
.tt-who small { font-weight: 400; }
.tt-w-tutor .tt-who { color: var(--accent); }
.tt-w-system .tt-said-line { color: var(--muted); font-style: italic; font-size: .88rem; }
.tt-said-line { color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }

/* the lesson itself */
.tt-live { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 16px; }
.tt-livebar { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; }
.tt-livebar .eyebrow { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-left { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.tt-left.is-late { color: var(--danger); font-weight: 600; }
.tt-orb { --lvl: 0; position: relative; width: 148px; height: 148px; margin: 6px 0 2px; border-radius: 50%; display: grid; place-items: center; }
.tt-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green-soft); transform: scale(calc(.82 + var(--lvl) * .18)); transition: transform .12s ease-out, background .2s ease; }
.tt-orb span { position: relative; width: 92px; height: 92px; border-radius: 50%; background: var(--accent); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .15s ease; }
.tt-orb[data-who="tutor"] span { animation: tt-pulse 1.1s ease-in-out infinite; }
.tt-orb[data-who="learner"]::before { background: color-mix(in srgb, var(--brand-orange) 22%, transparent); }
.tt-orb[data-who="learner"] span { background: var(--brand-orange); }
.tt-orb[data-who="wait"] span { background: var(--line); box-shadow: none; animation: tt-breathe 1.6s ease-in-out infinite; }
@keyframes tt-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes tt-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tt-orb span, .tt-orb::before { animation: none !important; transition: none !important; } }
.tt-status { margin: 0; color: var(--ink); font-weight: 600; text-align: center; min-height: 1.4em; }
.tt-captions { width: 100%; max-height: 34vh; overflow-y: auto; display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--canvas); }
.tt-captions:empty { display: none; }
.tt-cap { margin: 0; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.tt-cap b { color: var(--muted); font-size: .8rem; margin-right: 4px; }
.tt-cap-tutor b { color: var(--accent); }
.tt-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.tt-controls .button { min-height: 44px; }
.tt-live .tt-hint { text-align: center; }
.tt-done .tt-controls { justify-content: flex-start; margin-top: 14px; }

/* the teacher's tab */
.tt-classes { margin: 0 0 12px; }
.tt-level { display: flex; margin: 0 0 12px; max-width: 520px; }
.tt-table-wrap { overflow-x: auto; margin: 0 0 4px; }
.tt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tt-table th, .tt-table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); vertical-align: top; }
.tt-table th { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.tt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tt-table small { color: var(--muted); }
.tt-table .tt-group th { padding-top: 14px; color: var(--ink); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.tt-flag { flex: none; font-size: .78rem; color: var(--danger); font-weight: 600; max-width: 40%; text-align: right; }
.tt-ok { flex: none; font-size: .78rem; color: var(--muted); }
.tt-modal { max-width: 760px; }
.tt-modal .eyebrow { display: block; margin: 0 0 6px; }

/* the operator's section */
.tt-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.tt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; align-items: end; margin: 0 0 12px; }
.tt-form .ia-field { margin: 0; }

@media (max-width: 560px) {
  .tt-card { padding: 12px 12px; }
  .tt-go { width: 100%; justify-self: stretch; }
  .tt-orb { width: 128px; height: 128px; }
  .tt-orb span { width: 80px; height: 80px; }
  .tt-w { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tt-who { flex-direction: row; gap: 6px; }
  .tt-controls .button { flex: 1 1 140px; }
  .tt-flag { display: none; }
}

/* §315 Practice: the label, and the operator's AI connections page */
.tt-practice { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .02em; text-transform: none; }
.tt-practice-note .tt-practice { margin: 0 6px 0 0; }
.aic-services { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; color: var(--ink); font-size: .92rem; }
.aic-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 5px 1px 0; background: var(--muted); vertical-align: middle; }
.aic-dot.is-on::before { background: var(--green); }
.aic-dot.is-off::before { background: var(--danger); }
.aic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.aic-card { display: grid; gap: 10px; align-content: start; }
.aic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.aic-head > div { display: grid; gap: 2px; min-width: 0; }
.aic-head strong { color: var(--ink); }
.aic-head span { color: var(--muted); font-size: .86rem; }
.aic-state { flex: none; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.aic-state.is-practice { background: var(--canvas); color: var(--muted); border: 1px solid var(--line); }
.aic-state.is-live { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green); }
.aic-row > strong { display: block; color: var(--ink); font-size: .9rem; margin: 0 0 4px; }
.aic-row p { margin: 0 0 6px; color: var(--ink); font-size: .9rem; }
.aic-list { margin: 0; padding-left: 1.1em; color: var(--ink); font-size: .9rem; line-height: 1.6; }
.aic-list code, .aic-row code { font-size: .84rem; overflow-wrap: anywhere; }
.aic-ok { color: var(--green-dark); font-weight: 600; }
.aic-no { color: var(--danger); font-weight: 600; }
.aic-muted { color: var(--muted); }
.aic-warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--canvas); color: var(--danger); font-size: .9rem; }
.aic-test.is-ok { color: var(--green-dark); }
.aic-test.is-bad { color: var(--danger); }
.aic-test small { color: var(--muted); margin-left: 4px; }
.aic-how summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.aic-how ol { margin: 8px 0; padding-left: 1.2em; color: var(--ink); font-size: .9rem; line-height: 1.55; }
.aic-how a { overflow-wrap: anywhere; }

/* §316 the agreement before the first lesson */
.tt-consent-lead { margin: 0 0 8px; color: var(--ink); line-height: 1.5; }
.tt-consent-list { margin: 0 0 8px; padding-left: 1.2em; color: var(--ink); line-height: 1.55; font-size: .95rem; }
.tt-consent-list li { margin: 0 0 4px; }
.tt-consent-choices { display: grid; gap: 8px; margin: 12px 0 14px; }
.tt-consent-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; line-height: 1.45; }
.tt-consent-choice input { margin-top: 3px; flex: none; accent-color: var(--accent); }
.tt-consent-choice:has(input:checked) { border-color: var(--accent); background: var(--green-soft); }
.tt-consent-foot { margin: 10px 0 0; }
