/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
  --navy:        #0d1b2a;
  --navy-mid:    #1a2e45;
  --navy-light:  #243d5c;
  --navy-border: rgba(255,255,255,0.08);
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --cream:       #f5f0e8;
  --white:       #ffffff;
  --muted:       rgba(245, 240, 232, 0.5);

  /* Category colours — green / blue / yellow */
  --cat-mp:       #27ae60;
  --cat-mooting:  #2980b9;
  --cat-essay:    #c9a800;

  /* Urgency (card view) */
  --urgent-red:       #e74c3c;
  --urgent-amber:     #e67e22;
  --urgent-green:     #27ae60;
  --urgent-red-bg:    rgba(231, 76, 60,  0.10);
  --urgent-amber-bg:  rgba(230, 126, 34, 0.10);
  --urgent-green-bg:  rgba(39,  174, 96, 0.10);
  --expired-bg:       rgba(245, 240, 232, 0.04);

  --font-serif: 'EB Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --radius-card: 8px;
  --radius-sm:   4px;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ── Light theme overrides ───────────────────────────────────────────── */
[data-theme="light"] {
  --navy:        #f7f3eb;
  --navy-mid:    #fdfaf4;
  --navy-light:  #ffffff;
  --navy-border: rgba(30, 18, 8, 0.09);
  --gold:        #9e7010;
  --gold-light:  #b8920c;
  --cream:       #1e1208;
  --white:       #1e1208;
  --muted:       rgba(30, 18, 8, 0.52);
  --urgent-red-bg:   rgba(231, 76, 60, 0.08);
  --urgent-amber-bg: rgba(230, 126, 34, 0.08);
  --urgent-green-bg: rgba(39, 174, 96, 0.08);
  --expired-bg:      rgba(30, 18, 8, 0.04);
  --shadow-card: 0 2px 10px rgba(30, 18, 8, 0.1);
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; }

/* ── Base ────────────────────────────────────────────────────────────── */
body {
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Sticky header + filter bar ────────────────────────────────────────── */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Header ─────────────────────────────────────────────────────────── */
header {
  background: var(--navy-mid);
  border-bottom: 2px solid var(--gold);
  padding: 1.5rem 1rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.crest { width: 48px; height: 48px; flex-shrink: 0; color: var(--gold); }

.header-text h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1.2;
}

.tagline { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; letter-spacing: 0.03em; }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.tab {
  background: rgba(201, 168, 76, 0.06);
  border: 1.5px solid rgba(201, 168, 76, 0.45);
  color: var(--cream);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

.tab:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
}

.tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
}

.bar-right { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; flex-wrap: wrap; }

/* ── View toggle ─────────────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-btn:last-child { border-right: none; }
.view-btn svg { width: 14px; height: 14px; fill: currentColor; }
.view-btn:hover { background: rgba(201, 168, 76, 0.12); color: var(--cream); }
.view-btn.active { background: rgba(201, 168, 76, 0.2); color: var(--gold); font-weight: 600; }


/* ── Sort control ─────────────────────────────────────────────────────────── */
#sort-select {
  background: var(--navy-light);
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--cream);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
}

#sort-select:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Main ─────────────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 1.5rem 1rem 5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── Card grid ─────────────────────────────────────────────────────────── */
.deadline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty-state svg { width: 56px; height: 56px; opacity: 0.5; }

/* ── Deadline card ─────────────────────────────────────────────────────────── */
.deadline-card {
  background: var(--navy-light);
  border-radius: var(--radius-card);
  border-left: 4px solid var(--urgent-green);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  scroll-margin-top: 5rem;
}

.deadline-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.45); }

.deadline-card.urgent-red   { border-left-color: var(--urgent-red); }
.deadline-card.urgent-amber { border-left-color: var(--urgent-amber); }
.deadline-card.urgent-green { border-left-color: var(--urgent-green); }
.deadline-card.expired      { border-left-color: rgba(245,240,232,0.2); opacity: 0.5; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.85rem; gap: 0.5rem;
}

.urgent-red   .card-header { background: var(--urgent-red-bg); }
.urgent-amber .card-header { background: var(--urgent-amber-bg); }
.urgent-green .card-header { background: var(--urgent-green-bg); }
.expired      .card-header { background: var(--expired-bg); }

.category-badge {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 0.2rem 0.55rem;
  border-radius: 20px; white-space: nowrap;
}

.badge-mini-pupillage { background: var(--cat-mp);      color: #fff; }
.badge-essay          { background: var(--cat-essay);   color: #1a0f00; }
.badge-mooting        { background: var(--cat-mooting); color: #fff; }

.urgency-chip {
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  padding: 0.18rem 0.5rem; border-radius: 20px;
}

.urgent-red   .urgency-chip { color: var(--urgent-red);   background: var(--urgent-red-bg); }
.urgent-amber .urgency-chip { color: var(--urgent-amber); background: var(--urgent-amber-bg); }
.urgent-green .urgency-chip { color: var(--urgent-green); background: var(--urgent-green-bg); }
.expired      .urgency-chip { color: var(--muted); background: rgba(255,255,255,0.05); }

.card-body {
  padding: 0.85rem; flex: 1;
  display: flex; flex-direction: column; gap: 0.45rem;
}

.org-name {
  font-family: var(--font-serif); font-size: 1.1rem;
  font-weight: 600; color: var(--gold-light); line-height: 1.3;
}

.description { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

.deadline-date {
  font-size: 0.8rem; color: var(--cream); font-weight: 500;
  margin-top: auto; padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 0.4rem;
}

.deadline-date::before {
  content: ''; display: inline-block; width: 10px; height: 10px;
  border: 1.5px solid currentColor; border-radius: 2px; opacity: 0.6;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.85rem; gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-apply {
  font-size: 0.8rem; font-weight: 600; background: var(--gold);
  color: var(--navy); padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm); text-decoration: none; transition: background 0.15s;
}

.btn-apply:hover { background: var(--gold-light); }
.btn-apply.no-link {
  background: rgba(201,168,76,0.12); color: var(--muted);
  cursor: default; pointer-events: none;
}

.btn-delete {
  background: transparent; border: 1px solid rgba(231,76,60,0.4);
  color: rgba(231,76,60,0.7); width: 28px; height: 28px; border-radius: 50%;
  font-size: 1rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-delete:hover { background: rgba(231,76,60,0.15); color: var(--urgent-red); border-color: var(--urgent-red); }

/* ── FAB ──────────────────────────────────────────────────────────────── */
.fab-add {
  position: fixed; bottom: 1.75rem; right: 1.75rem;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: var(--navy); border: none;
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s; z-index: 150;
}

.fab-add:hover { background: var(--gold-light); transform: scale(1.06); }

/* ── Add-deadline panel ─────────────────────────────────────────────────────────── */
.panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}

.panel-overlay.visible { opacity: 1; pointer-events: auto; }

#add-panel {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(440px, 100%); background: var(--navy-mid);
  border-left: 1px solid rgba(201,168,76,0.3); z-index: 200;
  transform: translateX(100%); transition: transform 0.28s ease; overflow-y: auto;
}

#add-panel.open { transform: translateX(0); }

.panel-inner { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; min-height: 100%; }
.panel-inner h2 { font-family: var(--font-serif); font-size: 1.4rem; color: var(--gold-light); }

/* ── Form ─────────────────────────────────────────────────────────── */
#add-deadline-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--cream); }
.optional { font-weight: 400; color: var(--muted); }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--navy-light); border: 1px solid rgba(201,168,76,0.3);
  color: var(--cream); padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.9rem; width: 100%; transition: border-color 0.15s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(245,240,232,0.35); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--gold); }

.form-group input.invalid,
.form-group select.invalid { border-color: var(--urgent-red); }

.field-error { font-size: 0.75rem; color: var(--urgent-red); min-height: 1em; }

.form-actions { display: flex; gap: 0.75rem; padding-top: 0.5rem; }

.btn-primary {
  flex: 1; background: var(--gold); color: var(--navy); border: none;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}

.btn-primary:hover { background: var(--gold-light); }

.btn-secondary {
  background: transparent; border: 1px solid rgba(201,168,76,0.4);
  color: var(--cream); padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.9rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover { background: rgba(201,168,76,0.1); border-color: var(--gold); }

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
  background: var(--navy-mid);
  border-top: 1px solid rgba(201,168,76,0.2);
  padding: 1.25rem 1rem; text-align: center;
  font-size: 0.75rem; color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-credit {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.footer-name {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.footer-name:hover { border-bottom-color: var(--gold); }

.coffee-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(201, 168, 76, 0.15);
  margin-top: 0.35rem;
}

.coffee-note {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.55;
}

.btn-coffee {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--gold);
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-coffee:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--gold);
}

/* ── Focus ─────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   CALENDAR VIEW
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.25rem 0 1rem;
}

.cal-nav h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold-light);
  min-width: 220px;
  text-align: center;
}

#cal-prev, #cal-next {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

#cal-prev:hover, #cal-next:hover {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
}

/* Legend */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.legend-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Scroll wrapper — grid always fits the viewport width, no side-scrolling needed */
.cal-scroll-wrapper {
  border-radius: var(--radius-card);
}

/* Grid — minmax(0,1fr) keeps all 7 columns equal width and prevents overflow;
   border on each cell = reliable grid lines at all pixel densities */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.cal-day-header {
  background: var(--navy-mid);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-right: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
}

/* Fixed-size square cells: every day box is identical, regardless of how many
   deadlines it holds. If events overflow, the cell scrolls internally rather
   than growing — keeps the whole grid uniform and on-screen. */
.cal-cell {
  background: var(--navy-light);
  padding: 0.2rem 0.25rem 0.25rem;
  aspect-ratio: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-right: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
}

.cal-cell-empty {
  background: rgba(13, 27, 42, 0.6);
  aspect-ratio: 1;
  border-right: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
}

.cal-past-day { background: rgba(13, 27, 42, 0.5); }

.cal-today { background: rgba(201, 168, 76, 0.07); }

.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-bottom: 0.25rem;
  border-radius: 50%;
  line-height: 1;
}

.cal-today .cal-day-num {
  background: var(--gold);
  color: var(--navy);
}

.cal-past-day .cal-day-num { opacity: 0.4; }

/* Event pills */
.cal-event {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.16rem 0.32rem;
  border-radius: 3px;
  margin-bottom: 0.18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event.has-link { cursor: pointer; }
.cal-event.has-link:hover { filter: brightness(1.15); }

/* ── Category × urgency shade matrix ────────────────────────────────────────────────────────── */

.shade-past { background: #252525; color: #5a5a5a; }

/* Mini Pupillage — GREEN  (far = darkest/dimmest → urgent = brightest) */
.cat-mini-pupillage.shade-far    { background: #12301e; color: #468a5c; }
.cat-mini-pupillage.shade-medium { background: #1a4a2c; color: #60ab74; }
.cat-mini-pupillage.shade-soon   { background: #1e6635; color: #8dd4a0; }
.cat-mini-pupillage.shade-urgent { background: #27ae60; color: #ffffff; }

/* Mooting — BLUE */
.cat-mooting.shade-far    { background: #0e1e32; color: #3d70a8; }
.cat-mooting.shade-medium { background: #142c52; color: #5a90cc; }
.cat-mooting.shade-soon   { background: #173e72; color: #80b4ee; }
.cat-mooting.shade-urgent { background: #2980b9; color: #ffffff; }

/* Essay — YELLOW */
.cat-essay.shade-far    { background: #281c00; color: #806000; }
.cat-essay.shade-medium { background: #3e2c00; color: #a88000; }
.cat-essay.shade-soon   { background: #5c4000; color: #d0a400; }
.cat-essay.shade-urgent { background: #c9a800; color: #1a0f00; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  header { padding: 0.6rem 1rem; }
  .crest { width: 34px; height: 34px; }
  .header-text h1 { font-size: 1.15rem; }
  .tagline { font-size: 0.68rem; }
  .filter-bar { padding: 0.5rem 0.75rem; }
  .tab { font-size: 0.73rem; padding: 0.28rem 0.6rem; }
  .bar-right { width: 100%; justify-content: space-between; }
  main { padding: 1rem 0.5rem 5rem; }
  .deadline-grid { grid-template-columns: 1fr; }
  #add-panel { width: 100%; border-left: none; }
  .cal-day-header { font-size: 0.6rem; padding: 0.3rem 0; }
  .cal-cell { padding: 0.15rem; }
  .cal-day-num { font-size: 0.62rem; width: 16px; height: 16px; margin-bottom: 0.1rem; }
  .cal-event { font-size: 0.52rem; padding: 0.06rem 0.16rem; margin-bottom: 0.1rem; }
  .cal-nav h2 { font-size: 1.1rem; min-width: 150px; }
  .deadline-card { scroll-margin-top: 9.5rem; }
}

@media (max-width: 430px) {
  .crest { width: 30px; height: 30px; }
  .header-text h1 { font-size: 1.05rem; }
  .tagline { display: none; }
  .cal-day-num { font-size: 0.58rem; width: 14px; height: 14px; }
  .cal-event { font-size: 0.48rem; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   SITE NAVIGATION
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.site-nav {
  background: var(--navy);
  border-bottom: 1px solid rgba(201, 168, 76, 0.12);
  padding: 0 1rem;
  position: relative;
  z-index: 200;
}

.site-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0 0.4rem;
}

.site-nav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav-brand:hover { color: var(--cream); }

.crest-sm {
  width: 34px;
  height: 34px;
  color: var(--gold);
  flex-shrink: 0;
}

.site-nav-links {
  display: flex;
  list-style: none;
  gap: 0;
  flex-wrap: wrap;
  margin-left: -0.5rem;
}

.site-nav-links a {
  display: block;
  padding: 0.3rem 0.6rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-nav-links a:hover { color: var(--cream); background: rgba(201, 168, 76, 0.07); }
.site-nav-links a[aria-current="page"] { color: var(--gold); font-weight: 600; }

/* Controls row — theme toggle + mobile hamburger */
.site-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-toggle-fab {
  position: fixed;
  top: 0.7rem;
  right: 1rem;
  z-index: 9999;
  background: var(--navy-mid);
  border: 1.5px solid rgba(201, 168, 76, 0.5);
  color: var(--gold);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle-fab:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
  background: rgba(201, 168, 76, 0.12);
}

[data-theme="light"] .theme-toggle-fab {
  box-shadow: 0 2px 8px rgba(30, 18, 8, 0.15);
}

.site-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--gold);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.site-nav-toggle:hover { background: rgba(201, 168, 76, 0.1); }

@media (max-width: 720px) {
  .site-nav-toggle { display: flex; }
  .theme-toggle-fab { right: 3.4rem; }

  .site-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-mid);
    border-bottom: 1px solid rgba(201, 168, 76, 0.18);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 0.75rem;
    gap: 0;
    z-index: 201;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-left: 0;
  }

  .site-nav-links.open { display: flex; }

  .site-nav-links a {
    padding: 0.55rem 0.6rem;
    font-size: 0.88rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT (non-tracker pages)
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.page-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1rem 5rem;
}

.page-main--narrow { max-width: 720px; }

.page-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1.15;
  margin-bottom: 0.65rem;
}

[data-theme="light"] .page-hero h1 { color: var(--gold); }

.page-lead {
  font-size: 0.98rem;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.65;
}

.loading-text {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   COMING SOON STATE
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.coming-soon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.5rem 2rem;
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-card);
  background: rgba(201, 168, 76, 0.03);
  max-width: 540px;
  margin: 0 auto;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 20px;
  padding: 0.3rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.coming-soon-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

[data-theme="light"] .coming-soon-title { color: var(--gold); }

.coming-soon-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 420px;
}

.notify-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
  flex-wrap: wrap;
  justify-content: center;
}

.notify-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  background: var(--navy-light);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--cream);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.notify-form input[type="email"]::placeholder { color: var(--muted); }
.notify-form input[type="email"]:focus { outline: none; border-color: var(--gold); }

.notify-form button {
  background: var(--gold);
  color: var(--navy-mid);
  border: none;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

[data-theme="light"] .notify-form button { color: #fdfaf4; }

.notify-form button:hover { filter: brightness(1.1); }

.notify-thanks {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   OPPORTUNITIES BOARD
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.opp-card {
  background: var(--navy-light);
  border-radius: var(--radius-card);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.opp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }

.opp-card-header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }

.opp-category {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
  border-radius: 20px;
  padding: 0.18rem 0.55rem;
}

.opp-deadline { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.opp-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--gold-light); line-height: 1.3; }
[data-theme="light"] .opp-title { color: var(--gold); }
.opp-org, .opp-elig, .opp-notes { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.opp-footer { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--navy-border); }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   GUIDES / APPLICATION TACTICS
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.guide-list { display: flex; flex-direction: column; gap: 1.25rem; }

.guide-card {
  padding: 1.25rem 1.5rem;
  background: var(--navy-light);
  border-radius: var(--radius-card);
  border-left: 3px solid rgba(201, 168, 76, 0.4);
  transition: border-color 0.15s;
}

.guide-card:hover { border-left-color: var(--gold); }

.guide-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.guide-date { font-size: 0.75rem; color: var(--muted); }

.guide-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.guide-title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; }
.guide-title a { color: var(--gold-light); text-decoration: none; transition: color 0.15s; }
[data-theme="light"] .guide-title a { color: var(--gold); }
.guide-title a:hover { color: var(--cream); }
.guide-summary { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   SKILLS QUIZ
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.quiz-intro {
  margin-bottom: 2rem;
  padding: 1.1rem 1.4rem;
  background: rgba(201, 168, 76, 0.04);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius-card);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

.quiz-question {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--navy-light);
  border-radius: var(--radius-card);
  border: 1px solid var(--navy-border);
  transition: border-color 0.15s;
}

.quiz-question-error {
  border-color: var(--urgent-red) !important;
  outline: 2px solid rgba(231, 76, 60, 0.2);
  outline-offset: 1px;
}

.quiz-question-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.quiz-question-text {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--cream);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.45rem; }

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quiz-option:hover { border-color: rgba(201, 168, 76, 0.45); background: rgba(201, 168, 76, 0.04); }

.quiz-option input[type="radio"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.18rem;
  cursor: pointer;
}

.quiz-option-text { font-size: 0.87rem; color: var(--cream); line-height: 1.5; cursor: pointer; }
.quiz-option:has(input:checked) { border-color: var(--gold); background: rgba(201, 168, 76, 0.08); }

.quiz-submit-wrap { text-align: center; padding: 1.25rem 0 0.5rem; }

.btn-quiz-submit {
  background: var(--gold);
  color: var(--navy-mid);
  border: none;
  padding: 0.8rem 2.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

[data-theme="light"] .btn-quiz-submit { color: #fdfaf4; }
.btn-quiz-submit:hover { filter: brightness(1.1); transform: translateY(-1px); }

.quiz-results { display: none; margin-top: 2.5rem; }
.quiz-results.visible { display: block; }

.quiz-results-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

[data-theme="light"] .quiz-results-title { color: var(--gold); }

.quiz-results-intro { font-size: 0.88rem; color: var(--muted); margin-bottom: 2rem; }

.quiz-chart { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 2.5rem; }

.quiz-chart-row {
  display: grid;
  grid-template-columns: 160px 1fr 3rem;
  align-items: center;
  gap: 0.75rem;
}

.quiz-chart-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-chart-bar-wrap {
  background: rgba(201, 168, 76, 0.1);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.quiz-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 4px;
  width: 0;
  transition: width 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quiz-chart-score { font-size: 0.78rem; font-weight: 700; color: var(--gold); text-align: right; }

.quiz-overall {
  padding: 1.2rem 1.4rem;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-card);
  margin-bottom: 2rem;
}

.quiz-overall-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

[data-theme="light"] .quiz-overall-title { color: var(--gold); }
.quiz-overall-body { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

.quiz-recs-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 1rem;
}

.quiz-recs { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 2rem; }

.quiz-rec-card {
  padding: 1.1rem 1.3rem;
  background: var(--navy-light);
  border-radius: var(--radius-card);
  border-left: 3px solid var(--gold);
}

.quiz-rec-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.quiz-rec-card-title {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.quiz-rec-level {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
}

.quiz-rec-level-low    { background: rgba(231, 76, 60, 0.15);  color: #e74c3c; }
.quiz-rec-level-medium { background: rgba(230, 126, 34, 0.15); color: #e67e22; }
.quiz-rec-level-high   { background: rgba(39, 174, 96, 0.15);  color: #27ae60; }

.quiz-rec-card-body { font-size: 0.87rem; color: var(--muted); line-height: 1.68; }

.quiz-retake-wrap { text-align: center; padding: 0.75rem 0 1rem; }

.btn-quiz-retake {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--gold);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-quiz-retake:hover { background: rgba(201, 168, 76, 0.08); border-color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   ABOUT PAGE
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.about-section { margin-bottom: 2.5rem; }

.about-section h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

[data-theme="light"] .about-section h2 { color: var(--gold); }

.about-section p { font-size: 0.91rem; color: var(--muted); line-height: 1.78; margin-bottom: 0.75rem; }
.about-section p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   SHARED FOOTER
   ══════════════════════════════════════════════════════════════════════════════════════════ */

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: rgba(245, 240, 232, 0.3);
  max-width: 540px;
  line-height: 1.5;
}

[data-theme="light"] .footer-disclaimer { color: rgba(30, 18, 8, 0.35); }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   CALENDAR LIGHT THEME ADJUSTMENTS
   ══════════════════════════════════════════════════════════════════════════════════════════ */

[data-theme="light"] .cal-cell { background: #fff; }
[data-theme="light"] .cal-cell-empty { background: rgba(247, 243, 235, 0.7); }
[data-theme="light"] .cal-past-day { background: rgba(247, 243, 235, 0.6); }
[data-theme="light"] .cal-today { background: rgba(158, 112, 16, 0.06); }
[data-theme="light"] .cal-grid { border-color: rgba(30, 18, 8, 0.1); }
[data-theme="light"] .cal-day-header { background: #fdfaf4; }

[data-theme="light"] .shade-past { background: #e8e4dc; color: #8a8270; }
[data-theme="light"] .cat-mini-pupillage.shade-far    { background: #d4eedd; color: #2e7d4f; }
[data-theme="light"] .cat-mini-pupillage.shade-medium { background: #b8e0c6; color: #1f6b3d; }
[data-theme="light"] .cat-mini-pupillage.shade-soon   { background: #82cda0; color: #0f4a26; }
[data-theme="light"] .cat-mooting.shade-far    { background: #cfddf0; color: #1b5899; }
[data-theme="light"] .cat-mooting.shade-medium { background: #aac6e8; color: #154888; }
[data-theme="light"] .cat-mooting.shade-soon   { background: #7aadd8; color: #0d3566; }
[data-theme="light"] .cat-essay.shade-far    { background: #f5e8bc; color: #7a5800; }
[data-theme="light"] .cat-essay.shade-medium { background: #f0d98a; color: #634600; }
[data-theme="light"] .cat-essay.shade-soon   { background: #e8c650; color: #4a3200; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADDITIONS
   ══════════════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 700px) {
  .page-main { padding: 1.75rem 0.75rem 4rem; }
  .page-hero { margin-bottom: 1.75rem; padding-bottom: 1.25rem; }

  .quiz-chart-row { grid-template-columns: 110px 1fr 2.5rem; gap: 0.5rem; }
  .quiz-chart-label { font-size: 0.72rem; }
  .quiz-question { padding: 1rem 0.95rem; }
  .quiz-rec-card { padding: 0.95rem 1.05rem; }

  .coming-soon-wrap { padding: 2.5rem 1.25rem; }
  .coming-soon-title { font-size: 1.35rem; }
}

@media (max-width: 430px) {
  .quiz-chart-row { grid-template-columns: 90px 1fr 2.25rem; }
  .quiz-chart-label { font-size: 0.65rem; }
}
