/* ==========================================================================
   Epilepsy rotation guide
   A 73 KB survival guide read on shift. Everything in it was equally weighted
   and a <select> was the only way to move: you cannot scan a dropdown. These
   styles add a sticky section bar, in-page search, and a checklist that
   remembers where you got to.
   ========================================================================== */

.rg-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0 0.55rem;
  margin: 0 0 1.1rem;
}

.rg-search-wrap { position: relative; display: flex; align-items: center; margin-bottom: 0.5rem; }

.rg-search-wrap i {
  position: absolute; left: 0.7rem;
  font-size: 0.78rem; color: var(--text-secondary); pointer-events: none;
}

.rg-search {
  min-height: var(--control-height);
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem 0.4rem 2rem;
  font-size: 0.83rem;
  background: var(--surface-1);
  color: var(--text-color);
}

.rg-search:focus { outline: 2px solid #0b6ab8; outline-offset: 1px; }

/* Chips scroll sideways rather than wrapping to four rows and pushing the
   content off screen - the bar is sticky, so its height is a running cost. */
.rg-chips {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.rg-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  text-decoration: none;
  white-space: nowrap;
}

.rg-chip:hover { background: var(--surface-2); border-color: var(--accent-color); color: var(--accent-color); }
.rg-chip.is-current { background: var(--action-bg); border-color: var(--accent-color); color: var(--action-ink); }
.rg-chip[hidden] { display: none; }

.rg-count { margin: 0.4rem 0 0; font-size: 0.74rem; color: var(--text-secondary); }

body.dark .rg-bar { background: var(--surface-1); border-bottom-color: var(--border-color); }
body.dark .rg-search { background: var(--surface-1); border-color: var(--border-color); color: var(--text-color); }
body.dark .rg-search-wrap i { color: var(--text-secondary); }
body.dark .rg-chip { background: var(--surface-1); border-color: var(--border-color); color: var(--text-color); }
body.dark .rg-chip:hover { background: var(--surface-2); color: var(--accent-color); border-color: var(--accent-color); }
body.dark .rg-chip.is-current { background: var(--action-bg); border-color: var(--accent-color); color: var(--action-ink); }
body.dark .rg-count { color: var(--text-secondary); }

/* ------------------------------------------------------------ checklist */

.rg-progress { margin: 0 0 0.75rem; }

.rg-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.rg-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #1f6f4a;
  transition: width 0.25s ease;
}

.rg-progress-text {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: #35704a;
}

ul.checklist { list-style: none; padding-left: 0; }

.rg-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
  line-height: 1.5;
}

.rg-check {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: transparent;
  font-size: 0.66rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.rg-check:hover { border-color: #1f6f4a; }
.rg-check:focus-visible { outline: 2px solid #0b6ab8; outline-offset: 2px; }

.rg-check-item.is-done .rg-check {
  background: #1f6f4a;
  border-color: #1f6f4a;
  color: var(--action-ink);
}

.rg-check-item.is-done { color: var(--text-secondary); }
.rg-check-item.is-done > *:not(.rg-check) { text-decoration: line-through; }

body.dark .rg-progress-bar { background: var(--surface-2); }
body.dark .rg-progress-bar span { background: #5aa872; }
body.dark .rg-progress-text { color: #8ecfa2; }
body.dark .rg-check { background: var(--surface-1); border-color: var(--border-color); }
body.dark .rg-check-item.is-done .rg-check { background: #5aa872; border-color: #5aa872; color: #10231a; }
body.dark .rg-check-item.is-done { color: var(--text-secondary); }

@media (max-width: 560px) {
  .rg-chip { font-size: 0.72rem; padding: 0.26rem 0.6rem; }
}

/* ------------------------------------------------------------------
   Study paths (#residents-path, #fellows-path): the site's learning tools
   in the order a trainee needs them. A numbered vertical path: the number
   column carries the sequence, the "when" line the timing, and each tool is
   one link card. rotation-path.js marks the next step and done steps.
   ------------------------------------------------------------------ */
#epilepsy-rotation .sp-curriculum-note { margin: 0 0 1rem; color: var(--text-secondary); line-height: 1.55; }
#epilepsy-rotation .sp-curriculum-note a { color: var(--accent-color); font-weight: 600; text-underline-offset: 3px; }

#epilepsy-rotation .sp-intro { margin: 0 0 1.25rem; max-width: 70ch; color: var(--text-secondary); line-height: 1.6; }
#epilepsy-rotation .study-path { list-style: none; margin: 0; padding: 0; counter-reset: sp; }
#epilepsy-rotation .sp-step { position: relative; counter-increment: sp; padding: 0 0 1.6rem 3.25rem; }
#epilepsy-rotation .sp-step:last-child { padding-bottom: .25rem; }
/* the number, and the line that joins one step to the next */
#epilepsy-rotation .sp-step::before { content: counter(sp); position: absolute; left: 0; top: .05rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; font-weight: 700; font-size: .95rem; color: var(--accent-color); background: var(--surface-1); border: 2px solid var(--accent-color); z-index: 1; }
#epilepsy-rotation .sp-step:not(:last-child)::after { content: ""; position: absolute; left: calc(1.05rem - 1px); top: 2.2rem; bottom: .15rem; width: 2px; background: var(--border-color); }
#epilepsy-rotation .sp-step.is-done::before { content: "\2713"; color: var(--action-ink, #fff); background: var(--accent-color); }
#epilepsy-rotation .sp-step.is-next::before { color: var(--action-ink, #fff); background: var(--accent-color); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-color) 18%, transparent); }

#epilepsy-rotation .sp-when { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .15rem; color: var(--accent-color); font-size: .88rem; font-weight: 650; }
#epilepsy-rotation .sp-step.is-next .sp-when::after { content: "Next"; padding: .1rem .55rem; font-size: .75rem; font-weight: 700; color: var(--action-ink, #fff); background: var(--accent-color); border-radius: 999px; }
#epilepsy-rotation .info-box h3.sp-title { margin: 0 0 .25rem; font-size: 1.2rem; line-height: 1.3; }
#epilepsy-rotation .sp-why { margin: 0 0 .8rem; max-width: 70ch; color: var(--text-secondary); line-height: 1.55; }

#epilepsy-rotation .sp-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .6rem; margin: 0 0 .7rem; padding: 0; list-style: none; }
#epilepsy-rotation .sp-links li { margin: 0; padding: 0; }
#epilepsy-rotation .sp-link { display: flex; gap: .75rem; align-items: flex-start; height: 100%; padding: .75rem .85rem; color: var(--text-color); text-decoration: none; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; transition: border-color .15s ease, background-color .15s ease; }
#epilepsy-rotation .sp-link:hover { border-color: var(--accent-color); background: var(--surface-1); }
#epilepsy-rotation .sp-link:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
#epilepsy-rotation .sp-link-icon { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; margin-top: .05rem; border-radius: 9px; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 12%, transparent); font-size: .9rem; }
#epilepsy-rotation .sp-link-copy { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
#epilepsy-rotation .sp-link-copy strong { font-size: .97rem; font-weight: 650; line-height: 1.3; }
#epilepsy-rotation .sp-link-copy > span { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
#epilepsy-rotation .sp-link-copy .sp-progress { align-self: flex-start; margin-top: .15rem; padding: .1rem .55rem; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 12%, transparent); border-radius: 999px; font-size: .8rem; font-weight: 650; }

#epilepsy-rotation .sp-done { display: inline-flex; align-items: center; gap: .45rem; min-height: 32px; color: var(--text-secondary); font-size: .9rem; cursor: pointer; }
#epilepsy-rotation .sp-done input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent-color); }
#epilepsy-rotation .sp-step.is-done .sp-title,
#epilepsy-rotation .sp-step.is-done .sp-why { color: var(--text-secondary); }
#epilepsy-rotation .sp-step.is-done .sp-links { opacity: .72; }

@media (max-width: 640px) {
  #epilepsy-rotation .sp-step { padding-left: 2.6rem; }
  #epilepsy-rotation .sp-step::before { width: 1.8rem; height: 1.8rem; font-size: .85rem; }
  #epilepsy-rotation .sp-step:not(:last-child)::after { left: calc(.9rem - 1px); top: 1.9rem; }
  #epilepsy-rotation .info-box h3.sp-title { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { #epilepsy-rotation .sp-link { transition: none; } }

/* ------------------------------------------------------------------
   Two-week bootcamp (#fellows-bootcamp): the study path's numbered days,
   each with the Fundamentals lessons, the Board Review sections and the
   tools for that day. Week headings sit between the days without a number.
   ------------------------------------------------------------------ */
#epilepsy-rotation .sp-why a { color: var(--accent-color); font-weight: 600; text-underline-offset: 3px; }
#epilepsy-rotation .bc-week { list-style: none; margin: 0 0 1rem; padding: .2rem 0 0; }
#epilepsy-rotation .bc-week + .sp-step { margin-top: 0; }
#epilepsy-rotation .sp-step + .bc-week { margin-top: .6rem; padding-top: 1.1rem; border-top: 1px solid var(--border-color); }
#epilepsy-rotation .info-box h3.bc-week-title { margin: 0; font-size: 1.05rem; color: var(--text-color); }
#epilepsy-rotation .bc-week-note { margin: .15rem 0 0; color: var(--text-secondary); font-size: .92rem; line-height: 1.5; }

#epilepsy-rotation .bc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .6rem; margin: 0 0 .7rem; }
#epilepsy-rotation .bc-col { min-width: 0; padding: .75rem .85rem; background: var(--surface-2); border-radius: 12px; }
#epilepsy-rotation .bc-col-h { display: flex; align-items: center; gap: .45rem; margin: 0 0 .45rem; color: var(--text-secondary); font-size: .82rem; font-weight: 700; }
#epilepsy-rotation .bc-col-h i { color: var(--accent-color); }
#epilepsy-rotation .bc-start { display: inline-block; margin-bottom: .35rem; color: var(--accent-color); font-weight: 650; text-underline-offset: 3px; }
#epilepsy-rotation .bc-topics { margin: 0; padding-left: 1.1rem; color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
#epilepsy-rotation .bc-topics li { margin: 0 0 .2rem; }
#epilepsy-rotation .bc-sections, #epilepsy-rotation .bc-tools { margin: 0; padding: 0; list-style: none; }
#epilepsy-rotation .bc-sections li, #epilepsy-rotation .bc-tools li { margin: 0; }
#epilepsy-rotation .bc-sections a, #epilepsy-rotation .bc-tools a { display: flex; gap: .5rem; padding: .28rem 0; color: var(--text-color); font-size: .93rem; line-height: 1.4; text-decoration: none; }
#epilepsy-rotation .bc-sections a:hover, #epilepsy-rotation .bc-tools a:hover { color: var(--accent-color); text-decoration: underline; text-underline-offset: 3px; }
#epilepsy-rotation .bc-sections a:focus-visible, #epilepsy-rotation .bc-tools a:focus-visible,
#epilepsy-rotation .bc-start:focus-visible, #epilepsy-rotation .bc-chip:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; border-radius: 4px; }
#epilepsy-rotation .bc-n { flex: none; min-width: 1.9rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; font-weight: 600; }

#epilepsy-rotation .bc-practice { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .45rem; }
#epilepsy-rotation .bc-row-label { min-width: 4.6rem; color: var(--text-secondary); font-size: .85rem; font-weight: 650; }
#epilepsy-rotation .bc-chip { display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .75rem; color: var(--text-color); background: var(--surface-1); border: 1px solid var(--border-color); border-radius: 999px; font-size: .86rem; font-weight: 600; text-decoration: none; }
#epilepsy-rotation .bc-chip:hover { border-color: var(--accent-color); color: var(--accent-color); }
#epilepsy-rotation .sp-step.is-done .bc-cols, #epilepsy-rotation .sp-step.is-done .bc-practice { opacity: .72; }
#epilepsy-rotation .bc-after { margin: 1rem 0 0; max-width: 70ch; color: var(--text-secondary); font-size: .93rem; line-height: 1.55; }
@media (max-width: 640px) {
  #epilepsy-rotation .bc-row-label { min-width: 0; width: 100%; }
}
#epilepsy-rotation .sp-step:has(+ .bc-week)::after { display: none; }
/* clinical-refine.css caps list items at a reading measure; a bootcamp day
   holds columns, so it takes the full width and its prose keeps the cap */
#epilepsy-rotation li.sp-step.bc-day, #epilepsy-rotation li.bc-week { max-width: none; }

/* ======================================================================
 * Institution guides (October 7, 2026)
 * The general guides are public; each program's survival guide sits in its
 * own locked tab (institution-guide.js). Locked, the tab shows one card
 * with the code form; open, it shows the guide one group of sections at a
 * time, with a row of buttons to switch group.
 * ====================================================================== */
#epilepsy-rotation .inst-off { display: none !important; }
#epilepsy-rotation .inst-panel.is-locked.active { display: block; }

/* "Locked" / "Signed in" beside the institution's name */
#epilepsy-rotation .inst-state { display: inline-flex; align-items: center; gap: .25rem; margin-left: .35rem; padding: .05rem .45rem; color: var(--text-secondary); background: var(--surface-2); border-radius: 999px; font-size: .72rem; font-weight: 650; line-height: 1.5; white-space: nowrap; vertical-align: .1em; }
#epilepsy-rotation .inst-state i { font-size: .85em; }
#epilepsy-rotation .inst-state.is-open { color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 12%, transparent); }

/* The locked card */
#epilepsy-rotation .inst-lock { max-width: 40rem; padding: 1.5rem 1.6rem; border: 1px solid var(--border-color); border-radius: var(--radius-md, 16px); background: var(--surface-1); }
#epilepsy-rotation .inst-lock-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: .8rem; border-radius: 12px; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 12%, var(--surface-1)); font-size: 1.05rem; }
#epilepsy-rotation .inst-lock-title { margin: 0 0 .4rem; font-size: clamp(1.3rem, 1.1rem + .6vw, 1.55rem); line-height: 1.25; }
#epilepsy-rotation .inst-lock-lede { margin: 0 0 1.2rem; max-width: 62ch; color: var(--text-secondary); line-height: 1.6; }
#epilepsy-rotation .inst-form label { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 650; }
#epilepsy-rotation .inst-form-row { display: flex; gap: .5rem; max-width: 26rem; }
#epilepsy-rotation .inst-code { flex: 1; min-width: 0; min-height: 44px; padding: .55rem .8rem; color: var(--text-color); background: var(--surface-1); border: 1px solid var(--border-color); border-radius: 10px; font: inherit; font-size: 1rem; }
#epilepsy-rotation .inst-code:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 1px; border-color: var(--accent-color); }
#epilepsy-rotation .inst-submit { flex: none; min-height: 44px; padding: .55rem 1.2rem; color: var(--action-ink, #fff); background: var(--action-bg); border: 0; border-radius: 10px; font: inherit; font-weight: 650; cursor: pointer; }
#epilepsy-rotation .inst-submit:hover { background: var(--action-hover); }
#epilepsy-rotation .inst-submit:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
#epilepsy-rotation .inst-submit:disabled { opacity: .6; cursor: progress; }
#epilepsy-rotation .inst-msg { min-height: 1.4em; margin: .5rem 0 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.45; }
#epilepsy-rotation .inst-msg.is-error { color: #b42318; font-weight: 600; }
body.dark #epilepsy-rotation .inst-msg.is-error { color: #ff8a80; }
#epilepsy-rotation .inst-lock-note { margin: .6rem 0 0; color: var(--text-secondary); font-size: .85rem; }

/* The open guide: its title, then the group buttons */
#epilepsy-rotation .inst-head { margin: 0 0 1rem; }
#epilepsy-rotation .inst-title { margin: 0 0 .3rem; font-size: clamp(1.35rem, 1.1rem + .7vw, 1.6rem); line-height: 1.25; }
#epilepsy-rotation .inst-title:focus:not(:focus-visible) { outline: none; }
/* .inst-panel raises specificity over clinical-refine.css's reading measure */
#epilepsy-rotation .inst-panel .inst-head p { max-width: none; margin: 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
#epilepsy-rotation .inst-parts { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.5rem; }
#epilepsy-rotation .inst-part-btn { min-height: 38px; padding: .35rem .95rem; color: var(--text-color); background: var(--surface-1); border: 1px solid var(--border-color); border-radius: 999px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
#epilepsy-rotation .inst-part-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
/* filled controls use the action colours: in dark mode the accent is a light pink */
#epilepsy-rotation .inst-part-btn[aria-pressed="true"] { color: var(--action-ink, #fff); background: var(--action-bg); border-color: var(--action-bg); }
#epilepsy-rotation .inst-part-btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
/* the first section of the group in view sits under the buttons (marked by institution-guide.js) */
#epilepsy-rotation .tab-content > h2.section-header.inst-first { margin-top: 0; }

/* Course schedule: each month with where to study it */
#epilepsy-rotation .course-months { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
#epilepsy-rotation .month-body { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
#epilepsy-rotation .month-links { display: flex; flex-wrap: wrap; gap: .3rem; }
#epilepsy-rotation .month-links a { display: inline-flex; align-items: center; min-height: 28px; padding: .1rem .55rem; color: var(--text-color); background: var(--surface-1); border: 1px solid var(--border-color); border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.3; text-decoration: none; }
#epilepsy-rotation .month-links a:hover { color: var(--accent-color); border-color: var(--accent-color); }
#epilepsy-rotation .month-links a:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

@media (max-width: 560px) {
  #epilepsy-rotation .inst-lock { padding: 1.1rem 1rem; }
  #epilepsy-rotation .inst-state { margin-left: 0; }
}

/* Start here: the goals and the reading list in short columns */
#epilepsy-rotation .goals-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem 2rem; }
#epilepsy-rotation .info-box .goals-cols h3 { margin: 0 0 .35rem; font-size: 1rem; }
#epilepsy-rotation .goals-cols .clean-list { margin: 0; }
