/* ============================================================================
   theme.css — the "Sefer" design system. Single source of truth for the app's
   look: scholarly ink-navy + brass, Frank Ruhl Libre display, Assistant body.

   HOW THIS FILE IS ORGANIZED (and how to make future changes):
     1. TOKENS      — change a color/radius/font HERE and it changes everywhere.
     2. BASE        — elements shared by all pages (buttons, inputs, tables).
     3. COMPONENTS  — named classes reused across pages.
     4. PER-PAGE    — overrides for page-local class names, grouped by page.

   Rules for future work:
     • New UI takes its colors from the tokens (var(--ink), var(--brass)…).
     • Never add gradients, hover-lift transforms, or new accent colors.
     • Prefer adding a class here over writing inline styles in the HTML.
   This file loads LAST in <head> so it wins ties against page styles.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@500;700;900&family=Assistant:wght@400;600;700&display=swap');

/* ───────────────────────────── 1 · TOKENS ────────────────────────────────── */
:root {
  /* palette */
  --ink: #182238;            /* primary — deep navy, used for actions/headers */
  --ink-hover: #101828;
  --ink-soft: #ebeef4;       /* tinted surface for selected/hover states      */
  --brass: #b99753;          /* accent rule/highlight — used sparingly        */
  --brass-ink: #7d6a3f;      /* brass legible on white                        */
  --paper: #faf9f5;          /* page ground                                   */
  --surface: #ffffff;        /* cards                                         */
  --line: #ddd9cc;           /* borders                                       */
  --line-soft: #edeae0;      /* row separators                                */
  --text: #23262e;
  --text-2: #6d7280;
  --on-ink: #f2efe6;         /* text on navy                                  */
  /* semantic (status chips keep their meaning, tuned to the palette) */
  --ok-bg: #eef2ea;   --ok-fg: #3c5c2e;
  --info-bg: #ebeff6; --info-fg: #2c4a77;
  --warn-bg: #f8f0e2; --warn-fg: #8a5c1d;
  --bad-bg: #f7e9e7;  --bad-fg: #8f2f26;
  /* shape & type */
  --radius: 5px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(24, 30, 48, 0.06);
  --font-body: 'Assistant', 'Heebo', -apple-system, sans-serif;
  --font-display: 'Frank Ruhl Libre', 'Assistant', serif;

  /* re-point the legacy token system (styles.css) at Sefer, so the hundreds of
     existing var(--primary-*) usages fall in line without edits */
  --primary-50: #f4f5f8;
  --primary-100: var(--ink-soft);
  --primary-200: #d7dce6;
  --primary-300: #aeb6cb;
  --primary-400: #5d6b8c;
  --primary-500: var(--ink);
  --primary-600: var(--ink);
  --primary-700: var(--ink-hover);
  --primary-800: var(--ink-hover);
  --primary-900: #0b111e;
}

/* ───────────────────────────── 2 · BASE ──────────────────────────────────── */
body {
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--text);
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0; }

/* Buttons: flat ink, no gradients, no shine sweep, no levitation.
   The ink default skips buttons marked class="self-colored" — those carry a
   meaningful per-button color (theme swatches, rating selections, active-tab
   toggles) set inline or from JS, which must stay visible. */
button {
  background-image: none !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  letter-spacing: 0;
  font-family: var(--font-body);
}
button:not(.self-colored) {
  background: var(--ink) !important;
  color: var(--on-ink) !important;
}
button::before { display: none !important; }
button:not(.self-colored):hover { background: var(--ink-hover) !important; color: var(--on-ink) !important; }
button:hover, button:active { transform: none !important; }
button.secondary {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--ink);
}
/* color too: the generic hover rule above would otherwise leave cream text on this light background */
button.secondary:hover { background: var(--ink-soft) !important; color: var(--ink) !important; }
button.danger { background: #8f2f26 !important; color: #fff !important; }
button.danger:hover { background: #7a251d !important; }

input[type="text"], input[type="number"], input[type="date"], input[type="time"],
input[type="password"], input[type="email"], input[type="search"], select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  box-sizing: border-box;   /* consistent sizing; never overflow a card on mobile */
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink-soft);
  border-color: var(--ink);
}

table th { font-family: var(--font-body); }

/* ─────────────────────────── 3 · COMPONENTS ──────────────────────────────── */
/* Action-button layout utilities (shared app-wide for a consistent, centered
   feel). .center-action = one standalone Add/Save/Generate button as a
   content-width centered block; .action-row = a centered, wrapping row of
   related buttons (e.g. Save + Cancel). */
.center-action { display: block; width: fit-content; margin: 16px auto 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; }

/* Cards (skills page sections, honors cards, admin sections) */
.skill-section, .card, .section, .settings-section {
  background: var(--surface);
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}
.skill-section:hover { box-shadow: var(--shadow) !important; transform: none !important; }

/* Skill headers: white with a brass base rule (the Sefer signature) */
.skill-header:not(.rtl-header), .skill-header.rtl-header {
  background: var(--surface) !important;
  background-image: none !important;
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  border-bottom: 2px solid var(--brass) !important;
}
.skill-header:not(.rtl-header):hover, .skill-header.rtl-header:hover {
  background: #f4f2ea !important;
}

/* Category / group headers: solid ink bands */
.group-header, .group-title {
  background: var(--ink) !important;
  background-image: none !important;
  color: var(--on-ink) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  font-family: var(--font-display);
}

/* Collapsed category rows (skills page <details> groups) — match the
   settings-menu card look: white row, body font, small ▼ arrow */
.skill-group-section summary.group-summary {
  background: var(--surface) !important;
  background-image: none !important;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: start;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.skill-group-section summary.group-summary::-webkit-details-marker { display: none; }
.skill-group-section summary.group-summary::after {
  content: '▼';
  color: var(--ink);
  font-size: 11px;
  font-family: var(--font-body);
  transition: transform 0.15s ease;
}
.skill-group-section[open] > summary.group-summary::after { transform: rotate(-180deg); }
.skill-group-section summary.group-summary:hover { background: #f7f6f1 !important; }
.group-clip {
  font-size: 16px;
  text-decoration: none;
  opacity: 0.55;
  filter: grayscale(1);
  transition: opacity 0.15s;
}
.group-clip:hover { opacity: 1; }
button.group-add-test-btn {
  padding: 6px 12px !important;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

/* Attendance card — same menu-card look, lightly ink-tinted header */
.attendance-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.attendance-card-header {
  background: var(--ink-soft);
  color: var(--ink);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.attendance-card-header:hover { background: color-mix(in srgb, var(--ink) 12%, #ffffff); }
.attendance-card-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
}
.attendance-card .attendance-arrow { color: var(--ink); }
.attendance-content {
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  max-height: 250px;
  overflow-y: auto;
  justify-content: flex-start;
  border-top: 1px solid var(--line-soft);
}
button.attendance-student-btn {
  padding: 7px 12px;
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
  text-align: center;
  direction: rtl;
  font-size: 13px;
  font-weight: 600;
  color: var(--text) !important;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
button.attendance-student-btn:hover {
  background: var(--ink-soft) !important;
  border-color: var(--ink);
  color: var(--ink) !important;
  transform: none !important;
}

/* Top bars (skills tracker bar + generic page <header>) */
#teacherTopBar, header {
  background: var(--ink) !important;
  background-image: none !important;
  color: var(--on-ink) !important;
  border-bottom: none;
  box-shadow: none !important;
}
#teacherTopBar h2, header h1 { color: var(--on-ink); }
/* Modal/panel header BARS are inline-styled `background: var(--ink)` divs. Their
   headings otherwise inherit styles.css's dark-grey h1/h2/h3 default, which reads
   as faded dark-on-dark on the ink bar (e.g. the Daily Chart title). Force any
   heading, and small caption text, inside an ink-backgrounded bar to on-ink. */
[style*="background: var(--ink)"] h1, [style*="background: var(--ink)"] h2,
[style*="background: var(--ink)"] h3, [style*="background: var(--ink)"] h4,
[style*="background:var(--ink)"] h1,  [style*="background:var(--ink)"] h2,
[style*="background:var(--ink)"] h3,  [style*="background:var(--ink)"] h4 {
  color: var(--on-ink) !important;
}
#hamburgerBtn, #settingsGearBtn, #logoutIconBtn, #adminNavBtn {
  background: transparent !important;
  color: var(--on-ink) !important;
  border: 1px solid transparent;
}
#hamburgerBtn:hover, #settingsGearBtn:hover, #logoutIconBtn:hover, #adminNavBtn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}
header a { color: #c9c2ab; }

/* Status pills (skills values) — keep meaning, calm the colors */
.status-mastered  { background: var(--ok-bg) !important;   color: var(--ok-fg) !important; }
.status-practiced { background: var(--info-bg) !important; color: var(--info-fg) !important; }
.status-introduced{ background: var(--warn-bg) !important; color: var(--warn-fg) !important; }
.skill-badge, .chip, .pill { border-radius: 3px; }

/* Settings drawer (skills) */
.settings-panel { background: var(--paper); font-family: var(--font-body); }
.settings-header { background: var(--ink) !important; color: var(--on-ink) !important; }
/* Section headers stay a white menu-card in EVERY state (the legacy gradient
   + hover/active/focus rules used to leave the open one dark with ghosted
   ink-on-dark text). */
button.settings-section-header,
.settings-section-header,
.settings-section-header:hover,
.settings-section-header:active,
.settings-section-header:focus {
  background: var(--surface) !important;
  background-image: none !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-soft) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  transform: none !important;
}
button.settings-section-header:hover,
button.settings-section-header:active,
button.settings-section-header:focus {
  background: #f7f6f1 !important;
  color: var(--ink) !important;
}
.settings-section-header .section-arrow { color: var(--ink) !important; }

/* Collapsible sub-sections inside the drawer (<details><summary>) — kill the
   legacy green pill; make them quiet surface rows like everything else. */
.settings-panel details > summary,
.settings-section-content details > summary {
  background: var(--surface) !important;
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-soft) !important;
  border-radius: var(--radius) !important;
  font-weight: 600;
}
.settings-panel details > summary:hover,
.settings-section-content details > summary:hover {
  background: #f7f6f1 !important;
  background-color: #f7f6f1 !important;
}

/* Login screen */
.login-header-band { background: var(--ink) !important; background-image: none !important; }
.login-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ─────────────────────────── 4 · PER-PAGE ────────────────────────────────── */
/* honors.html */
.tabs button { background: var(--surface) !important; color: var(--text-2) !important; border: 1px solid var(--line); }
.tabs button.active { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink); }
.btn-primary { background: var(--ink) !important; color: var(--on-ink) !important; }
button.btn-light, .btn-light { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.pill.weekly { background: var(--info-bg) !important; color: var(--info-fg) !important; }
.pill.monthly { background: var(--warn-bg) !important; color: var(--warn-fg) !important; }

/* report-card.html sidebar */
button.sidebar-tab, .sidebar-tab { background: transparent !important; color: var(--text-2) !important; border-radius: 0 !important; }
button.sidebar-tab:hover { background: var(--ink-soft) !important; color: var(--ink) !important; }
.sidebar-tab.active {
  background: transparent !important;
  color: var(--ink) !important;
  border-bottom: 2px solid var(--brass) !important;
  font-weight: 700;
}
.gen-btn { border-radius: var(--radius-sm) !important; box-shadow: none !important; }
.gen-btn.primary { background: var(--ink) !important; color: var(--on-ink) !important; }
.gen-btn.secondary { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--ink) !important; }
.gen-btn.accent { background: var(--brass) !important; color: var(--ink-hover) !important; }
.style-section, .gen-section { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }

/* admin.html — bring the legacy sections/headings into the Sefer language */
.admin-container center h1,
.admin-container h1 {
  font-family: var(--font-display) !important;
  color: var(--ink) !important;
  font-weight: 700;
}
.admin-container center h5 { color: var(--text-2) !important; font-weight: 400; }
.section {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}
.section h2, .section h3 {
  font-family: var(--font-display) !important;
  color: var(--ink) !important;
  border-bottom: 2px solid var(--brass) !important;
}
.section h2::before { content: none !important; }   /* drop the 📌 pin — no emoji icons */
.section th, .admin-container th {
  background: var(--ink-soft) !important;
  color: var(--ink) !important;
  font-family: var(--font-body) !important;
}
/* Section-scoped info boxes (orange/yellow) → calm warn tokens */
#feedbackRequestsPanel h2 { color: var(--warn-fg) !important; }
#feedbackRequestsPanel #requestCount { background: var(--warn-fg) !important; }

/* admin.html collapsibles — same menu-card row language as the skills page */
details.collapsible > summary {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::after {
  content: '▼';
  color: var(--ink);
  font-size: 11px;
  transition: transform 0.15s ease;
}
details.collapsible[open] > summary::after { transform: rotate(-180deg); }
details.collapsible > summary:hover { background: #f7f6f1; }

/* Bare <details> summaries (e.g. admin student-list grade groups) — the legacy
   styles.css paints EVERY `details summary` green (#c8e6c9 / dark-green text).
   theme.css loads last, so this quiet-surface override wins for bare summaries
   while the more specific .collapsible / .group-summary rules above keep theirs. */
details > summary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
details > summary:hover { background: #f7f6f1; }

/* tzivos.html tab bar (page CSS loses to the base ink rule otherwise) */
#tzTabBar button { background: var(--surface) !important; color: var(--text-2) !important; border: 1px solid var(--line); }
#tzTabBar button.active { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink); }

/* danger buttons keep their destructive affordance */
button.btn-danger, .btn-danger { background: #8f2f26 !important; color: #fff !important; }

/* setup wizard */
button.copy-btn, .copy-btn { background: var(--ink) !important; color: var(--on-ink) !important; border-radius: var(--radius-sm) !important; }
.btn.btn-primary { background: var(--ink) !important; color: var(--on-ink) !important; }
.btn.btn-secondary { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--ink) !important; }

/* admin.html — "Behavior Chart Setup" editor (admin configures a teacher's
   daily behavior chart for them). Prefix bcx-. */
.bcx-overlay {
  display: none; position: fixed; inset: 0; z-index: 2500;
  background: rgba(16, 24, 40, 0.45);
  align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 24px 12px;
}
.bcx-panel {
  background: var(--paper); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  width: 100%; max-width: 640px; box-shadow: var(--shadow);
  font-family: var(--font-body);
}
.bcx-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: var(--on-ink);
  padding: 14px 18px; border-radius: var(--radius) var(--radius) 0 0;
}
.bcx-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; color: var(--on-ink); border: 0; }
button.bcx-x { background: transparent !important; color: var(--on-ink) !important; border: 0; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; min-height: 0 !important; }
.bcx-body { padding: 16px 18px; }
.bcx-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.bcx-card h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 16px; color: var(--ink); border-bottom: 2px solid var(--brass); padding-bottom: 4px; }
.bcx-hint { color: var(--text-2); font-size: 13px; margin: 0 0 10px; }
.bcx-label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.bcx-field { margin: 10px 0; }
.bcx-opt { display: flex; width: fit-content; align-items: center; gap: 6px; margin-inline-end: 16px; font-size: 14px; cursor: pointer; padding: 3px 0; }
.bcx-row { display: flex; gap: 8px; flex-wrap: wrap; }
.bcx-row select { flex: 1; min-width: 0; }
.bcx-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; padding: 4px 0; min-width: 0; }
/* styles.css gives every input padding/margin/min-width:180px — reset inside the panel */
.bcx-panel input, .bcx-panel select { margin: 0; min-width: 0; font-family: var(--font-body); }
.bcx-panel input[type=checkbox], .bcx-panel input[type=radio] { width: 18px; height: 18px; padding: 0; flex-shrink: 0; }
.bcx-panel select, .bcx-panel input[type=time] { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; width: auto; }
.bcx-grow { flex: 1; min-width: 0; }
.bcx-sub { color: var(--text-2); font-size: 12px; }
.bcx-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.bcx-item.is-off { background: var(--paper); color: var(--text-2); }
.bcx-item-top, .bcx-item-row { display: flex; align-items: center; gap: 8px; }
.bcx-item-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.bcx-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.bcx-tools { display: flex; gap: 4px; flex-shrink: 0; }
button.bcx-icon {
  margin: 0; flex-shrink: 0;
  width: 30px; height: 30px; min-height: 30px !important; padding: 0;
  background: var(--surface) !important; color: var(--ink) !important;
  border: 1px solid var(--line) !important; border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1; cursor: pointer;
}
button.bcx-icon:hover { background: var(--ink-soft) !important; color: var(--ink) !important; }
button.bcx-icon:disabled { opacity: 0.35; cursor: default; }
button.bcx-icon.bcx-danger { color: var(--bad-fg) !important; }
.bcx-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 13px;
}
.bcx-swatch { width: 20px; height: 20px; border-radius: var(--radius-sm); flex-shrink: 0; border: 1px solid var(--line); }
.bcx-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bcx-add input { flex: 1 1 140px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; }
.bcx-add input.bcx-letter { flex: 0 0 64px; text-align: center; text-transform: uppercase; }
.bcx-item input[type=text] { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; }
button.bcx-btn {
  margin: 0;
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 14px;
  background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--ink) !important;
}
button.bcx-btn:hover { background: var(--ink-soft) !important; color: var(--ink) !important; }
button.bcx-btn-primary, button.bcx-btn-primary:hover { background: var(--ink) !important; color: var(--on-ink) !important; }
button.bcx-btn-quiet { border-color: var(--line) !important; color: var(--text-2) !important; }
.bcx-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px;
  border-top: 1px solid var(--line); background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  position: sticky; bottom: 0;
}
@media (max-width: 480px) {
  .bcx-overlay { padding: 0; }
  .bcx-panel { border-radius: 0; min-height: 100%; }
  .bcx-body { padding: 12px; }
}

/* ── Checkboxes & radios are not text fields ─────────────────────────────────
   styles.css sizes EVERY input as a text field (min-width:180px, width:100% on
   phones, text padding), which blew checkboxes/radios up to ~180px inside flex
   rows wherever a page forgot to override it. Reset them here once. :where()
   keeps the specificity at a bare `input`, so any class or inline size a page
   sets on purpose still wins. */
input:where([type="checkbox"], [type="radio"]) {
  width: auto;
  min-width: 0;
  padding: 0;
  flex: 0 0 auto;
}

/* ── Resource Room (resource-room.js, skills.html) ─────────────────────────── */
.rr { margin: 16px 0 40px; }
.rr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rr-title { font-family: var(--font-display); color: var(--ink); font-size: 22px; margin: 0 0 4px; }
.rr-sub { color: var(--text-2); font-size: 14px; margin: 0; line-height: 1.5; }
.rr-muted { color: var(--text-2); font-size: 12px; }
.rr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
button.rr-card { display: flex; align-items: center; gap: 12px; text-align: start; width: 100%; padding: 14px;
  background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--line) !important; cursor: pointer; }
button.rr-card:hover { border-color: var(--ink) !important; background: var(--surface) !important; color: var(--text) !important; }
.rr-avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-soft); color: var(--ink); font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.rr-avatar-lg { flex-basis: 56px; width: 56px; height: 56px; font-size: 26px; }
.rr-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rr-card-name { font-weight: 700; font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-card-meta, .rr-card-stats { font-size: 13px; color: var(--text-2); }
.rr-bar { display: flex; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-top: 4px; }
.rr-bar > span { display: block; height: 100%; background: var(--ok-fg); }
.rr-empty { padding: 22px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); line-height: 1.6; }
button.rr-back, button.rr-link, a.rr-link { background: none !important; border: none !important; color: var(--ink) !important; padding: 4px 0 !important;
  font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; }
button.rr-back:hover, button.rr-link:hover, a.rr-link:hover { text-decoration: underline; background: none !important; color: var(--ink) !important; }
.rr-plan-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.rr-plan-id { flex: 1; min-width: 180px; }
.rr-plan-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rr-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 14px; }
.rr-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; vertical-align: middle; }
.rr-chip-goal { background: var(--warn-bg); color: var(--warn-fg); }
.rr-chip-rr { background: var(--info-bg); color: var(--info-fg); }
.rr-chip-class { background: var(--ok-bg); color: var(--ok-fg); }
.rr-chip-other { background: var(--ink-soft); color: var(--ink); }
.rr-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.rr-group-title { font-size: 15px; margin: 0; padding: 10px 14px; color: var(--ink); background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.rr-row { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.rr-row:last-child { border-bottom: none; }
.rr-row-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rr-row-name { font-weight: 600; color: var(--text); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.rr-row-ctl { flex: 0 0 auto; }
.rr-row-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
input.rr-note { flex: 1; min-width: 0; font-size: 13px; padding: 6px 10px; }
button.rr-remove { background: none !important; color: var(--text-2) !important; border: 1px solid var(--line) !important; width: 32px; height: 32px; padding: 0 !important; flex: 0 0 32px; }
button.rr-remove:hover { color: var(--bad-fg) !important; border-color: var(--bad-fg) !important; background: var(--bad-bg) !important; }
button.rr-val { min-width: 96px; padding: 7px 14px; border: 1px solid var(--line) !important; font-weight: 700; cursor: pointer; color: var(--text) !important; background: var(--surface) !important; }
button.rr-val.status-none:hover { background: var(--ink-soft) !important; }
button.rr-val.status-mastered   { background: var(--ok-bg) !important;   color: var(--ok-fg) !important;   border-color: var(--ok-fg) !important; }
button.rr-val.status-practiced  { background: var(--info-bg) !important; color: var(--info-fg) !important; border-color: var(--info-fg) !important; }
button.rr-val.status-introduced { background: var(--warn-bg) !important; color: var(--warn-fg) !important; border-color: var(--warn-fg) !important; }
select.rr-select { min-width: 140px; }
.rr-num { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text-2); }
.rr-num input { width: 84px; text-align: center; }
.rr-checklist { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; max-width: 520px; }
.rr-pct { font-weight: 700; color: var(--ink); min-width: 44px; }
label.rr-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin: 0; cursor: pointer; }
.rr-plan-foot { margin-top: 18px; text-align: center; }
/* Modals */
.rr-overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45); z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 14px; }
.rr-dialog { background: var(--surface); border-radius: 8px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 18px 18px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.rr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rr-dialog-head h3 { margin: 0; color: var(--ink); font-size: 18px; }
button.rr-x { background: none !important; color: var(--text-2) !important; border: none !important; font-size: 18px; width: 36px; height: 36px; padding: 0 !important; }
.rr-search { width: 100%; margin: 10px 0; box-sizing: border-box; }
.rr-results { display: flex; flex-direction: column; }
.rr-pick-sec h4 { margin: 14px 0 4px; font-size: 13px; color: var(--brass-ink); text-transform: none; }
.rr-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); }
.rr-result button { flex: 0 0 auto; padding: 6px 14px; font-size: 13px; }
.rr-added { font-size: 12px; color: var(--ok-fg); font-weight: 700; }
.rr-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; font-weight: 600; color: var(--text); font-size: 14px; }
.rr-field input, .rr-field select { width: 100%; box-sizing: border-box; font-weight: 400; }
.rr-error { color: var(--bad-fg); font-size: 13px; min-height: 18px; margin-top: 6px; }
.rr-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 600px) {
  .rr-grid { grid-template-columns: 1fr; }
  .rr-row-main { flex-direction: column; align-items: stretch; }
  .rr-row-ctl { align-self: flex-start; }
  .rr-plan-actions { width: 100%; }
}
/* Admin: Resource Room tags in the student editor */
.rr-tag-list { display: flex; flex-direction: column; gap: 8px; }
.rr-tag-list label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }
/* Student profile: Resource Room plan */
.rr-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.rr-profile-row:last-child { border-bottom: none; }
.rr-profile-val { font-weight: 700; color: var(--ink); }

/* ── Progress over the years (student.html, skill-progress.js) ─────────────── */
.sp-empty { color: var(--text-2); margin: 0; line-height: 1.6; }
.sp-summary { margin: 0 0 12px; color: var(--text); font-weight: 600; }
.sp-chart { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; padding: 12px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.sp-bar-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 32px; align-items: center; gap: 10px; font-size: 13px; }
.sp-bar-lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-bar { display: flex; height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.sp-bar > span { background: var(--ok-fg); }
.sp-bar-n { font-weight: 700; color: var(--ink); text-align: end; }
.sp-years { display: flex; flex-direction: column; gap: 12px; }
.sp-year { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sp-year-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--ink-soft); color: var(--ink); font-weight: 700; font-size: 16px; }
.sp-year-grade { font-weight: 600; font-size: 14px; color: var(--text); }
.sp-year-count { margin-inline-start: auto; font-size: 12px; font-weight: 600; color: var(--text-2); }
.sp-list-title { font-size: 12px; font-weight: 700; padding: 8px 14px 2px; }
.sp-ok { color: var(--ok-fg); }
.sp-info { color: var(--info-fg); }
.sp-item { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; flex-wrap: wrap; }
.sp-item:last-child { border-bottom: none; }
.sp-subj { font-size: 11px; color: var(--text-2); }
.sp-when { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.sp-later { color: var(--ok-fg); font-weight: 600; }
@media (max-width: 600px) { .sp-bar-row { grid-template-columns: 110px 1fr 26px; } }
.sp-h3 { font-size: 15px; color: var(--ink); margin: 18px 0 8px; }
.sp-ta-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); }
table.sp-ta { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; margin: 0 !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; overflow: visible !important; }
table.sp-ta th { text-transform: none !important; letter-spacing: 0 !important; }
table.sp-ta tbody tr { background: var(--surface) !important; }
table.sp-ta th, table.sp-ta td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: center; }
table.sp-ta thead th { background: var(--paper); color: var(--ink); font-weight: 700; }
table.sp-ta tbody th { text-align: start; font-weight: 600; color: var(--text); background: var(--surface); white-space: nowrap; }
table.sp-ta tbody tr:last-child th, table.sp-ta tbody tr:last-child td { border-bottom: none; }
.sp-ta-grade { font-size: 11px; font-weight: 400; color: var(--text-2); }
td.sp-ta-hi { color: var(--ok-fg); background: var(--ok-bg); font-weight: 700; }
td.sp-ta-mid { color: var(--info-fg); background: var(--info-bg); font-weight: 700; }
td.sp-ta-lo { color: var(--warn-fg); background: var(--warn-bg); font-weight: 700; }
td.sp-ta-none { color: var(--text-2); }
.sp-note { font-size: 12px; color: var(--text-2); margin: 6px 0 0; }

/* ── Behaviour chart: points column (skills.html table layout) ─────────────── */
td.bc-pts-cell { padding: 4px 2px !important; border: 1px solid var(--line); text-align: center; vertical-align: middle; cursor: default; overflow: hidden; }
.bc-pts { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; }
button.bc-pts-btn { width: 28px; height: 28px; min-width: 28px !important; margin: 0 !important; border-radius: 50% !important; padding: 0 !important; font-size: 17px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; flex: 0 0 28px; box-shadow: none !important; }
button.bc-pts-minus { background: var(--bad-bg) !important; color: var(--bad-fg) !important; border: 1px solid var(--bad-fg) !important; }
button.bc-pts-plus  { background: var(--ok-bg) !important;  color: var(--ok-fg) !important;  border: 1px solid var(--ok-fg) !important; }
button.bc-pts-minus:hover { background: var(--bad-fg) !important; color: var(--surface) !important; }
button.bc-pts-plus:hover  { background: var(--ok-fg) !important;  color: var(--surface) !important; }
.bc-pts-val { min-width: 28px; font-size: 16px; font-weight: 700; color: var(--brass-ink); cursor: pointer; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Behaviour chart: weekly summary cell (renderWeeklySummary) ───────────── */
td.bc-week-cell { padding: 6px 8px !important; border: 1px solid var(--line); background: var(--paper); vertical-align: middle; overflow: hidden; }
.bc-week { display: flex; flex-direction: column; gap: 5px; }
.bc-week-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-week-overall { display: inline-block; padding: 2px 8px; border-radius: 10px; color: var(--surface); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bc-week-dots { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.bc-week-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bc-week-dot.is-empty { background: transparent; border: 1px solid var(--line); }
.bc-week-marks { display: flex; flex-wrap: wrap; gap: 4px; }
.bc-week-mark { font-size: 11px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.bc-week-pts { font-size: 11px; font-weight: 700; color: var(--brass-ink); white-space: nowrap; }
.bc-week-rows { display: flex; flex-direction: column; gap: 3px; }
.bc-week-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.bc-week-none { font-size: 11px; color: var(--text-2); }
th.bc-th-icon svg { width: 18px; height: 18px; display: block; margin: 0 auto; }

/* ── Skill tables follow the page language ─────────────────────────────────
   skills.html builds its skill tables right-to-left (styles.css
   .rtl-skills-table / .rtl-table-wrapper + inline direction/text-align), so in
   the English UI the student column sat on the right. body.tables-ltr (set by
   applyTableDirection() in skills.html from the teacher's 'Marking table
   direction' setting — auto = by student names) flips them; the Hebrew UI is untouched. Typed content keeps
   its own direction (unicode-bidi: plaintext). */
body.tables-ltr .skill-table-wrapper,
body.tables-ltr .skill-table-wrapper * { direction: ltr !important; }
body.tables-ltr .skill-table-wrapper [style*="text-align:right"],
body.tables-ltr .skill-table-wrapper [style*="text-align: right"],
body.tables-ltr .rtl-skills-table th,
body.tables-ltr .rtl-skills-table td { text-align: left !important; }
body.tables-ltr .skill-table-wrapper textarea,
body.tables-ltr .skill-table-wrapper input[type="text"] { unicode-bidi: plaintext; text-align: start !important; }

/* ── Database setup check (index-check.js: wizard + admin) ───────────────── */
.ic-muted { color: var(--text-2); }
.ic-note { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.6; border: 1px solid var(--line); }
.ic-note.ic-ok   { background: var(--ok-bg);   color: var(--ok-fg);   border-color: var(--ok-fg); }
.ic-note.ic-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-fg); }
.ic-note.ic-bad  { background: var(--bad-bg);  color: var(--bad-fg);  border-color: var(--bad-fg); }
.ic-note a { color: inherit; font-weight: 600; }
.ic-steps { margin: 0 0 16px; padding-inline-start: 22px; color: var(--text); font-size: 14px; line-height: 1.7; }
.ic-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.ic-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.ic-body { flex: 1; min-width: 0; }
.ic-name { font-weight: 700; color: var(--text); }
.ic-desc { font-size: 13px; color: var(--text-2); margin: 2px 0 10px; }
.ic-body .ic-note { margin: 0; }
a.ic-create { display: inline-block; padding: 10px 18px; background: var(--ink); color: var(--paper) !important; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 15px; }
a.ic-create:hover { background: var(--ink-hover); }
a.ic-create:visited { opacity: .75; }
.ic-recheck { padding: 10px 22px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; margin-top: 6px; }
.ic-recheck:disabled { opacity: .6; cursor: wait; }
.ic-recheck-result { margin-top: 12px; }

/* ── Student profile (student.html + student-profile.js) ───────────────────
   Views: body.view-teacher | view-parent | view-student. Sections are
   <details class="sp-sec">, closed on open, with a one-line summary.       */
body:not(.view-teacher) .teacher-only { display: none !important; }
body.view-student .sp-cmp { display: none !important; }
.container.sp-page { background: transparent !important; box-shadow: none !important; padding: 16px !important; max-width: 1040px; margin: 0 auto; }
.sp-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-viewswitch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.sp-viewswitch button { background: transparent !important; color: var(--text-2) !important; border: 0 !important; border-radius: 8px !important; padding: 7px 14px !important; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: none !important; white-space: nowrap; }
.sp-viewswitch button.is-on { background: var(--ink) !important; color: var(--surface) !important; }
button.sp-lang { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 8px !important; padding: 6px 12px !important; font-weight: 700; font-size: 12.5px; cursor: pointer; box-shadow: none !important; }
.sp-hero { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; }
.sp-hero #studentPhoto { width: 104px !important; height: 104px !important; border-radius: 50% !important; object-fit: cover; border: 3px solid var(--brass) !important; flex: 0 0 auto; }
.sp-hero-text { flex: 1; min-width: 0; }
.sp-name { margin: 0 !important; }
.sp-name input { font-family: 'Frank Ruhl Libre', serif !important; font-size: 30px !important; font-weight: 700 !important; color: var(--ink) !important; -webkit-text-fill-color: var(--ink); opacity: 1; border: 0; background: transparent !important; width: 100%; padding: 0 !important; text-align: start; height: auto !important; }
.sp-name input:not(:disabled) { border-bottom: 2px solid var(--brass); }
.sp-grade { margin: 2px 0 0 !important; color: var(--text-2); font-size: 16px; }
.sp-viewhint { margin: 6px 0 0 !important; font-size: 13px; color: var(--text-2); }
.sp-hero-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
button.sp-tool { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 8px !important; padding: 5px 12px !important; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: none !important; }
button.sp-tool:hover { border-color: var(--ink) !important; }

.sp-glance { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.sp-glance:empty { display: none; }
.sp-glance-title { font-size: 15px !important; margin: 0 0 12px !important; color: var(--text-2) !important; font-weight: 700; text-transform: none; border: 0 !important; padding: 0 !important; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.sp-tile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.sp-tile-k { font-size: 12.5px; color: var(--text-2); font-weight: 700; }
.sp-tile-v { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.25; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.sp-tile-v.sp-tile-txt { font-size: 17px; line-height: 1.35; padding: 6px 0 3px; }
.sp-tile-v.sp-tile-none { color: var(--text-2); }
.sp-tile-s { font-size: 12.5px; color: var(--text-2); }
.sp-meter { height: 6px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.sp-meter i { display: block; height: 100%; background: var(--ok-fg); border-radius: 4px; }
.sp-chip { display: inline-block; color: var(--surface); font-weight: 700; font-size: 11.5px; border-radius: 10px; padding: 2px 9px; white-space: nowrap; }
.sp-chip-lg { font-size: 17px; padding: 4px 14px; border-radius: 14px; }
.sp-trend { font-weight: 700; }
.sp-trend-up { color: var(--ok-fg); }
.sp-trend-down { color: var(--warn-fg); }
.sp-trend-same { color: var(--info-fg); }
.sp-strengths { margin: 12px 0 0; font-size: 14px; color: var(--text); }

.sp-secbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 16px 2px 8px; }
.sp-secbar-hint { font-size: 13px; color: var(--text-2); }
button.sp-linkbtn { background: transparent !important; border: 0 !important; color: var(--ink) !important; font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 6px !important; box-shadow: none !important; text-decoration: underline; text-underline-offset: 3px; }

details.sp-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
details.sp-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 15px 18px; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent; color: var(--ink); font-size: 16px; }
details.sp-sec > summary::-webkit-details-marker { display: none; }
details.sp-sec > summary::after { content: ''; flex: 0 0 auto; width: 9px; height: 9px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin-top: -4px; transition: transform .15s; margin-inline-start: auto; }
details.sp-sec[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.sp-sec > summary:hover { background: var(--paper); }
details.sp-sec[open] > summary { border-bottom: 1px solid var(--line) !important; }
.sp-sec-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.sp-sec-sub { font-size: 13px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-sec-body { padding: 14px 18px 18px; }
/* Old section cards live inside the new ones: flatten them, drop their titles */
.sp-sec .visual-dashboard, .sp-sec .section, .sp-sec .summary-card { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
.sp-sec .dashboard-title, .sp-sec .section > h2 { display: none !important; }
.sp-sec .dashboard-header { justify-content: flex-end; border: 0 !important; margin: 0 0 8px !important; padding: 0 !important; }
.sp-sec .dashboard-header:not(:has(button)) { display: none; }
body:not(.view-teacher) .sp-sec .dashboard-header, body:not(.view-teacher) .sp-sec .export-buttons { display: none !important; }
.sp-muted { color: var(--text-2); font-size: 14px; }
.sp-good { color: var(--ok-fg); font-weight: 600; font-size: 14px; margin: 4px 0 0; }
.sp-h4 { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 8px; }

/* Behavior trend (daily chart) */
.sp-bh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sp-seg button { background: var(--surface) !important; color: var(--text-2) !important; border: 0 !important; border-radius: 0 !important; padding: 6px 14px !important; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: none !important; }
.sp-seg button.is-on { background: var(--ink) !important; color: var(--surface) !important; }
.sp-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.sp-legend span { display: inline-flex; align-items: center; gap: 4px; }
.sp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.spb-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 4px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.spb-bar { flex: 1 0 34px; max-width: 70px; display: flex; flex-direction: column; align-items: stretch; height: 100%; }
.spb-track { flex: 1; display: flex; align-items: flex-end; }
.spb-fill { width: 100%; border-radius: 6px 6px 0 0; min-height: 6px; }
.spb-lbl { font-size: 11px; color: var(--text-2); text-align: center; padding: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.sp-bh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sp-bh-table th, table.sp-bh-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
table.sp-bh-table { box-shadow: none !important; }
table.sp-bh-table th { text-transform: none !important; letter-spacing: normal !important; }
table.sp-bh-table thead th { color: var(--text-2); font-weight: 700; font-size: 12px; background: transparent !important; }
.spb-bars.spb-wide .spb-bar { max-width: 120px; }
table.sp-bh-table tbody th { text-align: start; font-weight: 600; color: var(--text); }
td.sp-bh-empty { color: var(--text-2); }
.sp-bh-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-tag { font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 2px 9px; }

@media (max-width: 600px) {
  .container.sp-page { padding: 12px !important; }
  .sp-topbar { gap: 8px; }
  .sp-viewswitch { order: 3; width: 100%; }
  .sp-viewswitch button { flex: 1; padding: 7px 6px !important; font-size: 12.5px; }
  .sp-hero { gap: 14px; padding: 14px; }
  .sp-hero #studentPhoto { width: 76px !important; height: 76px !important; }
  .sp-name input { font-size: 23px !important; }
  .sp-tiles { grid-template-columns: 1fr 1fr; }
  .sp-tile-v { font-size: 24px; }
  details.sp-sec > summary { padding: 13px 14px; flex-wrap: wrap; row-gap: 2px; }
  .sp-sec-sub { order: 3; flex-basis: 100%; white-space: normal; }
  details.sp-sec > summary::after { order: 2; }
  .sp-sec-body { padding: 12px 12px 14px; }
}
/* styles.css rotates the first span of every open summary (a legacy ▸ arrow);
   the profile's section titles are text, not arrows. */
details.sp-sec[open] > summary > span:first-of-type { transform: none !important; display: inline; }

/* ── Settings drawer: header buttons sat 5px out of their cards (global
   button margin). ─────────────────────────────────────────────────────── */
.settings-section > .settings-section-header { margin: 0 !important; width: 100% !important; box-sizing: border-box; border: 0 !important; border-radius: inherit !important; }
a.profile-link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ── PHONES (≤600px) — teacher marking flows ─────────────────────────────
   Skill tables (Student | Mark | Notes | Profile) become compact two-line
   rows: name + mark (+ profile) on top, a one-line note box underneath;
   checklist boxes get the full width. Only 4-column tables are reflowed. */
@media (max-width: 600px) {
  .skill-table-wrapper { overflow-x: visible !important; margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) { display: block; width: 100% !important; min-width: 0 !important; box-shadow: none !important; border: 0 !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead { display: block; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead > tr { display: flex; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th { width: auto !important; padding: 8px 0 !important; background: transparent !important; font-size: 12.5px !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th:nth-child(1) { flex: 1; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th:nth-child(n+3) { display: none; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody { display: block; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px 10px; padding: 9px 10px !important; border-bottom: 1px solid var(--line); }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; min-width: 0; background: transparent !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px !important; line-height: 1.25; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(2) { grid-column: 2; grid-row: 1; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(4) { grid-column: 4; grid-row: 1; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  /* checklist: the boxes take a full row of their own, note below */
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(2):has(input[type="checkbox"]) { grid-column: 1 / -1; grid-row: 2; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr:has(td:nth-child(2) input[type="checkbox"]) > td:nth-child(3) { grid-row: 3; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3) textarea { width: 100% !important; min-width: 0 !important; min-height: 34px !important; height: 34px; padding: 6px 8px !important; box-sizing: border-box; resize: none !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3) textarea:focus { height: 64px; }
  /* Empty note → a small pencil button on the first line; tap it (focus)
     or type → it opens to a full-width box on its own line. */
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3):has(textarea:placeholder-shown:not(:focus)) { grid-column: 3; grid-row: 1; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3) textarea:placeholder-shown:not(:focus) { width: 36px !important; min-width: 36px !important; min-height: 34px !important; height: 34px; padding: 0 !important; color: transparent; cursor: pointer;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d6a3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / 16px no-repeat !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(3) textarea:placeholder-shown:not(:focus)::placeholder { color: transparent; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th { border: 0 !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(2) > div:has(input[type="checkbox"]) { flex-wrap: wrap; gap: 6px !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(2) > div > div:has(input[type="checkbox"]) { flex: 1 1 100%; }
  table.skill-table td .status-clickable { display: inline-block; min-width: 72px; text-align: center; padding: 7px 10px !important; }
  table.skill-table td label:has(> input[type="checkbox"]) { padding: 6px 7px !important; font-size: 12.5px !important; margin: 0 !important; flex: 0 0 calc((100% - 12px) / 3); box-sizing: border-box; justify-content: space-between; min-width: 0; }
  a.profile-link span { display: none; }      /* icon only on phones */
  a.profile-link { padding: 6px; }

  /* Behavior quick-mark pop-up: 4 marks per row instead of 2 big squares */
  button.behavior-mark-btn { width: calc(25% - 9px) !important; min-height: 62px !important; border-width: 2px !important; padding: 4px 2px !important; }
  button.behavior-mark-btn .bmark-label { font-size: 16px !important; }
  button.rating-btn { padding: 12px 4px !important; font-size: 14px !important; }
}

/* ── Honors list on phones: one card per award instead of a 7-column table */
@media (max-width: 600px) {
  table.aw-table { min-width: 0 !important; display: block; width: 100%; }
  table.aw-table thead { display: none; }
  table.aw-table tbody { display: block; }
  table.aw-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  table.aw-table tbody td { display: block; padding: 0 !important; border: 0 !important; }
  table.aw-table tbody td:nth-child(3) { grid-column: 1; grid-row: 1; font-weight: 700; font-size: 16px; color: var(--ink); }
  table.aw-table tbody td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: end; }
  table.aw-table tbody td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
  table.aw-table tbody td:nth-child(1) div { font-size: 12px !important; }
  table.aw-table tbody td:nth-child(4) { grid-column: 2; grid-row: 2; font-size: 13px; color: var(--text-2); text-align: end; }
  table.aw-table tbody td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; font-size: 13px; color: var(--text-2); }
  table.aw-table tbody td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; font-size: 14px; color: var(--text); }
  table.aw-table tbody td:nth-child(6):empty { display: none; }
  table.aw-table tbody td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; white-space: normal !important; margin-top: 4px; }
  table.aw-table tbody td:nth-child(7) select { flex: 1 1 0; min-width: 0 !important; max-width: none !important; }
}

/* ── Visual polish: chevrons instead of ▼/▲ text arrows (all sizes) ─────── */
.skill-group-section summary.group-summary::after {
  content: '' !important; width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg); margin: -4px 4px 0; transition: transform .15s;
}
.skill-group-section[open] > summary.group-summary::after { transform: rotate(-135deg) !important; margin-top: 4px; }
.skill-group-section summary.group-summary:has(.group-add-test-btn) .group-add-test-btn { margin-inline-start: auto !important; margin-inline-end: 10px !important; }
.attendance-arrow { font-size: 0 !important; display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin: -4px 4px 0; transition: transform .15s; }
.attendance-card:has(.attendance-content[style*="display: flex"]) .attendance-arrow { transform: rotate(-135deg); margin-top: 4px; }

/* ── Visual polish on phones: one rhythm, aligned columns ──────────────── */
@media (max-width: 600px) {
  #skillsContainer { padding-top: 10px; }
  /* Same card, same 8px gap for attendance and every subject */
  .attendance-card { margin: 0 0 8px !important; border-inline-start: 4px solid var(--ink) !important; }
  .attendance-card-header { background: var(--surface) !important; min-height: 52px; box-sizing: border-box; }
  .attendance-card-title { font-size: 16px !important; font-weight: 600 !important; }
  details.skill-group-section { margin: 0 0 8px !important; }
  details.skill-group-section > summary.group-summary { margin: 0 !important; min-height: 52px; box-sizing: border-box; }
  details.skill-group-section[open] > summary.group-summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  /* The open subject's skills sit flush under its header (no extra inset) */
  details.skill-group-section > div { padding: 8px 0 4px !important; }
  .skill-section { margin: 0 0 8px !important; border-radius: 12px; overflow: hidden; }
  .skill-section .skill-header { padding: 12px 14px !important; }
  .skill-table-wrapper { padding-top: 0 !important; padding-bottom: 0 !important; }
  table.skill-table { margin: 0 !important; }
  /* Marking rows: fixed columns so every mark button lines up */
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr,
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead > tr { display: grid !important; grid-template-columns: minmax(0, 1fr) 118px 36px 30px !important; gap: 6px 8px !important; align-items: center; padding-left: 12px !important; padding-right: 12px !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th:nth-child(2) { grid-column: 2; text-align: center !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > thead th:nth-child(1) { grid-column: 1; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(2) > div { text-align: center !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) td .status-clickable { display: block; width: 100%; box-sizing: border-box; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr > td:nth-child(4) { text-align: center !important; }
  table.skill-table:has(> thead > tr > th:nth-child(4):last-child) > tbody > tr:nth-child(even) { background: var(--paper) !important; }
}
.attendance-card-header > div { display: flex; align-items: center; }
@media (max-width: 600px) {
  /* Tzivos header: all three buttons as matching chips */
  .tz-header { justify-content: center !important; align-items: center !important; gap: 8px !important; padding-bottom: 14px !important; }
  .tz-header .back-btn { margin: 0 !important; position: static !important; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px !important; border-radius: 8px !important;
    background: color-mix(in srgb, var(--surface) 12%, transparent) !important; border: 1px solid color-mix(in srgb, var(--surface) 30%, transparent) !important; color: var(--surface) !important; font-size: 13px; text-decoration: none; }
}

/* ── Line icons (ui-menus.js) ──────────────────────────────────────────── */
svg.ui-ico { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
[data-ico] { display: inline-flex; align-items: center; gap: 8px; }
#navMenuPanel [data-ico] { justify-content: flex-start; }
#navMenuPanel [data-ico] svg.ui-ico { width: 20px; height: 20px; color: var(--brass-ink); }
#dailyBehaviorChartModal button[data-ico] { gap: 5px; }
#dailyBehaviorChartModal button[data-ico] svg.ui-ico { width: 17px; height: 17px; }

/* ── Settings drawer + behavior setup: grouped, labelled sections ──────── */
.ui-grp-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-ink); margin: 20px 4px 8px; }
html[lang="he"] .ui-grp-title, html[dir="rtl"] .ui-grp-title { letter-spacing: 0; text-transform: none; font-size: 13px; }
.ui-grp-title:first-child { margin-top: 4px; }
button.settings-section-header.ui-sec-head { display: flex !important; align-items: center; gap: 12px; text-align: start; padding: 12px 14px !important; }
.ui-sec-ico { flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--ink-soft); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.ui-sec-ico svg.ui-ico { width: 19px; height: 19px; }
.ui-sec-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ui-sec-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.ui-sec-desc { font-weight: 400; font-size: 12.5px; color: var(--text-2); line-height: 1.35; white-space: normal; }
/* chevron instead of ▼ text */
.section-arrow { font-size: 0 !important; display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) !important; margin: -4px 4px 0; transition: transform .15s; }
.section-arrow.rotated { transform: rotate(-135deg) !important; margin-top: 4px; }
/* chart type box: same header look as the sections */
.ui-mode-box { flex-direction: column; align-items: stretch !important; gap: 10px !important; padding: 12px 14px !important; }
.ui-mode-lead { display: flex; align-items: center; gap: 12px; }
.ui-mode-box .bc-modepills { padding-inline-start: 48px; }
.ui-toggle-title svg.ui-ico { color: var(--brass-ink); }
/* behavior setup: Save / Cancel always reachable */
.ui-sticky-foot { position: sticky; bottom: 0; z-index: 3; background: var(--surface); margin: 8px -20px -20px; padding: 12px 20px !important; box-shadow: 0 -6px 14px -10px rgba(0,0,0,.25); display: flex; justify-content: flex-end; gap: 10px; }
.ui-sticky-foot button { margin: 0 !important; }
@media (max-width: 600px) {
  .ui-sticky-foot { margin: 8px -12px -12px; padding: 10px 12px !important; }
  .ui-sticky-foot button { flex: 1; padding: 12px 10px !important; }
  .ui-mode-box .bc-modepills { padding-inline-start: 0; }
}
#navMenuPanel .nav-menu-grid button[data-ico], #navMenuPanel .nav-menu-grid a[data-ico] { display: flex !important; align-items: center; gap: 12px !important; }
button.settings-section-header.ui-sec-head { margin: 0 !important; width: 100% !important; box-sizing: border-box; }
#behaviorChartConfigModal label.bc-toggle { width: 100%; box-sizing: border-box; margin-inline: 0 !important; }
/* Seating layout: a normal row in "Extras", not a heavy dark bar */
#behaviorChartConfigModal button[onclick*="openClassroomLayoutEditor"] { margin: 0 !important; width: 100% !important; box-sizing: border-box; background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: var(--radius) !important; padding: 12px 14px !important; }
#behaviorChartConfigModal button[onclick*="openClassroomLayoutEditor"] [data-i18n="bc.seatingHint"] { color: var(--text-2); opacity: 1 !important; }
/* "My skills" sub-items: one clean row each */
.ui-sublist details:not(#subskillsSection) { background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 10px !important; padding: 0 !important; margin: 0 0 8px !important; box-shadow: none !important; }
.ui-sublist details:not(#subskillsSection) > summary { display: flex !important; align-items: center; flex-wrap: wrap; gap: 2px 8px; padding: 12px 14px !important; margin: 0 !important; background: transparent !important; border: 0 !important; list-style: none; font-size: 14.5px !important; }
.ui-sublist details:not(#subskillsSection) > summary::-webkit-details-marker { display: none; }
.ui-sublist details:not(#subskillsSection) > summary > span:first-child:not([data-i18n]) { display: none !important; }
.ui-sublist details:not(#subskillsSection) > summary > .ui-sub-title { order: 1; transform: none !important; font-weight: 700; color: var(--ink); }
.ui-sublist details:not(#subskillsSection) > summary > .ui-sub-title svg.ui-ico { color: var(--brass-ink); }
.ui-sublist details:not(#subskillsSection) > summary::after { content: '' !important; order: 2; margin-inline-start: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin-top: -4px; }
.ui-sublist details[open]:not(#subskillsSection) > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.ui-sublist details:not(#subskillsSection) > summary > small { order: 3; flex-basis: 100%; margin: 0 !important; padding-inline-start: 26px; color: var(--text-2) !important; }
.ui-sublist details:not(#subskillsSection) > *:not(summary) { margin: 0 14px 14px !important; }
/* Chart setup: Hebrew subject rows run RTL, but with English menus the
   explanation box above them stays English left-to-right. */
html[dir="ltr"] #subjectConfigList[dir="rtl"] > :not(:has(input)) { direction: ltr; text-align: left !important; }

/* ── Student profile, parent-meeting / student views: not-started and
   just-introduced skills (and, for the student, low marks) leave the main
   grid and are listed under "Coming up next" (renderUpcomingSkills). ── */
body.view-parent #skillsGrid .skill-item[data-stage="begin"],
body.view-student #skillsGrid .skill-item[data-stage="begin"],
body.view-student #skillsGrid .skill-item[data-stage="weak"] { display: none !important; }
body.view-parent #skillsGrid .skill-group:not(:has(.skill-item:not([data-stage="begin"]))),
body.view-student #skillsGrid .skill-group:not(:has(.skill-item[data-stage="ok"])) { display: none !important; }
body:not(.view-student) .sp-up-weak { display: none !important; }
body:not(.view-student) .sp-up-group:not(:has(.sp-up-item:not(.sp-up-weak))) { display: none !important; }
.sp-up-intro { margin: 0 0 12px; font-size: 14px; color: var(--text-2); }
.sp-up-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sp-up-group { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sp-up-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sp-up-group ul { list-style: none; margin: 0; padding: 0; }
.sp-up-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.sp-up-item:first-child { border-top: 0; }
.sp-up-tag { flex: 0 0 auto; font-size: 12px; color: var(--info-fg); background: var(--info-bg); border-radius: 10px; padding: 2px 9px; white-space: nowrap; }

/* ── Award text message (award-sms.js, honors.html) ─────────────────────── */
button.awsms-btn { display: inline-flex; align-items: center; gap: 5px; }
button.awsms-btn.is-sent { color: var(--ok-fg) !important; border-color: var(--ok-fg) !important; }
.awsms-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 20, 35, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.awsms-box { background: var(--surface); border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.awsms-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.awsms-title { font-family: 'Frank Ruhl Libre', serif; font-size: 20px; font-weight: 700; color: var(--ink); }
.awsms-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
button.awsms-x { background: transparent !important; border: 0 !important; font-size: 24px; line-height: 1; color: var(--text-2) !important; cursor: pointer; padding: 0 4px !important; box-shadow: none !important; margin: 0 !important; }
.awsms-body { padding: 14px 18px; overflow-y: auto; }
.awsms-lbl { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 4px 0 6px; }
.awsms-recs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label.awsms-rec { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--paper); }
label.awsms-rec input { width: 18px !important; min-width: 18px !important; height: 18px; margin: 0; }
.awsms-rec-name { font-weight: 600; color: var(--text); }
.awsms-rec-phone { color: var(--text-2); font-size: 13px; margin-inline-start: auto; }
.awsms-rec-note { flex-basis: 100%; font-size: 12px; color: var(--warn-fg); padding-inline-start: 28px; }
label.awsms-rec.is-off { opacity: .8; }
.awsms-none { color: var(--warn-fg); font-size: 14px; margin: 0 0 12px; }
#awSmsText { width: 100%; box-sizing: border-box; font-size: 15px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; min-width: 0 !important; }
.awsms-count { font-size: 12px; color: var(--text-2); text-align: end; margin-top: 4px; }
.awsms-result { font-size: 14px; font-weight: 600; margin-top: 8px; min-height: 18px; }
.awsms-result.is-ok { color: var(--ok-fg); }
.awsms-result.is-warn { color: var(--warn-fg); }
.awsms-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@media (max-width: 600px) { .awsms-foot .btn { flex: 1; } }
.awsms-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
button.awsms-chip { background: var(--ink-soft) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 999px !important; padding: 4px 10px !important; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: none !important; margin: 0 !important; }
.awsms-example { margin-top: 12px; background: var(--paper); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.awsms-example #awSmsExample { font-size: 14px; color: var(--text); line-height: 1.5; margin-top: 4px; }

/* Skill tables (desktop/tablet): keep the Notes column narrow so subskill
   checkboxes get the width and rows stay short. Phones use the grid layout above. */
@media (min-width: 601px) {
  table.skill-table th.sk-notes,
  table.skill-table td.sk-notes { width: 200px !important; max-width: 220px; }
  table.skill-table th.sk-status { width: auto !important; }   /* the marks column takes the spare width */
  table.skill-table td.sk-notes textarea { width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
  table.skill-table td.sk-notes textarea:not(:focus) { min-height: 34px !important; }
  table.skill-table td.sk-notes textarea:placeholder-shown:not(:focus) { height: 34px !important; resize: none; }
}
