/* ThinkLM Teacher app — the shell + component system, ported from the claude_design mockup
   (ThinkLM Teacher.dc.html). Loaded ALONGSIDE design.css (which supplies the shared tokens + fonts
   + base body). Calm, low-stimulation, no gamification — matches the student app. */

:root {
  --side: #1a2433;      /* the dark sidebar */
  --side-mut: #93a0b3;
  --shadow-card: 0 2px 10px rgba(20, 40, 80, .04);
  --shadow-lift: 0 3px 12px rgba(20, 40, 80, .06);
}

/* the teacher body is a slightly cooler paper so the white app frame reads as a surface */
body.t-body { background: #e9edf2; font-size: 14px; }

/* --- app shell: sidebar + main ------------------------------------------------------------- */
.t-app { min-height: 100vh; display: flex; }

.t-sidebar {
  flex: 0 0 232px; background: var(--side); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.t-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.t-brand .glyph {
  width: 26px; height: 26px; border-radius: 7px; background: #fff; position: relative; flex: 0 0 auto;
}
.t-brand .glyph::after {
  content: ""; position: absolute; inset: 7px; border: 1.5px solid var(--side); border-radius: 2px;
}
.t-brand-name { font-weight: 700; font-size: 16px; }

.t-nav { display: flex; flex-direction: column; gap: 2px; }
.t-nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px;
  color: var(--side-mut); font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.t-nav-item .ico { width: 20px; text-align: center; font-size: 14px; opacity: .85; }
.t-nav-item:hover { background: rgba(255, 255, 255, .05); color: #e7edf5; }
.t-nav-item.is-active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }

/* nav grouping (38A; 2026-07-06 UX-2 CEO: "subsets of a tab, shown as such"): the group reads as
   ONE tab — a soft container around parent + child, and a tree connector on the sub item. */
.t-nav-group {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 255, 255, .04); border-radius: 11px; padding: 2px;
}
.t-nav-item.sub {
  position: relative; margin-left: 27px; padding: 8px 11px 8px 16px; font-size: 13px;
}
.t-nav-item.sub::before {
  content: ""; position: absolute; left: -12px; top: -8px; bottom: 50%; width: 10px;
  border-left: 1.5px solid rgba(255, 255, 255, .22);
  border-bottom: 1.5px solid rgba(255, 255, 255, .22);
  border-bottom-left-radius: 7px;
}
.t-nav-item.sub .ico { width: 16px; font-size: 12px; }

.t-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-radius: 11px; background: rgba(255, 255, 255, .05);
}
.t-user .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #33405a; color: #cdd7e6;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
  flex: 0 0 auto;
}
.t-user .who { min-width: 0; flex: 1 1 auto; }
.t-user .who .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-user .who .org { font-size: 11px; color: var(--side-mut); }
.t-user .t-logout { flex: 0 0 auto; margin: 0; }
.t-logout-btn {
  background: transparent; border: 1px solid rgba(255, 255, 255, .18); color: var(--side-mut);
  font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 8px; cursor: pointer;
}
.t-logout-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .35); }

.t-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.t-header {
  flex: 0 0 auto; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 26px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.t-header .t-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.t-header .spacer { flex: 1; }
.t-content { flex: 1; overflow: auto; }
.t-page { max-width: 920px; margin: 0 auto; padding: 28px 26px 70px; }
.t-page.narrow { max-width: 640px; }

/* --- primitives ---------------------------------------------------------------------------- */
.t-card {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 24px;
  box-shadow: var(--shadow-card); margin-bottom: 22px;
}
.t-eyebrow {
  font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 11px;
}
.t-h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 5px; }
.t-h2 { font-size: 16px; font-weight: 700; margin: 0 0 15px; }
.t-sub { font-size: 13.5px; color: var(--ink2); }
.muted { color: var(--ink3); }

.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 13.5px; border: none; cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.t-btn:hover { background: var(--accent-press); }
.t-btn.ghost { background: transparent; color: var(--ink2); border: 1px solid var(--line2); }
.t-btn.ghost:hover { background: var(--fill); }
/* selected state for one-of-N ghost toggles (e.g. the Argument/Creative framework presets) */
.t-btn.ghost.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.t-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .04em;
  color: var(--accent-ink); background: var(--accent-soft); padding: 4px 9px; border-radius: 6px;
}
.t-chip .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.t-chip.plain { color: var(--ink3); background: var(--fill); }

/* tiles (dashboard quick actions) */
.t-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 24px; }
.t-tile { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 18px; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.t-tile:hover { border-color: var(--line2); box-shadow: var(--shadow-card); }
.t-tile .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 28px; }
.t-tile .ico.plain { background: var(--fill); color: var(--ink2); }
.t-tile .tt { font-size: 15.5px; font-weight: 650; margin-bottom: 3px; }
.t-tile .td { font-size: 12.5px; color: var(--ink2); line-height: 1.45; }

/* lists / rows (recent problems, library, assignments, sections) */
.t-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); list-style: none; margin: 0; padding: 0; }
.t-row { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.t-row:last-child { border-bottom: none; }
.t-row .grow { flex: 1; min-width: 160px; }
.t-row .title { font-weight: 600; font-size: 14px; }
.t-row .meta { color: var(--ink3); font-size: 12px; margin-top: 2px; }

/* forms */
.t-form { display: flex; flex-direction: column; gap: 4px; }
.t-label { font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); margin: 14px 0 8px; }
.t-input, .t-textarea, .t-select {
  width: 100%; border: 1px solid var(--line2); border-radius: 11px; padding: 13px;
  font-family: inherit; font-size: 14.5px; color: var(--ink); background: var(--paper);
}
.t-textarea { min-height: 88px; resize: vertical; font-family: "Source Serif 4", Georgia, serif; font-size: 15px; line-height: 1.5; }
.t-input:focus, .t-textarea:focus, .t-select:focus { outline: none; border-color: var(--accent); background: #fff; }
/* 2.4.7 — restore a keyboard focus ring (the mouse-focus border stays calm; keyboard gets the ring) */
.t-input:focus-visible, .t-textarea:focus-visible, .t-select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
/* 2.4.1 skip-to-content bypass: off-screen until focused */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--accent); color: #fff; padding: 9px 15px; border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus { top: 8px; }
h1.t-title { margin: 0; }
.t-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.t-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); margin: 8px 0; }
.t-form-actions { margin-top: 14px; }
.t-mt { margin-top: 22px; }

/* info / alert callouts */
.t-info { display: flex; gap: 10px; padding: 12px 13px; border: 1px solid #dce8f5; border-radius: 11px; background: var(--accent-soft); font-size: 12.5px; color: var(--accent-ink); line-height: 1.5; margin: 12px 0; }
.t-alert { display: flex; gap: 10px; align-items: center; background: var(--warm-soft); border: 1px solid #e8dccf; border-left: 3px solid var(--warm); border-radius: 11px; padding: 12px 15px; font-size: 12.5px; color: var(--ink); line-height: 1.45; margin: 12px 0; }
.t-error { color: var(--warm-text); font-weight: 600; }

/* stat cards + stall map (live / review) */
.t-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.t-stat { flex: 1 1 140px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 15px; }
.t-stat.accent { border-color: var(--accent); background: var(--accent-soft); }
.t-stat .k { font: 600 9.5px "IBM Plex Mono", monospace; color: var(--ink3); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .04em; }
.t-stat.accent .k { color: var(--accent); }
.t-stat .v { font-size: 26px; font-weight: 700; }
.t-stat.accent .v { color: var(--accent-ink); }
.t-stat .n { font-size: 11px; color: var(--ink2); margin-top: 2px; }

.t-stall { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 8px 17px; }
.t-stall-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.t-stall-row:last-child { border-bottom: none; }
.t-stall-row.hot { background: var(--accent-soft); margin: 0 -17px; padding-left: 17px; padding-right: 17px; }
.t-stall-row .lbl { flex: 0 0 150px; font-size: 12.5px; }
.t-stall-row .lbl .step { font: 600 9px "IBM Plex Mono", monospace; color: var(--ink3); }
.t-stall-row .lbl .nm { font-weight: 600; }
.t-bar { flex: 1; height: 11px; border-radius: 6px; background: var(--fill); overflow: hidden; display: flex; }
.t-bar > span { height: 100%; background: var(--accent); display: block; }
.t-bar > span.warm { background: var(--warm); }
.t-stall-row .cnt { flex: 0 0 120px; text-align: right; font-size: 11.5px; color: var(--ink3); }

/* the join-code / open-room card */
.t-room { border: 1px solid var(--line2); border-radius: 18px; background: var(--surface); padding: 30px; text-align: center; box-shadow: 0 8px 26px rgba(20, 40, 80, .1); max-width: 540px; margin: 0 auto; }
.t-code { font: 700 44px "IBM Plex Mono", monospace; letter-spacing: .06em; color: var(--accent); margin: 6px 0 14px; }

/* login scene (centered) */
.t-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.t-login { width: 100%; max-width: 380px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 30px; box-shadow: var(--shadow-lift); }
.t-login h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.t-login .t-input { margin-bottom: 12px; }
.t-login .t-btn { width: 100%; margin-top: 6px; }

/* the per-class practice control (embedded in a section row) */
.t-practice { flex-basis: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink2); }
.t-practice label { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; margin-top: 4px; }
.t-practice select { padding: 5px 8px; font-size: 12px; border: 1px solid var(--line2); border-radius: 7px; background: var(--paper); color: var(--ink); }
.t-practice .t-btn { margin-top: 8px; }

/* the class-profile / Review readout */
.class-profile h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.cp-meta { font: 600 11px "IBM Plex Mono", monospace; color: var(--ink3); margin-bottom: 14px; }
.cp-empty { color: var(--ink2); font-size: 13.5px; }
.cp-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cp-action { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 11px; background: var(--surface); padding: 13px 15px; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.cp-action.cp-low { border-left-color: var(--ink3); }

/* a small "preview / not built yet" ribbon for the stub screens */
.t-preview-note { display: inline-flex; align-items: center; gap: 7px; font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .06em; color: var(--warm-text); background: var(--warm-soft); border: 1px solid #e8dccf; padding: 5px 10px; border-radius: 7px; margin-bottom: 16px; }

/* the answer-free student-view disclosure on a library row (what students see, safe to project) */
.t-student-view { margin-top: 8px; }
.t-student-view > summary { display: inline-block; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent, #3a6ea5); }
.t-student-problem { margin-top: 6px; padding: 10px 12px; background: #f4f6f9; border: 1px solid #e2e7ee; border-radius: 8px; font-size: 13.5px; white-space: pre-wrap; }

/* the authoring step editor (AI-drafted, teacher-edited reasoning steps) */
.t-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.t-steps-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.t-btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.t-hint { font-size: 12px; color: var(--ink2); line-height: 1.5; margin: 4px 0 10px; }
.t-step { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 9px; align-items: center; margin-bottom: 8px; }
.t-step .t-input { margin: 0; }
.t-step .t-input.mono { font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.t-step .t-check { margin: 0; white-space: nowrap; }
.t-step.is-final { grid-template-columns: 1fr auto; padding: 11px 13px; border: 1px dashed var(--line2); border-radius: 11px; background: var(--fill); margin-top: 4px; }
.t-step-final-label { font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.t-step.is-final .t-code { font-size: 20px; margin: 0; }

@media (max-width: 560px) { .t-row-2 { grid-template-columns: 1fr; } .t-step { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .t-sidebar { flex-basis: 100%; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }
  .t-app { flex-direction: column; }
  .t-brand { padding: 0 8px 0 0; }
  .t-user, .t-nav-item .lbl { display: none; }
  .t-nav { flex-direction: row; }
  .t-nav-group { flex-direction: row; padding: 0; background: none; }
  .t-nav-item.sub { margin-left: 0; padding: 10px 11px; }
  .t-nav-item.sub::before { display: none; }
}

/* ── 2026-07-05 UX pass: the prep result bar + the in-flight "working" affordance ── */
.t-prep-result { margin-top: 18px; }
.t-prep-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.t-prep-bar-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--ink3); }
.t-prep-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* ── 2026-07-06 UX-3: the FORMATTED prep result (raw markdown stays in the hidden .t-prep-out) ── */
.t-prep-rich { color: var(--ink); font-size: 14.5px; line-height: 1.65; overflow-wrap: break-word; }
.t-prep-rich h3, .t-prep-rich h4, .t-prep-rich h5 {
  margin: 18px 0 8px; color: var(--ink); line-height: 1.3;
}
.t-prep-rich h3 { font-size: 18px; }
.t-prep-rich h4 { font-size: 16px; }
.t-prep-rich h5 { font-size: 14.5px; letter-spacing: .01em; }
.t-prep-rich p { margin: 8px 0; }
.t-prep-rich ul, .t-prep-rich ol { margin: 8px 0 8px 22px; padding: 0; }
.t-prep-rich li { margin: 4px 0; }
.t-prep-rich li > ul, .t-prep-rich li > ol { margin-top: 4px; margin-bottom: 4px; }
.t-prep-rich hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.t-working {
  display: none; align-items: center; gap: 8px; margin-right: auto;
  color: var(--ink2); font-size: 12.5px; font-weight: 600;
}
.t-working.htmx-request { display: flex; }
.t-working-dots { display: inline-flex; gap: 3px; }
.t-working-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: t-working-bounce 1.2s infinite ease-in-out;
}
.t-working-dots i:nth-child(2) { animation-delay: 0.15s; }
.t-working-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes t-working-bounce {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ── the Help video-demo section (2026-07-05) ── */
.t-demo-grid { display: flex; flex-direction: column; gap: 22px; margin-top: 14px; }
.t-demo { margin: 0; }
.t-demo figcaption { font-size: 13px; color: var(--ink2); line-height: 1.55; margin-bottom: 8px; }
.t-demo img {
  width: 100%; max-width: 780px; border: 1px solid var(--line); border-radius: 12px; display: block;
  box-shadow: 0 1px 3px rgba(20,40,80,.07);
}
