/* Calvin's School — clean, linear, easy to scan. No tiles, no gamification.
   Layout principle (James 2026-08-14): single column, lists and tables with
   hairline separators, one obvious action per row. Boxed panels only for rare
   focal moments (login, check-in, celebration). */

:root {
  --bg: #fbfcfe;
  --panel: #ffffff;
  --text: #1e2637;
  --muted: #64708a;
  --border: #e4e8f0;
  --accent: #2f6fdf;
  --accent-soft: #e8f0fd;
  --good: #178a44;
  --good-soft: #e6f5ec;
  --wait: #b26a05;
  --wait-soft: #fdf3e0;
  --danger: #c22f2f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --panel: #191e27;
    --text: #e8edf6;
    --muted: #94a0b8;
    --border: #2a3342;
    --accent: #6aa2f8;
    --accent-soft: #1c2f4e;
    --good: #43c377;
    --good-soft: #16341f;
    --wait: #e3a94e;
    --wait-soft: #3a2d13;
    --danger: #f07575;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

/* ---- header / nav ---- */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.2rem 0.4rem;
}
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
nav { display: flex; align-items: baseline; gap: 1.2rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--accent); }
nav a.active { color: var(--text); border-bottom-color: var(--accent); }

.subnav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
  padding: 0.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.subnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--accent); }
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 0.4rem 1.2rem 3rem; }

h1 { font-size: 1.5rem; margin: 0.8rem 0 0.1rem; }
h2 {
  font-size: 1.05rem;
  margin: 2rem 0 0.3rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
a { color: var(--accent); }
.muted { color: var(--muted); margin: 0.2rem 0; }
.small { font-size: 0.85rem; }
.error { color: var(--danger); font-weight: 600; }
.ok-banner {
  background: var(--good-soft); color: var(--good); font-weight: 600;
  border-radius: 8px; padding: 0.5rem 0.8rem;
}

/* ---- row lists (tasks, approvals, courses) ---- */
.rows { margin: 0.4rem 0; }
.row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }

.status-dot {
  flex: 0 0 1.6rem;
  height: 1.6rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
}
.status-dot.verified { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.status-dot.pending_approval { background: var(--wait-soft); border-color: var(--wait); color: var(--wait); }
.status-dot.todo { border-color: var(--accent); }

.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 0.88rem; margin-top: 0.1rem; }
.row-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.5rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}
.tag.plain { background: var(--border); color: var(--muted); }

.note {
  display: inline-block;
  background: var(--wait-soft);
  color: var(--text);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  margin-top: 0.3rem;
  font-size: 0.88rem;
}
.kickback {
  background: var(--wait-soft);
  color: var(--text);
  border-left: 4px solid var(--wait);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0.45rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.big { font-size: 1.05rem; padding: 0.65rem 1.3rem; }
.linklike {
  background: none; border: none; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; padding: 0;
}
.linklike:hover { color: var(--accent); }

/* ---- focal panels (login, check-in, celebration only) ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin: 1.2rem 0;
}
.panel.center { text-align: center; padding: 2.2rem 1.6rem; }
.panel.center h2 { border: none; margin: 0 0 0.4rem; font-size: 1.4rem; }
.done-list { list-style: none; padding: 0; text-align: left; max-width: 460px; margin: 1rem auto 0; }
.done-list li { padding: 0.15rem 0; }
.login-panel { max-width: 380px; margin: 3rem auto; }

/* click-through lesson */
.connection {
  background: var(--accent-soft); color: var(--text);
  border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 0.7rem 0.9rem; margin: 0.8rem 0; font-size: 0.92rem;
}
.lesson { margin-top: 1rem; }
.slide { animation: slidein 0.2s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.slide { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 1.6rem; min-height: 220px; }
.slide-emoji { font-size: 2.6rem; line-height: 1; }
.slide h2 { border: none; margin: 0.5rem 0 0.6rem; }
.slide p { font-size: 1.05rem; line-height: 1.6; }
.slide-bullets { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.slide-bullets li { font-size: 1.02rem; line-height: 1.55; margin: 0.35rem 0; }
.slide-img {
  display: block; width: 100%; max-height: 300px; object-fit: cover;
  border-radius: 10px; margin: 0.2rem 0 0.7rem; border: 1px solid var(--border);
}
.img-credit { color: var(--muted); font-size: 0.72rem; margin-top: -0.4rem; }
.slide.intro { text-align: center; }
.intro-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0.2rem 0.7rem; }
.intro-title { border: none; font-size: 1.8rem; margin: 0.7rem 0 0.3rem; }
.intro-sub { font-size: 1.05rem; color: var(--muted); max-width: 42ch; margin: 0 auto 0.6rem; }
.slide.intro .connection { text-align: left; }
.toc-list { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.toc-list li { font-size: 1.05rem; padding: 0.5rem 0.2rem; border-bottom: 1px solid var(--border); }
.toc-list li:last-child { border-bottom: none; }
.q-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 0.1rem 0.6rem; margin-bottom: 0.5rem; }
.q-feedback { margin-top: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 8px; font-weight: 600; }
.q-feedback.good { background: var(--good-soft); color: var(--good); }
.q-feedback.bad { background: var(--wait-soft); color: var(--wait); }
.answer-hint {
  margin-top: 0.7rem; padding: 0.5rem 0.75rem; border-radius: 8px;
  background: var(--danger); color: #fff; font-weight: 600;
}
.answer-hint.flash { animation: hintflash 0.35s ease; }
@keyframes hintflash { 0% { transform: scale(0.96); } 50% { transform: scale(1.03); } 100% { transform: none; } }

/* course footer with progress bar */
.course-foot { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.pbar { flex: 1; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.pbar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.pbar-label { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.quiz .q { margin: 1rem 0; }
.q-text { font-weight: 600; margin-bottom: 0.4rem; }
.q-opt { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; font-weight: 400; cursor: pointer; }
.q-opt input { width: auto; }

/* check-out stats screen */
.stat-grid {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin: 1.4rem 0 0.6rem;
}
.stat { min-width: 84px; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.subjects-row { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0; }
.subject-chip {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; margin: 0.4rem 0; }
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.6rem 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

.bar {
  display: inline-block;
  width: 110px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.fill { display: block; height: 100%; background: var(--good); border-radius: 999px; }

/* ---- forms & inline editors ---- */
form label { display: block; margin: 0.55rem 0 0.15rem; font-weight: 600; font-size: 0.88rem; }
form label.inline { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 1rem; font-weight: 500; }
input:not([type="checkbox"]), select {
  width: 100%;
  max-width: 420px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.weekday-picks { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.4rem 0; }
.wd { display: inline-flex !important; align-items: center; gap: 0.25rem; font-weight: 500 !important; margin: 0 !important; }

/* week grid on the requirements page */
.week-scroll { overflow-x: auto; }
.week-grid { border-collapse: collapse; width: 100%; min-width: 460px; margin: 0.6rem 0; }
.week-grid th, .week-grid td { border-bottom: 1px solid var(--border); padding: 0.5rem 0.4rem; text-align: center; }
.week-grid thead th {
  font-size: 0.8rem; color: var(--muted); border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.week-grid th.corner, .week-grid td.track-cell {
  text-align: left; white-space: nowrap; position: sticky; left: 0;
  background: var(--bg); z-index: 1;
}
.week-grid td.track-cell { font-weight: 500; padding-right: 1rem; }
.week-grid td.track-cell.done { text-decoration: line-through; color: var(--muted); text-decoration-thickness: 1px; }
.tag.pct-green  { background: var(--good-soft); color: var(--good); text-decoration: none; display: inline-block; }
.tag.pct-yellow { background: var(--wait-soft); color: var(--wait); text-decoration: none; display: inline-block; }
.tag.pct-red    { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); text-decoration: none; display: inline-block; }
.week-grid .daycount {
  display: inline-block; margin-left: 0.35rem; min-width: 1.3rem;
  font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0 0.35rem;
}
.week-grid th.weekend, .week-grid td.weekend { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.week-grid tr.off { opacity: 0.5; }
.mark { font-size: 1.05rem; line-height: 1; }
.mark.sched { color: var(--accent); }   /* blue — not a RAG status */
.legend { margin-top: 0.2rem; }

/* status pills (parent Today table) */
.status-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-verified { background: var(--good-soft); color: var(--good); }
.status-todo { background: var(--wait-soft); color: var(--wait); }
.status-pending { background: color-mix(in srgb, var(--wait) 22%, transparent); color: var(--wait); }
.status-inprogress { background: var(--accent-soft); color: var(--accent); }
.tag.inprogress-tag { background: var(--accent-soft); color: var(--accent); }
.status-dot.inprogress { border-color: var(--accent); color: var(--accent); }

.btn.verifying {
  background: var(--wait-soft); border-color: var(--wait); color: var(--wait);
  cursor: default; font-weight: 700;
}
.done-pill {
  display: inline-block; font-weight: 700; color: var(--good);
  background: var(--good-soft); border-radius: 999px; padding: 0.4rem 0.9rem;
}

/* live check-in clock (parent dashboard) */
#school-clock { font-weight: 700; }
#school-clock.clock-red { color: var(--danger); }
#school-clock.clock-yellow { color: var(--wait); }
#school-clock.clock-green { color: var(--good); }

/* bookshelf */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.2rem 1rem;
  margin: 0.8rem 0;
}
.book { text-align: center; }
.cover, .mini-cover {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.cover {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .spine {
  padding: 0.6rem; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center; height: 100%;
}
.book-title { font-weight: 600; font-size: 0.9rem; margin-top: 0.4rem; line-height: 1.25; }
.book-author { color: var(--muted); font-size: 0.82rem; }
.book-date { color: var(--good); font-size: 0.8rem; font-weight: 600; margin-top: 0.15rem; }
.book .editor { margin-top: 0.2rem; }
.book .editor > summary { font-size: 0.8rem; }

.reading-row .mini-cover { flex: 0 0 46px; width: 46px; height: 69px; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-cover .spine { display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 700; color: var(--muted); }
.reading-actions { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.4rem; }
.reading-actions form { margin: 0; }
.inline-book { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-book label { margin: 0; }
.live-pct { font-weight: 700; color: var(--accent); align-self: center; min-width: 2.5rem; }
.add-book {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.8rem 1.1rem; margin: 1rem 0;
  display: flex; gap: 0.8rem; align-items: flex-end; flex-wrap: wrap;
}
.add-book label { margin: 0; }
.add-book .pagefields { display: flex; gap: 0.5rem; }

details.editor { margin-top: 0.3rem; }
details.editor > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  list-style: none;
}
details.editor > summary::before { content: "▸ "; }
details.editor[open] > summary::before { content: "▾ "; }
details.editor > .editor-body {
  border-left: 3px solid var(--border);
  padding: 0.2rem 0 0.6rem 1rem;
  margin: 0.4rem 0 0.2rem;
}
.editor-body form { margin-bottom: 0.8rem; }
.editor-body button { margin-top: 0.5rem; }

/* ---- history course map (completion tracking; not gamified) ---- */
.coursemap { margin: 1rem 0; }
.coursemap-head { margin-bottom: 0.5rem; }
.coursemap-head strong { display: block; margin-bottom: 0.35rem; }
.coursemap-bar {
  height: 8px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.coursemap-bar span {
  display: block; height: 100%; background: var(--good); border-radius: 999px;
  transition: width 0.3s ease;
}
.coursemap-list { list-style: none; margin: 0; padding: 0; }
.coursemap-list li {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.4rem 0.2rem; border-bottom: 1px solid var(--border);
}
.coursemap-list li:last-child { border-bottom: none; }
.cm-mark { width: 1.2rem; text-align: center; flex: none; font-weight: 700; }
.cm-name { flex: 1; }
.cm-score { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.cm-done .cm-mark { color: var(--good); }
.cm-done .cm-name { color: var(--muted); }
.cm-current .cm-mark { color: var(--accent); }
.cm-current .cm-name { font-weight: 600; }
.cm-upcoming { color: var(--muted); }
.cm-upcoming .cm-mark { color: var(--border); }
.cm-just { background: var(--good-soft); border-radius: 8px; }
.coursemap-toggle { margin: 0.2rem 0 1rem; }
.coursemap-toggle > summary {
  cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 0.3rem 0;
}
.coursemap-toggle[open] > summary { margin-bottom: 0.3rem; }

/* ---- hands-on science plan (parent look-ahead) ---- */
.sci-next { border-left: 4px solid var(--accent); }
.sci-next-tag {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); font-weight: 700; margin-bottom: 0.2rem;
}
.sci-next h2 { margin: 0.1rem 0 0.4rem; }
.sci-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.sci-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; background: var(--panel);
}
.sci-item.cm-done { opacity: 0.65; }
.sci-item.cm-current { border-color: var(--accent); background: var(--accent-soft); }
.sci-head { display: flex; align-items: baseline; gap: 0.5rem; }
.sci-head .cm-mark { width: 1.1rem; text-align: center; flex: none; font-weight: 700; }
.sci-item.cm-done .cm-mark { color: var(--good); }
.sci-item.cm-current .cm-mark { color: var(--accent); }
.sci-title { flex: 1; font-weight: 600; }
.sci-unit {
  font-size: 0.72rem; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.5rem;
}
.sci-summary { margin: 0.35rem 0 0.3rem 1.6rem; }
.sci-meta { margin: 0.15rem 0 0 1.6rem; font-size: 0.9rem; }
.sci-notes { color: var(--muted); }

/* ---- parent course review ---- */
.review-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.review-list li { margin-bottom: 0.4rem; }
.review-unit {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem;
  text-decoration: none; color: var(--text); background: var(--panel);
}
.review-unit:hover { border-color: var(--accent); background: var(--accent-soft); }
.review-unit-name { font-weight: 600; }
.review-unit-meta { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.rv-block { margin: 0 0 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.rv-kicker {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; margin-bottom: 0.3rem;
}
.rv-intro { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; }
.rv-slide h3 { margin: 0.1rem 0 0.5rem; }
.rv-img {
  max-width: 340px; width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--border); margin: 0.2rem 0 0.6rem; display: block;
}
.rv-q { font-weight: 600; margin: 0.2rem 0 0.4rem; }
.rv-opts { list-style: none; margin: 0 0 0.3rem; padding: 0; }
.rv-opts li { padding: 0.15rem 0.4rem; border-radius: 6px; }
.rv-opts li.rv-correct { background: var(--good-soft); color: var(--good); font-weight: 600; }
.rv-explain { margin: 0.2rem 0 0; font-size: 0.9rem; }
.rv-check { background: var(--panel); }
.rv-testlist > li { margin-bottom: 1rem; }
.rv-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---- book match dialog (Plex-style) ---- */
.bmm {
  position: fixed; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(15, 20, 30, 0.55);
}
.bmm[hidden] { display: none; }
.bmm-box {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.bmm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border);
}
.bmm-head strong { font-size: 1.05rem; }
.bmm-x {
  border: none; background: none; font-size: 1.1rem; cursor: pointer;
  color: var(--muted); line-height: 1; padding: 0.2rem 0.4rem;
}
.bmm-body { padding: 0.8rem 1.1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; }
.bmm-msg { color: var(--muted); margin: 0.6rem 0; }
.bmm-foot { padding: 0.8rem 1.1rem; border-top: 1px solid var(--border); }

.cover-opt {
  display: flex; gap: 0.75rem; text-align: left; align-items: flex-start;
  padding: 0.55rem; border: 2px solid var(--border); border-radius: 10px;
  background: var(--panel); cursor: pointer; width: 100%;
}
.cover-opt img { width: 66px; height: auto; border-radius: 5px; flex: none; }
.cover-opt-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cover-opt-meta strong { line-height: 1.2; }
.cover-opt-by { font-size: 0.8rem; color: var(--muted); }
.cover-opt-meta p {
  margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.cover-opt:hover { border-color: var(--accent); background: var(--accent-soft); }

.bmm-url {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); font-size: 0.9rem;
}

.bmm-note { margin: 0 0 0.3rem; font-size: 0.86rem; color: var(--muted); }
.bmm-link {
  border: none; background: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--accent); text-decoration: underline;
}

/* ---- optional "do more" menu ---- */
.more-grid { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.4rem 0 1rem; }
.more-grid form { margin: 0; }
.more-item {
  display: flex; align-items: baseline; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel);
}
.more-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.more-add { color: var(--accent); font-weight: 700; flex: none; }
.more-name { font-weight: 600; }
.more-next { color: var(--muted); font-size: 0.85rem; }

/* ---- science plan (collapsible entries on Course review) ---- */
.sci-plan { margin: 0.3rem 0 0.5rem; }
.sci-entry { border: 1px solid var(--border); border-radius: 9px; margin-bottom: 0.4rem; background: var(--panel); }
.sci-entry.cm-current { border-color: var(--accent); }
.sci-entry.cm-done { opacity: 0.7; }
.sci-entry > summary {
  cursor: pointer; padding: 0.55rem 0.7rem; display: flex; align-items: baseline; gap: 0.5rem;
}
.sci-entry > summary::-webkit-details-marker { display: none; }
.sci-entry .cm-mark { width: 1.1rem; text-align: center; flex: none; font-weight: 700; }
.sci-entry.cm-done .cm-mark { color: var(--good); }
.sci-entry.cm-current .cm-mark { color: var(--accent); }
.sci-entry-title { flex: 1; font-weight: 600; }
.sci-entry-body { padding: 0 0.7rem 0.7rem 2.3rem; }
.sci-entry-body p { margin: 0.25rem 0; }
.sci-entry-body .sci-meta { font-size: 0.9rem; }
.sci-entry-body .sci-notes { color: var(--muted); }

/* ---- activity swap ---- */
.swap-link {
  display: inline-block; margin-top: 0.2rem; font-size: 0.82rem;
  color: var(--accent); text-decoration: none;
}
.swap-link:hover { text-decoration: underline; }
.tag.swap-waiting { background: var(--wait-soft); color: var(--wait); white-space: nowrap; }
.swap-options { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.swap-opt {
  display: flex; align-items: baseline; gap: 0.6rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.swap-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.swap-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.swap-opt-name { font-weight: 600; }
.swap-opt-next { color: var(--muted); font-size: 0.85rem; }
.swap-reason { display: block; margin: 0.6rem 0; }

/* ---- Parent-picked videos (self-hosted, no social embed): a row of up to 3 ---- */
.video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 0.4rem 0 1.4rem;
  align-items: start;
}
.video-card {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem;
}
.video-card video {
  display: block;
  width: 100%;
  max-height: 60vh;            /* portrait clips stay on-screen */
  border-radius: 10px;
  background: #000;
}
.video-card figcaption { padding: 0.6rem 0.3rem 0.2rem; }
.video-title { font-weight: 700; }
.video-blurb { color: var(--muted); margin-top: 0.2rem; font-size: 0.92rem; }
.video-credit { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; font-style: italic; }
/* collapse to two, then one, so reels never get too small to watch */
@media (max-width: 720px) { .video-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .video-row { grid-template-columns: 1fr; } }

/* ---- Flash banner (one-shot feedback after an action) ---- */
.flash {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
  font-weight: 600;
}

/* ---- Print: progress report as a clean record (hide chrome) ---- */
@media print {
  header, .subnav, .no-print { display: none !important; }
  main { max-width: none; margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  .table, .row, .stat { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* ---- Report: Time-per-day bar chart with a y-axis ---- */
.daychart { display: flex; gap: 6px; align-items: flex-start; }
.daychart-y { position: relative; flex: 0 0 42px; height: 180px; }
.dytick { position: absolute; right: 4px; transform: translateY(50%); font-size: 0.66rem; color: var(--muted); white-space: nowrap; }
.daychart-scroll { flex: 1; overflow-x: auto; padding-bottom: 0.2rem; }
.daychart-plot { position: relative; height: 180px; width: max-content; min-width: 100%; }
.daychart-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.daychart-cols { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.dcol { flex: 1 0 34px; height: 100%; display: flex; align-items: flex-end; }
.dbar { position: relative; width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.dval { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-size: 0.62rem; color: var(--text); white-space: nowrap; }
.daychart-xlabels { display: flex; gap: 6px; margin-top: 4px; }
.dxlabel { flex: 1 0 34px; text-align: center; font-size: 0.66rem; color: var(--muted); white-space: nowrap; }
/* weekend time stands out in green */
.dcol.weekend .dbar { background: var(--good); }
.dcol.weekend .dval { color: var(--good); }
.dxlabel.weekend { color: var(--good); }

/* ---- Report: Time-per-subject horizontal bars (equal-length tracks) ---- */
.hbars { margin: 0.6rem 0; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 58px; align-items: center; gap: 8px; padding: 0.28rem 0; }
.hbar-label { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--border); border-radius: 6px; height: 14px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.hbar-val { font-size: 0.82rem; color: var(--muted); white-space: nowrap; text-align: right; }

/* report period: custom date inputs only shown when "Custom" is chosen */
.custom-range { display: inline-flex; align-items: flex-end; gap: 0.6rem; }

/* Day-bar hover tooltip: per-subject breakdown (rendered into a fixed layer) */
.dtip { display: none; }   /* data source only; cloned into #daytip on hover */
.daytip {
  position: fixed; z-index: 60;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  padding: 0.5rem 0.65rem; font-size: 0.8rem;
  min-width: 150px; max-width: 240px; pointer-events: none;
}
.daytip[hidden] { display: none; }
.dtip-head { font-weight: 700; margin-bottom: 0.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
.dtip-row { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.1rem 0; }
.dtip-val { color: var(--muted); white-space: nowrap; }
