:root {
  color-scheme: light;
  --bg: #151312;
  --paper: #fffaf0;
  --paper2: #f1e7d8;
  --ink: #211c18;
  --muted: rgba(33, 28, 24, 0.62);
  --line: rgba(33, 28, 24, 0.14);
  --red: #bc0b0e;
  --blue: #244cff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
body { overflow-x: clip; }
button, input { font: inherit; }
.app { max-width: 820px; min-height: 100dvh; margin: 0 auto; background: var(--paper); overflow-x: clip; }
.sticky-panel { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 250, 240, 0.97); backdrop-filter: blur(10px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px 7px; border-bottom: 1px solid var(--line); }
.title-block { min-width: 0; }
.brand { margin: 0 0 1px; color: var(--red); font-size: 11px; font-weight: 950; }
h1 { margin: 0; font-size: 20px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download, .pager button, .mode-row button, .translation-toggle { border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.download { flex: 0 0 auto; padding: 8px 10px; color: var(--red); text-decoration: none; font-size: 13px; font-weight: 900; }
.passage-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 8px 4px; }
.counter { margin: 0 0 2px; color: var(--blue); font-size: 12px; font-weight: 900; }
h2 { margin: 0; min-width: 0; font-size: 19px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: grid; grid-template-columns: 36px 58px 36px; gap: 5px; align-items: center; }
.pager button { min-height: 34px; padding: 0; font-size: 21px; font-weight: 950; }
.pager #currentPassage { color: var(--blue); font-size: 17px; background: #fffdf7; }
.range { display: block; width: calc(100% - 16px); margin: 3px 8px 8px; accent-color: var(--blue); }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 8px 8px; }
.mode-row button { min-height: 36px; font-size: 14px; font-weight: 900; }
.mode-row button.active { border-color: rgba(36, 76, 255, 0.32); background: #e7ecff; color: var(--blue); }
.sentence-list { padding: 10px 12px 26px; }
.sentence-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--paper2); color: var(--red); font-size: 13px; font-weight: 950; }
.pair { min-width: 0; }
.english { margin: 0 0 7px; font-size: 16px; line-height: 1.45; font-weight: 780; overflow-wrap: anywhere; }
.translation-toggle { display: block; width: 100%; min-height: 34px; padding: 8px 9px; text-align: left; background: #fff; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.translation-toggle.is-hidden { color: transparent; background: #2a2520; }
.translation-toggle.is-hidden::selection { color: transparent; background: transparent; }
@media (max-width: 430px) {
  h1 { font-size: 18px; }
  h2 { font-size: 17px; }
  .pager { grid-template-columns: 32px 52px 32px; }
  .english { font-size: 15px; }
  .translation-toggle { font-size: 14px; }
  .sentence-list { padding-left: 10px; padding-right: 10px; }
}

.top-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.version-link { display: inline-block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #e7ecff; color: var(--blue); font-size: 13px; font-weight: 900; line-height: 1; text-decoration: none; }
