/* Study-OS Emnebase — Official HK-dir DBH Grade Stats, Interactive Charts, Comparator & Pensum Finder */

:root {
  --grade-a: #10b981;
  --grade-a-ink: #065f46;
  --grade-a-soft: rgba(16, 185, 129, 0.14);
  --grade-b: #14b8a6;
  --grade-b-ink: #115e59;
  --grade-b-soft: rgba(20, 184, 166, 0.14);
  --grade-c: #3b82f6;
  --grade-c-ink: #1d4ed8;
  --grade-c-soft: rgba(59, 130, 246, 0.13);
  --grade-d: #f59e0b;
  --grade-d-ink: #92400e;
  --grade-d-soft: rgba(245, 158, 11, 0.16);
  --grade-e: #f97316;
  --grade-e-ink: #9a3412;
  --grade-e-soft: rgba(249, 115, 22, 0.15);
  --grade-f: #ef4444;
  --grade-f-ink: #b91c1c;
  --grade-f-soft: rgba(239, 68, 68, 0.13);
  --exam-home: #0d9488;
  --exam-home-ink: #0f5f58;
  --exam-home-soft: rgba(13, 148, 136, 0.13);
  --exam-school: #2563eb;
  --exam-school-ink: #1d4ed8;
  --exam-school-soft: rgba(37, 99, 235, 0.12);
  --exam-portfolio: #7c3aed;
  --exam-portfolio-ink: #6d28d9;
  --exam-portfolio-soft: rgba(124, 58, 237, 0.12);
  --exam-oral: #d97706;
  --exam-oral-ink: #92400e;
  --exam-oral-soft: rgba(217, 119, 6, 0.14);
  --exam-assignment: #e11d48;
  --exam-assignment-ink: #be123c;
  --exam-assignment-soft: rgba(225, 29, 72, 0.12);
  --exam-other: #475569;
  --exam-other-ink: #334155;
  --exam-other-soft: rgba(71, 85, 105, 0.11);
}

:root[data-theme="dark"],
html[data-theme="dark"] {
  --grade-a-ink: #6ee7b7;
  --grade-a-soft: rgba(16, 185, 129, 0.2);
  --grade-b-ink: #5eead4;
  --grade-b-soft: rgba(20, 184, 166, 0.2);
  --grade-c-ink: #93c5fd;
  --grade-c-soft: rgba(59, 130, 246, 0.2);
  --grade-d-ink: #fcd34d;
  --grade-d-soft: rgba(245, 158, 11, 0.2);
  --grade-e-ink: #fdba74;
  --grade-e-soft: rgba(249, 115, 22, 0.2);
  --grade-f-ink: #fca5a5;
  --grade-f-soft: rgba(239, 68, 68, 0.2);
  --exam-home: #2dd4bf;
  --exam-home-ink: #5eead4;
  --exam-home-soft: rgba(45, 212, 191, 0.18);
  --exam-school: #60a5fa;
  --exam-school-ink: #93c5fd;
  --exam-school-soft: rgba(96, 165, 250, 0.18);
  --exam-portfolio: #a78bfa;
  --exam-portfolio-ink: #c4b5fd;
  --exam-portfolio-soft: rgba(167, 139, 250, 0.18);
  --exam-oral: #fbbf24;
  --exam-oral-ink: #fcd34d;
  --exam-oral-soft: rgba(251, 191, 36, 0.19);
  --exam-assignment: #fb7185;
  --exam-assignment-ink: #fda4af;
  --exam-assignment-soft: rgba(251, 113, 133, 0.18);
  --exam-other: #94a3b8;
  --exam-other-ink: #cbd5e1;
  --exam-other-soft: rgba(148, 163, 184, 0.18);
}

/* Wider, modern layout exclusively for Emnebase (never modifying seo.css) */
.seo-shell {
  max-width: 1120px;
}

body.has-compare-bar {
  padding-bottom: 92px;
}

/* Hero KPI Strip */
.eb-hero-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.eb-hero-kpi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.eb-hero-kpi strong {
  font-weight: 680;
}
.eb-hero-kpi.is-accent {
  background: var(--grade-a-soft);
  border-color: color-mix(in srgb, var(--grade-a) 35%, transparent);
  color: var(--grade-a-ink);
}

/* Controls, Search & Instant Autocomplete */
.eb-controls {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
}
.eb-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.eb-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  align-items: center;
}
.eb-search-icon {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
}
.eb-search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 38px 10px 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.eb-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.eb-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}
.eb-search-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.eb-search-clear:hover {
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  color: var(--ink);
}
.eb-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  padding: 6px;
  display: grid;
  gap: 3px;
  max-height: 360px;
  overflow-y: auto;
}
:root[data-theme="dark"] .eb-autocomplete,
html[data-theme="dark"] .eb-autocomplete {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.52);
}
.eb-ac-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 110ms ease, border-color 110ms ease;
}
.eb-ac-item:hover,
.eb-ac-item.is-active {
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.eb-ac-left {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.eb-ac-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.eb-ac-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eb-ac-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.eb-ac-grade {
  font-size: 11.5px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 999px;
}
.eb-ac-fail {
  font-size: 11px;
  color: var(--muted);
}

.eb-select {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  max-width: 100%;
}
.eb-select-format {
  min-width: 158px;
}
.eb-select-scale {
  min-width: 126px;
}
.eb-share-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Filter Pills (University + Major) */
.eb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.eb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}
.eb-pill:hover {
  border-color: var(--accent);
}
.eb-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .eb-pill.active,
html[data-theme="dark"] .eb-pill.active {
  color: #091512;
}
.eb-pill-cnt {
  opacity: 0.78;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.eb-pill.active .eb-pill-cnt {
  opacity: 0.92;
}
.eb-pill-practice.active {
  background: #047857;
  border-color: #047857;
  color: #fff;
}
:root[data-theme="dark"] .eb-pill-practice.active,
html[data-theme="dark"] .eb-pill-practice.active {
  background: #10b981;
  border-color: #10b981;
  color: #062118;
}
.eb-major-pills {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.eb-major-pill {
  font-size: 12px;
  padding: 5px 10px;
  background: var(--panel-alt);
}
.eb-major-pill.is-zero {
  opacity: 0.68;
}
.eb-major-pill.is-zero .eb-pill-cnt {
  opacity: 1;
}

/* Live Summary Strip */
.eb-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.eb-summary-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: var(--muted);
}
.eb-sum-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.eb-sum-item strong {
  color: var(--ink);
}
.eb-sum-sep {
  opacity: 0.45;
}
.eb-sum-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}
.eb-reset-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.eb-reset-btn:hover {
  background: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .eb-reset-btn:hover,
html[data-theme="dark"] .eb-reset-btn:hover {
  color: #091512;
}

.eb-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.eb-empty-state {
  display: grid;
  gap: 12px;
}

/* Semantic Grade Color Tokens (Badges, Bars, Pills) */
.grade-a,
.grade-pass {
  --g-col: var(--grade-a);
  --g-ink: var(--grade-a-ink);
  --g-soft: var(--grade-a-soft);
}
.grade-b {
  --g-col: var(--grade-b);
  --g-ink: var(--grade-b-ink);
  --g-soft: var(--grade-b-soft);
}
.grade-c {
  --g-col: var(--grade-c);
  --g-ink: var(--grade-c-ink);
  --g-soft: var(--grade-c-soft);
}
.grade-d {
  --g-col: var(--grade-d);
  --g-ink: var(--grade-d-ink);
  --g-soft: var(--grade-d-soft);
}
.grade-e {
  --g-col: var(--grade-e);
  --g-ink: var(--grade-e-ink);
  --g-soft: var(--grade-e-soft);
}
.grade-f,
.grade-fail {
  --g-col: var(--grade-f);
  --g-ink: var(--grade-f-ink);
  --g-soft: var(--grade-f-soft);
}

.eb-grade-badge,
.eb-sum-grade,
.eb-ac-grade,
.eb-kpi-grade-pill,
.eb-mini-grade {
  background: var(--g-soft, var(--panel-alt));
  color: var(--g-ink, var(--ink));
  border: 1px solid color-mix(in srgb, var(--g-col, var(--line)) 34%, transparent);
}

/* Course Cards */
.eb-list {
  display: grid;
  gap: 12px;
}
.eb-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}
.eb-card:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
:root[data-theme="dark"] .eb-card:hover,
html[data-theme="dark"] .eb-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}
.eb-card.is-compared {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 3.5%, var(--panel));
}
.eb-card-main {
  min-width: 0;
}
.eb-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.eb-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.eb-uni-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--muted);
}
.eb-ico {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
}
.eb-practice-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 36%, transparent);
}
.eb-title {
  margin: 0 0 4px;
  font-size: 16.5px;
  line-height: 1.28;
  color: var(--ink);
}
.eb-title-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color 120ms ease;
}
.eb-title-btn:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.eb-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.eb-inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.eb-inline-link:hover {
  text-decoration: underline;
}
.eb-pensum-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  line-height: 1.4;
}
.eb-pensum-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.eb-pensum-title-preview {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.eb-pensum-title-preview strong {
  color: var(--ink);
  font-weight: 650;
}
.eb-free-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  white-space: nowrap;
}
.eb-pensum-diff-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.eb-pensum-diff-chip.is-unchanged {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 32%, transparent);
}
.eb-pensum-diff-chip.is-updated {
  background: var(--grade-d-soft);
  color: var(--grade-d-ink);
  border: 1px solid color-mix(in srgb, var(--grade-d) 36%, transparent);
}

/* Card Stats Box, Semantic Mini Histogram & Sparkline */
.eb-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}
.eb-stats-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: background 140ms ease, border-color 140ms ease;
}
.eb-stats-btn:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.eb-hist {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  padding: 4px 7px 2px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
}
.eb-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 15px;
}
.eb-bar-track {
  display: flex;
  align-items: flex-end;
  height: 30px;
  width: 10px;
}
.eb-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--g-col, var(--accent));
  min-height: 2px;
}
.eb-bar.is-f {
  background: var(--grade-f);
}
.eb-bar-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}
.eb-grade-summary {
  min-width: 96px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.eb-grade-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.eb-grade-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.15;
}
.eb-grade-num {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.eb-spark-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.eb-sparkline {
  display: block;
  overflow: visible;
}
.eb-delta {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.eb-delta.is-up {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
}
.eb-delta.is-down {
  background: var(--grade-f-soft);
  color: var(--grade-f-ink);
}
.eb-delta.is-flat {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--muted);
}
.eb-fail-pct {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.eb-fail-pct.is-high {
  color: var(--grade-f-ink);
}
.eb-cand-cnt {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* Card Action Buttons */
.eb-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 176px;
}
.eb-actions > a,
.eb-actions > button {
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  padding: 7px 12px;
  white-space: nowrap;
}
.eb-actions-sub {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.eb-actions-sub button {
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}
.ghost-btn.eb-compare-toggle.active,
:root[data-theme="dark"] .ghost-btn.eb-compare-toggle.active,
html[data-theme="dark"] .ghost-btn.eb-compare-toggle.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  color: var(--accent);
}
.eb-btn-sm {
  font-size: 12.5px;
  padding: 6px 11px;
  white-space: nowrap;
}

.eb-ratings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.eb-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--muted);
}
.eb-rating-chip strong {
  color: var(--ink);
}
.eb-my-grade-chip {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.eb-my-grade-chip strong {
  color: var(--accent);
}

/* Dialogs (Unified Course Detail + Comparator) */
.eb-dialog {
  width: min(560px, calc(100vw - 20px));
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 26px 68px rgba(15, 23, 42, 0.32);
  overflow: hidden;
}
.eb-dialog[open] {
  display: flex;
  flex-direction: column;
}
.eb-dialog.is-wide {
  width: min(820px, calc(100vw - 20px));
}
.eb-dialog.is-compare {
  width: min(940px, calc(100vw - 20px));
}
.eb-dialog::backdrop {
  background: rgba(9, 13, 12, 0.54);
  backdrop-filter: blur(6px);
}
.eb-dlg-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-alt) 50%, var(--panel));
}
.eb-dlg-head-main {
  min-width: 0;
}
.eb-dlg-title {
  margin: 2px 0 0;
  font-size: clamp(16.5px, 2.2vw, 20px);
  line-height: 1.25;
}
.eb-dlg-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.eb-dlg-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 16px 20px 22px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

/* 5-Tile KPI Summary Strip inside Modal */
.eb-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.eb-kpi-tile {
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.eb-kpi-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eb-kpi-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  flex-wrap: wrap;
}
.eb-kpi-val.is-sm {
  font-size: 14px;
}
.eb-kpi-val.is-danger {
  color: var(--grade-f-ink);
}
.eb-kpi-grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}
.eb-kpi-num {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
}
.eb-kpi-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}
.eb-kpi-cta {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.eb-kpi-cta:hover {
  background: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .eb-kpi-cta:hover,
html[data-theme="dark"] .eb-kpi-cta:hover {
  color: #091512;
}

/* Modal Tab Bar */
.eb-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 13px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.eb-tab {
  flex: 1 1 0;
  min-width: max-content;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, box-shadow 130ms ease;
}
.eb-tab:hover {
  color: var(--ink);
}
.eb-tab[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.eb-tab-dot {
  color: var(--accent);
  font-weight: 750;
}
.eb-tab-panel {
  display: grid;
  gap: 14px;
}

/* Section Boxes & Interactive SVG Charts */
.eb-section-box {
  padding: 14px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 2%, var(--panel));
  display: grid;
  gap: 11px;
  min-width: 0;
}
.eb-section-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.eb-detail-cta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.eb-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.eb-svg-chart-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.eb-trend-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.eb-chart-readout {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 620;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.eb-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.eb-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.eb-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
}
.eb-legend-swatch.is-avg {
  background: #10b981;
}
.eb-legend-swatch.is-fail {
  height: 8px;
  width: 8px;
  background: rgba(239, 68, 68, 0.45);
  border: 1px solid #ef4444;
}

.eb-svg-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  user-select: none;
}
.eb-svg-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.eb-svg-grid.is-base {
  stroke-dasharray: none;
  stroke-width: 1.2;
}
.eb-svg-axis-lbl {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}
.eb-svg-axis-lbl.is-strong {
  font-weight: 750;
}
.eb-svg-axis-lbl.is-fail {
  fill: var(--grade-f-ink);
}
.eb-svg-bar-group {
  cursor: pointer;
  outline: none;
}
.eb-svg-bar {
  transition: opacity 120ms ease, filter 120ms ease;
  opacity: 0.86;
}
.eb-svg-bar-group:hover .eb-svg-bar,
.eb-svg-bar-group:focus-visible .eb-svg-bar,
.eb-svg-bar-group.is-active .eb-svg-bar {
  opacity: 1;
  filter: brightness(1.06);
}
.eb-svg-pct-lbl {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
}
.eb-svg-grade-lbl {
  fill: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
}
.eb-svg-cnt-lbl {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.eb-svg-mine-pill {
  fill: #0f172a;
}
.eb-svg-mine-lbl,
.eb-svg-mine-text {
  fill: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
:root[data-theme="dark"] .eb-svg-mine-pill,
html[data-theme="dark"] .eb-svg-mine-pill {
  fill: #f8fafc;
}
:root[data-theme="dark"] .eb-svg-mine-lbl,
html[data-theme="dark"] .eb-svg-mine-lbl,
:root[data-theme="dark"] .eb-svg-mine-text,
html[data-theme="dark"] .eb-svg-mine-text {
  fill: #0f172a;
}
.eb-svg-fail-bar {
  fill: rgba(239, 68, 68, 0.22);
  stroke: rgba(239, 68, 68, 0.55);
  stroke-width: 1;
}
.eb-svg-year-pt {
  cursor: pointer;
  outline: none;
}
.eb-svg-guide {
  stroke: transparent;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  transition: stroke 120ms ease;
}
.eb-svg-year-pt:hover .eb-svg-guide,
.eb-svg-year-pt:focus-visible .eb-svg-guide,
.eb-svg-year-pt.is-active .eb-svg-guide {
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
}
.eb-svg-dot {
  fill: #10b981;
  stroke: var(--panel);
  stroke-width: 2.2;
  transition: r 120ms ease;
}
.eb-svg-dot.is-muted {
  fill: var(--muted);
}
.eb-svg-year-pt:hover .eb-svg-dot,
.eb-svg-year-pt:focus-visible .eb-svg-dot,
.eb-svg-year-pt.is-active .eb-svg-dot {
  r: 7;
}
.eb-svg-yr-lbl {
  fill: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}
.eb-svg-year-pt.is-active .eb-svg-yr-lbl {
  fill: var(--ink);
  font-weight: 800;
}

/* Compact 5-Year History Table */
.eb-hist-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.eb-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.eb-hist-table th,
.eb-hist-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.eb-hist-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--panel-alt);
}
.eb-hist-table tbody tr:last-child td {
  border-bottom: none;
}
.eb-hist-row {
  cursor: pointer;
  transition: background 110ms ease;
}
.eb-hist-row:hover,
.eb-hist-row.is-active {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.eb-mini-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
}
.eb-fail-cell {
  color: var(--grade-f-ink);
  font-weight: 680;
}

/* Live Cohort, Rating Progress Bars & Grade Logger (Tab 2) */
.eb-live-term-locked,
.eb-live-term-unlocked {
  display: grid;
  gap: 8px;
}
.eb-live-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.eb-live-rating-bars {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.eb-live-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.eb-live-rating-row {
  display: grid;
  gap: 4px;
}
.eb-live-rating-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.eb-k-bar-track {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}
.eb-k-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 220ms ease;
}

.eb-grade-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.eb-grade-choice {
  min-width: 48px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.eb-grade-choice:hover {
  border-color: var(--g-col, var(--accent));
}
.eb-grade-choice.active {
  background: var(--g-col, var(--accent));
  border-color: var(--g-col, var(--accent));
  color: #061812;
}
.eb-grade-choice.grade-c.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.eb-grade-choice.grade-f.active,
.eb-grade-choice.grade-fail.active,
.eb-grade-choice.is-fail.active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.eb-percentile-box {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  font-size: 13px;
  line-height: 1.45;
}

/* Crisp 1-5 Segmented Pill Buttons */
.eb-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.eb-rate-pills-group {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.eb-rate-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}
.eb-rate-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.eb-rate-pill {
  min-height: 34px;
  padding: 4px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 110ms ease, border-color 110ms ease, color 110ms ease;
}
.eb-rate-pill:hover {
  border-color: var(--accent);
}
.eb-rate-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .eb-rate-pill.active,
html[data-theme="dark"] .eb-rate-pill.active {
  color: #091512;
}
.eb-rate-poles {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
}
.eb-privacy-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Pensum & Book Sources (Tab 3) */
.eb-book-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eb-book-form input {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
}
.eb-source-grid {
  display: grid;
  gap: 8px;
}
.eb-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--ink);
}
.eb-source-row > div:first-child {
  min-width: 0;
}
.eb-source-row:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.eb-price-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}
.eb-price-pill.is-free {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
}
.eb-nb-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  font-size: 13px;
}
.eb-nb-thumb {
  width: 44px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.eb-nb-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.eb-nb-price-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}
.eb-nb-price-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Live Norwegian Bookstore NOK Price Comparator (#eb-prices-slot) */
.eb-prices-slot {
  display: grid;
  min-width: 0;
}
.eb-prices-slot:empty {
  display: none;
}
.eb-prices-card {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}
.eb-prices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}
.eb-prices-head-left,
.eb-prices-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.eb-prices-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.01em;
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 34%, transparent);
  white-space: nowrap;
}
.eb-prices-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grade-a);
  flex-shrink: 0;
}
.eb-prices-stores {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.eb-store-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.015em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.eb-store-pill.is-norli {
  background: var(--grade-c-soft);
  color: var(--grade-c-ink);
  border-color: color-mix(in srgb, var(--grade-c) 32%, transparent);
}
.eb-store-pill.is-ark {
  background: var(--grade-d-soft);
  color: var(--grade-d-ink);
  border-color: color-mix(in srgb, var(--grade-d) 34%, transparent);
}
.eb-prices-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.eb-ad-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid var(--line);
}
.eb-prices-list {
  display: grid;
}
.eb-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
  transition: background 120ms ease;
}
.eb-price-row:last-child {
  border-bottom: none;
}
.eb-price-row:hover {
  background: color-mix(in srgb, var(--ink) 2.5%, var(--panel));
}
.eb-price-row.is-cheapest {
  background: color-mix(in srgb, var(--grade-a) 5.5%, var(--panel));
  box-shadow: inset 3px 0 0 var(--grade-a);
}
.eb-price-row.is-cheapest:hover {
  background: color-mix(in srgb, var(--grade-a) 8.5%, var(--panel));
}
.eb-price-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.eb-price-thumb {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  flex-shrink: 0;
  display: block;
}
.eb-price-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.eb-price-title {
  font-size: 13.5px;
  font-weight: 680;
  line-height: 1.32;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.eb-price-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.eb-price-best-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.015em;
  background: #047857;
  color: #ffffff;
  white-space: nowrap;
}
.eb-stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.eb-stock-pill.is-in {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
}
.eb-stock-pill.is-order {
  background: var(--grade-d-soft);
  color: var(--grade-d-ink);
}
.eb-isbn-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-alt);
  border: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.eb-price-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.eb-price-nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.eb-price-now {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
}
.eb-price-discount {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.eb-price-old {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.eb-price-save {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  white-space: nowrap;
}
.eb-price-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}
.eb-price-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.eb-price-row.is-cheapest .eb-price-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.eb-price-row.is-cheapest .eb-price-cta:hover {
  background: var(--accent-hover, var(--accent));
  border-color: var(--accent-hover, var(--accent));
}
.eb-prices-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-alt);
  display: flex;
  justify-content: center;
}
.eb-prices-more-btn {
  width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 680;
  cursor: pointer;
  transition: border-color 130ms ease, color 130ms ease, background 130ms ease;
}
.eb-prices-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.eb-prices-empty {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Subtle 2-Row Skeleton Shimmer */
.eb-price-skel-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.eb-price-skel-row:last-child {
  border-bottom: none;
}
.eb-skel-box {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--ink) 7%, transparent) 0%,
    color-mix(in srgb, var(--ink) 14%, transparent) 50%,
    color-mix(in srgb, var(--ink) 7%, transparent) 100%
  );
  background-size: 220% 100%;
  animation: ebPriceShimmer 1.35s ease-in-out infinite;
}
.eb-skel-thumb {
  width: 36px;
  height: 50px;
}
.eb-skel-mid {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.eb-skel-line {
  height: 12px;
}
.eb-skel-line.is-wide {
  width: 78%;
}
.eb-skel-line.is-med {
  width: 64%;
}
.eb-skel-line.is-short {
  width: 44%;
  height: 10px;
}
.eb-skel-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eb-skel-price {
  width: 56px;
  height: 18px;
}
.eb-skel-cta {
  width: 78px;
  height: 28px;
  border-radius: 999px;
}
@keyframes ebPriceShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Official Curriculum & Per-Book Live Price Comparator (#eb-official-pensum-slot) */
.eb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eb-official-pensum-section {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent) 2.5%, var(--panel));
}
.eb-pensum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.eb-pensum-heading {
  justify-content: flex-start;
  gap: 8px;
}
.eb-pensum-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}
.eb-pensum-syncing {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.eb-pensum-total-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.38;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.eb-pensum-total-pill.is-priced,
.eb-pensum-total-pill.is-free {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 34%, transparent);
}
.eb-pensum-total-pill.is-neutral {
  background: var(--panel-alt);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 620;
}

/* Term Switcher Tabs (I år vs Forrige år) */
.eb-term-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
}
.eb-term-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}
.eb-term-tab:hover {
  color: var(--ink);
}
.eb-term-tab.active,
.eb-term-tab[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.eb-term-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.eb-term-tab.active .eb-term-cnt {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Official Links Strip */
.eb-official-links-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.eb-official-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 130ms ease, color 130ms ease, background 130ms ease;
}
.eb-official-link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.eb-official-link-pill.is-primary {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
}
.eb-official-link-pill.is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Year-over-Year Diff Banners */
.eb-pensum-diff {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.42;
  min-width: 0;
}
.eb-pensum-diff.is-unchanged {
  background: color-mix(in srgb, var(--grade-a) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--grade-a) 36%, transparent);
  color: var(--grade-a-ink);
}
.eb-pensum-diff.is-updated {
  background: color-mix(in srgb, var(--grade-d) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--grade-d) 40%, transparent);
  color: var(--grade-d-ink);
}
.eb-pensum-diff.is-single {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 11px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.eb-pensum-diff-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: 700;
}
.eb-pensum-diff-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-weight: 800;
}
.eb-pensum-diff-sub {
  margin: 0;
  font-size: 12px;
  opacity: 0.92;
  overflow-wrap: anywhere;
}
.eb-diff-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.eb-diff-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 680;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.eb-diff-pill.is-added {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 32%, transparent);
}
.eb-diff-pill.is-removed {
  background: var(--grade-f-soft);
  color: var(--grade-f-ink);
  border: 1px solid color-mix(in srgb, var(--grade-f) 32%, transparent);
}
.eb-pensum-diff-single-txt {
  font-weight: 600;
}
.eb-pensum-diff-link {
  color: var(--accent);
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
}
.eb-pensum-diff-link:hover {
  text-decoration: underline;
}

/* Official Pensum Loading Skeleton & Empty Note */
.eb-pensum-skeleton {
  display: grid;
  gap: 9px;
}
.eb-pensum-skel-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.eb-pensum-empty-note,
.eb-pensum-api-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Per-Book Official Cards */
.eb-pensum-books {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.eb-pensum-book {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
  transition: border-color 140ms ease;
}
.eb-pensum-book.is-required {
  border-left: 3px solid var(--accent);
}
.eb-pensum-book-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  flex-wrap: wrap;
}
.eb-pensum-book-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.eb-imp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.eb-imp-badge.is-required {
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.eb-imp-badge.is-recommended {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--muted);
  border: 1px solid var(--line);
}
.eb-oer-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border: 1px solid color-mix(in srgb, var(--grade-a) 36%, transparent);
  text-decoration: none;
  white-space: nowrap;
}
.eb-oer-badge:hover {
  background: var(--grade-a);
  color: #052e16;
  text-decoration: none;
}
.eb-book-diff-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
}
.eb-book-diff-tag.is-new {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
}
.eb-book-diff-tag.is-removed {
  background: var(--grade-f-soft);
  color: var(--grade-f-ink);
}
.eb-pensum-book-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 720;
  line-height: 1.32;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.eb-pensum-book-meta {
  margin: 0;
  font-size: 12.2px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.eb-pensum-book-note {
  margin: 0;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11.8px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Embedded Per-Book Live Norli · ARK Price Strip (.eb-book-live-prices) */
.eb-book-live-prices-slot {
  min-width: 0;
}
.eb-book-live-prices {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  overflow: hidden;
  min-width: 0;
}
.eb-book-live-prices.is-loading {
  padding: 7px 10px;
}
.eb-book-price-skel-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.eb-skel-compact-price {
  width: 58px;
  height: 15px;
}
.eb-book-live-status {
  font-size: 11.5px;
  color: var(--muted);
}
.eb-book-live-prices.is-oer {
  padding: 7px 10px;
  border-color: color-mix(in srgb, var(--grade-a) 34%, transparent);
  background: color-mix(in srgb, var(--grade-a) 8%, var(--panel));
}
.eb-book-oer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.eb-book-oer-msg {
  font-size: 12px;
  font-weight: 650;
  color: var(--grade-a-ink);
}
.eb-book-live-prices.is-empty {
  padding: 7px 10px;
  border-style: dashed;
}
.eb-book-empty-msg {
  font-size: 11.8px;
  color: var(--muted);
  line-height: 1.4;
}
.eb-book-live-prices.is-deferred {
  padding: 7px 10px;
  background: transparent;
  border-style: dashed;
}
.eb-check-price-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}
.eb-check-price-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.eb-book-live-prices.has-offers {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.eb-book-offers-list {
  display: grid;
}
.eb-book-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.eb-book-offer-row:last-child {
  border-bottom: none;
}
.eb-book-offer-row.is-cheapest {
  background: color-mix(in srgb, var(--grade-a) 6%, var(--panel));
  box-shadow: inset 3px 0 0 var(--grade-a);
}
.eb-book-offer-left {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.eb-book-offer-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.eb-book-offer-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.eb-book-offer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.eb-book-offer-nums {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.eb-book-offer-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.eb-price-cta-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}
.eb-book-offer-row.is-cheapest .eb-price-cta-sm {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.eb-price-cta-sm.is-oer {
  background: #047857;
  border-color: #047857;
  color: #fff;
}
.eb-price-cta-sm.is-oer:hover {
  background: #065f46;
  border-color: #065f46;
  color: #fff;
}
.eb-book-offers-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel-alt);
}
.eb-book-offers-more {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.eb-book-offers-more:hover {
  text-decoration: underline;
}
.eb-book-ad-note {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Compact Per-Book Quick Links (Oria · Bookis · Finn.no) */
.eb-book-quick-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.eb-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.eb-quick-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.eb-quick-link.is-free {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
  border-color: color-mix(in srgb, var(--grade-a) 30%, transparent);
}
.eb-quick-link.is-free:hover {
  border-color: var(--grade-a);
  color: var(--grade-a-ink);
}

:root[data-theme="dark"] .eb-price-best-pill,
html[data-theme="dark"] .eb-price-best-pill {
  background: #34d399;
  color: #052e16;
}
:root[data-theme="dark"] .eb-price-cta:hover,
html[data-theme="dark"] .eb-price-cta:hover,
:root[data-theme="dark"] .eb-price-row.is-cheapest .eb-price-cta,
html[data-theme="dark"] .eb-price-row.is-cheapest .eb-price-cta,
:root[data-theme="dark"] .eb-book-offer-row.is-cheapest .eb-price-cta-sm,
html[data-theme="dark"] .eb-book-offer-row.is-cheapest .eb-price-cta-sm,
:root[data-theme="dark"] .eb-nb-price-btn:hover,
html[data-theme="dark"] .eb-nb-price-btn:hover,
:root[data-theme="dark"] .eb-official-link-pill.is-primary:hover,
html[data-theme="dark"] .eb-official-link-pill.is-primary:hover,
:root[data-theme="dark"] .eb-check-price-btn:hover,
html[data-theme="dark"] .eb-check-price-btn:hover {
  color: #091512;
}
:root[data-theme="dark"] .eb-price-cta-sm.is-oer,
html[data-theme="dark"] .eb-price-cta-sm.is-oer {
  background: #34d399;
  border-color: #34d399;
  color: #052e16;
}
:root[data-theme="dark"] .eb-price-cta-sm.is-oer:hover,
html[data-theme="dark"] .eb-price-cta-sm.is-oer:hover {
  background: #6ee7b7;
  border-color: #6ee7b7;
  color: #052e16;
}
:root[data-theme="dark"] .eb-skel-box,
html[data-theme="dark"] .eb-skel-box {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 220% 100%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eb-price-best-pill {
    background: #34d399;
    color: #052e16;
  }
  :root:not([data-theme="light"]) .eb-price-cta:hover,
  :root:not([data-theme="light"]) .eb-price-row.is-cheapest .eb-price-cta,
  :root:not([data-theme="light"]) .eb-book-offer-row.is-cheapest .eb-price-cta-sm,
  :root:not([data-theme="light"]) .eb-nb-price-btn:hover,
  :root:not([data-theme="light"]) .eb-official-link-pill.is-primary:hover,
  :root:not([data-theme="light"]) .eb-check-price-btn:hover {
    color: #091512;
  }
  :root:not([data-theme="light"]) .eb-price-cta-sm.is-oer {
    background: #34d399;
    border-color: #34d399;
    color: #052e16;
  }
  :root:not([data-theme="light"]) .eb-prices-badge,
  :root:not([data-theme="light"]) .eb-stock-pill.is-in,
  :root:not([data-theme="light"]) .eb-price-save,
  :root:not([data-theme="light"]) .eb-pensum-diff-chip.is-unchanged,
  :root:not([data-theme="light"]) .eb-pensum-total-pill.is-priced,
  :root:not([data-theme="light"]) .eb-pensum-total-pill.is-free,
  :root:not([data-theme="light"]) .eb-pensum-diff.is-unchanged,
  :root:not([data-theme="light"]) .eb-diff-pill.is-added,
  :root:not([data-theme="light"]) .eb-oer-badge,
  :root:not([data-theme="light"]) .eb-book-diff-tag.is-new,
  :root:not([data-theme="light"]) .eb-book-oer-msg,
  :root:not([data-theme="light"]) .eb-quick-link.is-free {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
  }
  :root:not([data-theme="light"]) .eb-book-oer-msg {
    background: transparent;
  }
  :root:not([data-theme="light"]) .eb-oer-badge:hover {
    background: #34d399;
    color: #052e16;
  }
  :root:not([data-theme="light"]) .eb-store-pill.is-norli {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.2);
  }
  :root:not([data-theme="light"]) .eb-store-pill.is-ark,
  :root:not([data-theme="light"]) .eb-stock-pill.is-order,
  :root:not([data-theme="light"]) .eb-pensum-diff-chip.is-updated,
  :root:not([data-theme="light"]) .eb-pensum-diff.is-updated {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.2);
  }
  :root:not([data-theme="light"]) .eb-diff-pill.is-removed,
  :root:not([data-theme="light"]) .eb-book-diff-tag.is-removed {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.2);
  }
  :root:not([data-theme="light"]) .eb-skel-box {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.14) 50%,
      rgba(255, 255, 255, 0.06) 100%
    );
    background-size: 220% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eb-skel-box {
    animation: none;
  }
  .eb-exam-weight-seg {
    transition: none;
  }
}

/* Official Exam Format & Weighting (iOS 27 Liquid Glass Card, Pills & Weighted Split Bar) */
.eb-exam-fmt-slot {
  min-width: 0;
}
.eb-exam-fmt-slot:empty {
  display: none;
}

.eb-exam-fmt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
  background: var(--exam-school-soft);
  color: var(--exam-school-ink);
  border: 1px solid color-mix(in srgb, var(--exam-school) 32%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  max-width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.eb-exam-fmt-pill > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.eb-exam-fmt-pill.is-home-exam {
  background: var(--exam-home-soft);
  color: var(--exam-home-ink);
  border-color: color-mix(in srgb, var(--exam-home) 36%, transparent);
}
.eb-exam-fmt-pill.is-school-exam {
  background: var(--exam-school-soft);
  color: var(--exam-school-ink);
  border-color: color-mix(in srgb, var(--exam-school) 32%, transparent);
}
.eb-exam-fmt-pill.is-portfolio-exam {
  background: var(--exam-portfolio-soft);
  color: var(--exam-portfolio-ink);
  border-color: color-mix(in srgb, var(--exam-portfolio) 34%, transparent);
}
.eb-exam-fmt-pill.is-oral-exam {
  background: var(--exam-oral-soft);
  color: var(--exam-oral-ink);
  border-color: color-mix(in srgb, var(--exam-oral) 36%, transparent);
}
.eb-exam-fmt-pill.is-assignment-exam {
  background: var(--exam-assignment-soft);
  color: var(--exam-assignment-ink);
  border-color: color-mix(in srgb, var(--exam-assignment) 34%, transparent);
}
.eb-exam-fmt-pill.is-mixed-exam {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}
.eb-exam-fmt-pill.is-lg {
  padding: 4px 11px;
  font-size: 12.5px;
  gap: 5px;
}

.eb-exam-fmt-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent);
  background:
    radial-gradient(ellipse 70% 80% at 6% 0%, rgba(255, 255, 255, 0.72), transparent 62%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(242, 247, 250, 0.72) 100%);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04),
    0 6px 20px rgba(15, 23, 42, 0.055);
  min-width: 0;
}
.eb-exam-fmt-card.is-home-exam {
  border-color: color-mix(in srgb, var(--exam-home) 32%, var(--line));
  background:
    radial-gradient(ellipse 64% 72% at 4% 0%, rgba(13, 148, 136, 0.11), transparent 66%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.88) 0%, rgba(240, 250, 248, 0.76) 100%);
}
.eb-exam-fmt-card.is-school-exam {
  border-color: color-mix(in srgb, var(--exam-school) 26%, var(--line));
  background:
    radial-gradient(ellipse 64% 72% at 4% 0%, rgba(37, 99, 235, 0.08), transparent 66%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.88) 0%, rgba(242, 246, 253, 0.76) 100%);
}
.eb-exam-fmt-card.is-portfolio-exam {
  border-color: color-mix(in srgb, var(--exam-portfolio) 28%, var(--line));
  background:
    radial-gradient(ellipse 64% 72% at 4% 0%, rgba(124, 58, 237, 0.09), transparent 66%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.88) 0%, rgba(247, 244, 254, 0.76) 100%);
}
.eb-exam-fmt-card.is-oral-exam {
  border-color: color-mix(in srgb, var(--exam-oral) 30%, var(--line));
}
.eb-exam-fmt-card.is-assignment-exam {
  border-color: color-mix(in srgb, var(--exam-assignment) 28%, var(--line));
}

.eb-exam-fmt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.eb-exam-fmt-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.eb-exam-fmt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
  flex-shrink: 0;
}
.eb-exam-fmt-card.is-home-exam .eb-exam-fmt-icon {
  background: var(--exam-home-soft);
  color: var(--exam-home-ink);
}
.eb-exam-fmt-card.is-school-exam .eb-exam-fmt-icon {
  background: var(--exam-school-soft);
  color: var(--exam-school-ink);
}
.eb-exam-fmt-card.is-portfolio-exam .eb-exam-fmt-icon {
  background: var(--exam-portfolio-soft);
  color: var(--exam-portfolio-ink);
}
.eb-exam-fmt-card.is-oral-exam .eb-exam-fmt-icon {
  background: var(--exam-oral-soft);
  color: var(--exam-oral-ink);
}
.eb-exam-fmt-card.is-assignment-exam .eb-exam-fmt-icon {
  background: var(--exam-assignment-soft);
  color: var(--exam-assignment-ink);
}
.eb-exam-fmt-title {
  margin: 0;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.eb-exam-fmt-source {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--ink) 6%, var(--panel));
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eb-exam-fmt-source.is-link {
  text-decoration: none;
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}
.eb-exam-fmt-source.is-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.eb-exam-fmt-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.eb-exam-fmt-meta-chip,
.eb-exam-fmt-aids-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.8px;
  font-weight: 620;
  line-height: 1.35;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  border: 1px solid var(--line);
  max-width: 100%;
  min-width: 0;
}
.eb-exam-fmt-meta-chip > span,
.eb-exam-fmt-aids-chip > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.eb-exam-weight-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.eb-exam-weight-bar {
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  height: 10px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.eb-exam-weight-seg {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: var(--seg-col, var(--exam-other));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1), filter 130ms ease;
}
.eb-exam-weight-seg:hover {
  filter: brightness(1.08);
}
.eb-exam-weight-seg.is-home { --seg-col: var(--exam-home); }
.eb-exam-weight-seg.is-school { --seg-col: var(--exam-school); }
.eb-exam-weight-seg.is-portfolio { --seg-col: var(--exam-portfolio); }
.eb-exam-weight-seg.is-oral { --seg-col: var(--exam-oral); }
.eb-exam-weight-seg.is-assignment { --seg-col: var(--exam-assignment); }
.eb-exam-weight-seg.is-other { --seg-col: var(--exam-other); }

.eb-exam-parts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.eb-exam-part-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.3;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  max-width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.eb-exam-part-chip.is-home {
  --seg-col: var(--exam-home);
  --seg-ink: var(--exam-home-ink);
  border-color: color-mix(in srgb, var(--exam-home) 34%, var(--line));
  background: color-mix(in srgb, var(--exam-home-soft) 72%, var(--panel));
}
.eb-exam-part-chip.is-school {
  --seg-col: var(--exam-school);
  --seg-ink: var(--exam-school-ink);
  border-color: color-mix(in srgb, var(--exam-school) 30%, var(--line));
  background: color-mix(in srgb, var(--exam-school-soft) 68%, var(--panel));
}
.eb-exam-part-chip.is-portfolio {
  --seg-col: var(--exam-portfolio);
  --seg-ink: var(--exam-portfolio-ink);
  border-color: color-mix(in srgb, var(--exam-portfolio) 30%, var(--line));
  background: color-mix(in srgb, var(--exam-portfolio-soft) 68%, var(--panel));
}
.eb-exam-part-chip.is-oral {
  --seg-col: var(--exam-oral);
  --seg-ink: var(--exam-oral-ink);
  border-color: color-mix(in srgb, var(--exam-oral) 34%, var(--line));
  background: color-mix(in srgb, var(--exam-oral-soft) 72%, var(--panel));
}
.eb-exam-part-chip.is-assignment {
  --seg-col: var(--exam-assignment);
  --seg-ink: var(--exam-assignment-ink);
  border-color: color-mix(in srgb, var(--exam-assignment) 32%, var(--line));
  background: color-mix(in srgb, var(--exam-assignment-soft) 68%, var(--panel));
}
.eb-exam-part-chip.is-other {
  --seg-col: var(--exam-other);
  --seg-ink: var(--exam-other-ink);
}
.eb-exam-part-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--seg-col, var(--exam-other));
}
.eb-exam-part-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.eb-exam-part-pct {
  font-weight: 780;
  color: var(--seg-ink, var(--ink));
  white-space: nowrap;
}
.eb-exam-part-dur {
  color: var(--muted);
  font-size: 11.2px;
  font-weight: 600;
  white-space: nowrap;
}

.eb-exam-fmt-summary {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* 1-Line Skeleton & Official Link Fallback */
.eb-exam-fmt-skeleton,
.eb-exam-fmt-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-alt) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  min-width: 0;
}
.eb-exam-fmt-skel-label,
.eb-exam-fmt-fallback-txt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.2px;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.eb-exam-fmt-skel-label > span,
.eb-exam-fmt-fallback-txt > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.eb-exam-fmt-skel-bar {
  width: 112px;
  max-width: 40%;
  height: 14px;
  border-radius: 999px;
  flex-shrink: 0;
}
.eb-exam-fmt-fallback-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.eb-exam-fmt-fallback-link:hover {
  text-decoration: underline;
}

:root[data-theme="dark"] .eb-exam-fmt-pill,
html[data-theme="dark"] .eb-exam-fmt-pill,
:root[data-theme="dark"] .eb-exam-part-chip,
html[data-theme="dark"] .eb-exam-part-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
:root[data-theme="dark"] .eb-exam-fmt-card,
html[data-theme="dark"] .eb-exam-fmt-card {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(ellipse 70% 80% at 6% 0%, rgba(255, 255, 255, 0.06), transparent 62%),
    linear-gradient(155deg, rgba(28, 39, 36, 0.84) 0%, rgba(19, 27, 25, 0.74) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.32);
}
:root[data-theme="dark"] .eb-exam-fmt-card.is-home-exam,
html[data-theme="dark"] .eb-exam-fmt-card.is-home-exam {
  border-color: color-mix(in srgb, var(--exam-home) 34%, rgba(255, 255, 255, 0.1));
  background:
    radial-gradient(ellipse 68% 76% at 5% 0%, rgba(45, 212, 191, 0.15), transparent 65%),
    linear-gradient(155deg, rgba(24, 38, 36, 0.86) 0%, rgba(17, 26, 24, 0.76) 100%);
}
:root[data-theme="dark"] .eb-exam-fmt-card.is-school-exam,
html[data-theme="dark"] .eb-exam-fmt-card.is-school-exam {
  border-color: color-mix(in srgb, var(--exam-school) 32%, rgba(255, 255, 255, 0.1));
  background:
    radial-gradient(ellipse 68% 76% at 5% 0%, rgba(96, 165, 250, 0.13), transparent 65%),
    linear-gradient(155deg, rgba(24, 34, 42, 0.86) 0%, rgba(18, 25, 30, 0.76) 100%);
}
:root[data-theme="dark"] .eb-exam-fmt-card.is-portfolio-exam,
html[data-theme="dark"] .eb-exam-fmt-card.is-portfolio-exam {
  border-color: color-mix(in srgb, var(--exam-portfolio) 34%, rgba(255, 255, 255, 0.1));
  background:
    radial-gradient(ellipse 68% 76% at 5% 0%, rgba(167, 139, 250, 0.14), transparent 65%),
    linear-gradient(155deg, rgba(30, 31, 44, 0.86) 0%, rgba(20, 22, 30, 0.76) 100%);
}
:root[data-theme="dark"] .eb-exam-fmt-card.is-oral-exam,
html[data-theme="dark"] .eb-exam-fmt-card.is-oral-exam {
  border-color: color-mix(in srgb, var(--exam-oral) 34%, rgba(255, 255, 255, 0.1));
  background:
    radial-gradient(ellipse 68% 76% at 5% 0%, rgba(251, 191, 36, 0.14), transparent 65%),
    linear-gradient(155deg, rgba(42, 35, 24, 0.86) 0%, rgba(28, 24, 18, 0.76) 100%);
}
:root[data-theme="dark"] .eb-exam-fmt-card.is-assignment-exam,
html[data-theme="dark"] .eb-exam-fmt-card.is-assignment-exam {
  border-color: color-mix(in srgb, var(--exam-assignment) 34%, rgba(255, 255, 255, 0.1));
  background:
    radial-gradient(ellipse 68% 76% at 5% 0%, rgba(251, 113, 133, 0.14), transparent 65%),
    linear-gradient(155deg, rgba(42, 26, 32, 0.86) 0%, rgba(28, 19, 23, 0.76) 100%);
}
:root[data-theme="dark"] .eb-exam-fmt-source.is-link:hover,
html[data-theme="dark"] .eb-exam-fmt-source.is-link:hover {
  color: #091512;
}
:root[data-theme="dark"] .eb-exam-fmt-skeleton,
html[data-theme="dark"] .eb-exam-fmt-skeleton,
:root[data-theme="dark"] .eb-exam-fmt-fallback,
html[data-theme="dark"] .eb-exam-fmt-fallback {
  background: rgba(26, 35, 32, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .eb-exam-weight-bar,
html[data-theme="dark"] .eb-exam-weight-bar {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .eb-exam-weight-seg,
html[data-theme="dark"] .eb-exam-weight-seg {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --exam-home: #2dd4bf;
    --exam-home-ink: #5eead4;
    --exam-home-soft: rgba(45, 212, 191, 0.18);
    --exam-school: #60a5fa;
    --exam-school-ink: #93c5fd;
    --exam-school-soft: rgba(96, 165, 250, 0.18);
    --exam-portfolio: #a78bfa;
    --exam-portfolio-ink: #c4b5fd;
    --exam-portfolio-soft: rgba(167, 139, 250, 0.18);
    --exam-oral: #fbbf24;
    --exam-oral-ink: #fcd34d;
    --exam-oral-soft: rgba(251, 191, 36, 0.19);
    --exam-assignment: #fb7185;
    --exam-assignment-ink: #fda4af;
    --exam-assignment-soft: rgba(251, 113, 133, 0.18);
    --exam-other: #94a3b8;
    --exam-other-ink: #cbd5e1;
    --exam-other-soft: rgba(148, 163, 184, 0.18);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-pill,
  :root:not([data-theme="light"]) .eb-exam-part-chip {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card {
    border-color: rgba(255, 255, 255, 0.13);
    background:
      radial-gradient(ellipse 70% 80% at 6% 0%, rgba(255, 255, 255, 0.06), transparent 62%),
      linear-gradient(155deg, rgba(28, 39, 36, 0.84) 0%, rgba(19, 27, 25, 0.74) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.11),
      inset 0 -1px 0 rgba(0, 0, 0, 0.28),
      0 10px 28px rgba(0, 0, 0, 0.32);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card.is-home-exam {
    border-color: color-mix(in srgb, var(--exam-home) 34%, rgba(255, 255, 255, 0.1));
    background:
      radial-gradient(ellipse 68% 76% at 5% 0%, rgba(45, 212, 191, 0.15), transparent 65%),
      linear-gradient(155deg, rgba(24, 38, 36, 0.86) 0%, rgba(17, 26, 24, 0.76) 100%);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card.is-school-exam {
    border-color: color-mix(in srgb, var(--exam-school) 32%, rgba(255, 255, 255, 0.1));
    background:
      radial-gradient(ellipse 68% 76% at 5% 0%, rgba(96, 165, 250, 0.13), transparent 65%),
      linear-gradient(155deg, rgba(24, 34, 42, 0.86) 0%, rgba(18, 25, 30, 0.76) 100%);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card.is-portfolio-exam {
    border-color: color-mix(in srgb, var(--exam-portfolio) 34%, rgba(255, 255, 255, 0.1));
    background:
      radial-gradient(ellipse 68% 76% at 5% 0%, rgba(167, 139, 250, 0.14), transparent 65%),
      linear-gradient(155deg, rgba(30, 31, 44, 0.86) 0%, rgba(20, 22, 30, 0.76) 100%);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card.is-oral-exam {
    border-color: color-mix(in srgb, var(--exam-oral) 34%, rgba(255, 255, 255, 0.1));
    background:
      radial-gradient(ellipse 68% 76% at 5% 0%, rgba(251, 191, 36, 0.14), transparent 65%),
      linear-gradient(155deg, rgba(42, 35, 24, 0.86) 0%, rgba(28, 24, 18, 0.76) 100%);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-card.is-assignment-exam {
    border-color: color-mix(in srgb, var(--exam-assignment) 34%, rgba(255, 255, 255, 0.1));
    background:
      radial-gradient(ellipse 68% 76% at 5% 0%, rgba(251, 113, 133, 0.14), transparent 65%),
      linear-gradient(155deg, rgba(42, 26, 32, 0.86) 0%, rgba(28, 19, 23, 0.76) 100%);
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-source.is-link:hover {
    color: #091512;
  }
  :root:not([data-theme="light"]) .eb-exam-fmt-skeleton,
  :root:not([data-theme="light"]) .eb-exam-fmt-fallback {
    background: rgba(26, 35, 32, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  :root:not([data-theme="light"]) .eb-exam-weight-bar {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  }
  :root:not([data-theme="light"]) .eb-exam-weight-seg {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
}

/* Sticky Bottom Course Comparator Tray */
.eb-compare-bar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  transform: translateX(-50%);
  width: min(1088px, calc(100vw - 20px));
  z-index: 60;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--glass-bg-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22);
  padding: 10px 14px;
}
:root[data-theme="dark"] .eb-compare-bar,
html[data-theme="dark"] .eb-compare-bar {
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}
.eb-compare-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.eb-compare-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.eb-compare-title {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  margin-right: 2px;
}
.eb-compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
}
.eb-compare-chip-uni {
  color: var(--muted);
  font-size: 11px;
}
.eb-series-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.eb-chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.eb-chip-remove:hover {
  color: var(--grade-f-ink);
}
.eb-compare-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Side-by-Side Comparison Table */
.eb-compare-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.eb-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.eb-compare-table th,
.eb-compare-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.eb-compare-table thead th {
  background: var(--panel-alt);
  vertical-align: top;
}
.eb-compare-table tbody th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  width: 146px;
}
.eb-compare-table tbody tr:last-child th,
.eb-compare-table tbody tr:last-child td {
  border-bottom: none;
}
.eb-cmp-th {
  display: grid;
  gap: 3px;
  min-width: 145px;
}
.eb-cmp-code-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}
.eb-cmp-name-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.eb-cmp-name-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}
.eb-best-cell {
  background: color-mix(in srgb, var(--grade-a) 7%, transparent);
}
.eb-worst-cell {
  background: color-mix(in srgb, var(--grade-f) 6%, transparent);
}
.eb-best-tag,
.eb-worst-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  margin-left: 3px;
}
.eb-best-tag {
  background: var(--grade-a-soft);
  color: var(--grade-a-ink);
}
.eb-worst-tag {
  background: var(--grade-f-soft);
  color: var(--grade-f-ink);
}

/* Inline DBH Grade Card embedded on /courses/*.html pages */
.dbh-inline-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

/* Subtle Floating Toast */
.eb-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -14px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 180ms ease, transform 180ms ease;
  max-width: calc(100vw - 24px);
  text-align: center;
}
.eb-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Responsive Breakpoints (Zero horizontal overflow down to 360px/390px) */
@media (max-width: 860px) {
  .eb-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .eb-stats-btn {
    width: 100%;
    justify-content: space-between;
  }
  .eb-actions {
    min-width: 0;
  }
  .eb-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .eb-rate-grid {
    grid-template-columns: 1fr;
  }
  .dbh-inline-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.has-compare-bar {
    padding-bottom: 160px;
  }
}

@media (max-width: 560px) {
  .eb-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .eb-search-wrap {
    grid-column: 1 / -1;
  }
  .eb-select,
  .eb-select-scale {
    min-width: 0;
    width: 100%;
  }
  .eb-share-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .eb-dlg-head {
    flex-direction: column;
    padding: 14px 14px 11px;
  }
  .eb-dlg-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .eb-dlg-body {
    padding: 12px 14px 18px;
  }
  .eb-source-row {
    flex-wrap: wrap;
  }
  .eb-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .eb-kpi-strip > .eb-kpi-tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .eb-grade-pills {
    flex-wrap: nowrap;
  }
  .eb-grade-choice {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px;
  }
  .eb-compare-bar {
    padding: 9px 10px;
  }
  .eb-compare-bar-actions {
    width: 100%;
  }
  .eb-compare-bar-actions > .primary-btn {
    flex: 1 1 auto;
  }
  .eb-compare-chip-uni {
    display: none;
  }
  .eb-section-box {
    padding: 12px;
  }
  .eb-prices-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 9px 10px;
  }
  .eb-price-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  .eb-price-right {
    justify-content: space-between;
    width: 100%;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }
  .eb-price-nums {
    align-items: flex-start;
    text-align: left;
  }
  .eb-price-skel-row {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 10px;
  }
  .eb-skel-right {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
  .eb-nb-box {
    align-items: flex-start;
  }
  .eb-term-tab {
    flex: 1 1 calc(50% - 4px);
    padding: 7px 8px;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }
  .eb-pensum-book {
    padding: 11px;
  }
  .eb-book-offer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 8px 9px;
  }
  .eb-book-offer-sub {
    max-width: 100%;
    white-space: normal;
  }
  .eb-book-offer-right {
    justify-content: space-between;
    width: 100%;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
  }
  .eb-book-offer-nums {
    justify-content: flex-start;
  }
  .eb-exam-fmt-card {
    padding: 11px 12px;
    gap: 8px;
    border-radius: 14px;
  }
  .eb-exam-fmt-pill.is-lg {
    font-size: 12px;
    padding: 3px 9px;
  }
  .eb-exam-part-chip {
    font-size: 11.5px;
    padding: 3px 8px;
  }
  .eb-exam-fmt-fallback {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 9px 11px;
  }
  .eb-exam-fmt-fallback-link {
    white-space: normal;
  }
}
