/* ==========================================================================
   DC Sketchfest 2027 — Judge's App
   Riso print shop: cobalt, fluorescent pink and sun yellow on warm paper,
   heavy outlines, hard offset shadows. Tokens lifted from the festival site
   so the two read as one brand.
   ========================================================================== */

:root {
  --ink:    #211b3a;
  --paper:  #f6efe1;
  --blue:   #2b3fbf;
  --pink:   #ef4d8e;
  --yellow: #ffc933;
  --white:  #fffdf8;
  --green:  #1f8a5b;

  --font-display: "Anton", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, sans-serif;

  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius: 18px;
  --radius-pill: 999px;

  --wrap: 68rem;
}

@media (max-width: 767px) {
  :root { --shadow: 5px 5px 0 var(--ink); --radius: 14px; }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(rgba(33, 27, 58, .07) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--yellow); color: var(--ink);
  padding: .75rem 1rem; border: var(--border); font-weight: 700;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 100; }

/* ---------------------------------------------------------- typography --- */

.display {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 .35rem;
}
.display--sm { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 2.5rem 0 .75rem; }
.sub { margin: 0; font-size: .95rem; opacity: .75; }
.fineprint { font-size: .8rem; opacity: .7; margin: 1.5rem 0 0; line-height: 1.5; }
a { color: var(--blue); }

/* -------------------------------------------------------------- layout --- */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 2.5rem 1.25rem 6rem; }
.wrap--narrow { max-width: 46rem; }
.view[hidden] { display: none; }

/* -------------------------------------------------------------- topbar --- */

.topbar {
  border-bottom: var(--border);
  background: var(--blue);
  color: var(--white);
  position: sticky; top: 0; z-index: 20;
}
.topbar[hidden] { display: none; }
.topbar__inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: 1.15rem; letter-spacing: .02em; line-height: 1;
}
.wordmark span { color: var(--yellow); }
.topbar__nav { display: flex; gap: .5rem; margin-left: auto; }
.topbar__who {
  display: flex; align-items: center; gap: .75rem;
  font-size: .85rem; margin-left: 1rem;
}

.tab {
  font: inherit; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--white);
  border: 2px solid transparent; border-radius: var(--radius-pill);
  padding: .35rem .9rem;
}
.tab:hover { border-color: rgba(255,253,248,.5); }
.tab.is-on { background: var(--yellow); color: var(--ink); border-color: var(--ink); }

.linkbtn {
  font: inherit; background: none; border: 0; padding: 0;
  color: inherit; text-decoration: underline; cursor: pointer;
}
.linkbtn--back {
  color: var(--ink); font-weight: 700; text-decoration: none;
  margin-bottom: 1.5rem; display: inline-block;
}
.linkbtn--back:hover { text-decoration: underline; }

/* --------------------------------------------------------------- login --- */

.view--login {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
}
.card {
  background: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
}
.card--login { width: min(26rem, 100%); }
.card--login .sub { margin-bottom: 1.75rem; }

label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }

input[type="text"], textarea {
  width: 100%; font: inherit; color: inherit;
  background: var(--paper);
  border: var(--border); border-radius: 12px;
  padding: .7rem .9rem;
}
input[type="text"]:focus-visible, textarea:focus-visible,
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--pink); outline-offset: 2px;
}
#code {
  font-family: var(--font-display); font-size: 1.5rem;
  letter-spacing: .18em; text-align: center; text-transform: uppercase;
}

/* ------------------------------------------------------------- buttons --- */

.btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  text-align: center; text-decoration: none;
  border: var(--border); border-radius: var(--radius-pill);
  padding: .7rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--pink); color: var(--white); width: 100%; margin-top: 1.25rem; }
.btn--ghost { background: var(--white); color: var(--ink); }
/* A gated button has to look gated: the donation backfill stays disabled
   until a dry run has said what it would do, and that is only a safeguard if
   you can see it. Matches .iconbtn:disabled below. */
.btn:disabled { opacity: .35; cursor: not-allowed; }
.actions .btn--primary { width: auto; margin-top: 0; }

.error {
  background: var(--pink); color: var(--white);
  border: var(--border); border-radius: 12px;
  padding: .6rem .8rem; font-size: .85rem; font-weight: 700;
  margin: 1rem 0 0;
}
.error[hidden] { display: none; }

/* ---------------------------------------------------------------- list --- */

.listhead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.filters { display: flex; gap: .4rem; }
.chip {
  font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
  background: var(--white); color: var(--ink);
  border: var(--border); border-radius: var(--radius-pill);
  padding: .35rem .9rem;
}
.chip.is-on { background: var(--yellow); }

.progress {
  height: 14px; background: var(--white);
  border: var(--border); border-radius: var(--radius-pill);
  overflow: hidden; margin-bottom: 2rem;
}
.progress__bar {
  height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--green) 0 8px, #29a06c 8px 16px);
  transition: width .3s ease;
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.subcard {
  background: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.4rem;
  display: flex; align-items: center; gap: 1.25rem;
  cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
  transition: transform .08s ease, box-shadow .08s ease;
}
.subcard:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.subcard__body { flex: 1; min-width: 0; }
.subcard__title { font-family: var(--font-display); text-transform: uppercase; font-size: 1.25rem; line-height: 1.05; }
.subcard__meta { font-size: .85rem; opacity: .75; margin-top: .25rem; }

.badge {
  flex-shrink: 0;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border: 2px solid var(--ink); border-radius: var(--radius-pill);
  padding: .25rem .7rem;
}
.badge--done     { background: var(--green);  color: var(--white); }
.badge--draft    { background: var(--yellow); color: var(--ink); }
.badge--todo     { background: var(--white);  color: var(--ink); }
.badge--conflict { background: var(--ink);    color: var(--white); }

.empty { text-align: center; opacity: .7; padding: 3rem 0; }

/* -------------------------------------------------------------- detail --- */

.detail {
  background: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem; margin-bottom: 2rem;
}
.detail__meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: .75rem 0 1.25rem;
}
.detail__meta span {
  font-size: .8rem; font-weight: 700;
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: var(--radius-pill); padding: .2rem .7rem;
}
.detail__desc { white-space: pre-wrap; }
.embed {
  position: relative; aspect-ratio: 16 / 9;
  border: var(--border); border-radius: 12px; overflow: hidden;
  margin-bottom: 1.25rem; background: var(--ink);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ----------------------------------------------------------- scoreform --- */

.scoreform {
  background: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}
.scoreform .display--sm { margin-top: 0; }

.criterion { padding: 1.1rem 0; border-top: 2px dashed rgba(33,27,58,.25); }
.criterion:first-child { border-top: 0; padding-top: 0; }
.criterion__label { font-weight: 700; }
.criterion__desc { font-size: .85rem; opacity: .7; margin: .15rem 0 .6rem; }

/* One row, always: a 5 wrapping under the 1 breaks the red-to-green read.
   The buttons share the row and shrink on a phone instead of wrapping. */
.scale { display: flex; gap: .4rem; flex-wrap: nowrap; max-width: 18rem; }
.scale input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale label {
  margin: 0; cursor: pointer;
  min-width: 2.75rem; text-align: center;
  font-family: var(--font-display); font-size: 1.1rem;
  background: var(--paper); border: var(--border); border-radius: 12px;
  padding: .45rem .5rem;
  transition: transform .08s ease;
}
.scale label:hover { transform: translateY(-2px); }
/* 1 to 5, graded red to green. Every button wears a pale tint of its colour
   so the gradient reads before anything is picked; the chosen one goes full
   strength with the hard shadow. Stops are set by app.js from the value's
   position on the scale (0 lowest .. 4 highest), not from the number. */
.scale__opt--0 { --tone: #c83a3a; --on-tone: var(--white); }
.scale__opt--1 { --tone: #e8743b; --on-tone: var(--ink); }
.scale__opt--2 { --tone: #f2c230; --on-tone: var(--ink); }
.scale__opt--3 { --tone: #8cc152; --on-tone: var(--ink); }
.scale__opt--4 { --tone: #1f8a5b; --on-tone: var(--white); }
.scale label.scale__opt { background: color-mix(in srgb, var(--tone) 22%, var(--paper)); flex: 1 1 0; min-width: 0; }
.scale input:checked + label.scale__opt {
  background: var(--tone); color: var(--on-tone); box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.scale input:checked + label { background: var(--blue); color: var(--white); box-shadow: var(--shadow-sm); }
.scale input:focus-visible + label { outline: 3px solid var(--pink); outline-offset: 2px; }
.scale__ends {
  display: flex; justify-content: space-between; max-width: 18rem;
  font-size: .75rem; opacity: .65; margin-top: .35rem;
}

.rec { border: 0; padding: 1.25rem 0 0; margin: 0; }
.rec legend { font-weight: 700; font-size: .9rem; padding: 0; }
/* The vote is half the score, so it gets the scorecard's biggest heading. */
.rec legend.rec__head {
  font-family: var(--font-display); font-weight: 400; letter-spacing: .01em;
  font-size: clamp(1.5rem, 3.6vw, 2rem); line-height: 1.1;
  margin-top: 1rem;
}
/* A darker pink than --pink: this is body-size text and needs 4.5:1 on white. */
.rec__weight { margin: .35rem 0 0; font-weight: 700; font-size: .9rem; color: #b8235f; }
.rec__opts .rec__opt span { font-size: 1.05rem; padding: .55rem 1.35rem; }
/* .pointer__body keeps typed line breaks (the feedback guide relies on them);
   this one is built HTML, so its template newlines must not show. */
.pointer__body.formula { white-space: normal; }
.formula ul { margin: .4rem 0 .6rem 1.1rem; padding: 0; }
.formula p { margin: .5rem 0; }
.formula__eq {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: .5rem .65rem;
}

/* Swap request: top of the scorecard, before any opinion is formed. */
.scoreform .swap + .display--sm { margin-top: 2rem; }
.swap { margin-bottom: .5rem; }
.btn--swap { width: 100%; justify-content: center; background: var(--paper); }
.swap__help { font-size: .85rem; opacity: .8; margin: .5rem 0 0; }
.swap__form { margin-top: .5rem; }
/* .btn sets display, which beats the browser's own [hidden] rule. */
.btn[hidden], .swap__form[hidden], .swap__done[hidden], #swapIdle[hidden] { display: none; }
.swap__done {
  border: var(--border); border-radius: 14px; background: color-mix(in srgb, var(--pink) 14%, var(--white));
  padding: .9rem 1rem; font-size: .9rem;
}
.swap__done .actions { margin-top: .75rem; }
.field__opt { font-weight: 400; opacity: .7; }

/* Private notes: visibly not part of what the committee reads. */
.notes textarea { background: color-mix(in srgb, var(--yellow) 12%, var(--white)); border-style: dashed; }
.notes__help { display: block; font-size: .82rem; opacity: .75; margin: -.15rem 0 .45rem; }

/* Admin: open-request count on the tab, request cards, hand-assignment list. */
.chip__count {
  display: inline-block; margin-left: .4rem; min-width: 1.3rem; padding: 0 .35rem;
  border-radius: var(--radius-pill); background: var(--pink); color: var(--white);
  font-size: .75rem; font-weight: 700; text-align: center;
}
.chip__count[hidden] { display: none; }
.swapcard {
  border: var(--border); border-radius: 14px; background: var(--white);
  padding: .9rem 1rem; margin-top: 1rem; display: grid; gap: .45rem;
}
.swapcard__head .sub { margin-left: .5rem; }
.swapcard__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .3rem; }
.swapcard__actions select { flex: 1 1 14rem; width: auto; max-width: 100%; }
.assignlist { list-style: none; margin: 1rem 0 0; padding: 0; columns: 2 22rem; column-gap: 1.5rem; }
.assignlist li { break-inside: avoid; }
.assignrow { margin-top: .35rem; align-items: center; }
.assignrow__title { flex: 1; }
.assignrow__meta { font-size: .75rem; opacity: .65; white-space: nowrap; }
.assignrow--recused .assignrow__title { opacity: .7; }
.check--inline { margin-top: 0; align-items: center; }
.rec__opts { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.rec__opt { margin: 0; cursor: pointer; }
.rec__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.rec__opt span {
  display: inline-block; font-weight: 700;
  background: var(--paper); border: var(--border); border-radius: var(--radius-pill);
  padding: .45rem 1.1rem;
}
.rec__opt--yes   input:checked + span { background: var(--green);  color: var(--white); }
.rec__opt--maybe input:checked + span { background: var(--yellow); }
.rec__opt--no    input:checked + span { background: var(--pink);   color: var(--white); }
.rec__opt input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }

.field { margin-top: 1.5rem; }
.field__label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }

.check {
  display: flex; gap: .6rem; align-items: flex-start;
  margin-top: 1.25rem; font-weight: 400; font-size: .9rem;
}
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--pink); }

.actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.saved { font-size: .85rem; font-weight: 700; color: var(--green); }
.saved[hidden] { display: none; }

/* ----------------------------------------------------------- committee --- */

.ballotnote {
  background: var(--yellow);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .9rem 1.2rem; margin: 0 0 1.5rem;
  font-size: .9rem; font-weight: 500;
}
.ballotnote[hidden] { display: none; }

.ballot { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .6rem; counter-reset: rank; }

.pick {
  background: var(--white);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .8rem 1rem;
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: center; gap: .9rem;
}
.pick.is-dragging { opacity: .4; }
.pick.is-over { border-style: dashed; transform: translateY(2px); }
.pick.is-locked { background: var(--paper); }

.pick__rank {
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1;
  text-align: center;
  background: var(--blue); color: var(--white);
  border: 2px solid var(--ink); border-radius: 10px;
  padding: .3rem 0;
  cursor: grab;
}
.pick__rank:active { cursor: grabbing; }
.pick__body { min-width: 0; }
.pick__title { font-weight: 700; }
.pick__meta { font-size: .8rem; opacity: .75; }
.pick__meta .auto-in  { color: var(--green); font-weight: 700; }
.pick__meta .auto-out { color: var(--pink);  font-weight: 700; }
.pick__tools { display: flex; gap: .3rem; align-items: center; }

.iconbtn {
  font: inherit; font-weight: 700; cursor: pointer; line-height: 1;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
  width: 2rem; height: 2rem;
}
.iconbtn:hover { background: var(--yellow); }
.iconbtn:disabled { opacity: .35; cursor: not-allowed; }
.iconbtn--wide { width: auto; padding: 0 .6rem; }

.pick__note {
  grid-column: 2 / -1;
  width: 100%; font: inherit; font-size: .85rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 8px;
  padding: .4rem .6rem; margin-top: .1rem;
}

.actions--sticky {
  position: sticky; bottom: 0;
  background: var(--paper);
  border-top: var(--border);
  padding: 1rem 0; margin-top: 0;
  z-index: 10;
}

.dossier__judge {
  border-top: 2px dashed rgba(33,27,58,.25);
  padding: 1rem 0;
}
.dossier__judge:first-of-type { border-top: 0; }
.dossier__who { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.dossier__who strong { font-size: 1rem; }
.dossier__comment { white-space: pre-wrap; margin: .5rem 0 0; }

/* --------------------------------------------------------------- admin --- */

.tablewrap {
  overflow-x: auto;
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--white);
}
.table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table th, .table td { padding: .65rem .85rem; text-align: left; white-space: nowrap; }
.table thead th {
  background: var(--blue); color: var(--white);
  font-family: var(--font-display); text-transform: uppercase;
  font-size: .8rem; letter-spacing: .04em; font-weight: 400;
}
.table tbody tr + tr td { border-top: 2px solid rgba(33,27,58,.15); }
.table td.num { font-variant-numeric: tabular-nums; }
.table .overall { font-family: var(--font-display); font-size: 1.05rem; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

/* --------------------------------------------------------- admin panels --- */

.filters--wrap { flex-wrap: wrap; margin-bottom: 2rem; }
.panel[hidden] { display: none; }
.minihead { font-size: .95rem; margin: 1.25rem 0 .5rem; }

.twocol { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 767px) { .twocol { grid-template-columns: 1fr; } }

.rolerow { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 1rem 0; }
.rolerow .check { margin-top: 0; }

.inlineform { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.5rem; }
.field--inline { margin-top: 0; }

select {
  width: 100%; font: inherit; color: inherit;
  background: var(--paper);
  border: var(--border); border-radius: 12px;
  padding: .7rem .9rem;
}

.settingsgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.settingsgrid .field { margin-top: 0; }
.settingsgrid .field--wide { grid-column: 1 / -1; }

.table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--pink); }
.table .rowbtn {
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-pill);
  padding: .15rem .6rem;
}
.table .rowbtn:hover { background: var(--yellow); }
.table td.wrapcell { white-space: normal; min-width: 14rem; }

/* Applications panel. The group photo is promo material, so it's shown at a
   size you can actually judge rather than as a thumbnail. */
.applicationphoto {
  max-width: 18rem; height: auto; display: block;
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin: 1rem 0 .5rem;
}
.muted { opacity: .45; }

.result {
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--white);
  padding: 1rem 1.2rem; margin: 1.25rem 0;
}
.result--bad { background: var(--pink); color: var(--white); }
.result ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.result pre {
  white-space: pre-wrap; font-size: .85rem; margin: .5rem 0 0;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: .75rem;
}

/* ------------------------------------------------------------- loading --- */

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(246,239,225,.7); z-index: 50; }
.loading[hidden] { display: none; }
.loading span {
  width: 2.5rem; height: 2.5rem;
  border: 4px solid var(--ink); border-top-color: var(--pink);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------- pointer --- */
/* The collapsible rubric under each score, and under the comments box.
 *
 * Closed by default on purpose: a judge reads it once and then wants the
 * buttons, and an always-open rubric pushes them off a laptop screen. The
 * summary stays a plain affordance rather than a button, so it reads as
 * "more if you want it" rather than something to be dealt with. */
.pointer {
  margin: .35rem 0 .6rem;
  border-left: 3px solid var(--line, #d8d4cc);
  padding-left: .75rem;
}

.pointer > summary {
  cursor: pointer;
  font-size: .85rem;
  opacity: .72;
  list-style: none;
  user-select: none;
}

.pointer > summary::-webkit-details-marker { display: none; }

.pointer > summary::before {
  content: '\25B8\00a0';          /* a caret that turns; no icon font needed */
  display: inline-block;
  transition: transform .15s ease;
}

.pointer[open] > summary::before { transform: rotate(90deg); }
.pointer > summary:hover { opacity: 1; }

.pointer__body {
  /* pre-line so the rubric's own line breaks survive without <br> in the data */
  white-space: pre-line;
  font-size: .88rem;
  line-height: 1.5;
  opacity: .85;
  padding: .4rem 0 .2rem;
}

/* ---- Recommended panels (draft board), rule warnings, judge profiles ---- */
.badge--warn { background: #b8235f; color: var(--white); }
.row--warn td { background: color-mix(in srgb, var(--pink) 10%, var(--white)); }
.draftrules { border: 2px dashed rgba(33,27,58,.35); border-radius: 12px; padding: .6rem .85rem; margin: .75rem 0; font-size: .88rem; }
.draftrules p { margin: .25rem 0; }
.draftnotice { caption-side: top; text-align: left; padding: .6rem .8rem; margin-bottom: .5rem;
  background: color-mix(in srgb, var(--pink) 16%, var(--white)); border: var(--border); border-radius: 12px; font-size: .9rem; }
.draftboard td { vertical-align: top; }
.jchip {
  display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap;
  border: 2px solid var(--ink); border-radius: var(--radius-pill); background: var(--paper);
  padding: .15rem .25rem .15rem .6rem; margin: 0 .25rem .3rem 0; font-size: .85rem;
}
.jchip__x { border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0 .35rem; line-height: 1; }
.jchip__x:hover { color: #b8235f; }
.jtag { display: inline-block; font-size: .65rem; font-weight: 700; padding: 0 .3rem; border-radius: 6px;
  background: var(--ink); color: var(--white); }
.jtag--unknown { background: var(--yellow); color: var(--ink); }
.jhome { opacity: .7; }
.jadd { font-size: .8rem; padding: .2rem .4rem; max-width: 22rem; width: auto; }
.publishbar {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
  padding: .9rem 1.1rem; margin-top: 1.25rem;
}
.publishbar .sub { margin: .25rem 0 0; }
.assignrow__warn:empty { display: none; }
.profiledlg { border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; max-width: 32rem; width: calc(100% - 2rem); background: var(--white); }
.profiledlg::backdrop { background: rgba(33,27,58,.45); }
.profilerace { border: 0; padding: 0; }
.profilerace .check--inline { display: flex; margin-top: .35rem; }

/* Support sits at the far end of the scorecard's action row. */
.btn--support { margin-left: auto; }

/* The "How judging works" bubble at the top of the slate. */
.howto {
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--yellow) 22%, var(--white));
  padding: .85rem 1.15rem; margin-bottom: 1.5rem;
}
.howto > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.howto__body { font-size: .92rem; line-height: 1.5; }
.howto__body ol { margin: .6rem 0 .4rem 1.2rem; padding: 0; }
.howto__body li { margin: .3rem 0; }
.howto__body p { margin: .5rem 0 0; }
.howto__head { font-size: 1rem; margin: 1rem 0 0; }
.howto__custom { white-space: pre-line; margin-top: .4rem; }

/* Frozen columns on wide tables: the team name stays put while the scores
   scroll sideways. freeze2 = rank (fixed 3.5rem) + team; freeze1 = team only.
   Each frozen cell needs its own background, or scrolled cells show through. */
.table--freeze1 :is(th, td):nth-child(1),
.table--freeze2 :is(th, td):nth-child(-n + 2) {
  position: sticky; z-index: 1; background: var(--white); box-sizing: border-box;
}
.table--freeze1 thead th:nth-child(1),
.table--freeze2 thead th:nth-child(-n + 2) { background: var(--blue); z-index: 2; }
.table--freeze1 :is(th, td):nth-child(1) { left: 0; }
.table--freeze2 :is(th, td):nth-child(1) { left: 0; width: 3.5rem; min-width: 3.5rem; max-width: 3.5rem; }
.table--freeze2 :is(th, td):nth-child(2) { left: 3.5rem; }
/* The team column wraps instead of growing, so on a phone it can't eat the
   whole screen; a hairline marks where the frozen part ends. */
.table--freeze1 :is(th, td):nth-child(1),
.table--freeze2 :is(th, td):nth-child(2) {
  white-space: normal; min-width: 9rem; max-width: 16rem;
  box-shadow: 2px 0 0 rgba(33,27,58,.18);
}

/* Footer credit. */
.credit { text-align: center; font-size: .78rem; opacity: .6; padding: 2.5rem 1rem 2rem; }
.credit a { color: inherit; }
