/* PPFA Instructor Lab — projector-optimized academic theme (spec §27).
   Related to the Student Lab but distinct instructor identity (indigo accent,
   larger base type). High contrast, keyboard-friendly, reduced-motion aware. */

:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #eceef4;
  --ink: #1a1c22;
  --ink-soft: #4c4f59;
  --line: #d5d8e2;
  --brand: #3b3a8f;          /* indigo — instructor identity (vs student teal) */
  --brand-soft: #e7e7f5;
  --accent: #8a5a2b;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --stop: #9a2b2b;
  --focus: #1a73c9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --maxw: 1000px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --base: 17px;
}
:root[data-theme="dark"] {
  --bg: #14151a; --surface: #1d1f27; --surface-2: #23262f; --ink: #edeef3; --ink-soft: #b7bac6;
  --line: #333747; --brand: #9a99e0; --brand-soft: #262747; --accent: #cf9a5e; --ok: #79c187;
  --warn: #e0b667; --stop: #e08a8a; --focus: #7fb2ff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--base); line-height: 1.6; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* header — instructor identity */
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem;
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.app-header a, .app-header .brand-sub { color: #fff; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-mark { font-size: 1.7rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; }
.brand-sub { font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.header-controls { display: flex; align-items: center; gap: .5rem; }
.build-chip { font-size: .72rem; opacity: .85; }

.btn { font: inherit; font-size: .9rem; cursor: pointer; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: .5rem .85rem; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.app-header .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.app-header .btn:hover { background: rgba(255,255,255,.25); }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-big { font-size: 1.15rem; padding: .8rem 1.5rem; margin-top: 1rem; display: inline-block; }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.layout { display: flex; min-height: calc(100vh - 60px); }
.sidenav { width: 230px; flex: 0 0 230px; background: var(--surface); border-right: 1px solid var(--line);
  padding: .8rem .5rem; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem; border-radius: 8px; color: var(--ink);
  text-decoration: none; font-size: .95rem; margin-bottom: 2px; }
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-link .ni { width: 1.4rem; text-align: center; }

.main { flex: 1 1 auto; min-width: 0; }
.view { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.3rem 4rem; }
.loading { color: var(--ink-soft); }

h1 { font-size: 1.9rem; margin: .2rem 0 .5rem; }
h2 { font-size: 1.35rem; margin:1.5rem 0 .5rem; }
h3 { font-size: 1.08rem; }
.page-kicker { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.lead { color: var(--ink-soft); font-size: 1.05rem; }
.prose { font-family: var(--serif); }
.muted { color: var(--ink-soft); } .hint { font-size: .85rem; color: var(--ink-soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow); margin: .8rem 0; }
.card.feature { border-left: 5px solid var(--brand); }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand); }
.tile-title { font-weight: 650; margin-bottom: .2rem; }
.tile-sub { font-size: .85rem; color: var(--ink-soft); }

.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: .8rem 0; }
.callout.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.callout.stop { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); }
.pill { font-size: .8rem; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); display: inline-block; }
.pill-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
ul, ol { margin: .4rem 0; padding-left: 1.3rem; } li { margin: .25rem 0; }

/* sequence + take-home + cue */
.sequence { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: .4rem; }
.sequence li { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border-radius: 8px; padding: .4rem .6rem; }
.seq-n { font-weight: 700; color: var(--brand); }
.cue { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; }
.cue-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #fff; background: var(--brand); border-radius: 4px; padding: .1rem .45rem; margin-right: .5rem; }
.takehome { font-size: 1.15rem; font-weight: 600; }

/* reveal card */
.reveal-card .reveal-head { display: flex; align-items: center; gap: .6rem; }
.reveal-card .reveal-head h3 { flex: 1; margin: 0; }
.reveal-body { margin-top: .6rem; }
.instructor-note { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

/* demonstration + compare */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.demo-grid .mistake { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: .5rem; color: var(--stop); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.compare .good { border-left: 3px solid var(--ok); padding-left: .7rem; }
.compare .bad { border-left: 3px solid var(--stop); padding-left: .7rem; }
.qa-opts { list-style: none; padding-left: .5rem; } .qa-correct { color: var(--ok); font-weight: 650; }

/* teaching mode */
.teach-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.teach-tools { display: flex; gap: .5rem; }
.lesson-title { margin-top: .3rem; }
.lesson-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.lesson-bar > span, .bar > span { display: block; height: 100%; background: var(--brand); }
.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.teach-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.panel-count { color: var(--ink-soft); font-size: .9rem; }
.teach-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: .8rem; }
#panel .card { font-size: 1.05rem; }
#panel h3 { font-size: 1.2rem; color: var(--brand); }

/* timer */
.timer { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.timer-clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.5em; }
.timer-plan { font-size: .8rem; color: var(--ink-soft); margin-left: auto; }

.component h2 { color: var(--brand); }
.step-card h3 { color: var(--brand); }
.qcard { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.step-actions { margin-top: .7rem; display: flex; gap: .5rem; flex-wrap: wrap; }
textarea { width: 100%; font: inherit; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }

.app-footer { border-top: 1px solid var(--line); background: var(--surface); }
.app-footer p { max-width: var(--maxw); margin: 0 auto; padding: .9rem 1.3rem; font-size: .82rem; color: var(--ink-soft); }

/* ---------------- CLASSROOM MODE (projector) ---------------- */
body.classroom { --base: 22px; }
body.classroom .app-header, body.classroom .sidenav, body.classroom .app-footer,
body.classroom .teach-foot, body.classroom .crumb { display: none !important; }
body.classroom .layout { display: block; }
body.classroom .view { max-width: 1400px; padding: 2rem 3rem 6rem; }
body.classroom h1 { font-size: 2.6rem; }
body.classroom #panel h3 { font-size: 2rem; }
body.classroom #panel .card { font-size: 1.5rem; line-height: 1.5; }
body.classroom .btn { font-size: 1.1rem; padding: .7rem 1.2rem; }
.exit-classroom { position: fixed; top: 1rem; right: 1rem; z-index: 200; }

/* mobile */
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .layout { display: block; }
  .sidenav { position: static; width: auto; height: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); display: none; }
  .sidenav.open { display: block; }
  .nav-toggle { display: inline-flex; }
  .demo-grid, .compare { grid-template-columns: 1fr; }
  .app-header { flex-wrap: wrap; gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .app-header, .sidenav, .teach-nav, .teach-tools, .exit-classroom, .skip-link { display: none !important; } .layout { display: block; } }

/* ---------------- v1.0 quality enhancements ---------------- */
.kbd-hint { font-size: .8rem; color: var(--ink-soft); text-align: center; margin: .3rem 0 0; }
.card.conclude { border-left: 5px solid var(--ok); }
.card.role .tile-title { color: var(--brand); }
/* Prepare / print full lesson plan */
.prepare-doc .prep-part { border-top: 1px solid var(--line); padding: .6rem 0; }
.prepare-doc .prep-part h3 { color: var(--brand); margin: .2rem 0 .4rem; }
.prepare-doc .prep-part:first-of-type { border-top: 0; }
@media print {
  .teach-top, .teach-nav, .kbd-hint, .lesson-bar, #timer-wrap { display: none !important; }
  .prepare-doc .prep-part { break-inside: avoid; }
  .reveal-body { display: block !important; }
  .reveal-btn { display: none !important; }
  a[href]:after { content: ""; }
}
