* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 760px;
  padding: 0 1rem 3rem;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.9;
  color: #222;
  background: #faf9f6;
}
header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .5rem 0; }
h1 { font-size: 1.4rem; margin: .5rem 0; }
.resume-btn { background: #e8f0e8; border: 1px solid #4a7c59; color: #2d5a3d; padding: .4rem .8rem; border-radius: 6px; cursor: pointer; }
nav, .controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
select, button {
  font-size: 1rem; padding: .45rem .7rem; border-radius: 6px;
  border: 1px solid #bbb; background: #fff; cursor: pointer;
}
button.primary { background: #4a7c59; color: #fff; border-color: #4a7c59; }
button:hover { filter: brightness(.95); }
a#download-btn {
  text-decoration: none; display: inline-block; background: #fff;
}
a#download-btn:hover { filter: brightness(.95); }

/* floating prev/next chapter buttons */
.float-nav { position: fixed; right: .9rem; bottom: 1.1rem; z-index: 10;
  display: flex; flex-direction: column; gap: .5rem; }
.float-nav button { width: 2.7rem; height: 2.7rem; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; padding: 0; border: 1px solid #4a7c59;
  background: rgba(74, 124, 89, .82); color: #fff; backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.float-nav button:hover { background: #4a7c59; }
.float-nav button:disabled { opacity: .35; cursor: default; }
details.help { margin-top: 1rem; font-size: .9rem; color: #444; }
details.help summary { cursor: pointer; color: #4a7c59; }
.manual-done { display: flex; align-items: center; gap: .35rem; cursor: pointer;
  color: #2d5a3d; border: 1px solid #4a7c59; border-radius: 6px;
  padding: .45rem .7rem; background: #e8f0e8; }
.manual-done input { width: 1.1rem; height: 1.1rem; accent-color: #4a7c59; }

/* progress page */
.summary { text-align: center; margin: 1rem 0 1.5rem; line-height: 1.7; }
.bigpct { font-size: 2.4rem; font-weight: 700; color: #4a7c59; }
.sumlabel { font-size: .85rem; color: #777; margin-top: -0.3rem; }
.small { font-size: .85rem; }
.insights { text-align: left; max-width: 26rem; margin: .4rem auto 0;
  line-height: 2; }
.insights p { margin: .15rem 0; }
.stats-details { max-width: 28rem; margin: .8rem auto 0; }
.stats-details summary { cursor: pointer; color: #4a7c59; font-size: .9rem;
  text-align: center; user-select: none; }
.stats-details summary:hover { text-decoration: underline; }
.pbar { display: block; height: .55rem; background: #e5e1d8; border-radius: 4px;
  overflow: hidden; margin-top: .3rem; }
.pfill { display: block; height: 100%; background: #4a7c59; border-radius: 4px; }
.recent ol { padding-left: 1.4rem; line-height: 1.9; color: #333; }
.muted { color: #999; }
h2 { font-size: 1.1rem; color: #2d5a3d; margin: 1.4rem 0 .4rem; }
h3 { font-size: .95rem; color: #555; margin: .9rem 0 .3rem; }
.legend { margin: .8rem 0; font-size: .85rem; color: #555; }
.legend .cell.demo { cursor: default; display: inline-flex;
  width: 1.3rem; height: 1.3rem; vertical-align: -0.35rem; margin-right: .15rem; }
.bookrow { padding: .25rem 0 .45rem; font-size: .95rem; }
.bookrow .bhead { display: flex; gap: .7rem; align-items: baseline; }
.bookrow .bname { min-width: 7.5em; }
.bookrow .bstat { color: #555; font-variant-numeric: tabular-nums; }
.bookrow.idle .cells { opacity: .55; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(1.5rem, 1fr));
  gap: 3px; margin-top: .25rem; }
.cell { display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 4px; font-size: .62rem; text-decoration: none;
  border: 1px solid #d8d4ca; background: #fff; color: #777; }
.cell:hover { outline: 2px solid #4a7c59; }
.c0 { background: #ffffff; }
.c1 { background: #cde5d3; border-color: #b5d4bf; color: #2d5a3d; }
.c2 { background: #8fc3a0; border-color: #7cb28f; color: #173d26; }
.c3 { background: #4a7c59; border-color: #4a7c59; color: #fff; }
.c4 { background: #2d5a3d; border-color: #2d5a3d; color: #fff; }
.danger { color: #a33; border-color: #a33; background: #fff; }
.speed { display: flex; align-items: center; gap: .4rem; }
.speed input { width: 140px; }
#speed-val { min-width: 2.8em; text-align: center; font-variant-numeric: tabular-nums; }
.status { min-height: 1.5em; color: #555; font-size: .95rem; margin: .2rem 0; }
.stats { font-size: .9rem; color: #666; margin: .2rem 0 .8rem; }
.chapter .verse {
  padding: .15rem .3rem; border-radius: 4px; cursor: pointer;
  font-size: calc(1rem * var(--font-scale, 1));
  line-height: 1.9;
}
.font-controls { display: inline-flex; gap: .25rem; margin-left: .15rem; }
.font-controls button { min-width: 2.4rem; font-weight: 700; }
.font-controls button:disabled { opacity: .35; cursor: default; }
.chapter .verse .vnum { color: #4a7c59; font-size: .8em; user-select: none; margin-right: .25em; }
.chapter .verse.speaking { background: #fff3bf; }
.chapter .verse.stopped { background: #ffe3e3; }
footer { margin-top: 2rem; font-size: .85rem; color: #888; }
.hidden { display: none; }
