/* =========================================================
   PathwayPro Science
   Life Sciences and Physical Sciences Grade 10 to 12,
   Natural Sciences Grade 7 to 9
   Family palette: #cca300 gold, #c76639 terracotta, #a2b4b4 sage
   ========================================================= */

:root {
  --ink: #253238;
  --ink-soft: #3a4a52;
  --mist: #b9b9c3;
  --gold: #cca300;
  --terra: #c76639;
  --sage: #a2b4b4;
  --rust: #983400;

  --gold-soft: #f4e6a8;
  --gold-glow: #ffe98a;
  --terra-soft: #f0c3ab;
  --sage-soft: #d7e0e0;
  --paper: #fbf8f0;
  --paper-2: #fffdf8;
  --card: #ffffff;
  --green: #4a7c59;
  --green-soft: #dcebe1;

  --shadow-sm: 0 2px 8px rgba(37, 50, 56, 0.08);
  --shadow-md: 0 10px 30px rgba(37, 50, 56, 0.12);
  --shadow-lg: 0 24px 60px rgba(37, 50, 56, 0.18);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 36px;

  --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--gold-soft) 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 10%, var(--terra-soft) 0%, transparent 50%),
    linear-gradient(160deg, var(--paper) 0%, var(--sage-soft) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

.hidden { display: none !important; }

/* ---------- Layout shell ---------- */
.app-shell { max-width: 1100px; margin: 0 auto; padding: 20px 18px 130px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: flex-end; gap: 12px; }
.topbar-spacer { flex: 1; }
.header-logo { height: 30px; width: auto; display: block; }
.header-role {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--sage); align-self: flex-end; margin-bottom: 2px; white-space: nowrap;
}
.landing-logo { width: 100%; max-width: 460px; height: auto; display: block; margin: 6px auto 14px; }
.avatar-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--card);
  padding: 8px 14px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow-sm);
  border: 2px solid var(--gold-soft); font-size: 0.9rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--ink) 0%, #2f4149 100%);
  color: #fff; border-radius: var(--r-xl); padding: 26px 28px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 22px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%); opacity: 0.35;
}
.hero-eyebrow { font-size: 0.8rem; font-weight: 800; color: var(--sage); text-transform: uppercase; letter-spacing: 0.12em; }
.hero h1 { font-size: 1.8rem; font-weight: 900; margin: 4px 0 10px; letter-spacing: -0.02em; }
.hero p { color: var(--mist); max-width: 52ch; font-weight: 600; }
.hero-metrics { display: flex; gap: 22px; margin-top: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-metric .v { font-size: 1.7rem; font-weight: 900; }
.hero-metric .v.gold { color: var(--gold-glow); }
.hero-metric .v.terra { color: var(--terra); }
.hero-metric .v.sage { color: var(--sage); }
.hero-metric .l { font-size: 0.78rem; color: var(--mist); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: center; gap: 10px; margin: 26px 4px 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.01em; }
.section-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--terra); flex: none; }
.section-head .link { margin-left: auto; font-size: 0.85rem; font-weight: 800; color: var(--terra); }
.link { font-weight: 800; color: var(--terra); font-size: 0.9rem; }

/* ---------- Grid and cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid rgba(37,50,56,0.05); }
.stat { text-align: center; }
.stat .icon { color: var(--terra); line-height: 1; }
.stat .v { font-size: 1.6rem; font-weight: 900; margin-top: 4px; }
.stat .l { font-size: 0.78rem; color: var(--sage); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 800; font-size: 0.95rem;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--terra) 100%); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-terra { background: var(--terra); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.mini-btn { padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; background: var(--paper); color: var(--ink); border: 2px solid var(--sage-soft); }
.mini-btn.done { background: var(--green); color: #fff; border-color: var(--green); }
.mini-btn.danger:hover { border-color: var(--rust); color: var(--rust); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 800; font-size: 0.88rem; margin-bottom: 7px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--r-md);
  border: 2px solid var(--sage-soft); background: var(--paper-2);
  font-size: 1rem; font-weight: 600; color: var(--ink); transition: border-color .14s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 84px; }
.hint { font-size: 0.82rem; color: var(--sage); font-weight: 700; margin-top: 6px; }
.hint.accent { color: var(--terra); }

/* ---------- Onboarding / auth ---------- */
.onboard { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.onboard-card {
  background: var(--card); border-radius: var(--r-xl); padding: 34px 30px;
  max-width: 470px; width: 100%; box-shadow: var(--shadow-lg); text-align: center;
}
.onboard-card .big-logo {
  width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 18px;
  background: linear-gradient(140deg, var(--gold) 0%, var(--terra) 100%);
  display: grid; place-items: center; box-shadow: var(--shadow-md); color: #fff;
}
.big-logo .ic { display: block; margin: auto; }
.onboard-card h1 { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; }
.onboard-card .tag { color: var(--sage); font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; margin-bottom: 18px; }
.onboard-card p.lead { color: var(--ink-soft); font-weight: 600; margin-bottom: 22px; }
.text-left { text-align: left; }
.demo-note {
  background: var(--sage-soft); border-radius: var(--r-md); padding: 14px 18px;
  font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; text-align: left; margin-top: 16px;
}
.demo-note strong { color: var(--ink); }
.demo-note .dn-row { margin-top: 6px; }
.code-pill { display: inline-block; background: var(--ink); color: var(--gold-glow); border-radius: 8px; padding: 1px 8px; font-family: var(--mono); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; }

/* name grid + pin pad (learner login) */
.name-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 360px; overflow-y: auto; padding: 4px; }
.name-pill {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--paper); border: 2px solid var(--sage-soft); font-weight: 800; text-align: left;
  transition: all .14s ease; color: var(--ink);
}
.name-pill:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.name-pill .np-av { width: 36px; height: 36px; border-radius: 10px; background: var(--sage-soft); display: grid; place-items: center; flex: none; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 8px 0 20px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--sage-soft); border: 2px solid var(--sage); transition: all .12s ease; }
.pin-dot.filled { background: var(--terra); border-color: var(--terra); transform: scale(1.1); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0);} 20%,60%{transform:translateX(-8px);} 40%,80%{transform:translateX(8px);} }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 280px; margin: 0 auto; }
.pin-key { padding: 18px 0; border-radius: var(--r-md); background: var(--paper); font-size: 1.4rem; font-weight: 900; color: var(--ink); border: 2px solid var(--sage-soft); transition: all .1s ease; }
.pin-key:hover { background: var(--gold-soft); border-color: var(--gold); }
.pin-key:active { transform: scale(0.94); }
.pin-key .ic { vertical-align: middle; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; background: rgba(255,255,255,0.6); padding: 6px; border-radius: 999px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.tab { flex: 1; padding: 11px 14px; border-radius: 999px; font-weight: 800; color: var(--ink-soft); transition: all .14s ease; white-space: nowrap; }
.tab.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }

.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subtab { padding: 9px 18px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; background: var(--card); color: var(--ink-soft); border: 2px solid var(--sage-soft); transition: all .14s ease; }
.subtab.active { background: var(--terra); border-color: var(--terra); color: #fff; }

/* ---------- Views ---------- */
.view { animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Bottom nav (learner) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(37,50,56,0.08);
  display: flex; justify-content: space-around; padding: 8px 6px 10px;
  z-index: 40; box-shadow: 0 -6px 24px rgba(37,50,56,0.08);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: 14px; color: var(--sage); font-weight: 800; font-size: 0.68rem;
  transition: color .14s ease, background .14s ease; flex: 1; max-width: 110px;
}
.nav-item .ni { display: grid; place-items: center; height: 24px; }
.nav-item.active { color: var(--terra); background: var(--terra-soft); }

/* ---------- Course picker cards ---------- */
.phase-card {
  text-align: left; width: 100%; border-radius: var(--r-lg); padding: 20px; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease; min-height: 132px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.phase-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.phase-card .pc-ic { opacity: 0.9; display: block; }
/* these are spans inside a button, so they need to be told to stack */
.phase-card .pc-title { display: block; font-weight: 900; font-size: 1.05rem; margin-top: 8px; line-height: 1.25; }
.phase-card .pc-sub { display: block; font-size: 0.78rem; opacity: 0.92; font-weight: 700; margin-top: 2px; }
.phase-card .pc-progress { display: block; margin-top: 10px; }
.phase-card .pc-progress .progress-track { display: block; }
.pc-gold { background: linear-gradient(140deg, var(--gold) 0%, #b08d00 100%); }
.pc-terra { background: linear-gradient(140deg, var(--terra) 0%, var(--rust) 100%); }
.pc-sage { background: linear-gradient(140deg, #7f9a9a 0%, var(--sage) 100%); }
.pc-ink { background: linear-gradient(140deg, var(--ink) 0%, #35474f 100%); }
.pc-green { background: linear-gradient(140deg, #3d6b4f 0%, var(--green) 100%); }

/* ---------- Progress bars ---------- */
.progress-track { height: 12px; border-radius: 999px; background: var(--sage-soft); overflow: hidden; }
.progress-track.on-dark { background: rgba(255,255,255,0.25); }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--terra)); transition: width .4s ease; min-width: 0; }
.progress-fill.green { background: linear-gradient(90deg, #6aa47f, var(--green)); }
.progress-line { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.progress-line .pl-label { font-weight: 800; font-size: 0.85rem; width: 76px; flex: none; color: var(--ink-soft); }
.progress-line .progress-track { flex: 1; }
.progress-line .pl-pct { font-weight: 900; font-size: 0.85rem; width: 44px; text-align: right; flex: none; }

/* ---------- Week list ---------- */
.week-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; background: var(--card); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); margin-bottom: 10px; border: 2px solid transparent;
  transition: all .14s ease; color: var(--ink);
}
.week-row:hover { border-color: var(--gold); transform: translateY(-1px); }
.week-row .wk-num {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 900; flex: none; background: var(--paper); color: var(--ink-soft);
  border: 2px solid var(--sage-soft); font-size: 0.8rem; text-align: center; line-height: 1.1;
}
.week-row.done .wk-num { background: var(--green); border-color: var(--green); color: #fff; }
.week-row.taught-only .wk-num { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.week-row .wk-body { flex: 1; min-width: 0; }
.week-row .wk-topic { font-weight: 800; font-size: 0.95rem; }
.week-row .wk-meta { font-size: 0.78rem; color: var(--sage); font-weight: 700; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.week-row .wk-arrow { color: var(--mist); font-weight: 900; flex: none; }
.status-tag { display: inline-block; font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; border-radius: 999px; padding: 2px 9px; }
.status-tag.done { background: var(--green-soft); color: var(--green); }
.status-tag.taught { background: var(--gold-soft); color: #8a6f00; }
.status-tag.pending { background: var(--terra-soft); color: var(--rust); }
.status-tag.approved { background: var(--green-soft); color: var(--green); }
.status-tag.lab { background: var(--sage-soft); color: #4f6b6b; display: inline-flex; align-items: center; gap: 4px; }
.status-tag.prac { background: var(--terra-soft); color: var(--rust); display: inline-flex; align-items: center; gap: 4px; }
.status-tag.sba { background: var(--ink); color: var(--gold-glow); display: inline-flex; align-items: center; gap: 4px; }

/* strand chips */
.strand-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-weight: 800; font-size: 0.72rem; border: 2px solid var(--sage-soft); background: #fff; color: var(--ink-soft);
}

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(37,50,56,0.55); backdrop-filter: blur(3px);
  z-index: 70; display: grid; place-items: center; padding: 18px; overflow-y: auto;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper-2); border-radius: var(--r-lg); max-width: 760px; width: 100%;
  max-height: calc(100vh - 60px); overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: popIn .25s ease; -webkit-overflow-scrolling: touch;
}
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: flex-start; gap: 12px;
  background: linear-gradient(135deg, var(--ink) 0%, #2f4149 100%); color: #fff;
  padding: 20px 22px; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-head .mh-eyebrow { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--sage); }
.modal-head h2 { font-size: 1.2rem; font-weight: 900; margin-top: 3px; letter-spacing: -0.01em; }
.modal-head .mh-close { margin-left: auto; flex: none; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; display: grid; place-items: center; }
.modal-head .mh-close:hover { background: rgba(255,255,255,0.25); }
.mh-close .ic { display: block; margin: auto; }
.modal-body { padding: 20px 22px 26px; }

.detail-block { margin-bottom: 18px; }
.detail-block .db-label {
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--terra); margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.detail-block .db-body { font-weight: 600; font-size: 0.94rem; color: var(--ink-soft); line-height: 1.55; }
.detail-block .db-body p { margin-bottom: 8px; }
.detail-block .db-body p:last-child { margin-bottom: 0; }
.detail-block .db-body ul, .detail-block .db-body ol { padding-left: 20px; margin: 4px 0; }
.detail-block .db-body li { margin-bottom: 6px; }
.detail-block .db-body code { font-family: var(--mono); font-size: 0.85em; background: var(--sage-soft); border-radius: 6px; padding: 1px 6px; }
.detail-block .db-body h4 { font-size: 1rem; font-weight: 900; color: var(--ink); margin: 12px 0 6px; }

.big-idea {
  background: linear-gradient(120deg, #fffdf8 0%, #f6f0e2 100%);
  border-left: 5px solid var(--gold); border-radius: var(--r-md); padding: 14px 16px;
}
.big-idea .db-label { color: #8a6f00; }

/* vocabulary */
.vocab-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-row { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; }
.vocab-row .vt { font-weight: 900; font-size: 0.86rem; color: var(--ink); flex: none; min-width: 118px; }
.vocab-row .vm { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Digital labs (PhET embeds and LabXchange links) ---------- */
.lab-section { margin-top: 22px; }
.lab-section:not(:empty) { border-top: 2px dashed var(--sage); padding-top: 18px; }
.lab-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.lab-head .ic { color: var(--sage); flex: none; }
.lab-head .gh-title { font-weight: 900; font-size: 1rem; color: var(--ink); }
.lab-card {
  background: var(--card); border: 2px solid var(--sage-soft); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 12px;
}
.lab-card-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; }
.lab-card-head .ic { color: var(--terra); flex: none; }
.lab-card-title { font-weight: 900; font-size: 0.92rem; flex: 1; min-width: 0; }
.lab-provider {
  font-size: 0.62rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 9px; border-radius: 999px; background: var(--sage-soft); color: #4f6b6b; flex: none;
}
.lab-provider.phet { background: var(--gold-soft); color: #8a6f00; }
.lab-provider.labxchange { background: var(--terra-soft); color: var(--rust); }
.lab-what { padding: 0 14px 12px; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55; }

/* the embed poster: a still frame with a play control, so opening a week does not
   pull several megabytes of simulation before anyone asks for it */
.lab-poster {
  position: relative; display: block; width: 100%; border: none; padding: 0;
  background: var(--ink); cursor: pointer; line-height: 0;
}
.lab-poster img { width: 100%; display: block; opacity: 0.82; transition: opacity .15s ease; }
.lab-poster:hover img { opacity: 1; }
.lab-poster .lp-play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.lab-poster .lp-play span {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.94); color: var(--ink); box-shadow: var(--shadow-md);
  transition: transform .15s ease;
}
.lab-poster:hover .lp-play span { transform: scale(1.08); }
.lab-poster .lp-hint {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  background: linear-gradient(transparent, rgba(37,50,56,0.85));
  color: #fff; font-size: 0.74rem; font-weight: 800; text-align: left; line-height: 1.3;
}
.lab-frame-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--ink); }
.lab-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lab-frame-wrap.loading::after {
  content: "Loading the simulation..."; position: absolute; inset: 0;
  display: grid; place-items: center; color: var(--sage); font-weight: 800; font-size: 0.85rem;
}
.lab-do { padding: 12px 14px; border-top: 1px solid var(--sage-soft); }
.lab-do .ld-label {
  display: block; font-size: 0.64rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sage); margin-bottom: 6px;
}
.lab-do ol { padding-left: 18px; margin: 0; }
.lab-do li { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; margin-bottom: 5px; }
.lab-look {
  margin: 10px 14px 14px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 0.83rem; line-height: 1.45;
}
.lab-links { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px; }
.lab-link {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  background: var(--ink); color: #fff; border-radius: var(--r-md);
  padding: 13px 16px; font-weight: 800; font-size: 0.88rem; min-height: 46px;
  transition: filter .14s ease, transform .12s ease;
}
.lab-link:hover { filter: brightness(1.12); transform: translateY(-1px); }
.lab-link .ic { color: var(--gold-glow); flex: none; }
.lab-link .ll-ext { margin-left: auto; opacity: 0.7; flex: none; }
.lab-note {
  display: flex; gap: 8px; align-items: flex-start; padding: 0 14px 14px;
  font-size: 0.78rem; font-weight: 600; color: var(--sage); line-height: 1.5;
}
.lab-note .ic { flex: none; margin-top: 2px; }
.lab-offline {
  padding: 16px 14px; background: var(--paper); text-align: left;
}
.lab-offline .lo-head { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 0.9rem; margin-bottom: 8px; }
.lab-offline .lo-head .ic { color: var(--terra); }
.lab-offline p { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55; margin-bottom: 10px; }

/* ---------- Practical write-ups ---------- */
.prac-section { margin-top: 22px; }
.prac-section:not(:empty) { border-top: 2px dashed var(--terra); padding-top: 18px; }
.prac-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 15px; background: var(--card); border-radius: var(--r-md);
  border: 2px solid var(--terra-soft); margin-bottom: 10px; color: var(--ink);
  transition: all .14s ease;
}
.prac-row:hover { border-color: var(--terra); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.prac-row .pr-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--terra-soft); color: var(--rust); flex: none; }
.prac-row .pr-body { flex: 1; min-width: 0; }
.prac-row .pr-title { font-weight: 900; font-size: 0.92rem; }
.prac-row .pr-meta { font-size: 0.75rem; font-weight: 700; color: var(--sage); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.prac-meta-grid { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.prac-chip { font-size: 0.7rem; font-weight: 800; background: var(--terra-soft); color: var(--rust); padding: 4px 11px; border-radius: 999px; }
.prac-chip.time { background: var(--sage-soft); color: #4f6b6b; }
.prac-chip.sba { background: var(--ink); color: var(--gold-glow); }

.safety-card {
  background: #fff5f0; border: 2px solid var(--terra-soft); border-left: 5px solid var(--rust);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px;
}
.safety-card .sf-head { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rust); margin-bottom: 8px; }
.safety-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.safety-row:last-child { margin-bottom: 0; }
.safety-level {
  flex: none; font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 999px; padding: 3px 8px; margin-top: 1px; min-width: 52px; text-align: center;
}
.safety-level.high { background: var(--rust); color: #fff; }
.safety-level.medium { background: var(--gold); color: #fff; }
.safety-level.low { background: var(--sage-soft); color: #4f6b6b; }

.apparatus-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.apparatus-item { background: var(--paper); border-radius: var(--r-sm); padding: 9px 12px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); }
.apparatus-item .ap-qty { color: var(--terra); font-weight: 900; }
.apparatus-item .ap-note { display: block; font-size: 0.74rem; font-weight: 600; color: var(--sage); margin-top: 2px; }

.method-list { counter-reset: step; padding-left: 0; list-style: none; }
.method-list li {
  display: flex; gap: 11px; align-items: flex-start; margin-bottom: 10px;
  font-size: 0.89rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55;
}
.method-list li::before {
  counter-increment: step; content: counter(step);
  flex: none; width: 25px; height: 25px; border-radius: 50%; background: var(--terra); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 0.74rem; margin-top: 1px;
}

/* results table the learner fills in */
.results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 320px; }
.results-table caption { text-align: left; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sage); padding-bottom: 8px; }
.results-table th {
  text-align: left; font-size: 0.72rem; font-weight: 900; color: var(--ink);
  background: var(--sage-soft); padding: 9px 11px; white-space: nowrap;
}
.results-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.results-table th:last-child { border-radius: 0 var(--r-sm) 0 0; }
.results-table td { padding: 0; border: 1px solid var(--sage-soft); }
.results-table input {
  width: 100%; border: none; background: transparent; padding: 9px 11px;
  font-size: 0.86rem; font-weight: 700; color: var(--ink); font-family: var(--font);
}
.results-table input:focus { outline: 2px solid var(--gold); outline-offset: -2px; background: var(--paper-2); }
.results-table input[readonly] { background: var(--paper); color: var(--ink-soft); font-weight: 800; }

.conclusion-frame {
  background: var(--paper); border-left: 5px solid var(--sage); border-radius: var(--r-md);
  padding: 13px 15px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft);
  line-height: 1.6; font-style: italic;
}
.question-list { padding-left: 0; list-style: none; }
.question-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-bottom: 1px solid var(--sage-soft); font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55;
}
.question-list li:last-child { border-bottom: none; }
.question-list .qn { flex: none; font-weight: 900; color: var(--terra); min-width: 22px; }
.question-list .qmarks { flex: none; margin-left: auto; font-weight: 900; font-size: 0.76rem; color: var(--sage); white-space: nowrap; }

/* ---------- Facilitator guide and memo (facilitator role only) ---------- */
.guide-section { margin-top: 22px; }
.guide-section:not(:empty) { border-top: 2px dashed var(--gold); padding-top: 18px; margin-bottom: 18px; }
.guide-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.guide-head .ic { color: var(--terra); flex: none; }
.guide-head .gh-title { font-weight: 900; font-size: 1rem; color: var(--ink); }
.guide-tag {
  font-size: 0.64rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--terra-soft); color: var(--rust); padding: 3px 10px; border-radius: 999px;
}
.guide-block {
  background: var(--paper); border: 2px solid var(--sage-soft); border-radius: var(--r-md);
  margin-bottom: 10px; overflow: hidden;
}
.guide-block summary {
  list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-weight: 900; font-size: 0.88rem; cursor: pointer; color: var(--ink-soft);
}
.guide-block summary::-webkit-details-marker { display: none; }
.guide-block summary::after { content: "\002B"; margin-left: auto; font-weight: 900; font-size: 1.05rem; color: var(--sage); }
.guide-block[open] summary::after { content: "\2212"; }
.guide-block summary .ic { color: var(--terra); flex: none; }
.guide-block .gb-body { padding: 0 14px 14px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55; }
.guide-block .gb-body p { margin-bottom: 8px; }
.guide-block .gb-body p:last-child { margin-bottom: 0; }
.guide-list { padding-left: 18px; margin: 0; }
.guide-list li { margin-bottom: 9px; }
.guide-list li:last-child { margin-bottom: 0; }
.flow-item { display: flex; gap: 10px; margin-bottom: 9px; align-items: flex-start; }
.flow-time {
  flex: none; font-weight: 900; color: var(--rust); font-size: 0.72rem;
  background: var(--terra-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; margin-top: 1px;
}
.wrong-card {
  background: #fff; border: 2px solid var(--sage-soft); border-left: 4px solid var(--terra);
  border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 10px;
}
.wrong-card:last-child { margin-bottom: 0; }
.wc-row { display: flex; gap: 10px; margin-bottom: 7px; align-items: flex-start; }
.wc-row:last-child { margin-bottom: 0; }
.wc-label {
  flex: none; width: 84px; font-weight: 900; font-size: 0.64rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--terra); padding-top: 3px;
}
.guide-loading { font-weight: 700; color: var(--sage); font-size: 0.85rem; }

/* marking guideline table */
.mark-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.mark-table th {
  text-align: left; font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--sage); padding: 6px 10px 6px 0; border-bottom: 2px solid var(--sage-soft);
}
.mark-table td { vertical-align: top; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--sage-soft); font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.mark-table .mt-marks { font-weight: 900; color: var(--terra); white-space: nowrap; text-align: right; }
.mark-table .mt-total td { font-weight: 900; color: var(--ink); border-bottom: none; }
.expect-callout {
  background: linear-gradient(120deg, #fffdf8 0%, #f6f0e2 100%);
  border-left: 5px solid var(--gold); border-radius: var(--r-md);
  padding: 13px 15px; margin-top: 12px; font-weight: 700; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55;
}
.expect-callout .ec-label { display: block; font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: #8a6f00; margin-bottom: 4px; }

/* ---------- Evidence ---------- */
.photo-drop {
  width: 100%; padding: 26px 16px; border-radius: var(--r-md);
  border: 2px dashed var(--sage); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink-soft); font-weight: 800; transition: all .14s ease; cursor: pointer;
}
.photo-drop:hover { border-color: var(--gold); background: var(--gold-soft); }
.evidence-preview img { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.evidence-card { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid rgba(37,50,56,0.05); }
.evidence-card img.ev-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.evidence-card .ev-body { padding: 14px 16px 16px; }
.evidence-card .ev-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.evidence-card .ev-who { font-weight: 900; font-size: 0.9rem; }
.evidence-card .ev-where { font-size: 0.75rem; color: var(--sage); font-weight: 800; }
.evidence-card .ev-caption { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.evidence-card .ev-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.review-box { background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; margin-top: 10px; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); }
.review-box .rb-row { display: flex; gap: 8px; margin-bottom: 5px; align-items: flex-start; }
.review-box .rb-row:last-child { margin-bottom: 0; }
.review-box .rb-ico { display: flex; align-items: center; height: 1.3em; flex: none; }
.review-box .rb-ico .ic { color: var(--gold); }

/* ---------- Class overview grid ---------- */
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.matrix { border-collapse: separate; border-spacing: 4px; min-width: 560px; }
.matrix th { font-size: 0.7rem; font-weight: 900; color: var(--sage); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 6px; text-align: center; }
.matrix th.mx-name { text-align: left; min-width: 130px; }
.matrix td { text-align: center; }
.matrix td.mx-name { text-align: left; font-weight: 800; font-size: 0.85rem; white-space: nowrap; padding-right: 8px; }
.mx-cell { width: 30px; height: 30px; border-radius: 8px; background: var(--paper); border: 2px solid var(--sage-soft); display: inline-grid; place-items: center; font-size: 0.72rem; font-weight: 900; }
.mx-cell.taught { background: var(--gold-soft); border-color: var(--gold); }
.mx-cell.done { background: var(--green); border-color: var(--green); color: #fff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.legend .li { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); }
.legend .sw { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--sage-soft); background: var(--paper); }
.legend .sw.taught { background: var(--gold-soft); border-color: var(--gold); }
.legend .sw.done { background: var(--green); border-color: var(--green); }

/* ---------- Badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
.badge-item { text-align: center; }
.badge-medal {
  width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sage-soft); color: var(--sage); opacity: 0.5;
}
.badge-item.earned .badge-medal {
  background: linear-gradient(140deg, var(--gold-glow), var(--gold)); color: #fff;
  opacity: 1; box-shadow: 0 6px 18px rgba(204,163,0,0.4);
}
.badge-item .bname { font-size: 0.74rem; font-weight: 800; color: var(--ink-soft); }
.badge-item .bhow { font-size: 0.68rem; font-weight: 700; color: var(--sage); margin-top: 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px;
  font-weight: 800; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all .3s ease; z-index: 95; display: flex; align-items: center; gap: 10px; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .em { display: inline-flex; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--sage); font-weight: 700; }
.empty .big { display: block; margin-bottom: 8px; line-height: 1; }
.empty .big .ic { color: var(--sage); }

/* ---------- Portfolio ---------- */
.portfolio-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.portfolio-head .pf-av { width: 64px; height: 64px; border-radius: 18px; background: var(--gold-soft); display: grid; place-items: center; flex: none; }
.portfolio-head h2 { font-size: 1.4rem; font-weight: 900; }
.portfolio-head .pf-sub { color: var(--sage); font-weight: 800; font-size: 0.85rem; }

/* ---------- Storage meter ---------- */
.storage-note { font-size: 0.78rem; font-weight: 700; color: var(--sage); display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.storage-note .sn-track { flex: 1; max-width: 160px; height: 6px; border-radius: 999px; background: var(--sage-soft); overflow: hidden; }
.storage-note .sn-fill { height: 100%; background: var(--sage); border-radius: 999px; }
.storage-note.warn { color: var(--rust); }
.storage-note.warn .sn-fill { background: var(--rust); }

/* ---------- Line icons and initials tiles ---------- */
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ic, .status-tag .ic, .link .ic { vertical-align: -0.16em; }
.np-av.init, .wk-num.init { font-weight: 900; font-size: 0.78rem; letter-spacing: 0.03em; color: var(--ink-soft); background: var(--gold-soft); border-color: var(--gold-soft); }
.pf-av.init { font-weight: 900; font-size: 1.15rem; letter-spacing: 0.03em; color: var(--ink-soft); }
.avatar-chip .em { display: inline-flex; }
.chip-init {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-soft); font-size: 0.66rem; font-weight: 900; color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .header-logo { height: 22px; }
  .header-role { font-size: 0.62rem; letter-spacing: 0.08em; }
}
@media (max-width: 720px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.45rem; }
  .tabs { position: sticky; top: 8px; z-index: 30; }
  .name-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .header-role { display: none; }
  .modal-body, .modal-head { padding-left: 16px; padding-right: 16px; }
  .wc-row { flex-direction: column; gap: 2px; }
  .wc-label { width: auto; }
  .vocab-row { flex-direction: column; gap: 2px; }
  .vocab-row .vt { min-width: 0; }
}

/* ---------- Print (portfolio and practical export) ---------- */
@media print {
  body { background: #fff; }
  .bottom-nav, .topbar, .tabs, .subtabs, .btn, .toast, .no-print { display: none !important; }
  .app-shell { padding: 0; max-width: none; }
  .card, .evidence-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .view { animation: none; }
  .lab-frame-wrap, .lab-poster { display: none !important; }
}
