/* ── Grades theme ───────────────────────────────────────────────────────
   Light mode: light blue. Dark mode: a dark navy palette close to zenow's
   sidebar (--sidebar-bg in main.css), with .ng-header/.ng-nav bumped to a
   lighter shade of it (below) so they read as distinct from the sidebar
   rather than blending into it. Everything else (buttons, inputs, section
   titles, empty-state, .load-dot) is inherited from main.css's token-driven
   components -- only the palette is overridden here. */

:root {
  --bg:           #EAF2FE;
  --surface:      #FFFFFF;
  --surface2:     #E1EBFC;
  --surface3:     #D2E2FA;
  --border:       #C9DDF6;
  --border2:      #AFC9EC;
  --primary:      #2F6FED;
  --primary-dim:  #2558C5;
  --primary-glow: rgba(47,111,237,0.10);
}

:root[data-theme="dark"] {
  --bg:           #0E1729;
  --surface:      #14213D;
  --surface2:     #182A4A;
  --surface3:     #1D3157;
  --border:       #24365C;
  --border2:      #2E4272;
  --primary:      #7EA6FF;
  --primary-dim:  #5C89E0;
  --primary-glow: rgba(126,166,255,0.14);
}

/* .ng-header/.ng-nav default to var(--surface), which in dark mode is the
   same navy as zenow's --sidebar-bg (main.css) -- was intentional at first
   (a "flows out of the sidebar" look) but reads as no boundary between the
   sidebar and the header/nav column. A lighter blue from the same palette
   (--surface3) keeps it on-brand while actually separating the two. */
:root[data-theme="dark"] .ng-header,
:root[data-theme="dark"] .ng-nav {
  background: var(--surface3);
}

#ng-loading {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.625rem;
  background: var(--bg);
}

/* ── App shell: zenow's own sidebar + a scrollable content column ────────
   Same #screen-app/.sidebar/.main split as the main app (main.css), reused
   here so Grades feels like a section of zenow, not a separate product. */
#ng-app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.ng-content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.ng-main { flex: 1; overflow-y: auto; max-width: 47.5rem; margin: 0 auto; padding: 1.75rem 1.5rem 3.75rem; width: 100%; }

/* Loading-screen scale of the shared .grades-wordmark-hero (main.css):
   bigger, sitting above the spinner -- same stacking as zenow's own
   #screen-loading .loading-logo. The crisp per-letter text-shadow (not a
   blurred filter -- filter+gradient-clip-text rasterizes soft) is what
   gives the "shadowed" look without going blurry. */
.ng-loading-logo {
  display: flex;
  font-size: 2.625rem; letter-spacing: -1.5px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Same fixed height as .sidebar-header (main.css) so the two header rows'
   bottom borders line up exactly where the sidebar meets this column,
   regardless of what each one's content naturally measures. */
.ng-header {
  display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
  height: 4.625rem; box-sizing: border-box; padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ng-header-wordmark { font-size: 1.625rem; }

.ng-page-title { font-size: 1.25rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; }

/* Skeleton loading placeholders -- a plain shimmering bar shown in place of
   a view's real content while its data fetches. Reuses main.css's own
   `pulse` keyframe (already loaded here) rather than defining a near-
   identical one. Bar geometry is set per call site via inline width/height
   (see grades.js's ngSkel* helpers), so this stays a single rule. */
.ng-skel {
  display: block;
  background: var(--surface2);
  border-radius: 0.3125rem;
  animation: pulse 1.3s ease-in-out infinite;
}
.ng-skel-card { pointer-events: none; }

.ng-subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }

.ng-subject-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
  text-align: left;
}
.ng-subject-card:hover { box-shadow: var(--shadow-sm); }
.ng-subject-card:active { transform: scale(0.98); }
.ng-subject-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ng-subject-name { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.ng-subject-card-avg { font-size: 1.375rem; font-weight: 800; color: var(--text); }
.ng-subject-card-meta { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--text-muted); }
.ng-trend-up { color: var(--green); }
.ng-trend-down { color: var(--red); }

.ng-subject-back {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.8125rem; font-weight: 600; padding: 0.25rem 0; margin-bottom: 0.75rem; cursor: pointer;
}
.ng-subject-back:hover { color: var(--text); }

.ng-subject-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.375rem; }
.ng-subject-title { font-size: 1.375rem; font-weight: 800; color: var(--text); }
.ng-subject-average { font-size: 1.375rem; font-weight: 800; color: var(--primary); }

.ng-category {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.875rem; margin-bottom: 0.625rem;
  background: var(--surface);
}
.ng-category-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.375rem; }
.ng-category-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.ng-category-stats { font-size: 0.75rem; color: var(--text-muted); }
.ng-category-delete { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0.125rem; }
.ng-category-delete:hover { color: var(--red); }

.ng-entry-row {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0; font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}
.ng-entry-row:first-of-type { border-top: none; }
.ng-entry-label { flex: 1; color: var(--text); }
.ng-entry-score { font-weight: 700; color: var(--text); }
.ng-entry-delete { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0.125rem; flex-shrink: 0; }
.ng-entry-delete:hover { color: var(--red); }
/* Admission goal's target-score grid -- an .ng-entry-row whose "score" slot
   is a live editable input instead of static text, colored red->green via
   inline style from ngTargetColor() in grades.js. */
.ng-test-actual-input { width: 4.5rem; text-align: right; flex-shrink: 0; transition: background 0.15s var(--ease); }

.ng-add-entry-form { display: flex; gap: 0.375rem; margin-top: 0.5rem; }
.ng-add-entry-form input { padding: 0.375rem 0.5625rem; font-size: 0.75rem; }
.ng-add-entry-form input[data-role="label"] { flex: 1; }
.ng-add-entry-form input[data-role="score"] { width: 5.5rem; }
.ng-add-entry-form button { padding: 0.25rem 0.625rem; }

.ng-inline-form { display: flex; gap: 0.5rem; margin-top: 0.625rem; flex-wrap: wrap; }
.ng-inline-form input, .ng-inline-form select { width: auto; flex: 1; min-width: 7.5rem; }
.ng-target-hint { font-size: 0.71875rem; color: var(--text-dim); margin-top: 0.375rem; line-height: 1.4; }

/* School search combobox -- a plain text input + an absolutely-positioned
   results list underneath, no library, this app has no other combobox to
   match. .ng-school-combobox itself is the positioning context so the
   list sits directly under the input regardless of where the form lives
   (Settings vs the Walkthrough modal). */
.ng-school-combobox { position: relative; }
.ng-school-results {
  position: absolute; top: calc(100% + 0.25rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 13.75rem; overflow-y: auto; z-index: 20;
}
.ng-school-result {
  padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.8125rem;
  display: flex; align-items: baseline; gap: 0.375rem;
}
.ng-school-result-country { color: var(--text-muted); font-size: 0.71875rem; }
.ng-school-result:hover, .ng-school-result.active { background: var(--surface2); }
.ng-school-result-empty { padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: var(--text-muted); }

.ng-locked { padding: 0.875rem; border-radius: var(--radius); background: var(--surface2); text-align: center; }
.ng-locked p { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.625rem; }

.ng-result { margin-top: 0.625rem; padding: 0.625rem 0.875rem; border-radius: var(--radius); background: var(--primary-glow); font-size: 0.8125rem; color: var(--text); }
.ng-result.ng-infeasible { background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ── Nav bar ────────────────────────────────────────────────────────────── */
.ng-nav {
  display: flex; gap: 0.25rem; padding: 0 1.5rem; overflow-x: auto; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.ng-nav-link {
  padding: 0.75rem 0.625rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.ng-nav-link:hover { color: var(--text); }
.ng-nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Risk banner ────────────────────────────────────────────────────────── */
.ng-risk-banner { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.ng-risk-card {
  display: flex; align-items: flex-start; gap: 0.625rem;
  padding: 0.75rem 0.875rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
}
.ng-risk-card.watch { background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.ng-risk-card-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.ng-risk-card-reasons { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }

/* ── Goals page ─────────────────────────────────────────────────────────── */
.ng-goals-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.125rem; flex-wrap: wrap; }
.ng-goals-header .ng-page-title { margin-bottom: 0.25rem; }
.ng-goals-hint { font-size: 0.78125rem; color: var(--text-muted); line-height: 1.5; max-width: 32.5rem; }

.ng-goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.ng-goal-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
.ng-goal-card-top { display: flex; align-items: center; gap: 0.5rem; }
.ng-goal-card-top .subject-dot { width: 0.5625rem; height: 0.5625rem; }
.ng-goal-name { flex: 1; min-width: 0; font-size: 0.875rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng-goal-discuss-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 1.375rem; height: 1.375rem; padding: 0; border: none; background: none; cursor: pointer;
}
.ng-goal-discuss-btn::after {
  content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--amber); transition: transform 0.15s;
}
.ng-goal-discuss-btn:hover::after { transform: scale(1.35); }

.ng-goal-avg { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.ng-goal-gap { font-size: 0.75rem; font-weight: 600; }
.ng-goal-gap-none { color: var(--text-dim); font-weight: 500; }
.ng-goal-gap-above { color: var(--green); }
.ng-goal-gap-close { color: var(--amber); }
.ng-goal-gap-below { color: var(--red); }

.ng-goal-bar-wrap { position: relative; height: 0.375rem; border-radius: 6.1875rem; background: var(--surface2); overflow: visible; }
.ng-goal-bar { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 6.1875rem; background: var(--text-dim); transition: width 0.3s; }
.ng-goal-bar.ng-goal-gap-above { background: var(--green); }
.ng-goal-bar.ng-goal-gap-close { background: var(--amber); }
.ng-goal-bar.ng-goal-gap-below { background: var(--red); }
.ng-goal-bar-target {
  position: absolute; top: -0.1875rem; bottom: -0.1875rem; width: 0.125rem; background: var(--text);
  transform: translateX(-1px); border-radius: 0.0625rem;
}

.ng-goal-input-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.125rem; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.ng-goal-input-row input { width: 4.75rem; text-align: right; }

/* ── Charts (hand-rolled inline SVG, no external library) ──────────────── */
.ng-chart { margin: 0.25rem 0 1.375rem; }
.ng-chart svg { width: 100%; height: auto; display: block; }
.ng-chart-empty { font-size: 0.75rem; color: var(--text-dim); padding: 1.25rem 0; text-align: center; }

/* ── Toggle switch ──────────────────────────────────────────────────────── */
.ng-toggle { position: relative; display: inline-block; width: 2.5rem; height: 1.5rem; flex-shrink: 0; }
.ng-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ng-toggle-slider {
  position: absolute; inset: 0; background: var(--border2); border-radius: 62.4375rem;
  transition: background 0.15s var(--ease);
}
.ng-toggle-slider::before {
  content: ''; position: absolute; width: 1.125rem; height: 1.125rem; left: 0.1875rem; top: 0.1875rem;
  background: #fff; border-radius: 50%; transition: transform 0.15s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ng-toggle input:checked + .ng-toggle-slider { background: var(--primary); }
.ng-toggle input:checked + .ng-toggle-slider::before { transform: translateX(16px); }

/* ── Terms & GPA ────────────────────────────────────────────────────────── */
.ng-term-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.625rem;
  padding: 0.625rem 0; border-top: 1px solid var(--border); font-size: 0.8125rem;
}
.ng-term-row:first-of-type { border-top: none; }
.ng-term-name { font-weight: 700; color: var(--text); }
.ng-term-name.current::after { content: '●'; color: var(--primary); font-size: 0.5rem; margin-left: 0.375rem; vertical-align: middle; }
.ng-term-actions { display: flex; gap: 0.25rem; }
.ng-gpa-readout { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.625rem; }
.ng-gpa-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.ng-gpa-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Review ─────────────────────────────────────────────────────────────── */
/* Rendered via renderZenoMarkdownNG now (real <h3-5>/<p>/<ul> elements), not
   raw textContent -- no white-space:pre-wrap needed, block spacing below
   does that job instead, and it'd otherwise double up around the tags. */
.ng-review-result {
  margin-top: 1rem; padding: 1rem 1.125rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.875rem; line-height: 1.6; color: var(--text);
}
.ng-review-result p { margin: 0; }
.ng-review-result p + p { margin-top: 0.75rem; }
.ng-review-result ul, .ng-review-result ol { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.ng-review-result li + li { margin-top: 0.25rem; }
.ng-review-result h3, .ng-review-result h4, .ng-review-result h5 {
  font-weight: 700; color: var(--text); line-height: 1.3;
  margin: 1.25rem 0 0.5rem;
}
.ng-review-result h3:first-child, .ng-review-result h4:first-child, .ng-review-result h5:first-child { margin-top: 0; }
.ng-review-result h3 { font-size: 1.0625rem; }
.ng-review-result h4 { font-size: 0.9375rem; }
.ng-review-result h5 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.ng-review-result strong { font-weight: 700; }
.ng-review-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.625rem; }

/* Trimmed Lists modal has no swipe-to-reveal, so the delete button (normally
   opacity:0 until hover/swipe in the main app) needs to just stay visible. */
#ng-modal-lists .list-item-delete { opacity: 1; transform: none; font-size: 1rem; }

/* ── Chrono, embedded: same .zeno-* classes/styles as zenow's own panel
   (main.css), just re-scoped from #screen-app.chrono-open to
   #ng-app.chrono-open since this is a different page shell. ──────────── */
#ng-app.chrono-open .zeno-panel { flex-basis: var(--zeno-w, 21.25rem); }
#ng-app.chrono-open .zeno-panel-inner { box-shadow: -4px 0 24px rgba(0,0,0,0.06); }
#ng-app.chrono-open #ng-btn-chrono { display: none; }

@media (max-width: 768px) {
  #ng-app.chrono-open .zeno-panel { width: 100%; transform: translateX(0); }
  #ng-app.chrono-open .zeno-panel-inner { box-shadow: none; }
  #ng-app.chrono-open #ng-chrono-backdrop { opacity: 1; pointer-events: auto; }
}
.ng-chat-toggle {
  position: fixed; right: 1.375rem; bottom: 1.375rem; z-index: 40;
  width: 3.25rem; height: 3.25rem; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(47,111,237,0.4);
  transition: transform 0.15s var(--ease);
}
.ng-chat-toggle:hover { transform: scale(1.06); }
.ng-chat-toggle:active { transform: scale(0.96); }

.ng-chat-panel {
  position: fixed; right: 1.375rem; bottom: 5.375rem; z-index: 41;
  width: 22.5rem; max-width: calc(100vw - 2rem); height: 30rem; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.ng-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ng-chat-close { background: none; border: none; color: var(--text-muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0.125rem 0.375rem; }
.ng-chat-close:hover { color: var(--text); }
.ng-chat-messages { flex: 1; overflow-y: auto; padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; }
.ng-chat-empty { font-size: 0.75rem; color: var(--text-dim); text-align: center; padding: 1.25rem 0.5rem; }
.ng-chat-msg { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: 0.875rem; font-size: 0.8125rem; line-height: 1.5; white-space: pre-wrap; }
.ng-chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 0.25rem; }
.ng-chat-msg.assistant { align-self: flex-start; background: var(--surface2); color: var(--text); border-bottom-left-radius: 0.25rem; }
.ng-chat-typing { display: flex; gap: 0.25rem; padding: 0 0.875rem 0.5rem; flex-shrink: 0; }
.ng-chat-typing span {
  width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--text-dim);
  animation: ng-typing-bounce 1s infinite ease-in-out;
}
.ng-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ng-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ng-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ng-chat-form { display: flex; gap: 0.5rem; padding: 0.625rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.ng-chat-form textarea {
  flex: 1; resize: none; max-height: 5.625rem; padding: 0.5rem 0.6875rem; font-size: 0.8125rem;
}
.ng-chat-form button { flex-shrink: 0; align-self: flex-end; }

/* ── Reports ────────────────────────────────────────────────────────────── */
.ng-report-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.125rem; align-items: center; }
.ng-report-term-select {
  margin-right: auto; padding: 0.4375rem 0.625rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 0.78125rem; font-weight: 600;
}
.ng-report-summary {
  padding: 0.875rem 1.125rem; margin-bottom: 1.125rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.ng-report-summary-title { font-weight: 700; color: var(--text); margin-bottom: 0.375rem; }
.ng-report-summary-stats { display: flex; flex-wrap: wrap; gap: 0.875rem; font-size: 0.78125rem; color: var(--text-muted); }
.ng-report-summary-stats strong { color: var(--primary); font-size: 0.875rem; }
.ng-report-content { font-size: 0.8125rem; }
.ng-report-subject { margin-bottom: 1.125rem; padding-bottom: 0.875rem; border-bottom: 1px solid var(--border); }
.ng-report-subject-head { display: flex; justify-content: space-between; font-weight: 700; color: var(--text); margin-bottom: 0.375rem; }
.ng-report-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.ng-report-table td { padding: 0.25rem 0; color: var(--text-muted); }
.ng-report-table td:last-child { text-align: right; color: var(--text); font-weight: 600; }

/* ── Stats & Badges ───────────────────────────────────────────────────────── */
.ng-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.625rem; margin-bottom: 1.375rem; }
.ng-stats-card {
  padding: 0.875rem 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
.ng-stats-value { font-size: 1.375rem; font-weight: 800; color: var(--primary); }
.ng-stats-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }

.ng-stats-streak-card {
  display: flex; align-items: center; gap: 0.875rem; width: 100%;
  padding: 0.875rem 1.125rem; margin-bottom: 1.375rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left;
  font-family: var(--font); transition: box-shadow 0.15s, transform 0.1s;
}
.ng-stats-streak-card:hover { box-shadow: var(--shadow-sm); }
.ng-stats-streak-card:active { transform: scale(0.99); }
.ng-stats-streak-card .streak-flame svg { width: 2.25rem; height: 2.25rem; }
.ng-stats-streak-count { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.ng-stats-streak-label { font-size: 0.78125rem; color: var(--text-muted); }

.ng-badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.ng-badge-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.375rem;
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
.ng-badge-share {
  position: absolute; top: 0.625rem; right: 0.625rem;
  width: 1.5rem; height: 1.5rem; padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.ng-badge-share svg { width: 0.8125rem; height: 0.8125rem; }
.ng-badge-share:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.ng-badge-icon {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.ng-badge-icon svg { width: 1.125rem; height: 1.125rem; }
.ng-badge-card.premium .ng-badge-icon { background: color-mix(in srgb, #F5B301 18%, transparent); color: #B8860B; }
.ng-badge-name { font-size: 0.84375rem; font-weight: 700; color: var(--text); }
.ng-badge-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.ng-badge-card.locked { opacity: 0.5; }
.ng-badge-card.locked.premium { opacity: 0.7; }
.ng-badge-upgrade { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-decoration: none; margin-top: 0.125rem; }
.ng-badge-upgrade:hover { text-decoration: underline; }

/* ── University goal (cumulative, degree-wide) ─────────────────────────── */
.ng-ug-card:empty { display: none; }
.ng-ug-card { margin-bottom: 0.75rem; }

.ng-ug-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  padding: 1.125rem 1.25rem; border-radius: var(--radius); border: 1px dashed var(--border2);
  background: var(--surface2);
}
.ng-ug-empty-title { font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.ng-ug-empty-sub { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; max-width: 34rem; }

.ng-ug-set {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 1.125rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface);
}
/* Reuses the Study Timer's own SVG progress-ring markup+CSS verbatim
   (.study-timer-ring* in main.css, already loaded on this page) rather than
   a new implementation -- just resized down here and repurposed to show
   years-into-program instead of a countdown. */
.ng-ug-ring-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.ng-ug-ring-col .study-timer-ring-wrap { width: 5.5rem; height: 5.5rem; margin: 0; }
.ng-ug-ring-col .study-timer-ring { width: 100%; height: 100%; }
/* Override the Study Timer's own red (a countdown/urgency color) -- this
   ring shows plain positive progress through the program, not a countdown. */
.ng-ug-ring-col .study-timer-ring-fg { stroke: var(--accent); }
.ng-ug-ring-label { font-size: 0.6875rem; font-weight: 700; color: var(--text-muted); margin-top: 0.25rem; white-space: nowrap; }
.ng-ug-main { flex: 1; min-width: 12rem; display: flex; flex-direction: column; gap: 0.25rem; }
.ng-ug-title-row { display: flex; align-items: center; gap: 0.5rem; }
.ng-ug-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ng-ug-school { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; margin: 0.125rem 0 0.25rem; }
.ng-ug-standing { font-size: 1.375rem; font-weight: 800; color: var(--text); }
.ng-ug-standing .ng-ug-arrow { color: var(--text-dim); font-weight: 500; margin: 0 0.375rem; }
.ng-ug-gap { font-size: 0.8125rem; font-weight: 600; }
.ng-ug-required { font-size: 0.78125rem; color: var(--text-muted); line-height: 1.45; }
.ng-ug-required.ng-ug-infeasible { color: var(--red); font-weight: 600; }
.ng-ug-actions { display: flex; gap: 0.5rem; margin-top: 0.375rem; }

/* Admission (prospective-mode) goal card's own detail rows -- tests
   recorded / next deadline / activity count have no equivalent in the
   enrolled card, so unlike .ng-ug-required these get a small icon each. */
.ng-ag-rows { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.25rem; }
.ng-ag-row { display: flex; align-items: center; gap: 0.4375rem; font-size: 0.78125rem; color: var(--text-muted); line-height: 1.35; }
.ng-ag-row-icon { flex-shrink: 0; width: 1rem; height: 1rem; display: flex; align-items: center; justify-content: center; color: var(--accent); opacity: 0.85; }
.ng-ag-row-icon svg { width: 100%; height: 100%; }

/* ── University goal walkthrough modal ──────────────────────────────────── */
.ng-wt-dots { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.125rem; }
.ng-wt-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--border2); transition: background 0.15s, transform 0.15s; }
.ng-wt-dot.active { background: var(--primary); transform: scale(1.25); }
.ng-wt-dot.done { background: var(--primary); opacity: 0.5; }

.ng-wt-pane { display: none; }
.ng-wt-pane.active { display: block; animation: fadeIn 0.2s var(--ease); }
.ng-wt-step-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.ng-wt-step-hint { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.875rem; }

.ng-wt-standing { display: flex; flex-direction: column; gap: 0.625rem; }
.ng-wt-standing-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.ng-wt-standing-row:last-child { border-bottom: none; }
.ng-wt-standing-row-label { color: var(--text-muted); }
.ng-wt-standing-row-value { font-weight: 700; color: var(--text); }
.ng-wt-standing-banner { padding: 0.75rem 0.875rem; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; margin-top: 0.5rem; }
.ng-wt-standing-banner.on-track { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.ng-wt-standing-banner.at-risk { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

.ng-wt-suggestions { display: flex; flex-direction: column; gap: 0.5rem; max-height: 18rem; overflow-y: auto; }
.ng-wt-suggestion-row { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); background: var(--surface2); }
.ng-wt-suggestion-name { flex: 1; min-width: 0; font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng-wt-suggestion-current { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.ng-wt-suggestion-arrow { color: var(--text-dim); }
.ng-wt-suggestion-input { width: 4.5rem; text-align: right; flex-shrink: 0; }

@media print {
  .sidebar, .ng-header, .ng-nav, .ng-report-actions, .ng-chat-toggle, .ng-chat-panel { display: none !important; }
  body, .ng-main { background: #fff !important; color: #000 !important; }
  .ng-report-subject { break-inside: avoid; }
}

@media (max-width: 768px) {
  .ng-header-wordmark { font-size: 1.25rem; }
}

@media (max-width: 600px) {
  .ng-main { padding: 1.25rem 1rem 3rem; }
  .ng-subject-grid { grid-template-columns: 1fr 1fr; }
  .ng-nav { padding: 0 0.75rem; }
  .ng-chat-panel { right: 1rem; left: 1rem; width: auto; bottom: 4.875rem; }
  .ng-chat-toggle { right: 1rem; bottom: 1rem; }
}
