/* ============================================================
   Wennan's World — Portal design system (local prototype)
   Palette, type and card language from the approved direction,
   elevated for a premium learner surface.
   ============================================================ */

:root {
  /* Core palette */
  --navy: #2B2E53;
  --navy-700: #23264A;
  --navy-900: #1A1C38;
  --bg-outer: #F4F5F7;
  --cream: #FEF9EC;
  --cream-deep: #F7EFD8;
  --orange: #F28C69;
  --green: #79B854;
  --blue: #6DB4D5;
  --yellow: #FBC543;
  --purple: #9D75CB;
  --ink: #2B2E53;
  --ink-soft: #5B5F82;
  --ink-faint: #8A8EAB;
  --line: rgba(43, 46, 83, 0.14);

  /* Elevation — the "sticker" language: hard offset + soft ambient */
  --lift-1: 0 3px 0 var(--navy), 0 6px 14px rgba(26, 28, 56, 0.10);
  --lift-2: 0 6px 0 var(--navy), 0 14px 26px rgba(26, 28, 56, 0.14);
  --lift-3: 0 10px 0 var(--navy), 0 22px 40px rgba(26, 28, 56, 0.18);
  --soft-1: 0 2px 8px rgba(26, 28, 56, 0.06);
  --soft-2: 0 10px 30px rgba(26, 28, 56, 0.10);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  --rail: 292px;
  --shell-max: 1560px;
  --ease: cubic-bezier(.2, .8, .25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Nunito', 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--navy);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.portal-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--yellow); color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Icons ---------- */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.ic-fill { fill: currentColor; stroke: none; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: relative;
  z-index: 20;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.6rem;
  background:
    radial-gradient(1200px 200px at 12% -60%, rgba(109, 180, 213, 0.30), transparent 70%),
    linear-gradient(180deg, #32355F 0%, var(--navy) 68%, var(--navy-700) 100%);
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.10);
}

.brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }

.brand-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
  transform: rotate(-1.2deg);
  transition: transform 0.25s var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-1.2deg) translateY(-2px) scale(1.02); }

.brand-divider { width: 2px; height: 34px; background: rgba(255, 255, 255, 0.16); border-radius: 2px; }

.brand-meta { min-width: 0; }
.brand-eyebrow {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
}
.brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #EBEDF7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 0.7rem; }

/* Saved pill */
.save-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10);
  border: 2px solid rgba(255, 255, 255, 0.20);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #EAF6E2;
  transition: all 0.2s var(--ease);
}
.save-pill[data-state="saved"] { background: rgba(121, 184, 84, 0.22); border-color: rgba(121, 184, 84, 0.55); }
.save-pill[data-state="saving"] { background: rgba(251, 197, 67, 0.20); border-color: rgba(251, 197, 67, 0.55); color: #FFF3D2; }
.save-pill .ic { width: 0.95em; height: 0.95em; }
.save-pill[data-state="saving"] .ic { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.user-chip:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.user-chip .who { text-align: right; line-height: 1.15; }
.user-chip .who strong { display: block; font-size: 0.92rem; font-weight: 900; }
.user-chip .who span { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(150deg, var(--orange), #E0714C);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Shell + rail
   ============================================================ */
.shell { display: flex; flex: 1; min-height: 0; }

.rail {
  flex: none;
  width: var(--rail);
  padding: 1.4rem 1.1rem 1.2rem;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 70%, var(--navy-900) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 8px; }

.rail-label {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  padding: 0.4rem 0.7rem 0.15rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: #E7E9F5;
  font-size: 1.02rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.nav-btn .ic { width: 1.25em; height: 1.25em; color: rgba(255, 255, 255, 0.72); }
.nav-btn:hover { background: rgba(255, 255, 255, 0.10); transform: translateX(2px); }
.nav-btn.active {
  background: var(--cream);
  color: var(--navy);
  border-color: var(--navy-900);
  box-shadow: 0 4px 0 var(--blue), 0 10px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
.nav-btn.active .ic { color: var(--blue); }
.nav-btn .count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
}
.nav-btn.active .count { background: var(--navy); color: #fff; }

.rail-foot { margin-top: auto; padding-top: 1rem; border-top: 2px dashed rgba(255, 255, 255, 0.18); }

/* Wennan helper in the rail */
.rail-wennan {
  margin-top: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-lg);
  padding: 0.9rem 1rem;
  color: #E7E9F5;
}
.rail-wennan img { width: 100%; border-radius: var(--r-md); margin-bottom: 0.6rem; }
.rail-wennan p { font-size: 0.86rem; font-weight: 700; line-height: 1.5; color: #C9CDE6; }
.rail-wennan strong { display: block; font-size: 0.9rem; font-weight: 900; color: var(--yellow); margin-bottom: 0.2rem; }

/* ============================================================
   Content canvas
   ============================================================ */
.canvas {
  flex: 1;
  min-width: 0;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(109, 180, 213, 0.13), transparent 62%),
    radial-gradient(700px 380px at 0% 100%, rgba(251, 197, 67, 0.13), transparent 60%),
    var(--bg-outer);
  border-top-left-radius: var(--r-xl);
  box-shadow: inset 6px 6px 0 rgba(255, 255, 255, 0.6);
  overflow-y: auto;
  scroll-behavior: smooth;
}
.canvas-inner { max-width: var(--shell-max); padding: 2.4rem 2.6rem 4rem; margin: 0 auto; }

/* ---------- Page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.page-head h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.page-head h1 .accent { color: var(--orange); }
.page-head .sub { margin-top: 0.45rem; font-size: 1.06rem; font-weight: 700; color: var(--ink-soft); }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: min(330px, 100%);
  padding: 0.7rem 1.1rem;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 rgba(43, 46, 83, 0.16);
}
.search .ic { color: var(--blue); width: 1.15em; height: 1.15em; }
.search input { flex: 1; border: 0; outline: 0; font-size: 1.02rem; font-weight: 700; background: none; }
.search input::placeholder { color: var(--ink-faint); font-weight: 700; }

/* ---------- Stat tiles ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.6rem;
}
.stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 5px 0 rgba(43, 46, 83, 0.14), var(--soft-1);
}
.stat::after {
  content: '';
  position: absolute;
  bottom: -46px;
  right: -30px;
  width: 118px; height: 118px;
  border-radius: 50%;
  opacity: 0.16;
  background: var(--tint, var(--blue));
}
.stat .ic { width: 1.35em; height: 1.35em; color: var(--tint, var(--blue)); }
.stat .value { font-size: 2rem; font-weight: 900; line-height: 1.1; margin-top: 0.35rem; }
.stat .label { font-size: 0.78rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- Section titles ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.32rem;
  font-weight: 900;
  margin-bottom: 1.15rem;
}
.section-title .ic { width: 1.15em; height: 1.15em; color: var(--orange); }
.section-title .hint { margin-left: auto; font-size: 0.85rem; font-weight: 800; color: var(--ink-faint); }

/* ============================================================
   Lab cards
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.8rem;
  margin-bottom: 3rem;
}

.lab-card {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 4px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 1.35rem;
  box-shadow: var(--lift-2);
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.lab-card:hover { transform: translateY(-5px); box-shadow: var(--lift-3); }
.lab-card:active { transform: translateY(-1px); box-shadow: var(--lift-1); }

.lab-card .card-body { display: flex; flex-direction: column; flex: 1; }
.lab-card.feature { grid-column: 1 / -1; flex-direction: row; gap: 1.8rem; align-items: stretch; }
.lab-card.feature .banner { width: min(44%, 460px); height: auto; min-height: 250px; margin: 0; }
.lab-card.feature .card-body { flex: 1; display: flex; flex-direction: column; }

.banner {
  position: relative;
  height: 158px;
  margin-bottom: 1.15rem;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(140deg, var(--c1, var(--blue)), var(--c2, var(--green)));
  display: grid;
  place-items: center;
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner .glyph { font-size: 3.2rem; color: rgba(255, 255, 255, 0.95); display: flex; gap: 0.6rem; filter: drop-shadow(0 3px 4px rgba(0,0,0,.22)); }
.banner .glyph .ic { width: 1em; height: 1em; stroke-width: 1.9; }
.banner .ribbon {
  position: absolute;
  top: 0.7rem; left: 0.7rem;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--cream); color: var(--navy);
  border: 2.5px solid var(--navy);
  border-radius: var(--r-pill);
  box-shadow: 0 2px 0 var(--navy);
}
.banner .ribbon .ic { width: 0.9em; height: 0.9em; }

.tag {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  margin-bottom: 0.7rem;
  font-size: 0.72rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase;
  color: #fff;
  border: 2.5px solid var(--navy);
  border-radius: var(--r-pill);
  box-shadow: 0 2px 0 var(--navy);
}
.tag .ic { width: 0.95em; height: 0.95em; }
.tag-progress { background: var(--green); }
.tag-new { background: var(--purple); }
.tag-done { background: var(--blue); }
.tag-locked { background: #9EA2BD; }
.tag-grade { background: var(--yellow); color: var(--navy); }

.lab-card h3 { font-size: 1.4rem; font-weight: 900; line-height: 1.15; margin-bottom: 0.4rem; }
.lab-card .question { font-size: 0.97rem; font-weight: 700; color: var(--ink-soft); line-height: 1.5; margin-bottom: 1.1rem; flex: 1; }

.meta-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; font-size: 0.8rem; font-weight: 800; color: var(--ink-faint); margin-bottom: 1rem; }
.meta-row span { display: inline-flex; align-items: center; gap: 0.35rem; }
.meta-row .ic { width: 1em; height: 1em; }

/* Progress */
.progress-track {
  height: 14px;
  background: rgba(43, 46, 83, 0.10);
  border: 2.5px solid var(--navy);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  transition: width 0.5s var(--ease);
}
.progress-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; font-size: 0.82rem; font-weight: 900; }
.progress-foot .pct { color: var(--ink-faint); }

.day-pips { display: flex; gap: 0.4rem; margin-bottom: 0.85rem; }
.pip {
  flex: 1;
  height: 9px;
  border-radius: var(--r-pill);
  background: rgba(43, 46, 83, 0.13);
  border: 1.5px solid rgba(43, 46, 83, 0.35);
}
.pip.done { background: var(--green); border-color: var(--navy); }
.pip.part { background: var(--yellow); border-color: var(--navy); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.72rem 1.3rem;
  font-size: 1rem; font-weight: 900;
  color: #fff;
  background: var(--navy);
  border: 2.5px solid var(--navy-900);
  border-radius: var(--r-pill);
  box-shadow: 0 4px 0 var(--navy-900);
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), filter 0.15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 0 var(--navy-900); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--navy-900); }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn-block { width: 100%; }
.btn-blue { background: var(--blue); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-ghost { background: #fff; color: var(--navy); box-shadow: 0 4px 0 rgba(43, 46, 83, 0.25); border-color: var(--navy); }
.btn-ghost:active { box-shadow: 0 0 0 rgba(43, 46, 83, 0.25); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================================
   Lab surface
   ============================================================ */
.day-tab {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--cream);
  color: var(--navy);
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--navy-900);
  font-size: 1.02rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.day-tab:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--navy-900); }
.day-tab.inactive { background: rgba(254, 249, 236, 0.55); box-shadow: 0 2px 0 var(--navy-900); transform: scale(0.985); }
.day-tab.inactive:hover { background: var(--cream); transform: scale(1) translateY(-1px); }
.day-tab .badge {
  width: 32px; height: 32px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  border: 2.5px solid var(--navy);
  background: #fff;
}
.day-tab .badge .ic { width: 1.05em; height: 1.05em; }
.day-tab .tab-text { min-width: 0; line-height: 1.2; }
.day-tab .tab-text small { display: block; font-size: 0.73rem; font-weight: 800; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.day-tab .state { margin-left: auto; }
.day-tab .state .ic { width: 1.15em; height: 1.15em; color: var(--green); }
.day-tab.inactive .state .ic { color: var(--ink-faint); }

.tab-1 .badge .ic { color: var(--green); }
.tab-2 .badge .ic { color: var(--blue); }
.tab-3 .badge .ic { color: var(--orange); }
.tab-4 .badge .ic { color: #C9A227; }
.tab-5 .badge .ic { color: var(--purple); }
.tab-6 .badge .ic { color: var(--navy); }
.tab-7 .badge .ic { color: var(--orange); }

/* Lab rail progress */
.rail-progress { background: rgba(255,255,255,0.07); border: 2px solid rgba(255,255,255,0.14); border-radius: var(--r-md); padding: 0.85rem 0.95rem; margin-bottom: 0.4rem; color: #fff; }
.rail-progress .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.rail-progress .top strong { font-size: 0.92rem; font-weight: 900; }
.rail-progress .top span { font-size: 0.78rem; font-weight: 900; color: var(--yellow); }
.rail-progress .track { height: 10px; background: rgba(0,0,0,0.28); border-radius: var(--r-pill); overflow: hidden; }
.rail-progress .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow)); }

/* ---------- Pages ---------- */
.page { display: none; }
.page.active { display: block; animation: rise 0.35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Lab hero / opener ---------- */
.opener {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  border: 4px solid var(--navy);
  border-radius: var(--r-xl);
  box-shadow: var(--lift-2);
  margin-bottom: 2rem;
}
.opener-top {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
}
.opener-copy { padding: 2.1rem 2.2rem; }
.opener-art { border-left: 4px solid var(--navy); background: linear-gradient(150deg, var(--blue), var(--green)); }
.opener-art img { width: 100%; height: 100%; object-fit: cover; }
.opener h1 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); font-weight: 900; line-height: 1.08; letter-spacing: -0.015em; margin: 0.5rem 0 0.7rem; }
.opener .goal {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem; margin-bottom: 0.9rem;
  background: var(--yellow); color: var(--navy);
  border: 2.5px solid var(--navy); border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--navy);
  font-size: 0.88rem; font-weight: 900;
}
.opener .question { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin-bottom: 0.6rem; }
.opener .brief { font-size: 1.02rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }

.opener-body { padding: 0 2.2rem 2.1rem; }
.opener-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 1.4rem; }

.panel {
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 1.3rem 1.4rem;
  box-shadow: 0 4px 0 rgba(43, 46, 83, 0.14);
}
.panel > h4 {
  font-size: 0.76rem; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 0.6rem;
}
.panel p { font-size: 0.98rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }
.panel.accent-green { border-color: var(--green); box-shadow: 0 4px 0 rgba(121, 184, 84, 0.35); }
.panel.accent-green > h4 { color: var(--green); }
.panel.accent-orange { border-color: var(--orange); box-shadow: 0 4px 0 rgba(242, 140, 105, 0.35); }
.panel.accent-orange > h4 { color: #D96D48; }
.panel.accent-purple { border-color: var(--purple); box-shadow: 0 4px 0 rgba(157, 117, 203, 0.35); }
.panel.accent-purple > h4 { color: var(--purple); }

.must-list { list-style: none; display: grid; gap: 0.65rem; }
.must-list li { display: flex; gap: 0.65rem; font-size: 0.97rem; font-weight: 700; color: var(--ink); line-height: 1.5; }
.must-list .ic { flex: none; margin-top: 0.15rem; width: 1.15em; height: 1.15em; color: var(--green); }

.word-list { display: grid; gap: 0.7rem; }
.word {
  background: var(--cream);
  border: 2.5px solid var(--navy);
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
}
.word b { display: block; font-size: 0.95rem; font-weight: 900; }
.word span { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Day header ---------- */
.day-head {
  background: linear-gradient(150deg, var(--navy) 0%, #3A3D6B 100%);
  color: #fff;
  border: 4px solid var(--navy-900);
  border-radius: var(--r-xl);
  padding: 1.7rem 1.9rem;
  box-shadow: var(--lift-2);
  margin-bottom: 1.8rem;
  position: relative;
  overflow: hidden;
}
.day-head::after {
  content: '';
  position: absolute; right: -80px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 197, 67, 0.30), transparent 65%);
}
.day-head .eyebrow { color: var(--yellow); }
.day-head h2 { font-size: clamp(1.4rem, 2.3vw, 2rem); font-weight: 900; line-height: 1.12; margin: 0.4rem 0 0.75rem; max-width: 46ch; position: relative; }
.day-head .eq {
  display: flex; gap: 0.6rem;
  font-size: 1rem; font-weight: 800; color: #FFE9A8;
  padding-top: 0.75rem; margin-top: 0.35rem;
  border-top: 2px dashed rgba(255, 255, 255, 0.22);
  max-width: 70ch;
  position: relative;
}
.day-head .eq .ic { flex: none; margin-top: 0.2rem; color: var(--yellow); }
.day-head .intro { font-size: 1rem; font-weight: 700; color: #D3D7EE; line-height: 1.6; max-width: 78ch; position: relative; }

/* ---------- Teaching cards ---------- */
.teach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-bottom: 1.8rem; }
.teach {
  background: #fff;
  border: 3px solid var(--navy);
  border-left-width: 9px;
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--soft-1);
}
.teach .kind {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.68rem; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.teach .kind .ic { width: 1em; height: 1em; }
.teach h4 { font-size: 1.05rem; font-weight: 900; margin-bottom: 0.4rem; line-height: 1.25; }
.teach p { font-size: 0.96rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }
.teach.k-model { border-left-color: var(--blue); } .teach.k-model .kind { color: var(--blue); }
.teach.k-worked_example { border-left-color: var(--purple); } .teach.k-worked_example .kind { color: var(--purple); }
.teach.k-example { border-left-color: var(--green); } .teach.k-example .kind { color: var(--green); }
.teach.k-non_example { border-left-color: var(--orange); } .teach.k-non_example .kind { color: #D96D48; }
.teach.k-safety { border-left-color: #D8442F; background: #FFF6F3; } .teach.k-safety .kind { color: #D8442F; }
.teach.k-release_check { border-left-color: var(--yellow); } .teach.k-release_check .kind { color: #C9A227; }

/* ---------- Visual block ---------- */
.visual {
  background: var(--cream);
  border: 4px solid var(--navy);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--lift-1);
  margin-bottom: 1.8rem;
}
.visual figure { margin: 0; background: #fff; border-bottom: 4px solid var(--navy); display: grid; place-items: center; padding: 1rem; }
.visual img { width: auto; max-width: 100%; max-height: 520px; object-fit: contain; border-radius: var(--r-sm); }
.visual .cap { padding: 1rem 1.3rem 1.2rem; }
.visual.no-art { border-style: dashed; }
.visual.no-art .cap { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; align-items: start; padding: 1.3rem; }
.visual.no-art .cap-mark {
  grid-row: 1 / span 2;
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 3px solid var(--navy); border-radius: 14px;
  background: #fff; box-shadow: 0 3px 0 var(--navy); font-size: 1.3rem; color: var(--blue);
}
.visual .cap p { font-size: 0.96rem; font-weight: 700; color: var(--ink-soft); line-height: 1.55; }
.visual .cap .job { display: flex; gap: 0.5rem; margin-top: 0.55rem; font-size: 0.88rem; font-weight: 800; color: var(--navy); }
.visual .cap .job .ic { flex: none; margin-top: 0.1rem; color: var(--orange); }

/* ---------- Activity (group) cards ---------- */
.activity {
  background: var(--cream);
  border: 4px solid var(--navy);
  border-radius: var(--r-xl);
  padding: 1.9rem 2rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--lift-2);
  position: relative;
}
.activity-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.4rem; }
.step-num {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  font-size: 1.2rem; font-weight: 900;
  border: 3px solid var(--navy);
  box-shadow: 0 3px 0 var(--navy);
}
.activity-head h3 { font-size: 1.32rem; font-weight: 900; line-height: 1.2; }
.activity .desc { font-size: 0.99rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; margin: 0.7rem 0 1.5rem; }

.field { margin-bottom: 1.6rem; }
.field:last-child { margin-bottom: 0; }
.field > label, .field .prompt {
  display: block;
  font-size: 1.04rem; font-weight: 800; line-height: 1.45;
  margin-bottom: 0.7rem;
}
.field .prompt .n {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 0.78rem; font-weight: 900;
  vertical-align: 2px;
}

textarea, input[type="text"], input[type="number"], input[type="email"], input[type="tel"], select {
  width: 100%;
  padding: 0.9rem 1.05rem;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  font-size: 1.04rem; font-weight: 700;
  box-shadow: inset 0 2px 0 rgba(43, 46, 83, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
textarea:focus, input:focus, select:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(109, 180, 213, 0.28); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B2E53' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1.1rem; padding-right: 2.6rem; }

.field-foot { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.55rem; }
.field-foot .note { font-size: 0.82rem; font-weight: 800; color: var(--ink-faint); }

.mic {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: #fff; color: var(--navy);
  border: 2.5px solid var(--navy); border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--navy);
  font-size: 0.85rem; font-weight: 900; cursor: pointer;
}
.mic:active { transform: translateY(3px); box-shadow: none; }
.mic[data-on="1"] { background: var(--orange); color: #fff; }
.mic .ic { width: 1em; height: 1em; }

/* ---------- Interaction: choice chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-pill);
  box-shadow: 0 3px 0 rgba(43, 46, 83, 0.22);
  font-size: 0.98rem; font-weight: 800;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 3px 0 var(--navy-900); }
.chip[aria-pressed="true"] .ic { color: var(--yellow); }
.chip .ic { width: 1em; height: 1em; }
.chip.over { opacity: 0.45; }

.budget-bar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.85rem; font-size: 0.86rem; font-weight: 900; color: var(--ink-soft); }
.budget-bar .dots { display: flex; gap: 0.3rem; }
.budget-bar .dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--navy); background: #fff; }
.budget-bar .dot.used { background: var(--orange); }

/* ---------- Interaction: sort bins ---------- */
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.bin {
  background: #fff;
  border: 3px dashed var(--navy);
  border-radius: var(--r-md);
  padding: 1rem;
  min-height: 120px;
  transition: background 0.15s, border-color 0.15s;
}
.bin.hot { background: #F2FBEC; border-color: var(--green); border-style: solid; }
.bin h5 { font-size: 0.95rem; font-weight: 900; margin-bottom: 0.15rem; }
.bin .hint { font-size: 0.8rem; font-weight: 700; color: var(--ink-faint); margin-bottom: 0.7rem; line-height: 1.4; }
.bin-items { display: flex; flex-direction: column; gap: 0.5rem; min-height: 40px; }

.sortable {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  background: var(--cream);
  border: 2.5px solid var(--navy);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 0 var(--navy);
  font-size: 0.92rem; font-weight: 800;
  cursor: grab;
  user-select: none;
  text-align: left;
}
.sortable:active { cursor: grabbing; }
.sortable.dragging { opacity: 0.4; }
.sortable .ic { flex: none; width: 1em; height: 1em; color: var(--ink-faint); }
.sortable.ok { background: #EAF7E1; border-color: var(--green); }
.sortable.bad { background: #FDEEE9; border-color: var(--orange); }
.sort-pool { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem; background: rgba(43,46,83,0.05); border: 2.5px solid var(--line); border-radius: var(--r-md); margin-bottom: 1rem; min-height: 62px; }
.sort-pool .sortable { background: #fff; }
.sort-pool:empty { display: grid; place-items: center; }
.sort-pool:empty::after { content: 'Every card is placed.'; font-size: 0.85rem; font-weight: 800; color: var(--ink-faint); }

.feedback {
  display: none;
  gap: 0.55rem;
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.92rem; font-weight: 800; line-height: 1.5;
}
.feedback.show { display: flex; }
.feedback.good { background: #EAF7E1; border: 2.5px solid var(--green); color: #3D6B25; }
.feedback.bad { background: #FDEEE9; border: 2.5px solid var(--orange); color: #A6472A; }
.feedback .ic { flex: none; margin-top: 0.1rem; }

/* ---------- Interaction: tally ---------- */
.tally-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; }
.tally-card {
  background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md);
  padding: 1rem; text-align: center; cursor: pointer;
  box-shadow: 0 3px 0 rgba(43,46,83,0.2);
  transition: transform 0.12s var(--ease);
}
.tally-card:active { transform: translateY(3px); box-shadow: none; }
.tally-card .n { font-size: 2.1rem; font-weight: 900; color: var(--navy); line-height: 1; }
.tally-card .lbl { font-size: 0.88rem; font-weight: 800; color: var(--ink-soft); margin-top: 0.35rem; }
.tally-card .marks { font-size: 0.9rem; font-weight: 900; color: var(--orange); letter-spacing: 0.12em; min-height: 1.2em; }

/* ---------- Interaction: table + chart ---------- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md); overflow: hidden; }
.data-table th, .data-table td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 2px solid var(--line); }
.data-table thead th { background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:first-child { font-weight: 900; }
.data-table input { padding: 0.5rem 0.6rem; border-width: 2.5px; border-radius: 10px; font-size: 0.95rem; }
.table-scroll { overflow-x: auto; }

.bars { display: grid; gap: 0.6rem; margin-top: 1rem; padding: 1rem; background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md); }
.bars .bar-row { display: grid; grid-template-columns: 110px 1fr 62px; align-items: center; gap: 0.7rem; font-size: 0.88rem; font-weight: 800; }
.bars .bar { height: 20px; background: rgba(43,46,83,0.10); border: 2px solid var(--navy); border-radius: var(--r-pill); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width 0.35s var(--ease); }
.bars .hint { font-size: 0.82rem; font-weight: 800; color: var(--ink-faint); }

/* ---------- Interaction: sim ---------- */
.sim-stage { background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md); overflow: hidden; }
.sim-stage svg { display: block; width: 100%; height: auto; }
.sim-control { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 800; }
input[type="range"] { flex: 1; accent-color: var(--blue); height: 26px; }
.sim-readout { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.readout {
  padding: 0.45rem 0.85rem; border-radius: var(--r-pill);
  border: 2.5px solid var(--navy); background: #fff;
  font-size: 0.85rem; font-weight: 900;
}
.readout.safe { background: #EAF7E1; }
.readout.under { background: #FDEEE9; }

/* ---------- Interaction: draw ---------- */
.draw-wrap { background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md); overflow: hidden; }
.draw-wrap canvas { display: block; width: 100%; touch-action: none; background: #fff; cursor: crosshair; }
.draw-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--navy); cursor: pointer; box-shadow: 0 2px 0 var(--navy); }
.swatch[aria-pressed="true"] { transform: scale(1.14); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--navy); }

/* ---------- Interaction: evidence sentence ---------- */
.evidence-card {
  background: linear-gradient(150deg, #FFFDF6, var(--cream-deep));
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 1.3rem 1.4rem;
  box-shadow: 0 4px 0 rgba(43,46,83,0.16);
}
.evidence-card .say { font-size: 1.1rem; font-weight: 800; line-height: 1.9; }
.evidence-card .slot { background: var(--yellow); border-bottom: 3px solid var(--navy); padding: 0.05rem 0.3rem; border-radius: 4px; }
.evidence-card .slot.empty { background: rgba(43,46,83,0.09); color: var(--ink-faint); font-style: italic; }

/* ---------- Checklist ---------- */
.check-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md);
  margin-bottom: 0.7rem;
  cursor: pointer;
  font-size: 1rem; font-weight: 800;
  box-shadow: 0 3px 0 rgba(43,46,83,0.15);
  text-align: left;
  width: 100%;
}
.check-row .box {
  width: 28px; height: 28px; flex: none;
  border: 3px solid var(--navy); border-radius: 9px;
  background: #fff; display: grid; place-items: center;
}
.check-row[aria-checked="true"] { background: #F2FBEC; border-color: var(--green); }
.check-row[aria-checked="true"] .box { background: var(--green); border-color: var(--green); }
.check-row .box .ic { width: 1em; height: 1em; color: #fff; opacity: 0; stroke-width: 3.4; }
.check-row[aria-checked="true"] .box .ic { opacity: 1; }

/* ---------- Differentiation strip ---------- */
.diff-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.diff {
  background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md);
  padding: 1rem 1.15rem; box-shadow: var(--soft-1);
}
.diff h5 { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.4rem; }
.diff p { font-size: 0.93rem; font-weight: 700; color: var(--ink-soft); line-height: 1.55; }
.diff.support h5 { color: var(--blue); }
.diff.core h5 { color: var(--green); }
.diff.stretch h5 { color: var(--purple); }

/* ---------- Day footer / navigation ---------- */
.day-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 1.7rem;
  background: var(--cream);
  border: 4px solid var(--navy);
  border-radius: var(--r-xl);
  box-shadow: var(--lift-2);
}
.day-foot .done-note { font-size: 0.98rem; font-weight: 800; color: var(--ink-soft); max-width: 62ch; line-height: 1.55; }
.day-foot .done-note strong { color: var(--navy); }
.day-foot .actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* Step progress inside a day */
.step-rail { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.step-dot {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #fff; border: 2.5px solid var(--navy); border-radius: var(--r-pill);
  font-size: 0.82rem; font-weight: 900; color: var(--ink-soft);
  cursor: pointer;
}
.step-dot.current { background: var(--navy); color: #fff; }
.step-dot.done { background: #EAF7E1; border-color: var(--green); color: #3D6B25; }
.step-dot .ic { width: 0.9em; height: 0.9em; }

/* ---------- Badges / backpack ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.3rem; }
.badge-card {
  text-align: center;
  background: var(--cream); border: 4px solid var(--navy); border-radius: var(--r-lg);
  padding: 1.5rem 1.1rem; box-shadow: var(--lift-1);
}
.badge-card.locked { background: #fff; opacity: 0.65; }
.badge-medal {
  width: 74px; height: 74px; margin: 0 auto 0.85rem;
  border-radius: 50%; display: grid; place-items: center;
  border: 4px solid var(--navy);
  background: linear-gradient(150deg, var(--yellow), var(--orange));
  box-shadow: 0 4px 0 var(--navy);
  font-size: 2rem; color: #fff;
}
.badge-medal .ic { width: 1em; height: 1em; }
.badge-card.locked .badge-medal { background: #E7E8EF; color: var(--ink-faint); }
.badge-card h4 { font-size: 1.05rem; font-weight: 900; margin-bottom: 0.3rem; }
.badge-card p { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); line-height: 1.5; }

.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  background: #fff; border: 3px dashed var(--navy); border-radius: var(--r-xl);
}
.empty-state .ic { width: 3rem; height: 3rem; color: var(--blue); margin: 0 auto 0.9rem; }
.empty-state h3 { font-size: 1.25rem; font-weight: 900; margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.98rem; font-weight: 700; color: var(--ink-soft); }

/* Backpack entries */
.evidence-list { display: grid; gap: 1rem; }
.evidence-item {
  background: #fff; border: 3px solid var(--navy); border-radius: var(--r-md);
  padding: 1.1rem 1.25rem; box-shadow: var(--soft-1);
}
.evidence-item .where { font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin-bottom: 0.3rem; }
.evidence-item .q { font-size: 0.95rem; font-weight: 900; margin-bottom: 0.4rem; }
.evidence-item .a { font-size: 0.96rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; white-space: pre-wrap; }

/* Lab map */
.map-wrap { background: var(--cream); border: 4px solid var(--navy); border-radius: var(--r-xl); padding: 2rem; box-shadow: var(--lift-2); }
.map-path { display: grid; gap: 1.1rem; }
.map-node {
  display: flex; align-items: center; gap: 1.1rem;
  background: #fff; border: 3px solid var(--navy); border-radius: var(--r-lg);
  padding: 1.1rem 1.3rem; box-shadow: 0 4px 0 rgba(43,46,83,0.15);
}
.map-node .marker {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px; display: grid; place-items: center;
  border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy);
  background: var(--blue); color: #fff; font-weight: 900; font-size: 1.15rem;
}
.map-node h4 { font-size: 1.1rem; font-weight: 900; }
.map-node p { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }
.map-node .go { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 200%);
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--navy); color: #fff;
  border: 3px solid var(--navy-900); border-radius: var(--r-pill);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  font-size: 0.96rem; font-weight: 900;
  z-index: 100;
  transition: transform 0.35s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }
.toast .ic { color: var(--yellow); }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i {
  position: absolute; top: -14px; width: 10px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .opener-top { grid-template-columns: 1fr; }
  .opener-art { border-left: 0; border-top: 4px solid var(--navy); max-height: 300px; }
  .lab-card.feature { flex-direction: column; }
  .lab-card.feature .banner { width: 100%; min-height: 180px; }
}

@media (max-width: 900px) {
  body.portal-shell { height: auto; overflow: auto; }
  .shell { flex-direction: column; }
  .rail {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    align-items: stretch;
  }
  .rail-label, .rail-wennan, .rail-progress { display: none; }
  .rail-foot { margin: 0; padding: 0; border: 0; }
  .nav-btn, .day-tab { width: auto; white-space: nowrap; }
  .day-tab .tab-text small { display: none; }
  .canvas { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
  .canvas-inner { padding: 1.5rem 1.2rem 3rem; }
  .topbar { padding: 0.6rem 0.8rem; gap: 0.5rem; }
  .brand { flex: 0 0 auto; }
  .brand-logo { height: 38px; }
  .brand-divider, .brand-meta { display: none; }
  .topbar-actions { gap: 0.4rem; flex: 0 1 auto; min-width: 0; }
  .user-chip { padding: 0.3rem; }
  .user-chip .who, .user-chip > .ic { display: none; }
  .save-pill { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  .save-pill span { display: none; }
  .opener-copy, .opener-body { padding-left: 1.3rem; padding-right: 1.3rem; }
  .activity { padding: 1.4rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* Print — parents do print a day */
@media print {
  .topbar, .rail, .day-foot, .mic, .btn { display: none !important; }
  body, .canvas { background: #fff; height: auto; overflow: visible; }
  .activity, .opener, .teach { box-shadow: none; break-inside: avoid; }
}
