/* Claude Certs study-notes site — warm off-white reading theme.
   Modeled on eds-voice; accent = clay/rust #b3541e. */
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 760px;
  padding: 0 1rem 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.9;
  color: #222;
  background: #faf9f6;
}
body.reader { padding-bottom: 0; }
/* keep scrolled-to lines clear of the sticky header (reader) */
html { scroll-padding-top: 130px; }

/* sticky header: title row + player bar stay on top while scrolling */
.stickyhead { position: sticky; top: 0; z-index: 10; margin: 0 -1rem;
  padding: 0 1rem .45rem; background: #faf9f6;
  border-bottom: 1px solid #e5e1d8; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }

/* compact sticky bar on phone-width screens */
@media (max-width: 560px) {
  .topbar { gap: .5rem; padding: .4rem 0 .2rem; }
  .ch-title { font-size: .88rem; }
  .topnav button, .p-inner button, .p-inner select {
    font-size: .85rem; padding: .35rem .5rem; }
  .p-inner { gap: .4rem; }
  .p-inner .t { font-size: .78rem; min-width: 2.5em; }
  .done-toggle { font-size: .85rem; padding: .3rem .5rem; }
}

header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .5rem 0; }
h1 { font-size: 1.4rem; margin: .5rem 0; }
a { color: #b3541e; }
.nav-btn { background: #f6e8de; border: 1px solid #b3541e; color: #7a3410;
  padding: .4rem .8rem; border-radius: 6px; cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.nav-btn:hover { filter: brightness(.96); }
.tagline { color: #555; margin-top: 0; }
.muted { color: #999; }
.hidden { display: none; }

button, select {
  font-size: 1rem; padding: .45rem .7rem; border-radius: 6px;
  border: 1px solid #bbb; background: #fff; cursor: pointer;
}
button.primary { background: #b3541e; color: #fff; border-color: #b3541e; }
button:hover { filter: brightness(.95); }
button:disabled { opacity: .35; cursor: default; }
.danger { color: #a33; border-color: #a33; background: #fff; }

/* ---- catalog ---- */
.pack { margin-top: 1.6rem; }
.pack h2 { font-size: 1.15rem; color: #7a3410; margin: 0 0 .1rem; }
.pack .blurb { color: #666; font-size: .9rem; margin: 0 0 .4rem; }
.row { display: flex; gap: .7rem; align-items: baseline; padding: .35rem .5rem;
  border-radius: 6px; text-decoration: none; color: #222; }
.row:hover { background: #f3efe6; }
.row .num { min-width: 1.8em; text-align: right; color: #aaa;
  font-variant-numeric: tabular-nums; font-size: .9rem; }
.row .ctitle { flex: 1; }
.row .dur { color: #777; font-size: .85rem; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; align-self: center;
  border: 1.5px solid #b3541e; flex: none; }
.dot.done { background: #b3541e; }

/* ---- reader top bar (inside .stickyhead) ---- */
.topbar { display: flex; gap: .8rem; align-items: center; padding: .5rem 0 .3rem; }
.topbar .now { flex: 1; min-width: 0; }
.ch-title { font-weight: 600; line-height: 1.35; font-size: .98rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-sub { display: flex; gap: .6rem; align-items: center; }
.ch-pack { font-size: .78rem; color: #888; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Listen / Study notes view toggle */
.seg { display: inline-flex; border: 1px solid #b3541e; border-radius: 6px;
  overflow: hidden; flex: none; }
.seg button { border: none; border-radius: 0; padding: .12rem .55rem;
  font-size: .78rem; background: #fff; color: #7a3410; }
.seg button + button { border-left: 1px solid #b3541e; }
.seg button.active { background: #b3541e; color: #fff; }
.topnav { display: flex; gap: .4rem; }
.topnav button { white-space: nowrap; }

/* ---- chapter typography ---- */
.chapter h1 { font-size: 1.45rem; line-height: 1.4; color: #7a3410;
  margin: 1.2rem 0 .6rem; }
.chapter h2 { font-size: 1.2rem; line-height: 1.4; color: #7a3410;
  margin: 1.6rem 0 .4rem; }
.chapter h3 { font-size: 1.02rem; color: #444; margin: 1.2rem 0 .3rem; }
.chapter h4 { font-size: .95rem; color: #555; margin: 1rem 0 .2rem; }
.chapter p { margin: .7rem 0; }
.chapter blockquote { margin: .8rem 0; padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid #e0b79c; color: #555; }
.chapter code { background: #f3efe7; padding: .1em .35em; border-radius: 4px;
  font-size: .88em; overflow-wrap: break-word; }
.chapter pre { background: #f5f2ea; padding: .8rem 1rem; border-radius: 6px;
  overflow-x: auto; line-height: 1.55; }
.chapter pre code { background: none; padding: 0; }
.chapter table { display: block; overflow-x: auto; border-collapse: collapse;
  width: 100%; margin: 1rem 0; font-size: .88rem; line-height: 1.55; }
.chapter th, .chapter td { border: 1px solid #ddd5c6; padding: .35rem .55rem;
  text-align: left; vertical-align: top; }
.chapter th { background: #f3ede2; }
.chapter hr { border: none; border-top: 1px solid #e3ded2; margin: 1.6rem 0; }
.chapter img { max-width: 100%; }
.chapter .error { border: 1px solid #a33; border-radius: 8px;
  padding: 1rem 1.2rem; color: #a33; }

/* ---- player bar (inside .stickyhead, compact for phone widths) ---- */
.p-inner { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.p-inner .t { font-variant-numeric: tabular-nums; font-size: .85rem;
  color: #555; min-width: 2.9em; text-align: center; }
#seek { flex: 1; min-width: 6rem; accent-color: #b3541e; }
#speed { padding: .35rem .4rem; }
.done-toggle { display: flex; align-items: center; gap: .35rem;
  cursor: pointer; color: #7a3410; border: 1px solid #b3541e;
  border-radius: 6px; padding: .4rem .65rem; background: #f6e8de;
  font-size: .95rem; white-space: nowrap; }
.done-toggle input { width: 1.05rem; height: 1.05rem; accent-color: #b3541e; }
.note { font-size: .8rem; color: #b3541e; line-height: 1.4; }

/* ---- karaoke highlight (Listen view) ---- */
.chapter.scriptview > * { cursor: pointer; }
.chapter .speaking { background: #fff3bf; border-left: 3px solid #b3541e;
  padding-left: .45rem; border-radius: 4px; }
/* sentence-level highlight: inline, no border, clean wrap across lines */
.chapter span.s.speaking { border-left: none; padding-left: 0;
  border-radius: 3px; box-decoration-break: clone;
  -webkit-box-decoration-break: clone; }

/* ---- progress page ---- */
.summary { text-align: center; margin: 1rem 0 1.5rem; line-height: 1.7; }
.bigpct { font-size: 2.4rem; font-weight: 700; color: #b3541e; }
.sumlabel { font-size: .85rem; color: #777; margin-top: -0.3rem; }
.pbar { display: block; height: .55rem; background: #e5e1d8;
  border-radius: 4px; overflow: hidden; margin-top: .3rem; }
.pfill { display: block; height: 100%; background: #b3541e;
  border-radius: 4px; }
.prow { padding: .5rem 0 .7rem; font-size: .95rem; }
.prow .phead { display: flex; gap: .7rem; align-items: baseline;
  justify-content: space-between; }
.prow .pname { font-weight: 600; color: #7a3410; }
.prow .pstat { color: #555; font-variant-numeric: tabular-nums;
  font-size: .85rem; white-space: nowrap; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr));
  gap: 4px; margin-top: .35rem; }
.cell { display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 4px; font-size: .72rem; text-decoration: none;
  border: 1px solid #d8d4ca; background: #fff; color: #777;
  font-variant-numeric: tabular-nums; }
.cell:hover { outline: 2px solid #b3541e; }
.cell.done { background: #b3541e; border-color: #b3541e; color: #fff; }

footer { margin-top: 2rem; font-size: .85rem; color: #888; }
