/* AB-100 Exam Prep — shared theme and base components */

:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-text-soft: #6f6f6f;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-success: #16a34a;
  --cp-danger: #dc2626;
  --cp-warning: #f59e0b;
  --cp-link: #0078d4;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-overlay: rgba(255, 255, 255, 0.8);
  --cp-panel: rgba(255, 255, 255, 0.86);
  --cp-panel-strong: rgba(255, 255, 255, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.55);
  --cp-highlight: rgba(177, 31, 75, 0.12);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #3d3b3a;
  --cp-bg-elevated: #343231;
  --cp-surface: #292929;
  --cp-surface-soft: #2e2e2e;
  --cp-border: #474747;
  --cp-border-strong: #5f5f5f;
  --cp-text: #dedede;
  --cp-text-muted: #919191;
  --cp-text-soft: #b0b0b0;
  --cp-accent: #fd8ea1;
  --cp-accent-hover: #fb7b91;
  --cp-accent-soft: rgba(253, 142, 161, 0.14);
  --cp-accent-fg: #1a1a1a;
  --cp-success: #4ade80;
  --cp-danger: #f87171;
  --cp-warning: #fbbf24;
  --cp-link: #4da6ff;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --cp-overlay: rgba(41, 41, 41, 0.88);
  --cp-panel: rgba(41, 41, 41, 0.72);
  --cp-panel-strong: rgba(41, 41, 41, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.04);
  --cp-highlight: rgba(253, 142, 161, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cp-bg);
  color: var(--cp-text);
  font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0 0 12px; }
a { color: var(--cp-link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd {
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 0.9em;
  background: var(--cp-surface-soft);
  border: 1px solid var(--cp-border);
  border-radius: 5px;
  padding: 1px 5px;
}
kbd { font-weight: 600; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--cp-panel-strong);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cp-border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 11px 20px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; text-decoration: none; color: var(--cp-text); }
.brand:hover { text-decoration: none; }
.badge-dot {
  width: 30px; height: 30px; border-radius: 0.625rem; flex: none;
  background: var(--cp-accent); color: var(--cp-accent-fg);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.brand-title { font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--cp-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navlink {
  font-size: 14px; color: var(--cp-text-muted); padding: 6px 10px;
  border-radius: 0.625rem; text-decoration: none; white-space: nowrap;
}
.navlink:hover { background: var(--cp-surface-soft); color: var(--cp-text); text-decoration: none; }
.navlink.active { color: var(--cp-accent); background: var(--cp-accent-soft); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--cp-border); background: var(--cp-surface);
  color: var(--cp-text); border-radius: 0.625rem; padding: 9px 15px; font-weight: 500;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--cp-surface-soft); border-color: var(--cp-border-strong); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-accent-fg); }
.btn-primary:hover { background: var(--cp-accent-hover); border-color: var(--cp-accent-hover); color: var(--cp-accent-fg); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--cp-text-muted); }
.btn-ghost:hover { background: var(--cp-surface-soft); color: var(--cp-text); }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }
.wrap-narrow { max-width: 900px; }
.card {
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: 16px; box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14);
}
.pad { padding: 24px; }
.stack { display: grid; gap: 20px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--cp-text-muted); font-weight: 600; }
.lead { color: var(--cp-text-muted); max-width: 70ch; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--cp-accent-soft); color: var(--cp-accent); border: 1px solid transparent;
}
.pill-muted { background: var(--cp-surface-soft); color: var(--cp-text-muted); border-color: var(--cp-border); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 14px 16px; background: var(--cp-surface-soft); }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--cp-text-muted); }
.stat .v { font-size: 20px; font-weight: 600; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--cp-border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--cp-text-muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.footnote { font-size: 12px; color: var(--cp-text-soft); margin-top: 30px; text-align: center; }
.footnote a { color: var(--cp-text-soft); text-decoration: underline; }

/* ---------- study page components ---------- */
.study-grid { display: grid; grid-template-columns: 1fr 250px; gap: 24px; align-items: start; }
@media (max-width: 940px) { .study-grid { grid-template-columns: 1fr; } .toc { position: static !important; order: -1; } }
.toc { position: sticky; top: 76px; }
.toc h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--cp-text-muted); margin-bottom: 10px; }
.toc a { display: block; font-size: 13.5px; color: var(--cp-text-muted); padding: 5px 9px; border-radius: 7px; border-left: 2px solid transparent; }
.toc a:hover { background: var(--cp-surface-soft); color: var(--cp-text); text-decoration: none; }

section.block { scroll-margin-top: 84px; }
section.block + section.block { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--cp-border); }
section.block > h2 { font-size: 20px; margin-bottom: 12px; }
section.block h3 { font-size: 15px; margin: 20px 0 8px; }
section.block ul, section.block ol { margin: 0 0 12px; padding-left: 22px; }
section.block li { margin-bottom: 7px; }
section.block li > strong { color: var(--cp-text); }

.note {
  border: 1px solid var(--cp-border); border-left: 3px solid var(--cp-accent);
  background: var(--cp-accent-soft); border-radius: 0.625rem;
  padding: 12px 15px; margin: 16px 0; font-size: 14px;
}
.note .lbl { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: var(--cp-accent); display: block; margin-bottom: 3px; }
.note.warn { border-left-color: var(--cp-warning); background: color-mix(in srgb, var(--cp-warning) 9%, transparent); }
.note.warn .lbl { color: var(--cp-warning); }
.note.good { border-left-color: var(--cp-success); background: color-mix(in srgb, var(--cp-success) 9%, transparent); }
.note.good .lbl { color: var(--cp-success); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
@media (max-width: 620px) { .compare { grid-template-columns: 1fr; } }
.compare > div { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 13px 15px; font-size: 14px; }
.compare .do { border-left: 3px solid var(--cp-success); }
.compare .dont { border-left: 3px solid var(--cp-danger); }
.compare h4 { font-size: 13px; margin-bottom: 7px; }
.compare .do h4 { color: var(--cp-success); }
.compare .dont h4 { color: var(--cp-danger); }
.compare ul { margin: 0; padding-left: 19px; }

.checklist { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.checklist li {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 !important;
  border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 10px 13px;
  background: var(--cp-surface-soft); font-size: 14px;
}
.checklist li::before {
  content: ""; flex: none; width: 15px; height: 15px; margin-top: 3px;
  border: 1.5px solid var(--cp-border-strong); border-radius: 4px;
}

.modcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.modcard {
  display: grid; gap: 7px; align-content: start; padding: 17px 18px;
  border: 1px solid var(--cp-border); border-radius: 0.625rem; background: var(--cp-surface);
  color: var(--cp-text); text-decoration: none; transition: border-color .15s, background .15s, transform .15s;
}
.modcard:hover { border-color: var(--cp-accent); background: var(--cp-accent-soft); text-decoration: none; transform: translateY(-1px); }
.modcard .n { font-size: 12px; font-weight: 700; color: var(--cp-accent); letter-spacing: .04em; }
.modcard .t { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.modcard .t a { color: inherit; text-decoration: none; }
.modcard .t a:hover { color: var(--cp-accent); }
.modcard .d { font-size: 13.5px; color: var(--cp-text-muted); line-height: 1.5; }

.modlinks {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px;
  padding-top: 10px; border-top: 1px solid var(--cp-border);
  font-size: 13px; font-weight: 600;
}
.modlinks a { color: var(--cp-accent); text-decoration: none; }
.modlinks a:hover { text-decoration: underline; }
.modlinks a.muted { color: var(--cp-text-muted); font-weight: 500; }

/* ---------- exam notes page ---------- */
.hotspot {
  border: 1px solid var(--cp-border); border-radius: 0.625rem;
  background: var(--cp-surface); padding: 18px 20px; margin-bottom: 14px;
}
.hotspot > h3 { font-size: 16.5px; margin-bottom: 4px; }
.hotspot .whence { font-size: 12.5px; color: var(--cp-text-muted); margin-bottom: 12px; }
.hotspot h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--cp-text-muted); margin: 16px 0 7px;
}
.hotspot ul { margin: 0; padding-left: 19px; font-size: 14px; }
.hotspot li { margin-bottom: 6px; }
.srclinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.srclinks a {
  font-size: 12.5px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--cp-border); border-radius: 999px; padding: 4px 11px;
  color: var(--cp-text-muted); background: var(--cp-surface-soft);
}
.srclinks a:hover { border-color: var(--cp-accent); color: var(--cp-accent); text-decoration: none; }
.splitbar {
  display: flex; height: 34px; border-radius: 0.625rem; overflow: hidden;
  border: 1px solid var(--cp-border); margin: 14px 0 10px; font-size: 12.5px; font-weight: 600;
}
.splitbar span { display: grid; place-items: center; }
.splitbar .one { flex: 1; background: var(--cp-accent); color: var(--cp-accent-fg); }
.splitbar .many { flex: 1; background: var(--cp-surface-soft); color: var(--cp-text); }

.pagenav { display: flex; gap: 12px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--cp-border); flex-wrap: wrap; }
.pagenav .spacer { margin-left: auto; }

/* ---------- cram sheet ---------- */
.cram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.cram {
  border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 16px 18px;
  background: var(--cp-surface); display: grid; gap: 8px; align-content: start;
}
.cram h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.cram h3 .num {
  flex: none; width: 21px; height: 21px; border-radius: 6px; background: var(--cp-accent);
  color: var(--cp-accent-fg); font-size: 11px; display: grid; place-items: center; font-weight: 700;
}
.cram ul { margin: 0; padding-left: 19px; font-size: 13.5px; }
.cram li { margin-bottom: 6px; }
.cram li strong { color: var(--cp-text); }

.deftable td:first-child { font-weight: 600; width: 32%; }
@media (max-width: 600px) { .deftable td:first-child { width: 40%; } }

@media print {
  .topbar, .toc, .pagenav, .btn, .footnote { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
  .study-grid { grid-template-columns: 1fr; }
}

/* ---------- video course ---------- */
.vidlist { display: flex; flex-direction: column; gap: 10px; }
.vidrow {
  display: grid; grid-template-columns: 104px 1fr auto; gap: 14px; align-items: start;
  border: 1px solid var(--cp-border); border-radius: 0.625rem;
  padding: 12px 14px; background: var(--cp-surface-soft);
}
.vidrow:hover { border-color: var(--cp-accent); background: var(--cp-accent-soft); }
.vidnum {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--cp-accent); padding-top: 2px;
}
.vidmain { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vidtitle { font-weight: 600; font-size: 14.5px; line-height: 1.4; color: var(--cp-text); text-decoration: none; }
.vidtitle:hover { color: var(--cp-accent); text-decoration: underline; }
.viddesc { font-size: 13px; color: var(--cp-text-muted); line-height: 1.5; }
.viddesc a { color: var(--cp-accent); text-decoration: none; }
.viddesc a:hover { text-decoration: underline; }
.viddur {
  font-size: 12.5px; color: var(--cp-text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.vidmods { display: flex; flex-direction: column; gap: 18px; }
.vidmod { border-top: 1px solid var(--cp-border); padding-top: 16px; }
.vidmod:first-child { border-top: 0; padding-top: 0; }
.vidmod-head { margin-bottom: 10px; }
.vidmod-head .n { display: block; font-size: 12px; font-weight: 700; color: var(--cp-accent); letter-spacing: .04em; }
.vidmod-head .t { display: block; font-weight: 600; font-size: 16px; margin-top: 2px; }
@media (max-width: 560px) {
  .vidrow { grid-template-columns: 1fr auto; }
  .vidnum { grid-column: 1 / -1; }
}
