/* =========================================================
   PathwayPro Coding
   Coding and Robotics module for Grade R to 12
   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: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(140deg, var(--gold) 0%, var(--terra) 100%);
  display: grid; place-items: center; color: #fff; font-size: 24px;
  box-shadow: var(--shadow-sm); flex: none;
}
.brand-text { line-height: 1.05; }
.brand-text .b1 { font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-text .b1 span { color: var(--terra); }
.brand-text .b2 { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; color: var(--sage); }
.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;
}
.brand { align-items: flex-end; }
.landing-logo { width: 100%; max-width: 420px; 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;
}
.avatar-chip .em { font-size: 1.2rem; }

/* ---------- 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 { font-size: 1.7rem; }
.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; font-size: 44px; box-shadow: var(--shadow-md); color: #fff;
}
.onboard-card h1 { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; }
.onboard-card h1 span { color: var(--terra); }
.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; font-size: 20px; 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); }

/* ---------- 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: 100px;
}
.nav-item .ni { font-size: 1.35rem; }
.nav-item.active { color: var(--terra); background: var(--terra-soft); }

/* ---------- Phase / 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: 128px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.phase-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.phase-card .pc-emoji { font-size: 1.9rem; }
.phase-card .pc-title { font-weight: 900; font-size: 1.05rem; margin-top: 8px; }
.phase-card .pc-sub { font-size: 0.78rem; opacity: 0.92; font-weight: 700; }
.phase-card .pc-progress { margin-top: 10px; }
.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-mix { background: linear-gradient(140deg, var(--gold) 0%, var(--terra) 55%, var(--rust) 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: 2px; 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.changes { background: var(--terra-soft); color: var(--rust); }

/* ---------- CAPS code chips ---------- */
.caps-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-weight: 800; font-size: 0.76rem; border: 2px solid; cursor: pointer;
  transition: all .12s ease; background: #fff;
}
.caps-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.caps-chip .cc-code { font-family: var(--mono); font-weight: 700; }
.caps-chip.c-code { border-color: var(--terra); color: var(--rust); }
.caps-chip.c-robo { border-color: var(--gold); color: #8a6f00; }
.caps-chip.c-digi { border-color: var(--sage); color: #5f7a7a; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 7px; }

/* popover */
.popover {
  position: absolute; z-index: 90; max-width: 320px; width: calc(100vw - 40px);
  background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 16px 18px;
  box-shadow: var(--shadow-lg); animation: fadeUp .2s ease;
}
.popover .po-code { font-family: var(--mono); font-size: 0.75rem; color: var(--gold-glow); font-weight: 700; }
.popover .po-name { font-weight: 900; font-size: 1rem; margin: 2px 0 8px; }
.popover .po-meaning { font-size: 0.85rem; font-weight: 600; color: #dfe6e6; margin-bottom: 10px; }
.popover .po-class { font-size: 0.8rem; font-weight: 600; color: var(--mist); border-left: 3px solid var(--terra); padding-left: 10px; }
.popover .po-class strong { color: var(--terra-soft); display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Week / lesson detail ---------- */
.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: 720px; 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; font-size: 1.1rem; font-weight: 900; display: grid; place-items: center; }
.modal-head .mh-close:hover { background: rgba(255,255,255,0.25); }
.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 { padding-left: 20px; margin: 4px 0; }
.detail-block .db-body li { margin-bottom: 5px; }
.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; }

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

.grade-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade-col { background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; border-top: 4px solid var(--sage); }
.grade-col:nth-child(1) { border-top-color: var(--gold); }
.grade-col:nth-child(2) { border-top-color: var(--terra); }
.grade-col:nth-child(3) { border-top-color: var(--sage); }
.grade-col .gc-head { font-weight: 900; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; color: var(--ink-soft); }
.grade-col .gc-body { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Code block (Python) ---------- */
.code-block { position: relative; background: #1d2b32; border-radius: var(--r-md); margin: 8px 0; overflow: hidden; }
.code-block pre {
  padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem;
  line-height: 1.6; color: #dfe8ec; -webkit-overflow-scrolling: touch;
}
.code-block .ck { color: #f2b566; }   /* keywords */
.code-block .cs { color: #a8d08d; }   /* strings */
.code-block .cc { color: #7f9a9a; font-style: italic; }  /* comments */
.code-block .cn { color: #8ecbe6; }   /* numbers */
.code-block .cf { color: #ffd98a; }   /* function names */
.copy-btn {
  position: absolute; top: 10px; right: 10px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff; font-weight: 800; font-size: 0.75rem;
  transition: background .14s ease;
}
.copy-btn:hover { background: rgba(255,255,255,0.25); }

/* ---------- Code Lab (in-lesson Python editor) ---------- */
.code-lab { background: var(--paper); border-radius: var(--r-md); padding: 16px; }
.code-lab .lab-note { font-weight: 700; font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 10px; }
.lab-editor {
  width: 100%; min-height: 220px; resize: vertical;
  background: #1d2b32; color: #dfe8ec; border: 2px solid #2f4149; border-radius: var(--r-md);
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; padding: 14px 16px;
  tab-size: 4; -moz-tab-size: 4; white-space: pre; overflow-x: auto;
  -webkit-overflow-scrolling: touch; caret-color: var(--gold-glow);
}
.lab-editor:focus { outline: none; border-color: var(--gold); }
.lab-editor::placeholder { color: #7f9a9a; font-style: italic; }
.lab-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.lab-btns .btn { min-height: 44px; }
.lab-out-wrap { border-radius: var(--r-md); overflow: hidden; border: 2px solid #2f4149; }
.lab-out-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #162228; color: var(--sage); padding: 8px 14px;
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em;
}
.lab-out-head .link { font-size: 0.78rem; text-transform: none; letter-spacing: 0; }
.lab-out {
  background: #1d2b32; color: #dfe8ec; margin: 0; padding: 14px 16px;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.6;
  min-height: 64px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  -webkit-overflow-scrolling: touch;
}
.lab-out .out-err { color: #f0a583; }
.lab-out .out-note { color: #7f9a9a; font-style: italic; }
.lab-out .out-empty { color: #7f9a9a; font-style: italic; }
@keyframes labPulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.lab-out .out-loading { color: var(--gold-glow); animation: labPulse 1.2s ease infinite; }

/* code evidence cards */
.ev-code { background: #1d2b32; }
.ev-code pre {
  margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 0.78rem; line-height: 1.55;
  color: #dfe8ec; max-height: 200px; overflow: auto; -webkit-overflow-scrolling: touch;
}
.ev-code .ck { color: #f2b566; } .ev-code .cs { color: #a8d08d; }
.ev-code .cc { color: #7f9a9a; font-style: italic; } .ev-code .cn { color: #8ecbe6; } .ev-code .cf { color: #ffd98a; }
.ev-out {
  border-top: 2px solid #2f4149; background: #162228; color: #b9c9cf;
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.5;
  padding: 10px 16px; max-height: 110px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.ev-out .ev-out-label { display: block; color: var(--sage); font-family: var(--font); font-weight: 900; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }

/* ---------- Quiz ---------- */
.quiz-q { background: var(--paper); border-radius: var(--r-md); padding: 16px; margin-bottom: 14px; }
.quiz-q .qq-text { font-weight: 800; margin-bottom: 12px; }
.quiz-q .qq-text code { font-family: var(--mono); font-size: 0.85em; background: var(--sage-soft); border-radius: 6px; padding: 1px 6px; }
.quiz-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; border-radius: var(--r-sm); background: #fff; border: 2px solid var(--sage-soft);
  font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; transition: all .12s ease; color: var(--ink);
}
.quiz-opt:hover { border-color: var(--gold); }
.quiz-opt .qo-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--sage-soft); display: grid; place-items: center; font-weight: 900; font-size: 0.75rem; flex: none; }
.quiz-opt.correct { border-color: var(--green); background: var(--green-soft); }
.quiz-opt.correct .qo-letter { background: var(--green); color: #fff; }
.quiz-opt.wrong { border-color: var(--rust); background: var(--terra-soft); }
.quiz-opt.wrong .qo-letter { background: var(--rust); color: #fff; }
.quiz-opt[disabled] { cursor: default; opacity: 1; }
.quiz-opt.faded { opacity: 0.55; }
/* an option already tried and wrong, with chances still left */
.quiz-opt.spent { opacity: 0.5; border-style: dashed; background: var(--paper-2); }
.quiz-opt.spent > span:last-child { text-decoration: line-through; }
.quiz-opt.spent .qo-letter { background: var(--sage-soft); color: var(--sage); }
.qq-note { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.84rem; padding: 10px 13px; border-radius: var(--r-sm); margin-top: 2px; }
.qq-note .ic { flex: none; }
.qq-note.retry { background: var(--gold-soft); color: #8a6f00; }
.qq-note.reveal { background: var(--green-soft); color: var(--green); }
.quiz-result { text-align: center; font-weight: 900; font-size: 1.05rem; padding: 14px; border-radius: var(--r-md); }
.quiz-result.pass { background: var(--green-soft); color: var(--green); }
.quiz-result.retry { background: var(--terra-soft); color: var(--rust); }
.quiz-attempts { text-align: center; font-weight: 700; font-size: 0.8rem; color: var(--sage); margin-top: 8px; }
/* facilitator read-out of tries per question */
.quiz-attempts-fac { background: var(--paper-2); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 4px; }
.quiz-attempts-fac .qa-head { display: flex; align-items: center; gap: 6px; color: var(--sage); font-weight: 900; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.quiz-attempts-fac .qa-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; font-weight: 700; padding: 3px 0; }
.quiz-attempts-fac .qa-name { flex: 1; min-width: 120px; }
.quiz-attempts-fac .qa-vals { font-family: var(--mono); font-size: 0.78rem; color: var(--sage); }

/* ---------- Lesson checklist ---------- */
.lesson-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.lesson-step { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--paper); color: var(--sage); border: 2px solid var(--sage-soft); }
.lesson-step.done { background: var(--green-soft); color: var(--green); border-color: transparent; }

/* Brain dump / check-in */
.brain-dump {
  background: linear-gradient(135deg, var(--terra-soft) 0%, var(--gold-soft) 100%);
  border-radius: var(--r-md); padding: 16px 18px; font-weight: 700; color: var(--ink-soft);
}
.brain-dump .bd-head { font-weight: 900; color: var(--rust); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }

/* ---------- 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); }
.photo-drop .pd-emoji { font-size: 2rem; }
.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 { flex: none; }

/* ---------- 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); }

/* ---------- Competency coverage ---------- */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.comp-cell { border-radius: var(--r-md); padding: 12px 14px; background: var(--paper); border: 2px solid var(--sage-soft); opacity: 0.55; }
.comp-cell.touched { opacity: 1; background: #fff; box-shadow: var(--shadow-sm); }
.comp-cell.touched.strand-c { border-color: var(--terra); }
.comp-cell.touched.strand-r { border-color: var(--gold); }
.comp-cell.touched.strand-d { border-color: var(--sage); }
.comp-cell .cp-code { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: var(--sage); }
.comp-cell.touched .cp-code { color: var(--terra); }
.comp-cell .cp-name { font-weight: 800; font-size: 0.84rem; margin-top: 2px; }
.comp-cell .cp-count { font-size: 0.72rem; font-weight: 800; color: var(--sage); margin-top: 4px; }

/* ---------- 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; font-size: 2rem;
  background: var(--sage-soft); color: var(--sage); filter: grayscale(1); opacity: 0.5;
}
.badge-item.earned .badge-medal {
  background: linear-gradient(140deg, var(--gold-glow), var(--gold)); color: #fff;
  filter: none; 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; }

/* ---------- Glossary ---------- */
.gloss-card { border-left: 5px solid var(--sage); }
.gloss-card.strand-c { border-left-color: var(--terra); }
.gloss-card.strand-r { border-left-color: var(--gold); }
.gloss-card.strand-d { border-left-color: var(--sage); }
.gloss-card .gl-code { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--terra); }
.gloss-card h3 { font-size: 1.02rem; font-weight: 900; margin: 2px 0 8px; }
.gloss-card .gl-meaning { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; margin-bottom: 10px; }
.gloss-card .gl-class { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; line-height: 1.5; }
.gloss-card .gl-class strong { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sage); margin-bottom: 3px; }

/* ---------- 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 { font-size: 1.3rem; }

/* confetti-ish badge pop */
.badge-pop {
  position: fixed; inset: 0; z-index: 96; display: grid; place-items: center;
  background: rgba(37,50,56,0.5); backdrop-filter: blur(3px); animation: fadeIn .2s ease;
}
.badge-pop .bp-card {
  background: var(--card); border-radius: var(--r-xl); padding: 34px 40px; text-align: center;
  box-shadow: var(--shadow-lg); animation: popIn .3s ease; max-width: 340px;
}
.badge-pop .bp-medal {
  width: 110px; height: 110px; margin: 0 auto 14px; border-radius: 50%; font-size: 3.2rem;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--gold-glow), var(--gold));
  box-shadow: 0 10px 30px rgba(204,163,0,0.5); animation: medalSpin .6s ease;
}
@keyframes medalSpin { from { transform: rotate(-16deg) scale(0.5); } to { transform: none; } }
.badge-pop .bp-eyebrow { font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.14em; color: var(--sage); }
.badge-pop h2 { font-size: 1.4rem; font-weight: 900; margin: 4px 0 6px; }
.badge-pop p { font-weight: 700; color: var(--ink-soft); margin-bottom: 18px; }

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

/* ---------- 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; font-size: 2rem; 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; }
.reflection-row { background: var(--card); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.reflection-row .rf-meta { font-size: 0.75rem; font-weight: 800; color: var(--sage); margin-bottom: 4px; }
.reflection-row .rf-text { font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- 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); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grade-cols { grid-template-columns: 1fr; }
  .header-logo { height: 22px; }
  .header-role { font-size: 0.62rem; letter-spacing: 0.08em; }
}
@media (max-width: 480px) {
  .header-role { display: none; }
}
@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; }
  .brand-text .b2 { display: none; }
  .modal-body, .modal-head { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Facilitator guide (answer memos) ---------- */
.guide-section { margin-top: 22px; }
.guide-section:not(:empty) {
  border-top: 2px dashed var(--sage);
  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; }
.flow-item { display: flex; gap: 10px; margin-bottom: 9px; align-items: flex-start; }
.flow-item:last-child { margin-bottom: 0; }
.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;
}
.flow-marker {
  text-align: center; font-weight: 900; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sage); margin: 12px 0;
}
.guide-list { padding-left: 18px; margin: 0; }
.guide-list li { margin-bottom: 9px; }
.guide-list li:last-child { margin-bottom: 0; }
.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; }
@media (max-width: 480px) {
  .wc-row { flex-direction: column; gap: 2px; }
  .wc-label { width: auto; }
}

/* ---------- Tinkercad lab memo (facilitator only) ---------- */
.lab-section { margin-top: 22px; }
.lab-section:not(:empty) { border-top: 2px dashed var(--gold); padding-top: 18px; }
.lab-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lab-head .ic { color: var(--gold); flex: none; }
.lab-title { font-weight: 900; font-size: 0.98rem; color: var(--ink); line-height: 1.35; margin-bottom: 8px; }
.lab-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.lab-chip {
  font-size: 0.7rem; font-weight: 800; background: var(--gold-soft); color: #8a6f00;
  padding: 4px 11px; border-radius: 999px;
}
.lab-level { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55; margin-bottom: 12px; }
.lab-links { display: flex; flex-direction: column; gap: 8px; }
.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-prestart { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sage-soft); }
.lab-prestart .lp-head {
  font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sage); margin-bottom: 8px;
}
.lab-prestart .lp-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.lab-prestart .lp-row:last-child { margin-bottom: 0; }
.lab-prestart .lp-row .ic { color: var(--sage); flex: none; margin-top: 2px; }
.lab-prestart .lp-row span { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.lab-code-note { font-size: 0.8rem; font-weight: 800; color: var(--terra); margin-bottom: 8px; }
.lab-section .code-block pre { max-height: 420px; overflow: auto; }
.lab-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lab-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.lab-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); white-space: nowrap;
}
.lab-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; }
.lab-table .lt-key { font-weight: 800; color: var(--ink); }
.lab-table .lt-marks { font-weight: 900; color: var(--terra); white-space: nowrap; }
.lab-table .lt-total td { font-weight: 900; color: var(--ink); border-bottom: none; }
.success-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;
}
.success-callout .sc-label { display: block; font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: #8a6f00; margin-bottom: 4px; }
.serial-out {
  background: #1d2b32; color: #dfe8ec; border-radius: var(--r-md); padding: 14px 16px;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.lab-task, .lab-stretch { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); line-height: 1.55; margin-bottom: 12px; }
.lab-stretch { background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; margin: 0; }
.lt-label { display: block; font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--terra); margin-bottom: 4px; }
.lab-note { font-size: 0.8rem; font-style: italic; font-weight: 600; color: var(--sage); line-height: 1.5; margin-top: 10px; }
.status-tag.lab { background: var(--gold-soft); color: #8a6f00; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 480px) {
  .lab-table, .lab-table tr, .lab-table td { display: block; width: 100%; }
  .lab-table th { display: none; }
  .lab-table td { border-bottom: none; padding: 2px 0; }
  .lab-table .lt-key { padding-top: 10px; border-top: 1px solid var(--sage-soft); }
  .lab-table tr:first-child .lt-key { border-top: none; }
}

/* ---------- Line icons and brand mark ---------- */
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ic, .lesson-step .ic, .status-tag .ic, .link .ic { vertical-align: -0.16em; }
.landing-mark {
  width: 104px; height: 104px; border-radius: 26px; display: block;
  margin: 0 auto 16px; box-shadow: var(--shadow-md);
}
.big-logo .ic { display: block; margin: auto; }
.nav-item .ni { display: grid; place-items: center; height: 24px; }
.empty .big .ic { color: var(--sage); }
.empty .big { line-height: 1; }
.stat .icon { color: var(--terra); line-height: 1; }
.brain-dump .bd-head { display: flex; align-items: center; gap: 6px; }
.pin-key .ic { vertical-align: middle; }
.mh-close .ic { display: block; margin: auto; }
.rb-ico .ic { color: var(--gold); }
.review-box .rb-row .rb-ico { display: flex; align-items: center; height: 1.3em; }

/* initials tiles replace avatars */
.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);
}

/* ---------- Print (portfolio 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, .reflection-row { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .view { animation: none; }
}

/* ---------- Printable packs ---------- */
.pack-list { padding: 6px 0; }
.pack-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--sage-soft);
  transition: background 0.15s ease;
}
.pack-row:last-child { border-bottom: none; }
.pack-row:hover { background: var(--paper); }
/* gated packs render as buttons, so match the anchor styling exactly */
button.pack-row { width: 100%; text-align: left; font-family: inherit; font-size: inherit; cursor: pointer; }
.pack-ic {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: var(--gold-soft); color: #8a6f00;
}
.pack-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pack-title { font-weight: 900; font-size: 0.95rem; }
.pack-desc { font-size: 0.8rem; color: var(--ink-soft); }
.pack-dl { color: var(--terra); flex: none; }
.pack-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 2px solid var(--gold); border-radius: 999px; text-decoration: none;
  font-size: 0.78rem; font-weight: 800; color: #8a6f00; background: var(--paper-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pack-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pack-chip .ic { vertical-align: -0.16em; }
