/* ============================================================
 * syllabus-styles.css — shared styles for all four syllabus pages.
 * Loaded by:
 *   - igcse-syllabus.html
 *   - as-alevel-syllabus.html
 *   - primary-checkpoint-syllabus.html
 *   - secondary-checkpoint-syllabus.html
 *
 * Page-specific overrides (year filter colours, settings panel tweaks,
 * subject palette additions) remain inline in each page's <style> block.
 * ============================================================ */

/* ===== Design Tokens ===== */
:root {
  --ink:       #1c1c2e;
  --ink-2:     #44445a;
  --ink-3:     #8888a8;
  --paper:     #f7f6f3;
  --paper-2:   #efede8;
  --white:     #ffffff;
  --border:    #e0ddd6;
  --accent:    #059669;
  --accent-dk: #047857;
  --accent-2:  #d1fae5;
  --shadow-sm: 0 1px 4px rgba(28,28,46,.07);
  --shadow:    0 3px 14px rgba(28,28,46,.10);
  --shadow-lg: 0 10px 40px rgba(28,28,46,.16);
  --radius:    10px;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(140deg, #064e3b 0%, #065f46 45%, #0d9488 100%);
  padding: 40px 40px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 70%, rgba(255,255,255,0.07) 0%, transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(0,0,0,0.12) 0%, transparent 50%);
}
.hero-inner {
  position: relative; z-index: 1; max-width: 1400px; margin: 0 auto;
  display: flex; align-items: flex-start; gap: 20px;
}
.hero-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; font-size: 1.4rem;
}
.hero-eyebrow {
  font-size: 0.75rem; font-weight: 500; color: rgba(255,255,255,0.55);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px;
}
.hero-title {
  font-family: 'Lora', serif; font-size: 1.85rem; font-weight: 600;
  color: #fff; margin-bottom: 6px; line-height: 1.2;
}
.hero-desc { font-size: 0.9rem; color: rgba(255,255,255,0.68); line-height: 1.6; }

/* ===== PAGE WRAP ===== */
.page-wrap { max-width: 1400px; margin: 0 auto; padding: 32px 40px 72px; }

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  text-decoration: none; margin-bottom: 24px; transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }

/* ===== ACCESS DENIED ===== */
.access-denied {
  text-align: center; padding: 56px 24px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.access-denied svg { opacity: 0.3; margin-bottom: 16px; }
.access-denied h3 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.access-denied p { font-size: 0.875rem; color: var(--ink-3); }

/* ===== SUBJECT COLOUR PALETTES ===== */
/* IGCSE / AS-A-Level subjects */
#mainContent[data-subject="math"]      { --subj-color:#059669; --subj-dk:#047857; --subj-light:#d1fae5; --subj-mid:#a7f3d0; --subj-text:#065f46; }
#mainContent[data-subject="biology"]   { --subj-color:#16a34a; --subj-dk:#15803d; --subj-light:#dcfce7; --subj-mid:#bbf7d0; --subj-text:#14532d; }
#mainContent[data-subject="chemistry"] { --subj-color:#7c3aed; --subj-dk:#6d28d9; --subj-light:#ede9fe; --subj-mid:#ddd6fe; --subj-text:#4c1d95; }
#mainContent[data-subject="physics"]   { --subj-color:#2563eb; --subj-dk:#1d4ed8; --subj-light:#dbeafe; --subj-mid:#bfdbfe; --subj-text:#1e3a8a; }
/* Checkpoint subjects */
#mainContent[data-subject="english"]   { --subj-color:#d97706; --subj-dk:#b45309; --subj-light:#fef3c7; --subj-mid:#fde68a; --subj-text:#92400e; }
#mainContent[data-subject="science"]   { --subj-color:#2563eb; --subj-dk:#1d4ed8; --subj-light:#dbeafe; --subj-mid:#bfdbfe; --subj-text:#1e3a8a; }

#mainContent[data-subject] .ch-header {
  border-left: 4px solid var(--subj-color, var(--accent));
  background: color-mix(in srgb, var(--subj-light, var(--accent-2)) 40%, var(--white));
}
#mainContent[data-subject] .ch-header:hover {
  background: color-mix(in srgb, var(--subj-light, var(--accent-2)) 65%, var(--white));
}
#mainContent[data-subject] .ch-num {
  background: var(--subj-light, var(--accent-2));
  color: var(--subj-text, var(--accent-dk));
}
#mainContent[data-subject] .ch-title { color: var(--subj-dk, var(--accent-dk)); }

/* ===== SUBJECT TABS ===== */
.subject-tabs {
  display: flex; gap: 4px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px; margin-bottom: 24px;
}
.subj-tab {
  flex: 1; padding: 9px 12px; border: none; border-radius: 7px;
  background: transparent; font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-3); cursor: pointer;
  transition: all 0.18s; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.subj-tab:hover { color: var(--ink); background: var(--paper); }
.subj-tab.active { background: var(--accent); color: #fff; }
#mainContent[data-subject="math"]      .subj-tab[data-subj="math"].active      { background:#059669; }
#mainContent[data-subject="biology"]   .subj-tab[data-subj="biology"].active   { background:#16a34a; }
#mainContent[data-subject="chemistry"] .subj-tab[data-subj="chemistry"].active { background:#7c3aed; }
#mainContent[data-subject="physics"]   .subj-tab[data-subj="physics"].active   { background:#2563eb; }
#mainContent[data-subject="english"]   .subj-tab[data-subj="english"].active   { background:#d97706; }
#mainContent[data-subject="science"]   .subj-tab[data-subj="science"].active   { background:#2563eb; }
.subj-icon { font-size: 1rem; line-height: 1; }

/* ===== SEARCH BAR ===== */
.pacing-search-wrap {
  position: relative; margin-bottom: 16px;
}
.pacing-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.pacing-search-input {
  width: 100%; padding: 9px 36px 9px 36px; border: 1px solid var(--border);
  border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.875rem;
  color: var(--ink); background: var(--white); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pacing-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(5,150,105,0.12); }
.pacing-search-input::placeholder { color: var(--ink-3); }
.pacing-search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  padding: 2px 5px; border-radius: 4px; font-size: 1rem; line-height: 1;
  display: none;
}
.pacing-search-clear:hover { color: var(--ink); background: var(--paper-2); }
.search-result-count {
  font-size: 0.8rem; color: var(--ink-3); padding: 0 2px; margin-bottom: 12px;
}
mark.hl {
  background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px;
}

/* ===== ACTION BAR ===== */
.action-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.action-bar-left h2 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.action-bar-left p { font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn {
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-secondary { background: var(--white); color: var(--ink-2); border-color: var(--border); }
.btn-secondary:hover { background: var(--paper); color: var(--ink); }
.btn-edit {
  background: var(--paper-2); color: var(--ink-2); border-color: var(--border);
  font-size: 0.78rem; padding: 5px 10px;
}
.btn-edit:hover { background: var(--paper); color: var(--ink); }
.btn-danger {
  background: #fff1f0; color: #dc2626; border-color: #fecaca;
  font-size: 0.78rem; padding: 5px 10px;
}
.btn-danger:hover { background: #fef2f2; }
.btn-reorder {
  background: none; border: 1px solid var(--border); color: var(--ink-3);
  font-size: 0.78rem; padding: 3px 7px; border-radius: 5px; cursor: pointer;
  line-height: 1; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
}
.btn-reorder:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); border-color: var(--ink-3); }
.btn-reorder:disabled { opacity: 0.25; cursor: default; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-print { background: var(--white); color: var(--ink-2); border-color: var(--border); }
.btn-print:hover { background: var(--paper); color: var(--ink); }

/* ===== HOLIDAY BREAK ROW ===== */
.holiday-break {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-top: 1px dashed #fed7aa; border-bottom: 1px dashed #fed7aa;
  background: #fff7ed; font-size: 0.775rem; color: #92400e;
}
.holiday-break.ease   { border-color: #c4b5fd; background: #f5f3ff; color: #5b21b6; }
.holiday-break.camp   { border-color: #a5f3fc; background: #ecfeff; color: #0e7490; }
.holiday-break-icon   { font-size: 1rem; flex-shrink: 0; }
.holiday-break-body   { flex: 1; min-width: 0; }
.holiday-break-label  { font-weight: 700; }
.holiday-break-dates  { opacity: 0.75; margin-left: 6px; font-weight: 400; }

/* ===== CHAPTER BLOCKS ===== */
.chapters-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-block {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.ch-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.ch-header:hover { background: var(--paper); }
.ch-toggle {
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  font-size: 1rem; line-height: 1; padding: 2px 4px; flex-shrink: 0;
  transition: transform 0.2s; display: flex; align-items: center;
}
.chapter-block.collapsed .ch-toggle { transform: rotate(-90deg); }
.chapter-block.collapsed .ch-body { display: none; }
.ch-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-2); color: var(--accent-dk);
  font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ch-title { font-size: 0.925rem; font-weight: 600; color: var(--ink); flex: 1; }
.ch-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.year-badge {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: var(--paper-2); color: var(--ink-2);
}
.topic-count { font-size: 0.78rem; color: var(--ink-3); }
.ch-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ===== CHAPTER BODY ===== */
.ch-body { border-top: 1px solid var(--border); }

/* ===== TOPIC ROWS ===== */
.topics-list { display: flex; flex-direction: column; }
.topic-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--paper-2);
  transition: background 0.12s;
  align-items: start;
}
.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--paper); }
.topic-num {
  font-size: 0.75rem; color: var(--ink-3); padding-top: 2px; text-align: center;
}
.topic-main { min-width: 0; }
.topic-title {
  font-size: 0.875rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; line-height: 1.4;
}
.topic-objectives {
  font-size: 0.8rem; color: var(--ink-2); line-height: 1.5; margin-bottom: 8px;
}
.topic-objectives ul { padding-left: 14px; margin: 2px 0; }
.topic-objectives li { margin: 1px 0; }
.topic-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  justify-content: space-between;
}
.topic-meta-left  { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topic-meta-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.meta-chip {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
  cursor: pointer; border: 1px solid transparent; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.meta-chip:hover { opacity: 0.75; }
.chip-hours  { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.chip-week   { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.chip-sem1   { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.chip-sem2   { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.chip-date   { background: #f0fdf4; color: #166534; border-color: #bbf7d0; cursor: default; }
.chip-beyond { background: #fef2f2; color: #991b1b; border-color: #fecaca; font-style: italic; }
.sem-toggle-group {
  display: flex; gap: 3px; border: 1px solid var(--border);
  border-radius: 7px; padding: 3px; background: var(--paper-2);
}
.sem-btn {
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem; font-weight: 600;
  padding: 4px 12px; border-radius: 5px; border: none; cursor: pointer;
  transition: all 0.15s; color: var(--ink-3); background: transparent;
}
.sem-btn:hover { color: var(--ink); background: var(--white); }
.sem-btn.active-s1 { background: #ede9fe; color: #6d28d9; }
.sem-btn.active-s2 { background: #fce7f3; color: #be185d; }
.chip-inline-input {
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 600;
  padding: 1px 6px; border-radius: 100px; border: 2px solid var(--accent);
  outline: none; width: 72px; text-align: center;
  color: var(--ink); background: var(--white);
}
.resource-link {
  font-size: 0.72rem; color: var(--accent); text-decoration: none;
  padding: 2px 8px; background: var(--accent-2); border-radius: 4px; white-space: nowrap;
}
.resource-link:hover { background: #a7f3d0; }
.topic-actions {
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; flex-shrink: 0; padding-top: 2px; min-width: 58px;
}
.topic-actions .btn { width: 100%; justify-content: center; }
.activity-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.obj-rich { font-size: 0.8rem; color: var(--ink-2); line-height: 1.5; }
.obj-rich ul { padding-left: 14px; margin: 2px 0; }
.obj-rich li { margin: 1px 0; }

/* ===== SYLLABUS BLOCK (ref lines + notes combined display) ===== */
.topic-syllabus-block { margin-bottom: 8px; }
.topic-refs-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.syllabus-ref-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline; column-gap: 7px; row-gap: 1px;
  font-size: 0.78rem; line-height: 1.5;
  padding: 4px 0 6px;
}
.srl-code {
  font-size: 0.68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 100px;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
  letter-spacing: 0.02em; cursor: pointer; transition: background 0.15s;
  white-space: nowrap; justify-self: start; align-self: center;
}
.srl-code:hover { background: #bae6fd; }
.srl-topic {
  font-size: 0.68rem; color: var(--ink-3);
  padding: 1px 6px; border-radius: 4px; background: var(--paper-2);
  white-space: nowrap; justify-self: start; align-self: center;
}
.srl-title {
  color: var(--ink-2); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srl-desc {
  grid-column: 3 / -1;
  color: var(--ink-3); font-size: 0.73rem; line-height: 1.55;
  white-space: normal; padding-top: 1px;
}

/* ===== SYLLABUS DETAIL MODAL ===== */
.syl-detail-header {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px;
}
.syl-detail-code {
  font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 100px;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; flex-shrink: 0;
}
.syl-detail-meta { flex: 1; min-width: 0; }
.syl-detail-title { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.syl-detail-topic { font-size: 0.8rem; color: var(--ink-3); }
.syl-detail-tier {
  font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--border);
  flex-shrink: 0; white-space: nowrap;
}
.syl-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 0;
}
.syl-col { padding: 0 20px 0 0; }
.syl-col + .syl-col {
  padding: 0 0 0 20px;
  border-left: 1px solid var(--border);
}
.syl-section-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--paper-2);
}
.syl-content-list {
  padding-left: 18px; margin: 0; color: var(--ink-2); font-size: 0.875rem; line-height: 1.75;
}
.syl-content-list li { margin: 1px 0; }
.syl-notes-list {
  padding-left: 18px; margin: 0; color: var(--ink-3); font-size: 0.82rem; line-height: 1.7;
}
.syl-notes-list li { margin: 1px 0; }
.syl-no-detail { font-size: 0.875rem; color: var(--ink-3); }
.syl-description {
  font-size: 0.875rem; color: var(--ink-2); line-height: 1.6;
  background: var(--paper); border-radius: 8px; padding: 10px 14px;
  margin-bottom: 18px; border-left: 3px solid var(--accent);
}

/* ===== SYLLABUS EDITOR ===== */
.syl-ed-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; cursor: pointer; transition: background 0.12s;
  border-bottom: 1px solid var(--paper-2); font-size: 0.82rem;
}
.syl-ed-item:hover { background: var(--paper); }
.syl-ed-item.active { background: var(--accent-2); }
.syl-ed-code {
  font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 100px;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
  flex-shrink: 0; white-space: nowrap;
}
.syl-tier-badge {
  font-size: 0.62rem; font-weight: 700; padding: 1px 5px; border-radius: 100px;
  flex-shrink: 0; white-space: nowrap; letter-spacing: 0.02em;
}
.syl-tier-badge.core       { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.syl-tier-badge.supplement { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }
.syl-tier-badge.extended   { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }
.syl-ed-title { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.syl-ed-field-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px; margin-top: 16px; display: block;
}
.syl-ed-field-label:first-child { margin-top: 0; }
.syl-ed-textarea {
  width: 100%; font-family: 'DM Sans', sans-serif; font-size: 0.875rem;
  color: var(--ink); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; resize: vertical; outline: none; background: var(--white);
  transition: border-color 0.15s; min-height: 100px; line-height: 1.6;
}
.syl-ed-textarea:focus { border-color: var(--accent); }
.syl-ed-hint { font-size: 0.72rem; color: var(--ink-3); margin-top: 4px; }
.syl-ed-entry-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.topic-notes {
  font-size: 0.78rem; color: var(--ink-3); line-height: 1.5;
  padding: 5px 0 0 2px;
  border-top: 1px solid var(--paper-2); margin-top: 5px;
}
.topic-notes ul { padding-left: 14px; margin: 2px 0; }
.topic-notes li { margin: 1px 0; }
.ch-footer {
  padding: 11px 16px; border-top: 1px solid var(--paper-2);
  display: flex; justify-content: flex-end; background: var(--paper);
}
.no-topics { padding: 20px 16px; text-align: center; color: var(--ink-3); font-size: 0.82rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--paper-2);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.empty-state h3 { font-size: 0.95rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.empty-state p { font-size: 0.82rem; color: var(--ink-3); margin-bottom: 20px; }

/* ===== LOADING ===== */
.loading-state { text-align: center; padding: 56px; color: var(--ink-3); font-size: 0.875rem; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(28,28,46,0.55);
  backdrop-filter: blur(4px); z-index: 9000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 14px; width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head h3 { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--paper); flex-shrink: 0; border-radius: 0 0 14px 14px;
}

/* ===== TEACHING SCHEDULE — TWO-COLUMN LAYOUT ===== */
.ts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: 100%;
  min-height: 0;
}
.ts-table-col {
  overflow-y: auto;
  min-height: 0;
  border-right: 1px solid var(--border);
}
.ts-sim-col {
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ts-sim-heading {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-3);
}
.ts-sim-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.ts-sim-field { margin-bottom: 12px; }
.ts-sim-field:last-child { margin-bottom: 0; }
.ts-sim-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--ink-2); margin-bottom: 5px;
}
.ts-sim-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 0.875rem; color: var(--ink);
  background: var(--white); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ts-sim-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}
.ts-stat-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.8rem; padding: 4px 0;
  border-bottom: 1px solid var(--paper);
}
.ts-stat-row:last-child { border-bottom: none; }
.ts-stat-label { color: var(--ink-3); }
.ts-stat-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ts-progress-bar-bg {
  height: 10px; background: var(--paper); border-radius: 100px;
  overflow: hidden; margin: 10px 0 4px;
}
.ts-progress-bar-fill {
  height: 100%; border-radius: 100px;
  background: var(--accent);
  transition: width 0.3s ease, background 0.3s ease;
}
.ts-progress-pct {
  font-size: 0.72rem; font-weight: 700; color: var(--ink-2); text-align: right;
}
.ts-gap-badge {
  display: inline-flex; align-items: center;
  font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 100px; margin-top: 8px;
  width: 100%; justify-content: center;
}
.ts-gap-badge.surplus  { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.ts-gap-badge.deficit  { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.ts-gap-badge.exact    { background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; }
@media (max-width: 760px) {
  .ts-layout { grid-template-columns: 1fr; }
  .ts-table-col { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; color: var(--ink);
  background: var(--white); outline: none; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 72px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-hint { font-size: 0.75rem; color: var(--ink-3); margin-top: 4px; }
.field-error { font-size: 0.75rem; color: #dc2626; margin-top: 4px; display: none; }
.form-input.invalid, .form-select.invalid { border-color: #dc2626; }

/* ===== SYLLABUS TAG PICKER ===== */
.syllabus-picker { position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--white); transition: border-color 0.15s; }
.syllabus-picker:focus-within { border-color: var(--accent); }
.syllabus-chips, .syllabus-chips-wrap {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 12px 5px;
  min-height: 40px; margin-bottom: 0;
}
.syllabus-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; padding: 2px 4px 2px 8px;
  border-radius: 100px; background: #e0f2fe; color: #0369a1;
  border: 1px solid #bae6fd; white-space: nowrap; cursor: default;
}
.syllabus-chip .chip-remove {
  border: none; background: none; cursor: pointer; color: #0369a1;
  padding: 0 2px; font-size: 0.8rem; line-height: 1; border-radius: 50%;
  display: inline-flex; align-items: center;
}
.syllabus-chip .chip-remove:hover { color: #dc2626; background: #fef2f2; }
.syllabus-chip-display {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 100px; background: #e0f2fe; color: #0369a1;
  border: 1px solid #bae6fd; white-space: nowrap; cursor: default;
  position: relative;
}
.syllabus-chip-display[title]:hover::after {
  content: attr(title);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 400;
  padding: 5px 8px; border-radius: 6px; white-space: pre-wrap; width: max-content; max-width: 260px;
  pointer-events: none; z-index: 9999; line-height: 1.4;
}
.syllabus-search-row {
  display: flex; align-items: center; padding: 5px 9px 9px; gap: 6px;
}
.syllabus-search-input {
  flex: 1; font-family: 'DM Sans', sans-serif; font-size: 0.8rem;
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 9px;
  outline: none; transition: border-color 0.15s; color: var(--ink);
}
.syllabus-search-input:focus { border-color: var(--accent); }
.syllabus-dropdown {
  max-height: 200px; overflow-y: auto; border-top: 1px solid var(--border);
  display: none;
}
.syllabus-dropdown.open { display: block; }
.syllabus-option {
  padding: 7px 12px; cursor: pointer; font-size: 0.8rem;
  display: flex; gap: 8px; align-items: baseline;
  border-bottom: 1px solid var(--paper-2); transition: background 0.1s;
}
.syllabus-option:hover { background: var(--paper); }
.syllabus-option .opt-code { font-weight: 700; color: var(--accent-dk); flex-shrink: 0; }
.syllabus-option .opt-title { color: var(--ink-2); }
.syllabus-option .opt-topic { font-size: 0.7rem; color: var(--ink-3); }
.syllabus-no-results { padding: 10px 12px; font-size: 0.8rem; color: var(--ink-3); text-align: center; }
.syllabus-hint { font-size: 0.72rem; color: var(--ink-3); margin-top: 5px; }

/* ===== RICH TEXT EDITOR ===== */
.rte-wrap { border: 1px solid var(--border); border-radius: 8px; background: var(--white); transition: border-color 0.15s; }
.rte-wrap:focus-within { border-color: var(--accent); }
.rte-toolbar {
  display: flex; gap: 2px; padding: 5px 8px; border-bottom: 1px solid var(--border);
  background: var(--paper); border-radius: 8px 8px 0 0;
}
.rte-btn {
  border: none; background: none; cursor: pointer; color: var(--ink-2);
  padding: 3px 7px; border-radius: 4px; font-size: 0.8rem; font-weight: 600;
  line-height: 1.4; transition: background 0.1s, color 0.1s;
}
.rte-btn:hover { background: var(--paper-2); color: var(--ink); }
.rte-btn.active { background: var(--accent-2); color: var(--accent-dk); }
.rte-sep { width: 1px; background: var(--border); margin: 3px 4px; align-self: stretch; }
.rte-editor {
  padding: 9px 12px; min-height: 140px; max-height: 280px; overflow-y: auto;
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; color: var(--ink);
  outline: none; line-height: 1.55;
}
.rte-editor:empty:before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; }
.rte-editor ul { padding-left: 18px; margin: 2px 0; }
.rte-editor li { margin: 1px 0; }

/* ===== RESOURCES ===== */
.res-section-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.res-section-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.resource-row { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
.resource-row .form-input { flex: 1; min-width: 0; }
.resource-row .url-input { flex: 2; min-width: 0; }
.res-del-btn {
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  padding: 5px 6px; border-radius: 4px; font-size: 1rem; line-height: 1; flex-shrink: 0;
}
.res-del-btn:hover { color: #dc2626; background: #fef2f2; }
.no-resources { font-size: 0.8rem; color: var(--ink-3); padding: 10px 0; text-align: center; }
.res-col-heads {
  display: flex; gap: 6px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; padding-right: 28px;
}
.res-col-heads span:first-child { flex: 1; }
.res-col-heads span:last-child { flex: 2; }

/* ===== ASSESSMENT ===== */
.ch-assessment {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--paper-2);
  background: var(--paper);
  flex-wrap: wrap;
}
.ch-assessment-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); flex-shrink: 0;
}
.asmnt-badge {
  font-size: 0.68rem; font-weight: 600; padding: 2px 8px;
  border-radius: 100px; flex-shrink: 0;
}
.asmnt-badge.igcsetools { background: #f2ecfb; color: #6c3fa0; border: 1px solid #d5c3f0; }
.asmnt-badge.external   { background: #e8f0fb; color: #1a5fa8; border: 1px solid #c2d8f5; }
.asmnt-badge.pdf        { background: #fff1f0; color: #dc2626; border: 1px solid #fecaca; }
.asmnt-title { font-size: 0.82rem; font-weight: 500; color: var(--ink); flex: 1; min-width: 0; }
.asmnt-duration { font-size: 0.72rem; color: var(--ink-3); flex-shrink: 0; }
.asmnt-open-link {
  font-size: 0.72rem; color: var(--blue); text-decoration: none;
  flex-shrink: 0;
}
.asmnt-open-link:hover { text-decoration: underline; }
.activity-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 500; padding: 2px 8px;
  border-radius: 100px; text-decoration: none;
  border: 1px solid; flex-shrink: 0;
}
.activity-chip.igcsetools { background: #f2ecfb; color: #6c3fa0; border-color: #d5c3f0; }
.activity-chip.external   { background: #e8f0fb; color: #1a5fa8; border-color: #c2d8f5; }
.activity-chip.pdf        { background: #fff1f0; color: #dc2626; border-color: #fecaca; }
.activity-chip:hover { opacity: 0.8; }
.upload-progress { font-size: 0.75rem; color: var(--ink-3); margin-top: 4px; display: none; }
.upload-progress.visible { display: block; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px; font-size: 0.875rem;
  padding: 12px 20px; border-radius: 10px; z-index: 9999;
  opacity: 0; transform: translateY(8px); transition: all 0.28s;
  pointer-events: none; max-width: 320px; background: var(--ink); color: #fff;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #dc2626; }

/* ===== CHAPTER PAGER ===== */
.chapter-pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; margin-top: 4px; font-size: 0.82rem; color: var(--ink-3);
}
.chapter-pager-info { font-size: 0.82rem; color: var(--ink-3); }
.chapter-pager-btns { display: flex; gap: 5px; }
.pg-btn {
  padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--white); color: var(--ink-2); font-size: 0.8rem; font-weight: 600;
  font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.15s;
}
.pg-btn:hover { background: var(--paper-2); color: var(--ink); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ===== BUFFER ROW ===== */
.buffer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-top: 1px dashed #fcd34d;
  background: #fffbeb;
}
.buffer-icon  { font-size: 1rem; flex-shrink: 0; }
.buffer-label { font-size: 0.82rem; font-weight: 600; color: #92400e; flex: 1; }
.buffer-hours { font-size: 0.75rem; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; padding: 2px 8px; }
.buffer-del   { margin-left: auto; }
.ch-footer-form { display: none; align-items: center; gap: 8px; flex: 1; }
.ch-footer-form.open { display: flex; }
.ch-footer-form input[type="text"] {
  flex: 1; min-width: 0; padding: 5px 9px; font-size: 0.82rem;
  border: 1px solid var(--border); border-radius: 6px; outline: none;
  font-family: inherit;
}
.ch-footer-form input[type="text"]:focus { border-color: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.ch-footer-form input[type="number"] {
  width: 70px; padding: 5px 7px; font-size: 0.82rem;
  border: 1px solid var(--border); border-radius: 6px; outline: none;
  font-family: inherit; text-align: center;
}
.ch-footer-form input[type="number"]:focus { border-color: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.ch-footer-form label { font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; }

/* ===== YEAR FILTER ===== */
.year-filter-group {
  display: flex; gap: 4px; background: var(--paper-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px;
}
.btn-year-filter {
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600;
  padding: 5px 14px; border-radius: 6px; border: none; cursor: pointer;
  transition: all 0.15s; color: var(--ink-3); background: transparent;
}
.btn-year-filter:hover { color: var(--ink); background: var(--white); }
.btn-year-filter.active-all { background: var(--white); color: var(--ink); }
/* Year-specific accent colours (one per Cambridge year band) */
.btn-year-filter.active-y4  { background: #dbeafe; color: #1d4ed8; }
.btn-year-filter.active-y5  { background: #fce7f3; color: #be185d; }
.btn-year-filter.active-y6  { background: #fef9c3; color: #854d0e; }
.btn-year-filter.active-y7  { background: #dbeafe; color: #1d4ed8; }
.btn-year-filter.active-y8  { background: #fce7f3; color: #be185d; }
.btn-year-filter.active-y9  { background: #dbeafe; color: #1d4ed8; }
.btn-year-filter.active-y10 { background: #fce7f3; color: #be185d; }
.btn-year-filter.active-y11 { background: #dbeafe; color: #1d4ed8; }
.btn-year-filter.active-y12 { background: #fce7f3; color: #be185d; }

/* ===== AO BADGES (IGCSE only) ===== */
.ao-badges-wrap { display: inline-flex; gap: 4px; align-items: center; }
.ao-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 100px;
  white-space: nowrap; letter-spacing: 0.02em;
}
.ao-badge.ao1  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ao-badge.ao2  { background: #fdf4ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.ao-badge.ao12 { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ===== PAPER BADGES (IGCSE only) ===== */
.paper-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 100px;
  white-space: nowrap; letter-spacing: 0.01em;
}
.paper-badge.core     { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.paper-badge.extended { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }
.paper-badge.both     { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--border); }

/* ===== COMMAND WORD CHIPS ===== */
.cmd-words-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.cmd-words-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.cmd-word-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cmd-chip {
  font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 100px;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--border);
  cursor: default; transition: background 0.15s;
}
.cmd-chip.detected {
  background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe;
}

/* ===== GLH BANNER ===== */
.glh-banner {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.glh-banner-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.glh-banner-title { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.glh-banner-nums { font-size: 0.78rem; color: var(--ink-3); }
.glh-track {
  height: 7px; border-radius: 100px; background: var(--paper-2);
  position: relative; margin-bottom: 10px; overflow: hidden;
}
.glh-fill {
  height: 100%; border-radius: 100px; position: absolute; top: 0; left: 0;
  transition: width 0.4s;
}
.glh-fill-planned   { background: var(--accent); opacity: 0.9; }
.glh-fill-projected { background: #f59e0b; opacity: 0.6; }
.glh-stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.glh-stat { text-align: center; flex: 1; min-width: 70px; }
.glh-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.glh-stat-label { font-size: 0.68rem; color: var(--ink-3); margin-top: 2px; }
.glh-stat.over .glh-stat-num  { color: #dc2626; }
.glh-stat.ok .glh-stat-num    { color: var(--accent); }
.glh-stat.warn .glh-stat-num  { color: #d97706; }

/* ===== GLH BREAKDOWN CHART ===== */
.glh-chart-wrap {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.glh-chart-toggle {
  padding: 10px 18px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; user-select: none; background: var(--paper); transition: background 0.15s;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid transparent;
}
.glh-chart-toggle:hover { background: var(--paper-2); }
.glh-chart-toggle.open { border-bottom-color: var(--border); }
.glh-chart-body { padding: 16px 20px; }
.glh-bar-row {
  display: grid; grid-template-columns: 180px 1fr 44px;
  align-items: center; gap: 10px; margin-bottom: 7px; font-size: 0.75rem;
}
.glh-bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glh-bar-track { height: 9px; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.glh-bar-fill { height: 100%; border-radius: 100px; background: var(--accent); transition: width 0.4s; min-width: 2px; }
.glh-bar-val { font-size: 0.7rem; font-family: 'DM Mono', monospace; color: var(--ink-3); text-align: right; }

/* ===== TIER FILTER (IGCSE only) ===== */
.tier-filter { display: flex; gap: 5px; margin-left: 12px; }
.tier-btn {
  padding: 4px 13px; border: 1.5px solid transparent; border-radius: 100px;
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; background: var(--paper-2); color: var(--ink-3);
  transition: all 0.15s; white-space: nowrap;
}
.tier-btn:hover { color: var(--ink); border-color: var(--border); }
.tier-btn[data-tier="all"].active      { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.tier-btn[data-tier="core"].active     { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.tier-btn[data-tier="extended"].active { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

/* ===== SETTINGS PANEL ===== */
.settings-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.settings-card-head { margin-bottom: 14px; }
.settings-card-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.settings-card-desc { font-size: 0.8rem; color: var(--ink-3); line-height: 1.55; }
.settings-subj-tabs {
  display: flex; gap: 3px; margin-bottom: 14px;
  background: var(--paper); border-radius: 7px; padding: 3px;
}
.s-stab {
  flex: 1; padding: 5px 10px; border: none; border-radius: 5px;
  background: transparent; font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; font-weight: 500; color: var(--ink-3); cursor: pointer;
  transition: all 0.15s;
}
.s-stab:hover { color: var(--ink); }
.s-stab.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.class-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  background: var(--paper-2); border: 1px solid var(--border);
  color: var(--ink-2); margin: 3px 3px 3px 0;
}
.class-tag-del {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 0.85rem; line-height: 1;
  padding: 0; margin-left: 2px; transition: color 0.12s;
}
.class-tag-del:hover { color: #dc2626; }
.class-tags-wrap { display: flex; flex-wrap: wrap; margin-bottom: 4px; }
.no-classes-hint { font-size: 0.78rem; color: var(--ink-3); padding: 6px 0; }

/* ===== ICON-ONLY ACTION BUTTONS ===== */
/* Compact icon-only variants for the topbar actions so they don't wrap on
   smaller widths. Native title attribute provides hover tooltips. */
.btn-icon-only {
  padding: 6px 8px;
  min-width: 32px;
  justify-content: center;
}
.btn-icon-only .btn-label { display: none; }
.btn-icon-only > svg { margin: 0; }

/* Spinning loader inside an icon-only button (used while Push to Pacing runs). */
@keyframes syl-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.btn-icon-only.btn-loading > svg { animation: syl-spin 0.9s linear infinite; }
.btn-icon-only.btn-loading { opacity: 0.65; cursor: wait; }

/* ===== PUSH PROGRESS / RESULT TOAST ===== */
/* Fixed-position card at top center; appears while a long write is in flight
   and as a success/error confirmation when it finishes. Non-blocking. */
.push-toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  min-width: 320px;
  max-width: 520px;
  padding: 14px 18px;
  background: var(--paper, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.push-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.push-toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
}
.push-toast-icon.spin {
  background: #2563eb;
}
.push-toast-icon.spin > svg { animation: syl-spin 0.9s linear infinite; }
.push-toast-icon.ok    { background: #059669; }
.push-toast-icon.error { background: #dc2626; }
.push-toast-body { flex: 1; min-width: 0; color: var(--ink, #1e293b); }
.push-toast-title { font-weight: 600; margin-bottom: 2px; }
.push-toast-msg   { color: var(--ink-2, #475569); font-size: 0.8rem; }
.push-toast-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--ink-3, #94a3b8);
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
  flex-shrink: 0;
}
.push-toast-close:hover { color: var(--ink, #1e293b); }

/* ===== PUSH STALE BANNER ===== */
.push-stale-banner {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-confirm-armed {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #78350f !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 32px 24px; }
  .hero-title { font-size: 1.5rem; }
  .page-wrap { padding: 24px 20px 48px; }
  .subject-tabs { flex-wrap: wrap; }
  .subj-tab { flex: 0 0 calc(50% - 4px); }
  .action-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topic-row { grid-template-columns: 24px 1fr auto; gap: 0 8px; }
  #settingsPanel > div { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  .syl-cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ch-header { flex-wrap: wrap; }
  .ch-meta { display: none; }
}
