/* ============================================================
   css/discuss.css — Shared design system for Discussion Tracker
   "Graphic Ink" palette: Cyan accent + Slate secondary

   This file is a dictionary of reusable components.
   Import it in every page, then layer page-specific CSS on top.
   ============================================================ */


/* ── 1. Design Tokens ── */
:root {
  /* Graphic Ink Palette — Illustration */
  --accent-pop:    #50bcca;  /* cyan — scores, active states, data */
  --accent-pop-text:    #50bcca;  /* cyan — scores, active states, data */
  --accent-soft:   #0D6986;  /* slate-blue — secondary accents     */
  --ink-bone:      #b9b7a7;  /* warm off-white — body text        */ 
  --ink-white:     #cbcac7;  /* light warm — headings, borders     */
  --ink-ash:       #82888a;  /* slate-gray — subdued text       */

  /* Background layers */
  --bg-base:       #0a0a0a;
  --bg-surface:    #141414;
  --bg-card:       #1e1e1e;
  --bg-overlay:    #282828;

  /* Grid pattern */
  --grid-color:    rgba(217, 186, 130, 0.03);
  --grid-pattern:  linear-gradient(var(--grid-color) 1px, transparent 1px),
                   linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);

  /* Structural borders */
  --border-ink:    1px solid var(--ink-white);
  --border-dim:    1px solid var(--ink-ash);
  --border-accent: 2px solid var(--accent-pop);

  /* Backward-compat aliases for JS inline styles */
  --border:        var(--ink-ash);
  --border-focus:  var(--ink-white);
  --text-primary:  var(--ink-bone);
  --text-secondary:var(--ink-ash);
  --text-muted:    #4a4f52;
  --amber:         var(--accent-pop);
  --amber-dim:     rgba(217, 186, 130, 0.15);
  --green:         #50ca9b;
  --green-dim:     #1e7855;
  --red:           #ca507f;
  --red-dim:       #7f2447;
  --indigo:        var(--accent-soft);
  --indigo-dim:    rgba(118, 139, 166, 0.15);

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;

  /* Radius */
  --radius-sm:     4px;
  --radius:        6px;
  --radius-lg:     6px;
  --radius-xl:     6px;
  --radius-bubble: 6px;
  --radius-pill:   99px;

  /* Typography */
  --font-display:  "Inter", sans-serif;
  --font-body:     "Inter", sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, monospace;
  --font-sans:     var(--font-body);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.6);
  --shadow:    0 4px 16px rgba(0,0,0,.7);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.8);

  /* Transitions */
  --ease: 150ms ease;
}


/* ── 2. Base Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-base);
  background-image: var(--grid-pattern);
  background-size: 32px 32px;
  color: var(--ink-bone);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100dvh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--ink-white);
}

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--ink-white);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}


/* ── 3. Layout Helpers ── */

/* .container — centered max-width wrapper (900px) */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* .stack — vertical flex column with standard gap */
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }

/* .row — horizontal flex row, center-aligned */
.row   { display: flex; align-items: center; gap: var(--sp-3); }

/* .row-between — horizontal flex row, space-between */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }


/* ── 4. Navigation ── */

/* .nav — sticky top nav bar with brand always centered */
.nav {
  background: var(--bg-base);
  border-bottom: var(--border-ink);
  padding: var(--sp-3) var(--sp-6);
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-left  { display: flex; align-items: center; gap: var(--sp-3); }
.nav-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }

/* .nav-brand — display-font app name, no-underline link */
.nav-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--ink-white);
  text-decoration: none;
  white-space: nowrap;
  text-align:center;
}
.nav-brand:hover { text-decoration: none; }

/* .nav-brand-sub — italic sub-label within nav-brand */
.nav-brand-sub {
  font-style: italic;
  font-weight: 400;
}

/* .nav-links — horizontal scrolling row of nav-link items */
.nav-links {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  min-width: 0;
}
.nav-links::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

/* .nav-link — mono uppercase nav pill link */
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-ash);
  transition: color var(--ease), background var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink-bone); background: var(--bg-overlay); text-decoration: none; }
.nav-link.active { color: var(--accent-pop); }

/* .nav-icon — small SVG icon inside the nav bar (36×36 white-tinted)
   Used by: wiretap-nav web component (app.js).
   Collapsed from: .proj-card-icon used only in app.js nav template. */
.nav-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}


/* ── Tab bar ──────────────────────────────────────────────────────────────── */

/* .proj-tabs — horizontal flex row of mode selector tabs */
.proj-tabs {
  display: flex;
  gap: var(--sp-2);
  padding: 0
}

/* .proj-tab — individual tab button (pill-shaped, display font) */
.proj-tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  border: var(--border-dim);
  background: transparent;
  color: var(--ink-ash);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  text-transform: lowercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.proj-tab:hover { background: var(--bg-overlay); color: var(--ink-bone); border-color: var(--ink-white); }

/* .proj-tab--active — selected tab (filled cyan) */
.proj-tab--active {
  background: var(--accent-pop);
  color: var(--bg-base);
  border-color: var(--accent-pop);
}


/* ── 5. Connection Status Dot ── */

/* .status-dot — inline SVG-icon status indicator */
.status-dot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1;
}

.status-dot::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* .status-green — connected (laika satellite icon) */
.status-green::before {
  background-image: url("../media/coldwar/laika.svg");
  filter: brightness(0) invert(1);
}

/* .status-red — disconnected (dish icon) with blinking ellipsis */
.status-red::before {
  background-image: url("../media/coldwar/satellite_dish.svg");
  filter: brightness(0) invert(1);
}

.status-red::after {
  content: "...";
  margin-left: 2px;
  color: var(--ink-dim);
  animation: status-blink 1.2s steps(1) infinite;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}


/* ── 6. Page Header ── */

/* .page-header — top banner with title + subtitle, bottom border */
.page-header {
  padding: var(--sp-6) 0 var(--sp-4);
  border-bottom: var(--border-dim);
  margin-bottom: var(--sp-6);
}

/* .page-title — large display-font heading */
.page-title {
  font-size: 1.8rem;
  margin: 0;
}

/* .page-subtitle — mono uppercase caption below page title */
.page-subtitle {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-ash);
  margin: var(--sp-2) 0 0;
}


/* ── 7. Cards ── */

/* .card — base surface card (bg, ink border, rounded, padded) */
.card {
  background: var(--bg-card);
  border: var(--border-ink);
  border-radius: var(--radius-bubble);
  padding: var(--sp-4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* .card-header — flex header row with dim bottom border */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: var(--border-dim);
}

/* .card-title — display-font heading inside a card */
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  color: var(--ink-white);
  margin: 0;
}

/* .group-card — card variant for student groups; lifts on hover with accent shadow.
   Used by: template, session, group pages.
   Promoted from: template section (was template-only originally). */
.group-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 120px;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.group-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--accent-pop);
}

/* .group-card-header — flex header row within a group card */
.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: var(--border-dim);
}

/* .group-card-name — truncated display-font group name; clickable */
.group-card-name {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--ink-white);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px var(--sp-1);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.group-card-name:hover { background: var(--bg-overlay); }

/* .group-card-drag-handle — grab-cursor drag handle icon */
.group-card-drag-handle {
  color: var(--ink-ash);
  cursor: grab;
  font-size: .9rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.group-card-drag-handle:active { cursor: grabbing; }


/* ── Projector ranking cards ──────────────────────────────────────────────── */

/* .proj-cards — auto-fill grid of group ranking cards */
.proj-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-8);
  align-content: start;
}

/* .proj-card — individual group ranking card (draggable) */
.proj-card {
  background: var(--bg-card);
  border: var(--border-ink);
  border-radius: var(--radius-bubble);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.proj-card:active { cursor: grabbing; }
.proj-card.drag-over {
  border-color: var(--accent-pop);
  box-shadow: 0 0 0 2px var(--amber-dim);
}

/* .proj-card-header — flex header row: rank + icon + name */
.proj-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--ink-ash);
}

/* .proj-card-body — flex column body below the header */
.proj-card-body {
  display: flex;
  flex-direction: column;
}

/* .proj-card-medal — medal emoji (1st/2nd/3rd) */
.proj-card-medal { font-size: 1.5rem; line-height: 1; }

/* .proj-card-rank — mono rank number pill */
.proj-card-rank {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent-pop);
  min-width: 1.4rem;
  text-align: center;
}

/* .proj-card-icon — group SVG icon (36×36 white-tinted)
   Note: this is the projector card icon. For the nav icon see .nav-icon in discuss.css. */
.proj-card-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* .proj-card-name — large truncated group name */
.proj-card-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  color: var(--ink-bone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .proj-card-score — large tabular-nums score in accent-pop */
.proj-card-score {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--accent-pop);
  line-height: 1;
}

/* .proj-card-empty — mono placeholder when card has no data */
.proj-card-empty {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-ash);
  text-align: center;
  padding: var(--sp-2) 0;
}


/* ── 8. Buttons ── */

/* .btn — base button: pill-shaped, display font, lowercase */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: var(--border-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  text-transform: lowercase;
  cursor: pointer;
  background: transparent;
  color: var(--ink-white);
  transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* .btn-primary — cyan-filled primary action */
.btn-primary {
  background: var(--accent-pop);
  border-color: var(--accent-pop);
  color: var(--bg-base);
}
.btn-primary:hover:not(:disabled) { opacity: .85; }

/* .btn-amber — alias for btn-primary (same visual, kept for semantic clarity) */
.btn-amber {
  background: var(--accent-pop);
  border-color: var(--accent-pop);
  color: var(--bg-base);
  font-weight: 800;
}
.btn-amber:hover:not(:disabled) { opacity: .85; }

/* .btn-success — green-filled success/confirm action */
.btn-success {
  background: var(--green);
  border-color: var(--green);
  color: #000;
  font-weight: 800;
}
.btn-success:hover:not(:disabled) { opacity: .85; }

/* .btn-danger — red-filled destructive action */
.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { opacity: .85; }

/* .btn-ghost — transparent with dim border; secondary/tertiary action */
.btn-ghost {
  background: transparent;
  color: var(--ink-ash);
  border: var(--border-dim);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-overlay);
  color: var(--ink-bone);
  border-color: var(--ink-white);
}

/* .btn-sm — small size modifier */
.btn-sm  { padding: 3px var(--sp-3); font-size: .75rem; }

/* .btn-lg — large size modifier */
.btn-lg  { padding: var(--sp-3) var(--sp-6); font-size: 1rem; }

/* .btn-xs — extra-small size modifier (icon-adjacent buttons, table cells)
   Promoted from: setup section. Used by: setup, template, session, mobile. */
.btn-xs  { padding: 2px var(--sp-2); font-size: .7rem; border-radius: var(--radius-sm); }

/* .btn-row — horizontal flex container for a group of buttons
   Promoted from: setup section. Used by: setup, template, session, mobile. */
.btn-row { display: flex; gap: var(--sp-2); }


/* ── 9. Form Controls ── */

/* .input / .textarea / .select — styled form fields (mono font, surface bg) */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-surface);
  border: var(--border-dim);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  color: var(--ink-bone);
  font-family: var(--font-mono);
  font-size: .85rem;
  transition: border-color var(--ease);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--ink-white);
  border-width: 2px;
}
.textarea { resize: vertical; min-height: 80px; }
.select option { background: var(--bg-card); }

/* .form-group — vertical flex container for label + input pair */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

/* .form-label — mono uppercase field label */
.form-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-ash);
}

/* .inline-form — compact form panel with surface background and dim border
   Promoted from: setup section. Used by: setup, template. */
.inline-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: var(--border-dim);
}

/* .input-rename — display-font inline text input for renaming items */
.input-rename {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 900;
  padding: 2px var(--sp-2);
}


/* ── 10. Badges ── */

/* .badge — base pill badge (mono uppercase, bordered) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 1px solid currentColor;
}

/* .badge-amber/.badge-green/.badge-red/.badge-indigo/.badge-gray — color variants */
.badge-amber   { color: var(--accent-pop); border-color: var(--accent-pop); background: var(--amber-dim); }
.badge-green   { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.badge-red     { color: var(--red); border-color: var(--red); background: var(--red-dim); }
.badge-indigo  { color: var(--accent-soft); border-color: var(--accent-soft); background: var(--indigo-dim); }
.badge-gray    { color: var(--ink-ash); border-color: var(--ink-ash); background: var(--bg-overlay); }


/* ── 11. Score Display ── */

/* .score — large tabular-nums display number in accent-pop color */
.score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-pop);
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* .score-sm — small score (1.4rem) */
.score-sm { font-size: 1.4rem; }

/* .score-lg — large score (3.5rem) */
.score-lg { font-size: 3.5rem; }


/* ── 12. Lists ── */

/* .list-item — flex row with hover background; stacked items get a top border */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  transition: background var(--ease);
}
.list-item:hover { background: var(--bg-overlay); }
.list-item + .list-item { border-top: var(--border-dim); }

/* .item-list — scrollable vertical container for item-row lists (max 420px)
   Promoted from: setup section. Used by: setup, template. */
.item-list { display: flex; flex-direction: column; overflow-y: auto; max-height: 420px; }

/* .item-row — compact flex row with hover; adjacent rows get a top border
   Promoted from: setup section. Used by: setup, template. */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.item-row:hover { background: var(--bg-overlay); }
.item-row + .item-row { border-top: var(--border-dim); }

/* .item-row--selected — highlighted row with left accent border */
.item-row--selected { background: var(--indigo-dim); border-left: 2px solid var(--accent-soft); }
.item-row--selected:hover { background: var(--indigo-dim); }

/* .item-row--dim — visually de-emphasized row */
.item-row--dim { opacity: .5; }

.feed-item--dim { opacity: .4; }
.mobile-quote-item--dim { opacity: .4; }

/* .item-select — invisible button that fills the clickable area of an item-row */
.item-select {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  padding: 0;
  min-width: 0;
}
.item-select:hover { opacity: .85; }

/* .item-name — primary name text within an item row */
.item-name  { font-size: .875rem; font-weight: 600; color: var(--ink-bone); }

/* .item-meta — secondary metadata text (muted, smaller) */
.item-meta  { font-size: .75rem; color: var(--ink-ash); }

/* .item-actions — right-aligned flex container for action buttons in an item row */
.item-actions { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }

/* .student-info — vertical flex stack for name + meta inside an item row */
.student-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

/* .empty-item — centered mono placeholder when a list has no entries
   Promoted from: setup section. Used by: setup, template, session, table, group. */
.empty-item {
  padding: var(--sp-4);
  text-align: center;
  color: var(--ink-ash);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ── 13. Section Header ── */

/* .section-header — flex row separating a section title from its action buttons */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: var(--border-dim);
}

/* .section-title — display-font section heading (ink-white, uppercase)
   Promoted from: setup section. Used by: setup, template, session, table, group. */
.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
  color: var(--ink-white);
}

.section-underline{
  border-bottom: 1px solid var(--ink-white);
}

/* .section-title--muted — muted variant: ash color + bottom margin
   Collapsed from: .proj-section-title (projector sidebar headings).
   Only difference from .section-title: color is ink-ash, font-size is 1rem, has margin-bottom. */
.section-title--muted {
  color: var(--ink-ash);
  font-size: 1rem;
  margin-bottom: var(--sp-4);
}


/* ── 14. Activity Feed ── */
/* Used by: session, table, projector pages. */

/* .feed-list — vertical flex container for feed items */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

/* .feed-item — flex row for a single activity log entry */
.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.feed-item:hover { background: var(--bg-overlay); }

.feed-item li{
  list-style-type: disc;
}

/* .feed-content — inner flex wrapper containing who + pts + note */
.feed-content {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

/* .feed-who — mono uppercase group/student label */
.feed-who {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-ash);
  flex-shrink: 0;
}

/* .feed-pts — display-font points value in a feed item */
.feed-pts {
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* .feed-note — italic, truncated note text within a feed item */
.feed-note {
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink-white);
  font-style: italic;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .feed-item--quote — modifier for quote feed items (full-width quote bubble) */
.feed-quote {
  display: block;
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--accent-pop);
  min-width: 0;
  border: 1px solid var(--accent-pop);
  border-radius: var(--radius-sm);
  padding: 1.25em;
  position: relative;
  background: var(--bg-card);
  width: 100%;
}

/* Speech-tail ::after on quote bubbles */
.feed-quote::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 16px;
    width: 14px;
    height: 14px;
    background: var(--bg-card);
    border-right: 1px solid var(--accent-pop);
    border-bottom: 1px solid  var(--accent-pop);
    transform: rotate(45deg);
    z-index: 1;
}

li.feed-item--spotlight{
  list-style-type:none;
}

/* .feed-item--spotlight — spotlighted quote; thicker accent border */
li.feed-item--spotlight .feed-quote {
  border: 3px solid var(--accent-pop);
  padding-left: var(--sp-2);
}

li.feed-item--spotlight .feed-quote::after{
    content: '';
    position: absolute;
    bottom: -9px;
    left: 16px;
    width: 14px;
    height: 14px;
    background: var(--bg-card);
    border-right: 3px solid var(--accent-pop);
    border-bottom: 3px solid  var(--accent-pop);
    transform: rotate(45deg);
    z-index: 1;
}

/* .feed-actions — right-aligned flex row for action buttons on a feed item */
.feed-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
}


/* ── 15. Horizontal Bar Chart ── */
/* Generic reusable horizontal bar chart component.
   Used by: projector (class mode), table (point breakdown).
   Renamed from: .proj-class-* (was projector-only, but table.js also used it). */

/* .bar-chart — container
   Collapsed from: .proj-class-chart */
.bar-chart {
}

/* .bar-chart-row — flex row: label + bar track + value
   Collapsed from: .proj-class-row */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

/* .bar-chart-label — display-font category name (min-width 160px)
   Collapsed from: .proj-class-label */
.bar-chart-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ash);
  min-width: 160px;
  flex-shrink: 0;
  text-align:right;
}

/* .bar-chart-track — flex-1 bar background container
   Collapsed from: .proj-class-bar-wrap */
.bar-chart-track {
  flex: 1;
  background: var(--bg-overlay);
  border: 1px solid var(--ink-ash);
  height: 28px;
  overflow: hidden;
}

/* .bar-chart-fill — width-based fill bar with animated transition
   Collapsed from: .proj-class-bar */
.bar-chart-fill {
  height: 100%;
  background: var(--accent-pop);
  transition: width .6s ease;
}

/* .bar-chart-value — right-aligned display-font numeric value
   Collapsed from: .proj-class-value */
.bar-chart-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent-pop);
  min-width: 3rem;
  text-align: right;
}

/* ── Mini bar chart (vertical inline) ──── */
/* Used by: projector cards (.proj-card-body), any page needing a compact vertical chart. */

/* .proj-mini-bars — horizontal flex row of vertical bar columns */
.proj-mini-bars {
  display: flex;
  gap: 6px;
}

/* .proj-mini-col — single vertical bar column (flex, centered) */
.proj-mini-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* .proj-mini-val — mono value above the mini bar */
.proj-mini-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink-ash);
  margin-bottom: 2px;
  line-height: 1;
}

/* .proj-mini-bar-track — fixed-height bar background container */
.proj-mini-bar-track {
  width: 100%;
  height: 56px;
  background: var(--bg-overlay);
  border: 1px solid var(--ink-ash);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

/* .proj-mini-bar — animated height fill bar */
.proj-mini-bar {
  width: 100%;
  background: var(--accent-pop);
  transition: height .5s ease;
  min-height: 3px;
}

/* .proj-mini-label — mono uppercase label below mini bar */
.proj-mini-label {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-ash);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
}


/* ── 16. Modal ── */
/* Used by: session, mobile. */

/* .modal-backdrop — fixed full-screen overlay with centered flex layout */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--sp-4);
}
.modal-backdrop.hidden { display: none; }

/* .modal — card-style dialog box with accent drop-shadow */
.modal {
  background: var(--bg-card);
  border: var(--border-ink);
  border-radius: var(--radius-bubble);
  padding: var(--sp-6);
  width: 100%;
  max-width: 480px;
  box-shadow: 8px 8px 0px var(--accent-pop);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* .modal-title — display-font heading inside a modal */
.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0;
}

/* .modal-header — flex header row with dim bottom border (contains title + close btn) */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: var(--border-dim);
}

/* .modal-actions — right-aligned button row at bottom of modal */
.modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
}


/* .note-modal-event-list — scrollable point history inside note modal */
.note-modal-event-list {
  max-height: 10rem;
  overflow-y: auto;
}

/* ── Spotlight overlay ────────────────────────────────────────────────────── */

/* #spotlight-overlay — full-screen modal for spotlighting a quote */
#spotlight-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: spotlight-in .4s ease;
}

#spotlight-overlay.spotlight-fade-out {
  animation: spotlight-out .5s ease forwards;
}

@keyframes spotlight-in {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes spotlight-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.03); }
}

/* .spotlight-quote — centered max-width quote container */
.spotlight-quote {
  max-width: 700px;
  text-align: center;
  padding: var(--sp-8);
}

/* .spotlight-badge — mono uppercase "— GROUP NAME —" attribution label */
.spotlight-badge {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--accent-pop);
  margin-bottom: var(--sp-5);
}

/* .spotlight-text — large display-font quote text */
.spotlight-text {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink-bone);
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}


/* ── 17. Toast Notifications ── */

/* .toast-container — fixed bottom-center column of toasts */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}

/* .toast — notification pill (mono, uppercase, animated in) */
.toast {
  background: var(--bg-card);
  border: var(--border-ink);
  border-radius: var(--radius-bubble);
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-bone);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in .2s ease;
  max-width: 320px;
  text-align: center;
}

/* .toast-undo — clickable undo toast with cyan border */
.toast.toast-undo {
  border-color: var(--accent-pop);
  color: var(--accent-pop);
  cursor: pointer;
}

/* .toast-success / .toast-error — color variants */
.toast.toast-success { border-color: var(--green); color: var(--green); }
.toast.toast-error   { border-color: var(--red);   color: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 18. Empty State ── */

/* .empty-state — centered padded placeholder when content is absent */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--ink-ash);
}

/* .empty-state-icon — large emoji/icon above empty state text */
.empty-state-icon { font-size: 2rem; margin-bottom: var(--sp-3); }

/* .empty-state-text — mono uppercase message */
.empty-state-text {
  font-family: var(--font-mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}


/* ── 19. Loading Spinner ── */

/* .spinner — 20px animated border-radius spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink-ash);
  border-top-color: var(--accent-pop);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── 20. Divider ── */

/* .divider — horizontal rule with dim border */
.divider {
  border: none;
  border-top: var(--border-dim);
  margin: var(--sp-4) 0;
}


/* ── 21. Utility Classes ── */
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--ink-ash); }
.text-amber     { color: var(--accent-pop); }
.text-green     { color: var(--green); }
.text-red       { color: var(--red); }
.text-indigo    { color: var(--accent-soft); }
.font-mono      { font-family: var(--font-mono); }
.font-bold      { font-weight: 700; }
.hidden         { display: none !important; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ── 22. Point Type UI ── */
/* Used by: setup (create form + list), session (inline award + overlay). */

/* .pt-form-grid — 2-column grid for create-point-type form */
.pt-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.pt-form-grid input:first-child { grid-column: 1 / -1; }

/* .pt-list — point type list; .item-row inside is center-aligned */
.pt-list .item-row { align-items: center; }

/* .pt-info — flex row for abbr badge + text info */
.pt-info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

/* .pt-text — vertical stack for point type title + sub-text */
.pt-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

/* .pt-abbr-badge — mono pill showing the abbreviation (e.g. "TK") */
.pt-abbr-badge {
  background: var(--indigo-dim);
  color: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 2px var(--sp-2);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  flex-shrink: 0;
  min-width: 2.5rem;
  text-align: center;
}

/* .pt-value — display-font point value number */
.pt-value {
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 900;
  color: var(--accent-pop);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* .pt-inline-btns — flex-wrap container for inline award buttons on group cards */
.pt-inline-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  flex: 1;
  min-width: 0;
}

/* .pt-inline-btn — small pill award button inside group cards */
.pt-inline-btn {
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
}

/* .pt-award-grid — grid of award buttons in point-type overlay modal */
.pt-award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-2);
}

/* .pt-award-btn — vertical button card for awarding a point type */
.pt-award-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-2);
  background: var(--bg-overlay);
  border: var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  color: var(--ink-bone);
  font-family: inherit;
}
.pt-award-btn:hover  { background: var(--indigo-dim); border-color: var(--accent-soft); }
.pt-award-btn:active { transform: scale(.93); }

/* .pt-award-val — large cyan number inside award button */
.pt-award-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent-pop);
}

/* .pt-award-title — mono uppercase label inside award button */
.pt-award-title {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-ash);
  text-align: center;
  line-height: 1.2;
}


/* ── 23. Student Chips (drag-and-drop) ── */
/* Used by: template page. */

/* .chip-pool — vertical flex container for draggable student chips */
.chip-pool {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 48px;
}

/* .chip-drop-hint — dashed-border placeholder shown in an empty chip pool */
.chip-drop-hint {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-ash);
  text-align: center;
  padding: var(--sp-3);
  border: 1px dashed var(--ink-ash);
  border-radius: var(--radius);
  margin: 0;
}

/* .student-chip — draggable mono pill representing a single student */
.student-chip {
  background: var(--bg-overlay);
  border: var(--border-ink);
  border-radius: var(--radius-bubble);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-bone);
  cursor: grab;
  user-select: none;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease), transform var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-chip:hover {
  background: var(--bg-card);
  border-color: var(--accent-pop);
  transform: translate(-1px, -1px);
}
.student-chip:active { cursor: grabbing; }
.student-chip.dragging { opacity: .4; transform: scale(.97); }


/* ── 24. Member List ── */
/* Used by: session page. */

/* .member-list — vertical flex list of members within a group card */
.member-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}

/* .member-item — flex row for one member (name + presence dot) */
.member-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.member-item:hover { background: var(--bg-overlay); }

/* .member-name — truncated member name text */
.member-name {
  font-size: .8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .presence-toggle — invisible button wrapping the presence dot */
.presence-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* .presence-dot — 10px circle showing present/absent status */
.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* .presence-dot--present — cyan (present) */
.presence-dot--present { background: var(--accent-pop); }

/* .presence-dot--absent — muted (absent) */
.presence-dot--absent  { background: var(--text-muted); }


/* ── 25. Action / Award Row ── */
/* Used by: session page. */

/* .action-bar — horizontal flex row for session action buttons */
.action-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* .award-row — inline point-award row below group card members */
.award-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: var(--border-dim);
}

/* .note-toggle-label — clickable label wrapping the note toggle checkbox + icon */
.note-toggle-label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

/* .note-toggle-cb — the actual checkbox input (accent-colored) */
.note-toggle-cb {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent-pop);
  margin: 0;
}

/* .note-toggle-icon — pencil emoji icon; dimmed when note is off */
.note-toggle-icon {
  font-size: .85rem;
  opacity: .35;
  transition: opacity var(--ease);
  line-height: 1;
}

/* .note-toggle-icon--on — full opacity when note is active */
.note-toggle-icon--on {
  opacity: 1;
}


/* ── 26. Animations ── */

/* @keyframes pulse-once / .pulse-once — blue-ring pulse for note inbox highlight */
@keyframes pulse-once {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.pulse-once { animation: pulse-once .8s ease-out; }


/* ── 27. Main + Responsive ── */

main { padding: var(--sp-4) 0 var(--sp-8); }

@media (max-width: 600px) {
  .nav { padding: var(--sp-3) var(--sp-4); }
  .nav-links { gap: 0; }
  .nav-link  { padding: var(--sp-2); font-size: .7rem; }
  .modal     { padding: var(--sp-4); }
}


/* ── Drag-and-drop shared states ────────────────────────────────────────────── */
.dragging {
  opacity: 0.45;
  transform: none !important;
  box-shadow: none !important;
}


/* ── Cards grid (auto-fill responsive grid) ──────────────────────────────────
   Usage: add .cards-grid to the container; override --cards-min as needed.
   ─────────────────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cards-min, 200px), 1fr));
  gap: var(--sp-4);
  align-content: start;
}


@media (max-width: 720px) {
  .spotlight-text   { font-size: 1.6rem; }
  .proj-card-score  { font-size: 1.3rem; }
}

.remove-margin{
  margin:0;
}

/* ── 28. Random Picker ──────────────────────────────────────────────────────── */

/* .picker-bar — row of random-pick trigger buttons + queue counter */
.picker-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.picker-remaining {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-ash);
  margin-left: auto;
}

/* .picker-section-label — small label above a picker modal row */
.picker-section-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-ash);
  margin-bottom: var(--sp-1);
}

/* .picker-row — flex row of picker toggle buttons */
.picker-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

/* .picker-btn — toggle button in a picker row */
.picker-btn {
  flex: 1;
  min-width: 56px;
  border: var(--border-dim);
  background: var(--bg-surface);
  color: var(--ink-bone);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.picker-btn:hover {
  border-color: var(--accent-soft);
}

/* .picker-btn--active — selected state */
.picker-btn--active {
  border-color: var(--accent-pop);
  background: color-mix(in srgb, var(--accent-pop) 15%, transparent);
  color: var(--accent-pop);
}


/* ── Agent Console toggles (mobile teacher view) ──────────────────────────── */
.agent-toggles {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}