/* MICE Challenge Lab. Everything is scoped under .mice-ctf so it sits inside any theme. */
.mice-ctf {
  --m-navy: #112958; --m-blue: #2467de; --m-purple: #7b2ac7;
  --m-ink: #17233d; --m-muted: #5b6882; --m-line: #d9e2f2; --m-soft: #f5f7fc; --m-panel: #ffffff;
  --m-ok: #0b7a4b; --m-ok-soft: #e4f6ed; --m-bad: #b42318; --m-bad-soft: #fdecea;
  --m-beginner: #2a8f5c; --m-intermediate: #2467de; --m-advanced: #7b2ac7; --m-final: #c2410c;
  --m-term-bg: #0f172a; --m-term-fg: #dbeafe; --m-term-dim: #93a4c3; --m-term-ok: #86efac;
  --m-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --m-radius: 12px;
  color: var(--m-ink); font-size: 16px; line-height: 1.55; max-width: 1100px; margin: 0 auto;
}
.mice-ctf *, .mice-ctf *::before, .mice-ctf *::after { box-sizing: border-box; }
.mice-ctf [hidden] { display: none !important; }
.mice-joinlink { justify-self: center; }
.mice-ctf h1, .mice-ctf h2, .mice-ctf h3 { color: var(--m-navy); line-height: 1.2; margin: 0; text-wrap: balance; }
.mice-ctf p { margin: .5em 0; }
.mice-ctf code { font-family: var(--m-mono); font-size: .9em; background: var(--m-soft); border: 1px solid var(--m-line); border-radius: 5px; padding: 0 .3em; }
.mice-ctf a { color: var(--m-blue); }
.mice-ctf :focus-visible { outline: 3px solid var(--m-purple); outline-offset: 2px; }
.mice-muted { color: var(--m-muted); }
.mice-loading { color: var(--m-muted); padding: 24px 0; }
.mice-error { color: var(--m-bad); font-weight: 600; min-height: 1.4em; }

/* buttons & inputs */
.mice-btn { appearance: none; border: 0; border-radius: 10px; padding: .7em 1.2em; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--m-blue), var(--m-purple)); cursor: pointer; }
.mice-btn:disabled { opacity: .45; cursor: not-allowed; }
.mice-btn--ghost { background: var(--m-soft); color: var(--m-navy); border: 1px solid var(--m-line); }
.mice-btn--small { padding: .4em .8em; font-size: .9em; }
.mice-link { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--m-blue); text-decoration: underline; cursor: pointer; }
.mice-mini { appearance: none; border: 1px solid var(--m-line); background: var(--m-panel); border-radius: 7px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; color: var(--m-navy); }
.mice-input { display: block; width: 100%; padding: .65em .8em; font: inherit; color: var(--m-ink); background: var(--m-panel); border: 2px solid var(--m-line); border-radius: 10px; }
.mice-input:focus { border-color: var(--m-blue); outline: none; }
.mice-input--mono { font-family: var(--m-mono); font-size: 15px; }
.mice-input--code { font-family: var(--m-mono); font-size: 26px; letter-spacing: .25em; text-transform: uppercase; text-align: center; }
textarea.mice-input { resize: vertical; white-space: pre; tab-size: 4; }
.mice-check { display: inline-flex; gap: .4em; align-items: center; cursor: pointer; }
.mice-tag { display: inline-block; margin-left: .5em; padding: .1em .5em; border-radius: 99px; font-size: .75em; font-weight: 700; background: var(--m-soft); color: var(--m-purple); border: 1px solid var(--m-line); vertical-align: middle; }

/* join */
.mice-joinwrap { display: grid; gap: 20px; max-width: 520px; margin: 24px auto; }
.mice-title { font-size: clamp(26px, 5vw, 38px); text-align: center; }
.mice-card { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 22px; }
.mice-join { display: grid; gap: 10px; }
.mice-join label { font-weight: 700; color: var(--m-navy); }
.mice-members { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mice-center { text-align: center; padding: 40px 20px; }

/* top bar */
.mice-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 16px; background: var(--m-navy); color: #fff; border-radius: var(--m-radius); }
.mice-top .mice-link { color: #c7d5ff; font-size: .9em; }
.mice-top__stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95em; font-variant-numeric: tabular-nums; }
.mice-top__stats b { font-size: 1.1em; }
.mice-clock { font-family: var(--m-mono); background: rgba(255, 255, 255, .12); padding: .1em .6em; border-radius: 6px; }
.mice-notice { padding: 12px 16px; border-radius: 10px; background: var(--m-ok-soft); color: var(--m-ok); font-weight: 600; margin-bottom: 14px; }
.mice-notice--end { background: var(--m-bad-soft); color: var(--m-bad); }

/* filters & grid */
.mice-filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.mice-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mice-chip { appearance: none; font: inherit; font-size: .88em; font-weight: 600; padding: .35em .85em; border-radius: 99px; border: 1px solid var(--m-line); background: var(--m-panel); color: var(--m-ink); cursor: pointer; }
.mice-chip[aria-pressed="true"] { background: var(--m-navy); color: #fff; border-color: var(--m-navy); }
.mice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mice-tile { display: grid; gap: 6px; align-content: start; padding: 14px; min-height: 140px; border-radius: var(--m-radius); background: var(--m-panel); border: 1px solid var(--m-line); border-top: 4px solid var(--m-intermediate); color: var(--m-ink); text-decoration: none; transition: transform .1s ease, box-shadow .1s ease; }
.mice-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(17, 41, 88, .12); }
.mice-tile--beginner { border-top-color: var(--m-beginner); } .mice-tile--advanced { border-top-color: var(--m-advanced); } .mice-tile--final { border-top-color: var(--m-final); }
.mice-tile.is-solved { background: var(--m-ok-soft); }
.mice-tile__num { font-family: var(--m-mono); font-size: .85em; color: var(--m-muted); }
.mice-tile__title { font-weight: 800; color: var(--m-navy); line-height: 1.25; }
.mice-tile__meta { display: flex; gap: 8px; font-size: .82em; color: var(--m-muted); }
.mice-tile__foot { display: flex; justify-content: space-between; margin-top: auto; font-size: .88em; font-variant-numeric: tabular-nums; }
.mice-tile.is-solved .mice-tile__foot span { color: var(--m-ok); font-weight: 700; }

/* challenge */
.mice-crumbs { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: .95em; }
.mice-crumbs--foot { margin-top: 18px; }
.mice-ch__head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 14px; }
.mice-ch__head h2 { font-size: clamp(22px, 4vw, 30px); }
.mice-badge { display: grid; place-items: center; min-width: 64px; height: 64px; border-radius: 14px; color: #fff; font-weight: 900; font-size: 20px; background: var(--m-intermediate); }
.mice-badge--beginner { background: var(--m-beginner); } .mice-badge--advanced { background: var(--m-advanced); } .mice-badge--final { background: var(--m-final); }
.mice-solved { font-weight: 800; color: var(--m-ok); background: var(--m-ok-soft); padding: .3em .8em; border-radius: 99px; }
.mice-panel { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.mice-panel > h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mice-ref > summary { cursor: pointer; font-weight: 800; color: var(--m-navy); text-transform: uppercase; letter-spacing: .06em; font-size: 15px; }
.mice-ev { margin: 0 0 12px; } .mice-ev:last-child { margin-bottom: 0; }
.mice-ev figcaption { font-size: .78em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); margin-bottom: 4px; }
.mice-pre { margin: 0; padding: 12px 14px; background: var(--m-term-bg); color: var(--m-term-fg); border-radius: 10px; font: 14px/1.6 var(--m-mono); white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; }
.mice-tablewrap { overflow-x: auto; }
.mice-table { border-collapse: collapse; width: 100%; font-size: .95em; }
.mice-table th, .mice-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--m-line); vertical-align: top; }
.mice-table th { background: var(--m-soft); font-size: .85em; color: var(--m-muted); }
.mice-table td { font-family: var(--m-mono); font-size: .92em; }
.mice-tasks { margin: 0; padding-left: 1.3em; } .mice-tasks li { margin: .3em 0; }

/* terminal */
.mice-term { background: var(--m-term-bg); color: var(--m-term-fg); border-radius: 10px; padding: 12px 14px; font: 14px/1.55 var(--m-mono); cursor: text; }
.mice-term__out { max-height: 360px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.mice-term__intro { color: var(--m-term-dim); margin-bottom: 8px; }
.mice-term__intro code { background: transparent; border: 0; color: var(--m-term-ok); }
.mice-term__cmd { color: var(--m-term-ok); }
.mice-term__err { color: #fca5a5; }
.mice-term__line { display: flex; gap: .6em; align-items: center; margin-top: 4px; }
.mice-term__prompt { color: var(--m-term-ok); white-space: nowrap; }
.mice-term__in { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--m-term-fg); font: inherit; outline: none; caret-color: var(--m-term-ok); }

/* checkpoint */
.mice-checkpoint { border: 2px solid var(--m-blue); }
.mice-q { font-size: 1.08em; font-weight: 700; }
.mice-format { font-size: .92em; color: var(--m-muted); }
.mice-checkpoint .mice-btn { margin-top: 12px; }
.mice-result { margin-top: 10px; font-weight: 700; min-height: 1.4em; }
.mice-result.is-ok { color: var(--m-ok); } .mice-result.is-bad { color: var(--m-bad); }
.mice-opts { display: grid; gap: 8px; }
.mice-opt { appearance: none; text-align: left; font: inherit; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--m-line); background: var(--m-panel); color: var(--m-ink); cursor: pointer; white-space: pre-wrap; overflow-wrap: anywhere; }
.mice-opt[aria-pressed="true"] { border-color: var(--m-purple); background: #f4edff; }
.mice-order { list-style: decimal; padding-left: 1.6em; margin: 0; display: grid; gap: 8px; }
.mice-order li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-soft); }
.mice-order__btns { display: flex; gap: 4px; flex: none; }
.mice-fields { display: grid; gap: 12px; }
.mice-field label { display: block; font-weight: 700; color: var(--m-navy); margin-bottom: 4px; }

/* hints & debrief */
.mice-hint { padding: 10px 0; border-top: 1px dashed var(--m-line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mice-hint:first-of-type { border-top: 0; }
.mice-hint__head { font-weight: 800; color: var(--m-purple); width: 100%; }
.mice-hint__body { width: 100%; }
.mice-debrief { background: var(--m-ok-soft); border-color: #b9e8cd; }
.mice-classroom { margin-top: 10px; padding: 10px 12px; background: var(--m-panel); border-radius: 10px; }

/* leaderboard */
.mice-board__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--m-line); }
.mice-board__title { font-size: clamp(22px, 4vw, 34px); line-height: 1.1; margin: 0; }
.mice-board__clock { font-family: var(--m-mono); font-size: 1.05em; color: var(--m-purple); font-weight: 700; background: rgba(123, 42, 199, .08); border: 1px solid rgba(123, 42, 199, .28); padding: 6px 13px; border-radius: 999px; white-space: nowrap; }
.mice-board__frozen { padding: 10px 14px; border-radius: 10px; background: #fff7e6; color: #8a4b00; font-weight: 700; margin-bottom: 12px; }
/* The board is a CONTAINMENT CONTEXT so the two-column switch below keys off the board's
   OWN width via @container, NOT the viewport. A full-width PAGE template does not make the
   board wide: a block theme still caps post content at its contentSize (often 720px), so a
   viewport media query would wrongly split a 720px board into two columns and clip Points.
   A container query measures the width the board actually has and only splits when it fits. */
.mice-board { container-type: inline-size; }
/* Single column by DEFAULT so the table always has the full width and the Points column is
   never clipped. The feed sits below it, and only moves beside the table when the BOARD
   (not the window) is wide enough for both — see the @container rule below. */
.mice-board__body { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.mice-board__table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); overflow: hidden; }
.mice-board__table th, .mice-board__table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--m-line); vertical-align: middle; }
.mice-board__table tbody tr:last-child td { border-bottom: 0; }
.mice-board__table th { font-size: .76em; text-transform: uppercase; letter-spacing: .06em; color: var(--m-muted); background: var(--m-soft); font-weight: 700; }
.mice-board__num { text-align: right !important; font-variant-numeric: tabular-nums; }
.mice-board__score { font-weight: 800; color: var(--m-navy); font-size: 1.08em; }
.mice-board__rank { width: 1%; white-space: nowrap; }
.mice-board__name { font-weight: 700; color: var(--m-ink); }

/* circular rank badge */
.mice-rankbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1em; height: 2.1em; padding: 0 .45em; border-radius: 999px; background: var(--m-soft); color: var(--m-muted); font-weight: 800; font-variant-numeric: tabular-nums; border: 1px solid var(--m-line); box-sizing: border-box; }
/* rank-change arrow (vs the previous refresh) */
.mice-delta { font-size: .8em; font-weight: 800; margin-left: .4em; line-height: 1; }
.mice-delta--up { color: var(--m-ok); }
.mice-delta--down { color: var(--m-muted); }

/* zebra + hover for the field (top 3 get their own treatment below) */
.mice-board__table tbody tr:nth-child(even) td { background: rgba(37, 103, 222, .028); }
.mice-board__row:hover td { background: rgba(36, 103, 222, .06); }

/* podium — top 3 */
.mice-board__row.is-top1 { box-shadow: inset 4px 0 0 #e0a800; }
.mice-board__row.is-top2 { box-shadow: inset 4px 0 0 #9aa6b8; }
.mice-board__row.is-top3 { box-shadow: inset 4px 0 0 #c67c3a; }
.mice-board__row.is-top1 td, .mice-board__row.is-top2 td, .mice-board__row.is-top3 td { background: linear-gradient(90deg, rgba(224, 168, 0, .13), transparent 62%); }
.mice-board__row.is-top2 td { background: linear-gradient(90deg, rgba(154, 166, 184, .18), transparent 62%); }
.mice-board__row.is-top3 td { background: linear-gradient(90deg, rgba(198, 124, 58, .14), transparent 62%); }
.mice-board__row.is-top1 .mice-rankbadge { background: linear-gradient(145deg, #ffde7a, #e0a800); color: #5a4300; border-color: #d49a00; }
.mice-board__row.is-top2 .mice-rankbadge { background: linear-gradient(145deg, #eef1f6, #9aa6b8); color: #303a4a; border-color: #8793a6; }
.mice-board__row.is-top3 .mice-rankbadge { background: linear-gradient(145deg, #f0c79c, #c67c3a); color: #5a3410; border-color: #b56d2e; }
.mice-board__row.is-top1 .mice-board__name { font-size: 1.06em; }

.mice-board__row.is-up { animation: mice-flash 2s ease-out; }
@keyframes mice-flash { from { background: #e4f6ed; } to { background: transparent; } }

/* feed */
.mice-board__feed { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 14px 16px; }
.mice-board__feed h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; color: var(--m-muted); }
.mice-board__event { padding: 8px 0; border-top: 1px solid var(--m-line); font-size: .92em; line-height: 1.45; }
.mice-board__event:first-of-type { border-top: 0; }

.mice-board--projector { padding: 2vw; font-size: clamp(16px, 1.6vw, 28px); }

/* Projector mode fills the screen. A block theme caps post content at its contentSize AND
   WordPress core centers constrained children with `margin-left/right: auto !important`
   (selector specificity 0,1,0). To break out we must WIN that cascade, so the full-bleed uses
   all three of the board's classes (specificity 0,3,0) — a plain `.mice-board--projector`
   (0,1,0) only ties core and then LOSES on source order (core's layout CSS prints after the
   plugin stylesheet), which pins the board to the indented content-left → left gap + right
   overflow. calc(50% - 50vw) is self-adjusting: it resolves to ~0 when the board is already
   full width, so it is harmless on themes/pages that do not cap the content width. */
.mice-ctf.mice-board.mice-board--projector {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  box-sizing: border-box;
}
.mice-board--projector .mice-board__table td { padding: .6em .9em; }
.mice-board--projector .mice-rankbadge { min-width: 1.8em; height: 1.8em; }

/* Move the feed beside the table only when the BOARD itself (its own width, not the window's)
   is wide enough for both. The table track floors at 560px and the feed is capped, so the
   table always keeps the bulk of the width and the Points column stays fully visible. Below
   this the feed sits beneath the full-width table. */
@container (min-width: 1000px) {
  .mice-board__body { grid-template-columns: minmax(560px, 1fr) minmax(300px, 360px); }
  .mice-board__feed { position: sticky; top: 12px; }
}

@media (max-width: 760px) {
  .mice-board__title { flex: 1 1 100%; } /* title on its own line, clock drops beneath it */
  .mice-board__table th, .mice-board__table td { padding: 9px 10px; }
  .mice-rankbadge { min-width: 1.9em; height: 1.9em; }
  .mice-ch__head { grid-template-columns: auto 1fr; }
  .mice-ch__head .mice-solved { grid-column: 1 / -1; justify-self: start; }
  .mice-members { grid-template-columns: 1fr; }
}
/* Phones: 4 columns don't fit, and Points is the ranking metric — drop the secondary
   "Solved" count so #, Team and Points always stay on screen (no horizontal scroll). */
@media (max-width: 480px) {
  .mice-board__table th:nth-child(3), .mice-board__table td:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mice-tile, .mice-board__row.is-up { transition: none; animation: none; } }

/* MICE Challenge Lab — teacher panel. Builds on mice-ctf.css design tokens (--m-*). */

.mice-teacher { max-width: 1100px; margin: 0 auto; }
.mice-teacher .mice-title { font-size: clamp(22px, 3.4vw, 32px); line-height: 1.15; margin: 4px 0 0; }

.mice-th__head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.mice-th__head > div:first-child { min-width: 0; }

.mice-statusctl { display: flex; flex-wrap: wrap; gap: 8px; }

/* status pill */
.mice-pill { display: inline-block; font-size: .72em; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; vertical-align: middle; }
.mice-pill--draft  { background: #eef1f6; color: #5a6675; }
.mice-pill--active { background: var(--m-ok-soft, #e4f6ed); color: #157347; }
.mice-pill--paused { background: #fff3cd; color: #8a5a00; }
.mice-pill--ended  { background: #f3e6e6; color: #9a3030; }

/* dashboard list of competitions */
.mice-complist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mice-compcard { text-align: left; background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.mice-compcard:hover { border-color: var(--m-blue); box-shadow: 0 2px 14px rgba(37,103,222,.1); }
.mice-compcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mice-compcard__top strong { font-size: 1.1em; color: var(--m-ink); }
.mice-compcard__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--m-muted); font-size: .9em; }
.mice-compcard__go { color: var(--m-blue); font-weight: 700; font-size: .9em; }

.mice-code { font-family: var(--m-mono); font-weight: 800; letter-spacing: .12em; background: var(--m-soft); border: 1px solid var(--m-line); border-radius: 7px; padding: 2px 8px; }
.mice-code--big { font-size: clamp(22px, 4vw, 34px); padding: 8px 18px; letter-spacing: .2em; }

/* tabs */
.mice-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--m-line); margin-bottom: 18px; }
.mice-tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--m-muted); cursor: pointer; }
.mice-tab:hover { color: var(--m-ink); }
.mice-tab.is-active { color: var(--m-navy); border-bottom-color: var(--m-purple); }

/* generic card (shared with student app, but ensure it exists here) */
.mice-teacher .mice-card { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 18px 20px; margin-bottom: 16px; }
.mice-teacher .mice-card h3 { margin: 0 0 12px; }
.mice-teacher label { display: block; font-weight: 700; font-size: .9em; margin: 12px 0 5px; color: var(--m-ink); }
.mice-teacher .mice-check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 10px 0 0; }
.mice-teacher .mice-check input { margin: 0; }
.mice-input--num { width: 90px; }

/* share */
.mice-share { text-align: center; }
.mice-sharecode { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.mice-sharelink { display: flex; gap: 8px; max-width: 560px; margin: 6px auto 0; }
.mice-sharelink .mice-input { flex: 1; }

/* fact grid */
.mice-factgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mice-fact { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: 10px; padding: 10px 12px; }
.mice-fact__k { display: block; font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: var(--m-muted); font-weight: 700; }
.mice-fact__v { display: block; font-size: 1.05em; font-weight: 700; color: var(--m-ink); margin-top: 2px; }

/* picker */
.mice-pickmodes { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 820px) { .mice-pickmodes { grid-template-columns: 1fr 1fr; } }
.mice-pickcol h4 { margin: 0 0 10px; }
.mice-pickrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mice-pickrow label { margin: 0; width: 86px; }
.mice-pickrow .mice-input--num { margin: 0; }

/* catalog picker */
.mice-specific { margin-top: 12px; }
.mice-catalog { max-height: 420px; overflow-y: auto; border: 1px solid var(--m-line); border-radius: 10px; padding: 8px 12px; margin-top: 10px; }
.mice-catgroup h5 { margin: 12px 0 6px; color: var(--m-muted); text-transform: uppercase; font-size: .76em; letter-spacing: .06em; }
.mice-catitem { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--m-line); font-weight: 500; cursor: pointer; }
.mice-catitem:last-child { border-bottom: 0; }
.mice-catitem__t { flex: 1; min-width: 0; }
.mice-catitem__m { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mice-catitem.is-used { opacity: .72; }
.mice-usedtag { font-size: .72em; font-weight: 800; text-transform: uppercase; color: #8a5a00; background: #fff3cd; border-radius: 6px; padding: 1px 6px; }
.mice-catactions { margin-top: 12px; }

/* difficulty chip */
.mice-dchip { font-size: .72em; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mice-dchip--beginner { background: #e4f6ed; color: #157347; }
.mice-dchip--intermediate { background: #e7eefc; color: #1f52b3; }
.mice-dchip--advanced { background: #f3e6f6; color: #7b2ac7; }
.mice-dchip--final { background: #fde8d6; color: #a85418; }

/* current set */
.mice-setlist { list-style: none; margin: 0; padding: 0; }
.mice-setitem { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--m-line); }
.mice-setitem:last-child { border-bottom: 0; }
.mice-setitem__t { flex: 1; min-width: 0; font-weight: 700; }
.mice-del { color: var(--m-bad, #b42318) !important; }

/* solutions */
.mice-solnote { background: #fff7e6; border-color: #ffe4a0; }
.mice-sol { padding: 0; overflow: hidden; }
.mice-sol__head { width: 100%; text-align: left; background: none; border: 0; padding: 14px 18px; display: flex; align-items: center; gap: 12px; cursor: pointer; font: inherit; }
.mice-sol__t { font-weight: 800; }
.mice-sol__ans { margin-left: auto; color: var(--m-muted); font-family: var(--m-mono); font-size: .85em; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mice-sol__body { padding: 0 18px 16px; border-top: 1px solid var(--m-line); }
.mice-sol__row { margin: 10px 0; }
.mice-mono { font-family: var(--m-mono); background: var(--m-soft); border-radius: 6px; padding: 2px 7px; }
.mice-sol__d { margin: 8px 0; }
.mice-sol__d summary { cursor: pointer; font-weight: 700; color: var(--m-blue); }

/* settings */
.mice-row2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 620px) { .mice-row2 { grid-template-columns: 1fr 1fr; } }
.mice-settings__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 18px; }

/* buttons that may not exist in base css */
.mice-btn--small { padding: 6px 12px; font-size: .9em; }
.mice-btn--danger { background: var(--m-bad, #b42318); }
.mice-btn.is-go { background: #157347; }
.mice-btn.is-end { background: #8a5a00; }

/* request form */
.mice-reqform { max-width: 560px; margin: 0 auto; }

/* modal */
.mice-modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9999; }
.mice-modal__box { background: var(--m-panel); border-radius: var(--m-radius); padding: 22px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.mice-modal__box h3 { margin: 0 0 12px; }
.mice-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; align-items: center; }

/* toast */
.mice-toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--m-ink, #1f2937); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; transition: opacity .25s, transform .25s; z-index: 10000; }
.mice-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.mice-toast.is-bad { background: var(--m-bad, #b42318); }

tr.is-off { opacity: .5; }

/* =========================================================================
 *  Widescreen: the TOOL UIs (student app + teacher panel) use the page's
 *  full width, capped and centered — breaking out of a block theme's narrow
 *  contentSize the same way the projector board does. Reading pages (the
 *  request form and the guides) keep their comfortable column width.
 * ========================================================================= */
#mice-ctf-app.mice-ctf,
.mice-ctf.mice-teacher {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  box-sizing: border-box;
}
.mice-ctf.mice-teacher {
  padding-left: max(16px, calc((100vw - 1240px) / 2));
  padding-right: max(16px, calc((100vw - 1240px) / 2));
}
#mice-ctf-app.mice-ctf {
  padding-left: max(16px, calc((100vw - 1160px) / 2));
  padding-right: max(16px, calc((100vw - 1160px) / 2));
}
/* Keep the single-challenge reading view comfortable even though the app is wide,
   so the challenge GRID can spread into more columns without long lines of text. */
#mice-ctf-app .mice-ch { max-width: 880px; margin-inline: auto; }

/* The dashboard and rosters get a touch more room on very wide screens. */
@media (min-width: 1100px) {
  .mice-complist { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* =========================================================================
 *  Unified hub: landing (no-token) + students tab
 * ========================================================================= */
.mice-cls-hero { max-width: 820px; margin: 8px auto 0; }
.mice-cls-hero .mice-title { font-size: clamp(30px, 5vw, 46px); }
.mice-lede { color: var(--m-muted); font-size: clamp(16px, 2.3vw, 19px); max-width: 60ch; margin: 10px auto 0; line-height: 1.5; }
.mice-cls-how { max-width: 980px; margin: 22px auto; display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .mice-cls-how { grid-template-columns: repeat(3, 1fr); } }
.mice-cls-feature { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 16px 18px; }
.mice-cls-feature h3 { margin: 0 0 6px; font-size: 1.05em; color: var(--m-navy); }
.mice-cls-feature p { margin: 0; color: var(--m-muted); font-size: .95em; line-height: 1.5; }
.mice-teacher .mice-reqform { margin: 16px auto; }
.mice-cls-expired { max-width: 680px; margin: 8px auto 0; background: var(--m-bad-soft); border-color: #f3c9c4; }

/* students tab: join methods + roster actions */
.mice-joinmethods .mice-method { border-top: 1px solid var(--m-line); padding: 16px 0; }
.mice-joinmethods .mice-method:first-of-type { border-top: 0; padding-top: 4px; }
.mice-joinmethods .mice-method h4 { margin: 0 0 6px; }
.mice-rowactions { white-space: nowrap; }
.mice-rowactions .mice-link { margin-right: 10px; font-size: .9em; }
.mice-rowactions .mice-del { color: var(--m-bad) !important; }

/* advancement tab (multi-level add-on) */
.mice-note { color: var(--m-navy); background: var(--m-accent-soft, #eef4fb); border: 1px solid var(--m-line); border-radius: 8px; padding: 8px 12px; font-size: .9em; margin: 10px 0 0; }
.mice-adv__foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.mice-board__table tr.is-advanced { opacity: .6; }
.mice-board__table tr.is-advanced td { font-style: italic; }
.mice-settings__locked { flex: 1; align-self: center; margin: 0; font-size: .9em; }
