[x-cloak] { display: none !important; }

#cp-app {
  --cp-primary: #1e40af;
  --cp-border:  #d1d5db;
  --cp-muted:   #6b7280;
  --cp-bg:      #ffffff;
  --cp-bg-alt:  #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
}

.cp-planner {
  background: var(--cp-bg);
  border: 1px solid var(--cp-border);
  border-radius: 8px;
  overflow: hidden;
  /* Break out of theme content-width constraint so tiles get real estate.
     Falls back gracefully on small screens via clamp(). */
  width: min(96vw, 1400px);
  max-width: 96vw;
  margin-left: calc(50% - min(48vw, 700px));
  margin-right: calc(50% - min(48vw, 700px));
}
@media (max-width: 900px) {
  .cp-planner { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
}

/* Detailed planner styles added in chunks 6 + 7 */

/* Page 1 breaks out of the theme content column to a comfortable width (a bit
   narrower than the hero). The create-form content is re-narrowed below so
   inputs/state-list stay readable; the gallery uses the full width. */
.cp-wizard { width: min(94vw, 900px); max-width: 94vw; margin-left: calc(50% - min(47vw, 450px)); margin-right: calc(50% - min(47vw, 450px)); padding: 8px 0; }
@media (min-width: 901px) { .cp-wizard-step { max-width: 620px; margin-left: auto; margin-right: auto; } }
@media (max-width: 900px) { .cp-wizard { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; } }
/* Page 1 sits on a clean card so it reads as a designed surface (matches the
   planner shell's soft blue shadow). */
.cp-wizard-card { background: var(--cp-bg); border: 1px solid var(--cp-border); border-radius: 12px; box-shadow: 0 4px 16px rgba(49, 130, 206, 0.08); padding: 32px clamp(20px, 5vw, 40px); }
.cp-wizard-section + .cp-wizard-section { margin-top: 26px; }
/* Section dividers ("Your plans" / "Create a plan") */
.cp-section-head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.cp-section-line { flex: 1; height: 1px; background: var(--cp-border); }
.cp-section-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--cp-muted); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.cp-wizard-back-link { display: inline-block; margin: 0 0 12px; padding: 0; background: none; border: none; color: var(--cp-primary); font-size: 14px; cursor: pointer; }
.cp-wizard-back-link:hover { text-decoration: underline; }
.cp-wizard-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 56px 20px; color: var(--cp-muted); font-size: 16px; }

/* Wizard (page 1) type scale is ~1.2× the planner's for a larger, friendlier
   landing experience. */
.cp-wizard-steps { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0 0 24px 0; font-size: 17px; color: var(--cp-muted); }
.cp-wizard-steps li { padding: 4px 12px; border-radius: 12px; background: var(--cp-bg-alt); }
.cp-wizard-steps li.active { background: var(--cp-primary); color: white; }
.cp-wizard-steps li.done { background: #d1fae5; color: #065f46; }

.cp-wizard-step h2 { margin-top: 0; font-size: 32px; }
.cp-wizard-step p { font-size: 18px; line-height: 1.55; }
.cp-wizard-step input[type="text"], .cp-wizard-step input[type="number"] {
  display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--cp-border); border-radius: 4px; font-size: 18px; margin-bottom: 12px; box-sizing: border-box;
}
.cp-wizard-step label { display: block; font-size: 17px; margin-bottom: 5px; color: var(--cp-muted); }

.cp-state-list { list-style: none; padding: 0; max-height: 360px; overflow: auto; border: 1px solid var(--cp-border); border-radius: 4px; }
.cp-state-list li { border-bottom: 1px solid var(--cp-border); }
.cp-state-list li:last-child { border-bottom: none; }
.cp-state-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 16px; text-align: left; background: none; border: none; cursor: pointer; font-size: 18px; transition: padding-left 0.12s; }
.cp-state-list button:hover { background: var(--cp-bg-alt); padding-left: 16px; }
/* Chevron affordance appears on hover/focus so rows read as navigable. */
.cp-state-list button::after { content: "›"; font-size: 16px; line-height: 1; color: var(--cp-primary); opacity: 0; transition: opacity 0.12s; }
.cp-state-list button:hover::after, .cp-state-list button:focus-visible::after { opacity: 1; }

.cp-wizard-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.cp-wizard-actions button { padding: 10px 20px; border: 1px solid var(--cp-border); background: white; border-radius: 4px; cursor: pointer; font-size: 17px; }
.cp-wizard-actions button.primary { background: var(--cp-primary); color: white; border-color: var(--cp-primary); }
.cp-wizard-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Page-1 plans gallery (server or local students) + a "+ New plan" card. */
.cp-wizard-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cp-wizard-student-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--cp-bg); border: 1px solid var(--cp-border); border-radius: 10px; cursor: pointer; text-align: left; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.cp-wizard-student-card:hover { border-color: var(--cp-primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(49, 130, 206, 0.10); }
.cp-student-card-avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e2effa; color: var(--cp-primary); font-weight: 700; font-size: 18px; }
.cp-student-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-student-card-body strong { font-size: 16px; color: #1a202c; line-height: 1.25; }
.cp-student-card-body span { font-size: 13px; color: var(--cp-muted); }
/* "+ New plan" card: dashed, brand-tinted, with a leading + bubble. */
.cp-wizard-student-card-add { border-style: dashed; border-color: #bcd6ef; background: #f6fafe; }
.cp-wizard-student-card-add:hover { border-style: solid; border-color: var(--cp-primary); background: #eef5fc; }
.cp-student-card-plus { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--cp-primary); color: #fff; font-size: 22px; font-weight: 600; line-height: 1; }
.cp-wizard-student-card-add strong { color: var(--cp-primary); }
/* Delete control on each plan card — hover-reveal on desktop, always shown on
   touch. Confirms before removing (deleteStudent is source-aware). */
.cp-wizard-student-cell { position: relative; }
.cp-wizard-student-cell .cp-wizard-student-card { width: 100%; padding-right: 38px; }
.cp-wizard-student-delete { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--cp-border); color: var(--cp-muted); font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s; }
.cp-wizard-student-cell:hover .cp-wizard-student-delete, .cp-wizard-student-delete:focus-visible { opacity: 1; }
.cp-wizard-student-delete:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
@media (hover: none) { .cp-wizard-student-delete { opacity: 0.6; } }

/* Admin-managed hero: any block(s) wrapped with the class hsp-blueprint-hero
   (or cp-hero) above the [course_plan] shortcode auto-hide once a student opens
   their plan, so the hero shows only on page 1 (the wizard). */
body.cp-plan-active .hsp-blueprint-hero,
body.cp-plan-active .cp-hero { display: none !important; }

/* Mirror of the above: blocks wrapped with hsp-blueprint-planner-note (or
   cp-planner-note) are hidden on the entry screen and show ONLY on the planner
   view (a plan is open) — a "blurb on top of the planner". */
.hsp-blueprint-planner-note, .cp-planner-note { display: none !important; }
body.cp-plan-active .hsp-blueprint-planner-note,
body.cp-plan-active .cp-planner-note { display: block !important; }

.cp-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.cp-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.cp-modal-card { position: relative; background: #fff; border-radius: 8px; padding: 20px 24px; max-width: 540px; width: 90%; max-height: 80vh; overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08); }
.cp-modal-card.cp-electives { max-width: 760px; }

/* === Course Picker — designed dialog === */
.cp-modal-card.cp-picker { max-width: 920px; padding: 0; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.cp-picker-header { display: flex; flex-direction: column; align-items: stretch; gap: 13px; padding: 20px 24px 16px; border-bottom: 1px solid var(--cp-border); background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%); }
.cp-picker-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.cp-picker-title { margin: 0; font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.01em; }
.cp-picker-subtitle { margin: 4px 0 0 0; font-size: 13px; color: var(--cp-muted); }
.cp-picker-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--cp-muted); cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.cp-picker-close:hover { background: #f3f4f6; color: #111827; }
.cp-picker-search { position: relative; display: flex; align-items: center; }
.cp-picker-search-icon { position: absolute; left: 12px; color: var(--cp-muted); pointer-events: none; }
.cp-picker .cp-picker-search-input { width: 100%; margin: 0; padding: 9px 34px 9px 36px; border: 1px solid var(--cp-border); border-radius: 8px; font-size: 14px; background: #fff; box-sizing: border-box; }
.cp-picker .cp-picker-search-input:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12); }
.cp-picker-search-clear { position: absolute; right: 8px; background: none; border: none; font-size: 20px; line-height: 1; color: var(--cp-muted); cursor: pointer; padding: 2px 7px; border-radius: 4px; }
.cp-picker-search-clear:hover { background: #f3f4f6; color: #111827; }
.cp-picker-empty { padding: 30px 8px; text-align: center; color: var(--cp-muted); font-size: 14px; }

.cp-picker-body { display: grid; grid-template-columns: 220px 1fr; flex: 1; min-height: 0; }

.cp-picker-nav { padding: 16px 8px; background: #fafbff; border-right: 1px solid var(--cp-border); overflow-y: auto; min-width: 0; }
.cp-nav-group { margin-bottom: 18px; }
.cp-nav-group:last-child { margin-bottom: 0; }
.cp-nav-group-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--cp-muted); font-weight: 700; padding: 0 12px 6px; }
.cp-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 13px; color: #374151; text-align: left; transition: background 0.1s, border-color 0.1s; }
.cp-nav-item:hover { background: #fff; border-color: var(--cp-border); }
.cp-nav-item-active { background: #fff; border-color: var(--cp-primary); color: var(--cp-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(30, 64, 175, 0.08); }
.cp-nav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cp-nav-dot-elective { background: #d1d5db; border: 2px solid #fcd34d; box-sizing: border-box; }
.cp-nav-label { flex: 1; }
.cp-nav-count { font-size: 11px; color: var(--cp-muted); font-variant-numeric: tabular-nums; padding: 1px 6px; background: #f3f4f6; border-radius: 8px; }
.cp-nav-item-active .cp-nav-count { background: #dbeafe; color: var(--cp-primary); }
.cp-nav-item-custom { color: var(--cp-primary); border-style: dashed; border-color: #c7d2fe; background: transparent; }
.cp-nav-item-custom:hover { background: #eef2ff; border-color: var(--cp-primary); }
.cp-nav-plus { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; background: var(--cp-primary); color: white; border-radius: 50%; font-size: 14px; font-weight: 600; }

.cp-picker-main { padding: 20px 24px; overflow-y: auto; min-width: 0; }
.cp-picker-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cp-picker-section-title { margin: 0; font-size: 15px; font-weight: 600; color: #111827; }
.cp-picker-section-count { font-size: 12px; color: var(--cp-muted); }

.cp-electives .cp-elective-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cp-elective-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; background: #fff; border: 1px solid var(--cp-border); border-radius: 8px; cursor: pointer; text-align: left; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.cp-elective-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--cp-primary); }
.cp-card-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.cp-card-name { display: block; font-weight: 600; font-size: 14px; color: #111827; line-height: 1.3; }
.cp-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.cp-card-chip { display: inline-flex; align-items: center; padding: 2px 8px; background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 500; border-radius: 10px; font-variant-numeric: tabular-nums; }
.cp-card-chip-muted { background: #f3f4f6; color: var(--cp-muted); font-weight: 400; }

.cp-form-help { margin: 0 0 16px 0; font-size: 13px; color: var(--cp-muted); line-height: 1.5; }
.cp-custom-form { display: flex; flex-direction: column; gap: 14px; }
.cp-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cp-field-label { font-size: 12px; font-weight: 600; color: #374151; }
.cp-field input, .cp-field select, .cp-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--cp-border); border-radius: 6px; font-size: 13px; background: #fff; box-sizing: border-box; transition: border-color 0.1s, box-shadow 0.1s; }
.cp-field input:focus, .cp-field select:focus, .cp-field textarea:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12); }
.cp-field-row { display: flex; gap: 12px; }
.cp-field-narrow { flex: 0 0 110px; }
.cp-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--cp-border); }
.cp-btn { padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background 0.1s, border-color 0.1s; }
.cp-btn-secondary { background: #fff; border-color: var(--cp-border); color: #374151; }
.cp-btn-secondary:hover { background: #f3f4f6; }
.cp-btn-primary { background: var(--cp-primary); color: #fff; }
.cp-btn-primary:hover { background: #1e3a8a; }

@media (max-width: 720px) {
  .cp-picker-body { grid-template-columns: 1fr; }
  .cp-picker-nav { border-right: none; border-bottom: 1px solid var(--cp-border); max-height: 200px; }
}
.cp-modal-card h3 { margin-top: 0; }
.cp-modal-card input, .cp-modal-card select, .cp-modal-card textarea { display: block; width: 100%; margin-bottom: 8px; padding: 6px 8px; box-sizing: border-box; border: 1px solid var(--cp-border); border-radius: 4px; font-size: 13px; }

.cp-modal-card form button.primary { background: var(--cp-primary); color: white; border: none; border-radius: 4px; padding: 8px 16px; cursor: pointer; }
.cp-modal-card form button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.cp-error { color: #dc2626; font-size: 13px; margin: 4px 0; }

.cp-tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-bottom: 1px solid var(--cp-border); margin-bottom: 12px; padding-bottom: 4px; }
.cp-tabs button { padding: 5px 10px; background: #f3f4f6; border: 1px solid var(--cp-border); border-bottom: none; border-radius: 4px 4px 0 0; cursor: pointer; font-size: 12px; white-space: nowrap; margin-bottom: -1px; }
.cp-tabs button.active { background: white; font-weight: 600; color: var(--cp-primary); }
.cp-tabs-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--cp-muted); font-weight: 600; padding: 0 6px 0 0; align-self: center; }
.cp-tabs-group-label-electives { color: #b45309; }
.cp-tabs-divider { display: inline-block; width: 1px; height: 18px; background: var(--cp-border); margin: 0 4px; align-self: center; }
.cp-tabs button.cp-tab-elective { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.cp-tabs button.cp-tab-elective.active { background: white; color: var(--cp-primary); border-color: var(--cp-border); }
.cp-electives .cp-elective-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

.cp-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--cp-bg-alt); border-bottom: 1px solid var(--cp-border); font-size: 13px; gap: 12px; }
.cp-toolbar .cp-state-pill { background: var(--cp-primary); color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.cp-toolbar-actions { display: flex; gap: 8px; align-items: center; }
.cp-toolbar > button, .cp-toolbar-actions button { padding: 4px 10px; font-size: 12px; border: 1px solid var(--cp-border); background: #fff; border-radius: 4px; cursor: pointer; }
.cp-toolbar-actions button.primary { background: var(--cp-primary); color: #fff; border-color: var(--cp-primary); }

/* Print menu dropdown (Color / B&W) */
.cp-print-wrap { position: relative; }
.cp-print-wrap > button.cp-print-open { background: #f3f4f6; border-color: var(--cp-primary); color: var(--cp-primary); }
.cp-print-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 160px; background: #fff; border: 1px solid var(--cp-border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); padding: 4px; z-index: 50; display: flex; flex-direction: column; gap: 2px; }
.cp-print-menu button { padding: 6px 10px; background: transparent; border: none; cursor: pointer; text-align: left; border-radius: 4px; font-size: 12px; color: #111827; }
.cp-print-menu button:hover { background: #f3f4f6; }

/* Student switcher (clickable plan title with dropdown) */
.cp-plan-title-wrap { position: relative; flex: 1; display: flex; justify-content: center; }
/* Styled as a clear button (white surface, visible border + shadow, chevron
   affordance) so users recognize it as the way to switch / add students.
   Scoped under #cp-app with !important on background/color because host themes
   commonly apply an aggressive `button:hover` gradient fill + white text that
   would otherwise bleed through and make our label unreadable on hover. */
#cp-app .cp-plan-title { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #fff !important; background-image: none !important; border: 1px solid var(--cp-border); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); cursor: pointer; font-size: 14px; color: #111827 !important; text-shadow: none; transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s; }
#cp-app .cp-plan-title:hover { background: #eef5ff !important; background-image: none !important; border-color: var(--cp-primary); box-shadow: 0 2px 6px rgba(0,0,0,0.10); color: #111827 !important; }
#cp-app .cp-plan-title-open { background: #fff !important; border-color: var(--cp-primary); box-shadow: 0 2px 6px rgba(0,0,0,0.10); }
#cp-app .cp-plan-title strong { font-weight: 700; color: #111827 !important; }
#cp-app .cp-plan-title-class { color: #374151 !important; }
/* Bigger, bolder caret with a smooth flip when the student menu opens. */
#cp-app .cp-plan-title-chevron { display: inline-block; font-size: 14px; font-weight: 700; line-height: 1; color: var(--cp-primary) !important; margin-left: 4px; transition: transform 0.18s ease; }
#cp-app .cp-plan-title-open .cp-plan-title-chevron { transform: rotate(180deg); }

.cp-student-menu { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); min-width: 260px; background: #fff; border: 1px solid var(--cp-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; z-index: 100; }
.cp-student-menu-section { padding: 6px 0; }
.cp-student-menu-section-divided { border-top: 1px solid var(--cp-border); }
.cp-student-menu-label { padding: 4px 10px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--cp-muted); font-weight: 700; }
.cp-student-menu-row { display: flex; align-items: stretch; border-radius: 4px; }
.cp-student-menu-row:hover { background: #f3f4f6; }
.cp-student-menu-row.cp-student-menu-item-active { background: #eef2ff; }
.cp-student-menu-row.cp-student-menu-item-active:hover { background: #e0e7ff; }
.cp-student-menu-item { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 8px 10px; background: transparent; border: none; border-radius: 4px 0 0 4px; cursor: pointer; text-align: left; min-width: 0; }
.cp-student-menu-delete { background: transparent; border: none; cursor: pointer; padding: 0 10px; opacity: 0; transition: opacity 0.15s, background 0.1s; border-radius: 0 4px 4px 0; font-size: 14px; color: var(--cp-muted); }
.cp-student-menu-row:hover .cp-student-menu-delete { opacity: 0.7; }
.cp-student-menu-delete:hover { opacity: 1 !important; background: #fee2e2; color: #b91c1c; }
.cp-student-menu-name { font-weight: 600; font-size: 13px; color: #111827; }
.cp-student-menu-meta { font-size: 11px; color: var(--cp-muted); margin-top: 1px; }
.cp-student-menu-empty { padding: 8px 10px; font-size: 12px; color: var(--cp-muted); font-style: italic; }
.cp-student-menu-add { flex-direction: row; align-items: center; gap: 8px; color: var(--cp-primary); font-weight: 600; }
.cp-student-menu-plus { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; background: var(--cp-primary); color: #fff; border-radius: 50%; font-size: 14px; font-weight: 600; }

.cp-student-picker { padding: 24px; max-width: 720px; margin: 0 auto; }
.cp-student-picker h2 { margin-top: 0; }
.cp-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cp-student-card { display: flex; flex-direction: column; padding: 16px; background: white; border: 1px solid var(--cp-border); border-radius: 8px; cursor: pointer; text-align: left; gap: 4px; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.cp-student-card:hover { border-color: var(--cp-primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08); }
.cp-student-card strong { font-size: 16px; }
.cp-student-card span { font-size: 12px; color: var(--cp-muted); }

/* Add-new-student card: dashed border, primary tint, leading + icon */
.cp-student-card-add { border-style: dashed; border-color: #c7d2fe; background: #f8faff; }
.cp-student-card-add strong { color: var(--cp-primary); }
.cp-student-card-add:hover { background: #eef2ff; border-color: var(--cp-primary); border-style: solid; }
.cp-student-card-plus { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--cp-primary); color: #fff; border-radius: 50%; font-size: 18px; font-weight: 600; margin-bottom: 6px; }

.cp-modal-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.cp-modal-actions button { padding: 8px 14px; border: 1px solid var(--cp-border); background: white; border-radius: 4px; cursor: pointer; font-size: 13px; }
.cp-modal-actions button.danger { color: #dc2626; border-color: #dc2626; }

/* Reusable confirmation modal */
.cp-modal-card.cp-confirm-card { max-width: 440px; }
.cp-confirm-card h3 { margin: 0 0 4px; font-size: 18px; }
.cp-confirm-message { margin: 0; color: var(--cp-muted); font-size: 14px; line-height: 1.55; }
.cp-confirm-card .cp-modal-actions { margin-top: 20px; }
.cp-confirm-card .cp-modal-actions button { padding: 9px 16px; font-size: 14px; }

.cp-body { display: grid; grid-template-columns: 1fr 280px; min-height: 600px; }
/* 4 columns × 3 rows. Auto rows mean each row's height is the max of its cells,
   so all 4 Fall cells share one row height and all 4 Spring cells share another.
   Alpine's <template x-for> leaves template elements in the DOM, which breaks
   nth-child counting — so we use gap+background for grid lines instead of
   per-cell borders. The grid background shows through 1px gaps as separator
   lines; cell backgrounds cover their own area. */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 1px;
  background: var(--cp-border);
}

.cp-year-header { padding: 14px 16px; font-weight: 600; font-size: 14px; text-align: center; }
/* Grade + school-year sub-label: slightly larger and darker than the muted
   default so "Grade 9 · 2026–27" stays readable on the year tints. */
.cp-year-header small { display: block; color: #475569; font-weight: 500; font-size: 13px; margin-top: 4px; }
/* Per-year planned-credit badge — quick read of each year's course load. */
.cp-year-credits { display: inline-block; margin-top: 6px; padding: 1px 9px; font-size: 11px; font-weight: 700; border-radius: 999px; background: rgba(255,255,255,0.65); color: #1f2937; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); }

.cp-semester { display: flex; flex-direction: column; padding: 12px; min-height: 240px; min-width: 0; }

/* Per-year color tint — header gets a more saturated band, semester cells a paler wash.
   The "Year N" text uses one shared color (the Year-4 gray) across all four columns;
   only the background tint varies between years. */
.cp-year-header[data-year="1"]                      { background: #dbeafe; color: #313042; }
.cp-year-header[data-year="2"]                      { background: #dcfce7; color: #313042; }
.cp-year-header[data-year="3"]                      { background: #fef3c7; color: #313042; }
.cp-year-header[data-year="4"]                      { background: #fce7f3; color: #313042; }
.cp-semester[data-year="1"]                         { background: #f5f9ff; }
.cp-semester[data-year="2"]                         { background: #f5fbf6; }
.cp-semester[data-year="3"]                         { background: #fffbf0; }
.cp-semester[data-year="4"]                         { background: #fdf4f8; }

/* Summer row: collapsed cells (no summer enabled) show only the "+ Add Summer School"
   button against a slightly more muted background to read as optional. */
.cp-semester.cp-summer { min-height: 60px; padding: 8px 12px 12px; position: relative; }
.cp-summer-collapsed { display: flex; align-items: center; justify-content: center; min-height: 48px; }
.cp-summer-content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cp-semester-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cp-summer-hide { background: transparent; border: none; color: var(--cp-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.cp-summer-hide:hover { background: rgba(0,0,0,0.06); color: #111827; }
.cp-add-summer { display: block; width: 100%; border: 1px dashed var(--cp-border); background: rgba(255, 255, 255, 0.5); padding: 10px; border-radius: 6px; font-size: 12px; color: var(--cp-muted); cursor: pointer; transition: all 0.1s; }
.cp-add-summer:hover { border-color: var(--cp-primary); color: var(--cp-primary); background: #fff; }
/* Summer label gets a sun-tinted accent independent of year tint */
.cp-summer .cp-semester-label { color: #b45309; }
/* The sortable drop zone — must be flex so empty cells still have a target area
   and so the bottom of the tiles list pushes up against the +Add button. */
.cp-tiles { display: flex; flex-direction: column; flex: 1; min-height: 40px; }
.cp-semester-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--cp-muted); font-weight: 600; margin-bottom: 10px; }

.cp-tile { background: #fff; border: 1px solid var(--cp-border); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: box-shadow 0.15s; position: relative; }
.cp-tile:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.cp-tile-move { display: none; }   /* shown on mobile via course-plan-mobile.css */
.cp-tile:last-of-type { margin-bottom: 12px; }
.cp-tile-year-long { background: linear-gradient(180deg, #fff 70%, #f3f4f6 100%); position: relative; padding-right: 24px; }
.cp-tile-year-long::after { content: "↕"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--cp-muted); font-size: 14px; opacity: 0.5; }

/* Subject-highlight: when a requirements row is clicked, matching tiles light up
   and non-matching tiles dim. Click again to clear. */
.cp-tile-highlighted {
  box-shadow: 0 0 0 2px var(--cp-primary), 0 4px 12px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cp-tile-dimmed {
  opacity: 0.3;
  transition: opacity 0.15s;
}
.cp-tile-dimmed:hover { opacity: 0.7; }

/* Briefly highlight newly-added tiles so users can see where they landed */
.cp-tile-just-added {
  animation: cp-flash 2.5s ease-out;
  box-shadow: 0 0 0 2px #fbbf24, 0 4px 12px rgba(251, 191, 36, 0.3);
}
@keyframes cp-flash {
  0%   { background-color: #fef3c7; }
  60%  { background-color: #fef3c7; }
  100% { background-color: transparent; }
}
.cp-tile-just-added.cp-tile-year-long {
  background: linear-gradient(180deg, #fef3c7 70%, #fde68a 100%);
}
.cp-tile-name { font-weight: 600; line-height: 1.3; word-break: break-word; }
.cp-tile-meta { display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 11px; color: var(--cp-muted); margin-top: 6px; white-space: nowrap; }
/* Credits as a small pill chip; duration de-emphasized + pushed to the right. */
.cp-tile-credits { display: inline-flex; align-items: center; padding: 1px 7px; background: #eef2f7; color: #334155; font-weight: 700; border-radius: 999px; font-variant-numeric: tabular-nums; }
.cp-tile-duration { margin-left: auto; color: var(--cp-muted); font-style: italic; }
.cp-add-course { display: block; width: 100%; border: 1px dashed var(--cp-border); background: transparent; padding: 8px 10px; border-radius: 4px; font-size: 12px; color: var(--cp-muted); cursor: pointer; margin-top: auto; }
.cp-add-course:hover { border-color: var(--cp-primary); color: var(--cp-primary); }
/* Faint hint shown in a semester cell with no courses, so empty cells read as
   intentional rather than unfinished. */
.cp-cell-empty-hint { display: block; font-size: 11px; color: var(--cp-muted); font-style: italic; opacity: 0.65; padding: 2px 2px 6px; }

/* Subject color border.
   Colors come from ONE source: CP_Data::standard_subjects() (PHP), emitted as
   --cp-subject-<key> custom properties on #cp-app. To change a subject color,
   edit standard_subjects() — it propagates here, to print, to themes, and to
   the picker/admin previews. Do NOT hardcode hex values in this file. */
.cp-subject-english        { border-left: 3px solid var(--cp-subject-english); }
.cp-subject-math           { border-left: 3px solid var(--cp-subject-math); }
.cp-subject-science        { border-left: 3px solid var(--cp-subject-science); }
.cp-subject-social_studies { border-left: 3px solid var(--cp-subject-social_studies); }
.cp-subject-world_languages{ border-left: 3px solid var(--cp-subject-world_languages); }
.cp-subject-fine_arts      { border-left: 3px solid var(--cp-subject-fine_arts); }
.cp-subject-pe_health      { border-left: 3px solid var(--cp-subject-pe_health); }
.cp-subject-electives      { border-left: 3px solid var(--cp-subject-electives); }

.cp-sidebar { padding:12px 14px; background:#fcfcfd; font-size:12px; border-left:1px solid var(--cp-border); }
.cp-sidebar h4 { margin:0 0 8px 0; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--cp-muted); }
.cp-req-row { display: block; padding: 6px 8px; border-bottom: 1px solid #f3f4f6; cursor: pointer; border-radius: 4px; transition: background 0.1s; }
.cp-req-row:hover { background: #f3f4f6; }
.cp-req-row-active { background: #e0e7ff; }
.cp-req-row-active:hover { background: #c7d2fe; }
.cp-req-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cp-req-swatch { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.cp-req-name { flex: 1; min-width: 0; }
.cp-req-progress { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cp-req-progress.complete { color:#059669; font-weight:600; }
.cp-req-progress.short    { color:#b45309; font-weight:600; }
/* Per-subject + hero progress bar */
.cp-req-bar { height: 4px; margin-top: 5px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.cp-req-bar-fill { height: 100%; width: 0; background: #f59e0b; border-radius: 999px; transition: width 0.25s ease; }
.cp-req-bar-fill.complete { background: #059669; }
.cp-req-bar-lg { height: 8px; }
/* Overall completion hero */
.cp-req-summary { padding: 4px 8px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--cp-border); }
.cp-req-summary-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cp-req-summary-num { font-size: 13px; color: #1f2937; }
.cp-req-summary-num strong { font-size: 17px; font-weight: 700; }
.cp-req-summary-pct { font-size: 12px; font-weight: 700; color: #b45309; font-variant-numeric: tabular-nums; }
.cp-req-summary-pct.complete { color: #059669; }
.cp-add-elective-btn { width:100%; padding:6px 10px; background:#fff; border:1px solid var(--cp-border); border-radius:4px; font-size:12px; cursor:pointer; }

.cp-elective-cards { display:grid; grid-template-columns: 1fr 1fr; gap:8px; }
.cp-elective-card { text-align:left; padding:10px 12px; border:1px solid var(--cp-border); border-radius:4px; background:#fff; cursor:pointer; }
.cp-elective-card strong { display:block; }
.cp-elective-card span { color:var(--cp-muted); font-size:11px; }

.cp-modal-card .cp-modal-actions { display:flex; gap:8px; align-items:center; margin-top:12px; }
.cp-modal-card .cp-modal-actions button { padding:6px 12px; border: 1px solid var(--cp-border); background: white; border-radius: 4px; cursor: pointer; }
.cp-modal-card .cp-modal-actions button.primary { background: var(--cp-primary); color:#fff; border:none; }
.cp-modal-card .cp-modal-actions button.danger  { background:#fff; color:#dc2626; border:1px solid #dc2626; }

.cp-banner { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: #fef3c7; border-bottom: 1px solid #f59e0b; font-size: 13px; }
.cp-banner button { padding: 4px 12px; background: var(--cp-primary); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }

.cp-toast { position: fixed; top: 16px; right: 16px; background: #1f2937; color: white; padding: 10px 16px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 10000; display: flex; align-items: center; gap: 12px; max-width: 400px; }
.cp-toast button { background: none; border: none; color: white; font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }

.cp-move-picker { max-width: 480px; }
.cp-move-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.cp-move-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--cp-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}
.cp-move-cell strong { font-size: 12px; color: var(--cp-muted); font-weight: 600; }
.cp-move-cell:hover { border-color: var(--cp-primary); }
.cp-move-cell-current { background: #eef2ff; border-color: var(--cp-primary); color: var(--cp-primary); }

/* === Pre-HS row (Grade 8 credits) ===
   Distinct lavender color block so Grade 8 reads as its own school-year band,
   not a reuse of any Year 1–4 tint or the plain panel background. */
.cp-pre-hs { display: flex; align-items: stretch; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--cp-border); border-left: 4px solid #7c5cff; background: #ede9fe; }
.cp-pre-hs-meta { flex: 0 0 200px; padding-right: 12px; border-right: 1px solid var(--cp-border); display: flex; flex-direction: column; }
.cp-pre-hs-label { font-weight: 700; font-size: 14px; color: #4c34b8; }
.cp-pre-hs-sub   { font-size: 11px; color: var(--cp-muted); margin-top: 2px; line-height: 1.35; }
.cp-pre-hs-hide  { align-self: flex-start; margin-top: 10px; font-size: 11px; background: transparent; border: 1px solid var(--cp-border); border-radius: 4px; padding: 3px 8px; cursor: pointer; color: var(--cp-muted); }
.cp-pre-hs-tiles { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; align-content: flex-start; }
.cp-pre-hs-tiles .cp-tile { width: 200px; margin-bottom: 0; }
.cp-pre-hs-tiles .cp-add-course { width: 160px; margin-top: 0; align-self: stretch; min-height: 64px; }
.cp-pre-hs-empty-hint { color: var(--cp-muted); font-size: 12px; font-style: italic; align-self: center; }
.cp-pre-hs-pill { background: transparent; border: 1px dashed var(--cp-border); color: var(--cp-muted); border-radius: 12px; padding: 3px 10px; font-size: 11px; cursor: pointer; }
.cp-pre-hs-pill:hover { border-color: var(--cp-primary); color: var(--cp-primary); border-style: solid; }

/* One-shot flash when the row is first opened — a fading amber glow draws the
   eye without animating the background colour (which differs per theme, so
   animating it caused a brief off-colour flash before settling). */
@keyframes cp-pre-hs-flash {
  0%   { box-shadow: inset 0 0 0 2px #fbbf24; }
  60%  { box-shadow: inset 0 0 0 2px #fbbf24; }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}
.cp-pre-hs-flash { animation: cp-pre-hs-flash 2.4s ease-out; }

/* === Transcript: tile state visuals === */
.cp-tile-in-progress { box-shadow: inset 3px 0 0 #f59e0b, 0 1px 2px rgba(0,0,0,0.04); }
.cp-tile-in-progress::after {
  content: "IN PROGRESS";
  position: absolute; top: 4px; right: 6px;
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em;
  color: #b45309;
}
.cp-tile-completed { background: #f0fdf4; }
.cp-tile-completed::after {
  content: "✓";
  position: absolute; top: 4px; right: 6px;
  font-size: 12px; color: #059669;
}
.cp-tile-grade {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #059669;
  background: #d1fae5;
  border-radius: 8px;
  padding: 1px 6px;
}
.cp-tile-level {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 3px;
  padding: 1px 4px;
}
.cp-tile-level[data-level="honors"]          { background: #fef3c7; color: #92400e; }
.cp-tile-level[data-level="ap"]              { background: #dbeafe; color: #1e40af; }
.cp-tile-level[data-level="dual_enrollment"] { background: #ede9fe; color: #5b21b6; }

/* === Transcript: sidebar GPA panel === */
.cp-gpa-panel { padding-top: 8px; border-top: 1px solid var(--cp-border); margin-top: 12px; }
.cp-gpa-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.cp-gpa-row:first-child { font-weight: 600; }
.cp-gpa-credits { border-top: 1px dashed #e5e7eb; margin-top: 6px; padding-top: 6px; color: var(--cp-muted); }
.cp-gpa-by-year { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f3f4f6; }
.cp-gpa-year-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 11px; color: var(--cp-muted); }

/* === Transcript print view: hidden on screen always; shown only in print
       (and only when html.cp-print-transcript is set, per course-plan-print.css).
       !important defends against any theme rule that might raise specificity. === */
.cp-transcript { display: none !important; }

/* === Elective placeholder tiles ===
   Generated by prefill for each unit of required elective credit. Distinct
   look so students can see "pick a course here". Click → opens picker →
   chosen course replaces this tile in place. */
.cp-tile-placeholder {
  background: repeating-linear-gradient(45deg, #fafafa 0 8px, #f3f4f6 8px 16px);
  border-style: dashed;
  border-color: var(--cp-muted);
  cursor: pointer;
}
.cp-tile-placeholder .cp-tile-name {
  color: var(--cp-muted);
  font-style: italic;
  font-weight: 500;
}
.cp-tile-placeholder .cp-tile-name::after {
  content: " — click to choose";
  font-size: 10px;
  font-style: italic;
  color: var(--cp-muted);
  font-weight: 400;
  letter-spacing: 0;
}
.cp-tile-placeholder .cp-tile-meta { opacity: 0.7; }
.cp-tile-placeholder:hover {
  border-color: var(--cp-primary);
  background: repeating-linear-gradient(45deg, #f0f7ff 0 8px, #e6effb 8px 16px);
}

/* === Sidebar: state reference (legal note + source URL) === */
.cp-state-note { padding-top: 8px; border-top: 1px solid var(--cp-border); margin-top: 14px; font-size: 11px; color: var(--cp-muted); line-height: 1.5; }
.cp-state-note h4 { font-size: 11px; }
/* pre-line honors the line breaks the admin entered in the Legal note textarea
   (newlines render as breaks) while still wrapping long lines normally. */
.cp-state-note-text { margin: 4px 0; white-space: pre-line; }
.cp-state-note-link { display: inline-block; margin-top: 4px; color: var(--cp-primary); text-decoration: none; font-weight: 500; }
.cp-state-note-link:hover { text-decoration: underline; }

/* === Legal disclaimer (wizard page 1 + planner sidebar page 2) ===
   Screen-only; hidden in print (course-plan-print.css). */
.cp-disclaimer { font-size: 11px; color: var(--cp-muted); line-height: 1.5; }
/* Page 1: small, centered under the wizard. */
.cp-wizard-disclaimer { display: block; max-width: 620px; margin: 28px auto 0; text-align: center; }
/* Page 2: bottom of the sidebar/state column, matching the state-reference note. */
.cp-sidebar-disclaimer { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--cp-border); }

/* ============================================================
   Host-theme button defense.
   Some host themes (and page-builders) style EVERY <button> with a
   gradient fill + white text + text-shadow on :hover/:focus. Inside the
   planner that overrides our controls and makes labels unreadable
   (Change state, Print, CSV, Browse catalog, Create custom course, …).
   The non-hover state is unaffected, so we only need to re-assert
   :hover/:focus. Scoped under #cp-app with !important to beat the theme;
   ID specificity here outranks the theme's bare `button:hover`.

   Default: every button gets a safe, readable light-tint hover. The rules
   that follow restore the brand fill for primary CTAs and the red accent
   for danger / delete buttons (higher specificity → they win). === */
#cp-app button:hover,
#cp-app button:focus {
  background-image: none !important;
  background-color: #eef5ff !important;
  color: #1f2937 !important;
  text-shadow: none !important;
}

/* Primary CTAs keep the brand fill + white text */
#cp-app .cp-toolbar-actions button.primary:hover,   #cp-app .cp-toolbar-actions button.primary:focus,
#cp-app .cp-btn-primary:hover,                       #cp-app .cp-btn-primary:focus,
#cp-app .cp-modal-card form button.primary:hover,    #cp-app .cp-modal-card form button.primary:focus,
#cp-app .cp-modal-actions button.primary:hover,      #cp-app .cp-modal-actions button.primary:focus,
#cp-app .cp-wizard-actions button.primary:hover,     #cp-app .cp-wizard-actions button.primary:focus {
  background-color: #2c5282 !important;
  color: #fff !important;
}

/* Danger buttons (Remove / Discard) keep a red identity */
#cp-app .cp-modal-actions button.danger:hover,       #cp-app .cp-modal-actions button.danger:focus {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #dc2626 !important;
}

/* Per-student delete (trash) keeps its red affordance */
#cp-app .cp-student-menu-delete:hover,               #cp-app .cp-student-menu-delete:focus,
#cp-app .cp-wizard-student-delete:hover,             #cp-app .cp-wizard-student-delete:focus {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

/* "Create custom course" nav item stays primary-tinted, not flat gray text */
#cp-app .cp-nav-item-custom:hover,                   #cp-app .cp-nav-item-custom:focus {
  background-color: #eef2ff !important;
  color: var(--cp-primary) !important;
}

/* ============================================================
   Keyboard focus rings — visible :focus-visible outline for
   keyboard users (mouse clicks don't trigger :focus-visible, so
   this doesn't add rings on pointer interaction). === */
#cp-app a:focus-visible,
#cp-app button:focus-visible,
#cp-app input:focus-visible,
#cp-app select:focus-visible,
#cp-app textarea:focus-visible,
#cp-app .cp-tile:focus-visible,
#cp-app .cp-req-row:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Wizard "Building your plan…" spinner === */
.cp-wizard-building { display: flex; align-items: center; gap: 10px; }
.cp-spinner {
  width: 18px; height: 18px; flex: 0 0 auto;
  border: 2px solid var(--cp-border);
  border-top-color: var(--cp-primary);
  border-radius: 50%;
  animation: cp-spin 0.7s linear infinite;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cp-spinner { animation-duration: 1.6s; } }

/* ─────────────────────────────────────────────────────────────────────────
   "Create your own" custom-plan flow: wizard entry, Custom pill, requirements
   dialog. (Feature: define-your-own subjects/requirements or blank planner.)
   ───────────────────────────────────────────────────────────────────────── */
.cp-custom-start { display:flex; align-items:center; justify-content:space-between; gap:14px; width:100%; text-align:left; cursor:pointer;
  background:linear-gradient(180deg,#f4f9ff,#eef5fc); border:1.5px solid #cfe0f2; border-radius:12px; padding:15px 18px; margin:2px 0 0;
  transition:border-color .12s, box-shadow .12s, transform .12s; }
.cp-custom-start:hover { border-color:var(--cp-primary); box-shadow:0 6px 18px rgba(49,130,206,.14); transform:translateY(-1px); }
.cp-custom-start-text { display:flex; flex-direction:column; gap:3px; }
.cp-custom-start-text strong { font-size:16px; color:#1f5f9e; }
.cp-custom-start-text span { font-size:13px; color:var(--cp-muted); }
.cp-custom-start-arrow { font-size:20px; color:var(--cp-primary); flex:0 0 auto; }
.cp-wizard-or { display:flex; align-items:center; gap:12px; margin:16px 0 12px; color:var(--cp-muted); font-size:13px; }
.cp-wizard-or::before, .cp-wizard-or::after { content:""; flex:1; height:1px; background:var(--cp-border); }

.cp-state-pill-custom { background:#ede9fe; color:#6d28d9; }
.cp-edit-reqs { background:none; border:1px solid var(--cp-border); border-radius:6px; padding:4px 10px; font-size:12px; color:#374151; cursor:pointer; margin-left:6px; }
.cp-edit-reqs:hover { background:#f3f4f6; border-color:var(--cp-primary); color:var(--cp-primary); }

.cp-reqdialog { width:min(94vw,560px); max-height:88vh; display:flex; flex-direction:column; padding:0; }
.cp-reqdialog-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:20px 24px 14px; border-bottom:1px solid var(--cp-border); }
.cp-reqdialog-head h3 { margin:0; font-size:18px; font-weight:700; color:#111827; }
.cp-reqdialog-sub { margin:5px 0 0; font-size:13px; color:var(--cp-muted); line-height:1.5; }
.cp-reqdialog-body { padding:16px 24px; overflow-y:auto; }
.cp-reqtable { width:100%; border-collapse:collapse; }
.cp-reqtable th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--cp-muted); font-weight:700; padding:0 0 8px; }
.cp-reqtable th:nth-child(2) { width:90px; }
.cp-reqtable th:nth-child(3) { width:30px; }
.cp-reqtable td { padding:6px 0; border-top:1px solid #f1f4f8; vertical-align:middle; }
.cp-reqtable-subject { display:flex; align-items:center; gap:9px; font-size:14px; color:#28324a; font-weight:600; }
.cp-reqtable-dot { width:11px; height:11px; border-radius:3px; flex:0 0 auto; }
.cp-reqdialog .cp-reqtable-credits { width:74px; margin:0; padding:6px 8px; border:1px solid var(--cp-border); border-radius:6px; font-size:14px; box-sizing:border-box; }
.cp-reqtable-remove { background:none; border:none; font-size:18px; line-height:1; color:#9ca3af; cursor:pointer; padding:2px 6px; border-radius:4px; }
.cp-reqtable-remove:hover { background:#fef2f2; color:#ef4444; }
.cp-reqdialog-add { display:flex; gap:8px; margin:14px 0 0; }
.cp-reqdialog .cp-reqdialog-add input { flex:1; margin:0; padding:8px 10px; border:1px solid var(--cp-border); border-radius:6px; font-size:14px; box-sizing:border-box; }
.cp-reqdialog-note { margin:12px 0 0; font-size:12px; color:var(--cp-muted); line-height:1.5; }
.cp-reqdialog-foot { display:flex; justify-content:flex-end; gap:10px; padding:14px 24px; border-top:1px solid var(--cp-border); background:#fafbff; }
.cp-reqdialog-foot-create { display:flex; gap:10px; }
.cp-btn-ghost { background:#fff; border:1px solid var(--cp-border); color:var(--cp-muted); }
.cp-btn-ghost:hover { background:#f3f4f6; color:#374151; }

/* Deactivated subject rows in the requirements dialog: greyed + struck through,
   but the Restore button stays fully legible/clickable. */
.cp-reqrow-off .cp-reqtable-subject, .cp-reqrow-off .cp-reqtable-credits { opacity: 0.4; }
.cp-reqrow-off .cp-reqtable-subject span:last-child { text-decoration: line-through; }
.cp-reqtable-action { white-space: nowrap; text-align: right; }
.cp-reqtable-restore { background: none; border: 1px solid var(--cp-border); border-radius: 5px; font-size: 11px; font-weight: 600; color: var(--cp-primary); cursor: pointer; padding: 3px 9px; }
.cp-reqtable-restore:hover { background: #eef5fc; border-color: var(--cp-primary); }

/* "custom" marker shown next to a state pill when a state plan's requirements
   have been overridden (Edit requirements on a state plan). */
.cp-state-pill-mark { display:inline-block; padding:3px 8px; border-radius:999px; background:#ede9fe; color:#6d28d9; font-size:11px; font-weight:600; margin-left:-2px; }

/* Search-states box styled to match (and sit as a peer to) the "Create your own"
   card: same border/radius/gradient + a large, card-like footprint. */
.cp-wizard-step input.cp-state-search {
  width: 100%; box-sizing: border-box; margin: 0 0 12px;
  padding: 18px; font-size: 16px;
  border: 1.5px solid #cfe0f2; border-radius: 12px;
  background: linear-gradient(180deg, #f4f9ff, #eef5fc);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.cp-wizard-step input.cp-state-search::placeholder { color: var(--cp-muted); }
.cp-wizard-step input.cp-state-search:focus { outline: none; border-color: var(--cp-primary); background: #fff; box-shadow: 0 0 0 3px rgba(49, 130, 206, .12); }

/* Credits-per-semester selector at the top of the requirements dialog. */
.cp-reqdialog-semval { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 16px; padding:0 0 14px; border-bottom:1px solid var(--cp-border); }
.cp-reqdialog-semval label { font-size:13px; font-weight:600; color:#374151; }
.cp-reqdialog .cp-reqdialog-semval select { width:auto; margin:0; padding:7px 10px; border:1px solid var(--cp-border); border-radius:6px; font-size:14px; background:#fff; box-sizing:border-box; }
.cp-reqdialog-semval-help { font-size:12px; color:var(--cp-muted); }

/* Running total credits in the requirements-dialog footer (left of the buttons). */
.cp-reqdialog-foot { justify-content: space-between; align-items: center; }
.cp-reqdialog-total { font-size: 14px; color: var(--cp-muted); white-space: nowrap; }
.cp-reqdialog-total strong { color: #111827; font-size: 16px; }
.cp-reqdialog-foot-actions { display: flex; gap: 10px; align-items: center; }

/* Student switcher: cap the menu height and scroll the student list internally so
   a long roster doesn't run off-screen; the label + "Add another student" stay put. */
.cp-student-menu { display: flex; flex-direction: column; max-height: min(70vh, 440px); }
.cp-student-menu .cp-student-menu-section:not(.cp-student-menu-section-divided) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cp-student-menu-list { overflow-y: auto; min-height: 0; }
.cp-student-menu-section-divided { flex: 0 0 auto; }

/* "My Courses" picker section: created courses, click to add, × to remove from library. */
.cp-nav-dot-mine { background: #7c3aed; }
.cp-mycourse-card { position: relative; padding: 0; cursor: default; }
.cp-mycourse-add { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 14px 34px 14px 14px; background: none; border: none; border-radius: 8px; cursor: pointer; text-align: left; }
.cp-mycourse-add:hover { background: none; }
.cp-mycourse-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--cp-muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s, background .1s, color .1s; }
.cp-mycourse-card:hover .cp-mycourse-remove, .cp-mycourse-remove:focus-visible { opacity: 0.7; }
.cp-mycourse-remove:hover { opacity: 1 !important; background: #fee2e2; color: #b91c1c; }
@media (hover: none) { .cp-mycourse-remove { opacity: 0.6; } }

/* My Courses grouped by subject. */
.cp-mycourse-group + .cp-mycourse-group { margin-top: 18px; }
.cp-mycourse-group-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cp-muted); margin: 0 0 8px; }
