/* Umlijoog Atlas. Kaavi red-oxide on limewash, with sea ink. */
:root {
  color-scheme: light;
  --page: #eef0ed;
  --surface: #fbfbf9;
  --ink: #14252c;
  --ink-2: #47555a;
  --muted: #6f7b7b;
  --grid: #dde1dd;
  --axis: #b9c1bd;
  --ring: rgba(20, 37, 44, 0.12);
  --sea: #1a6fa8;
  --kaavi: #b4462a;
  --wash-sea: rgba(26, 111, 168, 0.10);
  --mid: #e4e6e2;
  --serif: "Tiro Kannada", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
  --rail: 7.5rem;
}
/* Light by default: easier to read outdoors on a basic phone. Dark is in Options. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c1417;
  --surface: #142024;
  --ink: #e7ecea;
  --ink-2: #b3bfbd;
  --muted: #8a9693;
  --grid: #22323a;
  --axis: #3a4c52;
  --ring: rgba(255, 255, 255, 0.10);
  --sea: #3b8fcc;
  --kaavi: #d0623f;
  --wash-sea: rgba(59, 143, 204, 0.14);
  --mid: #2a3a40;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}
a { color: var(--sea); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--kaavi);
  outline-offset: 3px;
}
img { max-width: 100%; display: block; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

/* Top bar */
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  font-family: var(--sans); font-size: 0.875rem; color: var(--ink-2);
}
.bar button {
  font: inherit; color: inherit; background: none; border: 1px solid var(--ring);
  border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer;
}

/* Opening */
.opening { padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem; max-width: 74rem; margin: 0 auto; }
.opening h1 {
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 1.5rem 0 0.75rem;
  max-width: 16ch;
}
.opening .lede { max-width: var(--measure); color: var(--ink-2); font-size: 1.2rem; margin: 0 0 2rem; }

/* Swipe compare */
.compare {
  position: relative; overflow: hidden; border-radius: 6px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--ring);
  touch-action: pan-y; user-select: none;
}
.compare img { width: 100%; height: auto; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); pointer-events: none;
}
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0;
}
.compare .tag {
  position: absolute; top: 0.6rem; font-family: var(--sans); font-size: 0.8rem;
  background: rgba(12, 20, 23, 0.72); color: #fff; padding: 0.2rem 0.55rem; border-radius: 3px;
}
.compare .tag.l { left: 0.6rem; } .compare .tag.r { right: 0.6rem; }
.pin {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  font-family: var(--sans); font-size: 0.78rem; color: #fff; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
}
.pin::before {
  content: ""; display: block; width: 10px; height: 10px; margin: 0 auto 2px;
  border-radius: 50%; background: var(--kaavi); box-shadow: 0 0 0 2px #fff;
}
.pin.minor::before { width: 7px; height: 7px; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); }
.caption { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; max-width: 60rem; }

/* Index of records */
.index { max-width: 74rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 2rem; }
.index ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--sans); font-size: 0.92rem; }
.index a { color: var(--ink-2); text-decoration: none; }
.index a:hover { color: var(--ink); text-decoration: underline; }
.index b { color: var(--kaavi); font-weight: 600; margin-right: 0.35rem; }

/* Record sections: the start year sits in the rail */
.record {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 2rem; max-width: 74rem; margin: 0 auto;
  padding: 3.5rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--grid);
}
.record .year {
  font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; color: var(--kaavi);
  position: sticky; top: 1.5rem; align-self: start; margin: 0.2rem 0 0;
}
.record .body { min-width: 0; }
.record h2 { font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 0.75rem; }
.record p { max-width: var(--measure); margin: 0 0 1rem; }
.record .src { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); max-width: var(--measure); }
.record .src a { color: var(--muted); }

@media (max-width: 720px) {
  .record { grid-template-columns: 1fr; padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .record .year { position: static; margin-bottom: 0.5rem; }
}

/* Facts row */
.facts { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; margin: 1.25rem 0 1.5rem; padding: 0; list-style: none; }
.facts li { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); max-width: 15rem; }
.facts strong { display: block; font-size: 1.6rem; font-weight: 600; color: var(--ink); line-height: 1.2; }

/* Figures */
.fig {
  background: var(--surface); border-radius: 6px; box-shadow: 0 0 0 1px var(--ring);
  padding: 1rem 1rem 0.75rem; margin: 1.25rem 0; position: relative;
}
.fig h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; margin: 0 0 0.15rem; }
.fig .sub { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin: 0 0 0.5rem; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); margin: 0 0 0.4rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
.legend i.box { width: 10px; height: 10px; border-radius: 2px; }

.axis text, .lbl { font-family: var(--sans); font-size: 13px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lbl.ink { fill: var(--ink-2); }
.grid line { stroke: var(--grid); stroke-width: 1; }
.base { stroke: var(--axis); stroke-width: 1; }
.cross { stroke: var(--ink-2); stroke-width: 1; }

.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 8rem;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring), 0 6px 18px rgba(0,0,0,.12);
  border-radius: 5px; padding: 0.45rem 0.6rem; font-family: var(--sans); font-size: 0.8rem; line-height: 1.35;
}
.tip .t { color: var(--muted); margin-bottom: 0.2rem; }
.tip .row { display: flex; align-items: center; gap: 0.45rem; }
.tip .row i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip .row b { font-weight: 600; }
.tip .row span { color: var(--ink-2); }
.tip[hidden] { display: none; }

details.table { font-family: var(--sans); font-size: 0.82rem; margin-top: 0.4rem; }
details.table summary { cursor: pointer; color: var(--ink-2); }
details.table .wrap { max-height: 18rem; overflow: auto; margin-top: 0.4rem; }
details.table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
details.table th, details.table td { text-align: right; padding: 0.2rem 0.6rem; border-bottom: 1px solid var(--grid); }
details.table th:first-child, details.table td:first-child { text-align: left; }

/* Gallery of satellite frames and maps */
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.frames figure { margin: 0; }
.frames .imgwrap { position: relative; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--ring); background: var(--surface); }
.frames figcaption { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); margin-top: 0.35rem; }
.frames figcaption small { display: block; color: var(--muted); }

blockquote.gz {
  margin: 1.25rem 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 3px solid var(--kaavi);
  max-width: var(--measure); font-size: 1.05rem;
}
blockquote.gz p { margin: 0 0 0.4rem; }
blockquote.gz cite { font-family: var(--sans); font-style: normal; font-size: 0.8rem; color: var(--muted); }

ol.timeline { list-style: none; padding: 0; margin: 1rem 0; max-width: var(--measure); }
ol.timeline li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid var(--grid); }
ol.timeline .y { color: var(--kaavi); font-variant-numeric: tabular-nums; }
ol.timeline a { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

.note { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 5px; padding: 0.7rem 0.9rem; max-width: var(--measure); }

footer.end {
  max-width: 74rem; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 2.5rem) 4rem;
  border-top: 1px solid var(--grid); font-family: var(--sans); font-size: 0.85rem; color: var(--muted);
}
footer.end p { max-width: 44rem; }

.prose { max-width: 46rem; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.prose h1 { font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.prose h2 { font-weight: 400; font-size: 1.5rem; margin-top: 2.2rem; }
.prose code { font-size: 0.85em; background: var(--surface); padding: 0.05rem 0.3rem; border-radius: 3px; box-shadow: 0 0 0 1px var(--ring); }
.prose pre { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 5px; padding: 0.8rem; overflow-x: auto; font-size: 0.82rem; }
.prose li { margin-bottom: 0.3rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .bar button, details.table summary { display: none; } .record { break-inside: avoid; } }

/* Narrow screens: secondary pins keep their dot, lose their label, so names never collide. */
@media (max-width: 600px) {
  .pin.minor { font-size: 0; }
  .facts { gap: 1rem 1.75rem; }
}

/* ---------- v2: navigation, explorer, chapters ---------- */
:root { --c-name: #8a6a33; --c-river: var(--sea); --c-rain: #2f7f74; --c-sea: var(--sea); --c-storms: var(--kaavi); --c-air: var(--kaavi); --c-people: #6a5a8c; }
html[lang="mr"] body, html[lang="kok"] body { font-family: "Tiro Devanagari Marathi", var(--serif); line-height: 1.8; }
html[lang="kn"] body { line-height: 1.8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar {
  position: sticky; top: 0; z-index: 20; gap: 1rem;
  background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--grid); padding-top: 0.6rem; padding-bottom: 0.6rem;
}
.bar .region { white-space: nowrap; }
.chapters { display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: none; flex: 1; justify-content: center; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a { white-space: nowrap; color: var(--ink-2); text-decoration: none; padding: 0.3rem 0.65rem; border-radius: 999px; }
.chapters a:hover { color: var(--ink); background: var(--surface); }
.chapters a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--ring); }
.tools { display: flex; gap: 0.5rem; align-items: center; }
.tools select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ring); border-radius: 999px; padding: 0.3rem 0.6rem; }
@media (max-width: 960px) {
  .bar { flex-wrap: wrap; }
  .bar .region { display: none; }
  .tools { margin-left: auto; }
  .chapters { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
.machine { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 5px; padding: 0.5rem 0.75rem; max-width: var(--measure); }
.caption b { font-weight: 600; color: var(--ink-2); }
section[id] { scroll-margin-top: 5rem; }

/* Year explorer */
.explorer { max-width: 74rem; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--grid); }
.explorer h2, .chapter h2 { font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.15; margin: 0 0 0.6rem; }
.explorer .intro { max-width: var(--measure); color: var(--ink-2); margin: 0 0 1.25rem; }
.ribbon svg { width: 100%; height: auto; display: block; }
.rb-lab { font-family: var(--sans); font-size: 10.5px; fill: var(--ink-2); }
.rb-axis { font-family: var(--sans); font-size: 10px; fill: var(--muted); }
.rb-track { stroke: var(--grid); stroke-width: 1; }
.rb-span { stroke-width: 5; stroke-linecap: round; opacity: 0.85; fill: none; }
.rb-dot { stroke: var(--page); stroke-width: 1; }
.rb-span.c-name { stroke: var(--c-name); } .rb-dot.c-name { fill: var(--c-name); }
.rb-span.c-river { stroke: var(--c-river); } .rb-dot.c-river { fill: var(--c-river); }
.rb-span.c-rain { stroke: var(--c-rain); } .rb-dot.c-rain { fill: var(--c-rain); }
.rb-span.c-sea { stroke: var(--c-sea); } .rb-dot.c-sea { fill: var(--c-sea); }
.rb-span.c-storms { stroke: var(--c-storms); } .rb-dot.c-storms { fill: var(--c-storms); }
.rb-span.c-air { stroke: var(--c-air); } .rb-dot.c-air { fill: var(--c-air); }
.rb-span.c-people { stroke: var(--c-people); } .rb-dot.c-people { fill: var(--c-people); }
.ribbon .now { stroke: var(--ink); stroke-width: 1.5; }
.yearbar { display: flex; gap: 0.6rem; align-items: center; margin: 0.8rem 0 0.6rem; font-family: var(--sans); }
.yearbar input[type="range"] { flex: 1; accent-color: var(--kaavi); min-width: 0; }
.yearbar button, .picks button, .tabs button, .flipbar button {
  font: inherit; font-family: var(--sans); font-size: 0.85rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--ring); border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; white-space: nowrap;
}
.yearbar button.ghost { background: none; }
.yearbar button:hover, .picks button:hover, .tabs button:hover, .flipbar button:hover { border-color: var(--ink-2); }
.picks { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 1.25rem; font-family: var(--sans); }
.picks-lab { font-size: 0.82rem; color: var(--muted); margin-right: 0.3rem; }
.picks b { color: var(--kaavi); font-weight: 600; }
.picks button[aria-pressed="true"], .tabs button[aria-selected="true"], .flipbar button[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.picks button[aria-pressed="true"] b { color: inherit; }
.yearcard { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 8px; padding: 1.25rem 1.4rem; }
.yc-year { font-size: clamp(3rem, 8vw, 4.6rem); line-height: 1; color: var(--kaavi); margin: 0 0 0.75rem; }
.yc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 1.5rem; align-items: start; }
.yc-body:not(:has(.yc-img)) { grid-template-columns: 1fr; }
.yc-list { list-style: none; margin: 0; padding: 0; }
.yc-list li { display: grid; grid-template-columns: 7rem 1fr; gap: 0.8rem; padding: 0.45rem 0; border-bottom: 1px solid var(--grid); }
.yc-list li:last-child { border-bottom: 0; }
.yc-chap { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); text-decoration: none; padding: 0.25rem 0 0 0.5rem; border-left: 3px solid var(--grid); }
.yc-list li[data-chap="name"] .yc-chap { border-color: var(--c-name); }
.yc-list li[data-chap="river"] .yc-chap { border-color: var(--c-river); }
.yc-list li[data-chap="rain"] .yc-chap { border-color: var(--c-rain); }
.yc-list li[data-chap="sea"] .yc-chap { border-color: var(--c-sea); }
.yc-list li[data-chap="storms"] .yc-chap { border-color: var(--c-storms); }
.yc-list li[data-chap="air"] .yc-chap { border-color: var(--c-air); }
.yc-list li[data-chap="people"] .yc-chap { border-color: var(--c-people); }
.yc-img img { border-radius: 4px; box-shadow: 0 0 0 1px var(--ring); }
.yc-empty { color: var(--ink-2); margin: 0; }
@media (max-width: 720px) {
  .yc-body { grid-template-columns: 1fr; }
  .yc-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .yearbar { flex-wrap: wrap; }
  .yearbar input[type="range"] { flex-basis: 100%; order: -1; }
}

/* Chapters */
.chapter { max-width: 74rem; margin: 0 auto; padding: 3.5rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--grid); }
.chapter > p, .more-body > p { max-width: var(--measure); }
.chapter .lead { font-size: 1.25rem; line-height: 1.6; }
.chapter h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.tabs { display: flex; gap: 0.4rem; margin: 1.25rem 0 0.6rem; }
.zoom, .flip { margin: 0 0 1rem; }
.zoom .imgwrap, .flip .imgwrap { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--ring); }
.zoom figcaption, .flip figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin-top: 0.5rem; max-width: 52rem; }
.ring { position: absolute; width: 24%; aspect-ratio: 2.8; transform: translate(-50%, -50%); border: 3px solid var(--kaavi); border-radius: 50%; pointer-events: none; }
.flip { outline-offset: 4px; }
.flipbar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0 0.6rem; }
.clues { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.8rem; }
.clues li { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 6px; padding: 0.9rem 1rem; }
.chapter .clues h3 { margin: 0 0 0.35rem; }
.clues p { margin: 0; font-size: 1rem; }
.verdict { border-left: 3px solid var(--kaavi); padding-left: 1rem; font-size: 1.15rem; }
details.more { margin-top: 1.75rem; }
details.more > summary {
  cursor: pointer; font-family: var(--sans); font-size: 0.95rem; color: var(--ink); padding: 0.6rem 0.9rem;
  background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 999px; display: inline-block; list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; color: var(--kaavi); }
details.more[open] > summary::before { content: "\2212  "; }
.more-body { padding-top: 0.5rem; }
.frames figure .imgwrap { position: relative; }

/* ---------- v3: plain reading for everyone ---------- */
body { font-size: 1.2rem; }
html.big { font-size: 118%; }
.chapter .lead { font-size: 1.3rem; }
.chapters { justify-content: flex-start; }
.chapters a { font-size: 0.95rem; }
#textsize, #theme { font: inherit; font-family: var(--sans); font-size: 0.9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--ring); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; white-space: nowrap; }
.langpick { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1.5rem; font-family: var(--sans); }
.langpick span { color: var(--ink-2); font-size: 1rem; margin-right: 0.25rem; }
.langpick button { font-size: 1.15rem; padding: 0.55rem 1.1rem; border-radius: 10px; border: 2px solid var(--ring); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 48px; }
.langpick button[lang="kn"] { font-family: "Tiro Kannada", var(--sans); }
.langpick button[lang="mr"], .langpick button[lang="kok"] { font-family: "Tiro Devanagari Marathi", var(--sans); }
.langpick button[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.yearbar button, .picks button, .tabs button, .flipbar button { min-height: 44px; font-size: 0.95rem; }
.yearbar input[type="range"] { height: 32px; }
.fliphelp { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2); margin: 1rem 0 0; }
.flipbar.modes { margin-top: 0.75rem; }
.items { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.item { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 8px; padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.item img { border-radius: 5px; margin: 0.25rem 0 0.6rem; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.item-year { margin: 0 0 0.2rem; color: var(--kaavi); font-size: 1.4rem; line-height: 1.1; }
.chapter .item h3 { font-family: var(--serif); font-size: 1.15rem; font-weight: 400; margin: 0 0 0.4rem; }
html[lang="mr"] .chapter .item h3, html[lang="kok"] .chapter .item h3 { font-family: "Tiro Devanagari Marathi", var(--serif); }
.item > p:not(.item-year):not(.item-meta) { margin: 0 0 0.75rem; font-size: 1.05rem; flex: 1; }
.item-meta { margin: 0; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.item-meta a { color: var(--muted); }
.conf { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--mid); color: var(--ink-2); margin-right: 0.3rem; }
.conf-tradition { background: color-mix(in srgb, var(--kaavi) 18%, var(--surface)); }
.srclist { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); padding-left: 1.2rem; }
.srclist li { margin-bottom: 0.3rem; }
ol.elders { max-width: var(--measure); padding-left: 1.4rem; font-size: 1.15rem; }
ol.elders li { margin-bottom: 0.7rem; padding-left: 0.3rem; }
ol.elders li::marker { color: var(--kaavi); }
@media (max-width: 600px) { .items { grid-template-columns: 1fr; } }
.item-credit { margin: -0.4rem 0 0.6rem; font-family: var(--sans); font-size: 0.72rem; } .item-credit a { color: var(--muted); }
.item-quote { margin: 0 0 0.75rem; font-size: 0.98rem; } .item-quote p { margin: 0; }
.items { align-items: start; } .item > p:not(.item-year):not(.item-meta) { flex: none; }
:root { --c-rulers: #8a6a33; --c-faith: #6a5a8c; --c-work: #2f7f74; --c-nature: #4f7a2e; --c-modern: #5d6b70; --c-census: #6a5a8c; --c-voices: #8a6a33; }
.rb-dot.c-rulers { fill: var(--c-rulers); } .rb-dot.c-faith { fill: var(--c-faith); } .rb-dot.c-work { fill: var(--c-work); }
.rb-dot.c-nature { fill: var(--c-nature); } .rb-dot.c-modern { fill: var(--c-modern); }
.yc-list li[data-chap="rulers"] .yc-chap { border-color: var(--c-rulers); } .yc-list li[data-chap="faith"] .yc-chap { border-color: var(--c-faith); }
.yc-list li[data-chap="work"] .yc-chap { border-color: var(--c-work); } .yc-list li[data-chap="nature"] .yc-chap { border-color: var(--c-nature); }
.yc-list li[data-chap="modern"] .yc-chap { border-color: var(--c-modern); } .yc-list li[data-chap="census"] .yc-chap { border-color: var(--c-census); }
.yc-list li[data-chap="voices"] .yc-chap { border-color: var(--c-voices); }

/* ---------- v4: short version, chapter menu, options, focus mode, easier letters ---------- */
.menubtn, #textsize {
  font: inherit; font-family: var(--sans); font-size: 0.95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--ring); border-radius: 999px; padding: 0.4rem 0.9rem; min-height: 44px; cursor: pointer; white-space: nowrap;
}
#chapbtn { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; max-width: 100%; flex: 0 1 auto; }
#chapbtn .burger, #chapbtn .burger::before, #chapbtn .burger::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; }
#chapbtn .burger { position: relative; flex: none; }
#chapbtn .burger::before, #chapbtn .burger::after { content: ""; position: absolute; left: 0; }
#chapbtn .burger::before { top: -5px; } #chapbtn .burger::after { top: 5px; }
#chapbtn .here { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#chapbtn .here:empty { display: none; }
#chapbtn .here::before { content: ""; display: inline-block; width: 1px; height: 1em; background: var(--axis); margin-right: 0.55rem; vertical-align: -0.12em; }
.bar { flex-wrap: nowrap; }
.tools { flex: none; }
.panel {
  position: absolute; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); color: var(--ink); border-radius: 12px;
  box-shadow: 0 0 0 1px var(--ring), 0 12px 32px rgba(0, 0, 0, 0.18);
  font-family: var(--sans); max-height: min(75vh, 40rem); overflow-y: auto; padding: 0.5rem;
}
#chapmenu { left: clamp(1rem, 4vw, 2.5rem); width: min(26rem, calc(100vw - 2rem)); }
#optmenu { right: clamp(1rem, 4vw, 2.5rem); width: min(20rem, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: 0.5rem; padding: 0.9rem; }
.panel[hidden] { display: none !important; }
.whole { margin: 0.4rem 0.6rem 0.6rem; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
#chaplist { list-style: none; margin: 0; padding: 0; }
#chaplist a {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 48px;
  padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 1.05rem;
}
#chaplist a:hover { background: var(--page); }
#chaplist a[aria-current] { background: var(--ink); color: var(--page); }
#chaplist a[aria-current] .mins { color: inherit; }
.mins { color: var(--muted); font-size: 0.85em; white-space: nowrap; }
#optmenu label { font-size: 0.85rem; color: var(--ink-2); }
#optmenu select { font: inherit; font-size: 1rem; color: var(--ink); background: var(--page); border: 1px solid var(--ring); border-radius: 8px; padding: 0.5rem; min-height: 44px; margin-bottom: 0.4rem; }
#optmenu button {
  font: inherit; font-size: 1rem; text-align: left; color: var(--ink); background: var(--page);
  border: 1px solid var(--ring); border-radius: 8px; padding: 0.55rem 0.75rem; min-height: 48px; cursor: pointer;
  display: flex; align-items: center; gap: 0.65rem;
}
#optmenu .toggle::before {
  content: ""; flex: none; width: 1.1rem; height: 1.1rem; border-radius: 4px; border: 2px solid var(--ink-2); box-sizing: border-box;
}
#optmenu .toggle[aria-pressed="true"]::before { background: var(--kaavi); border-color: var(--kaavi); box-shadow: inset 0 0 0 2px var(--page); }

/* The short version */
.quick { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); border-radius: 10px; padding: 1.1rem 1.25rem 0.6rem; margin: 0 0 2rem; max-width: 46rem; }
.quick h2 { font-weight: 400; font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.25rem; }
.quick-lead { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2); margin: 0 0 0.5rem; }
.quick ol { margin: 0; padding-left: 1.5rem; }
.quick li { padding: 0.55rem 0 0.55rem 0.2rem; border-top: 1px solid var(--grid); }
.quick li::marker { color: var(--kaavi); font-family: var(--sans); font-weight: 600; }
.quick a { color: var(--ink); text-decoration-color: var(--axis); text-decoration-thickness: 1px; }
.quick a:hover { text-decoration-color: var(--kaavi); }

/* End of every section: where to go next */
.chapend { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center; margin-top: 2.5rem; font-family: var(--sans); }
.chapend a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 52px; padding: 0.6rem 1.15rem; border-radius: 999px; text-decoration: none; font-size: 1.02rem; }
.chapend .next { background: var(--ink); color: var(--page); margin-left: auto; }
.chapend .next .mins { color: inherit; opacity: 0.75; }
.chapend .prev { color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }
html:not(.focus) .chapend .prev { display: none; }
.opening .chapend { max-width: 46rem; }

/* Focus mode: one section at a time */
html.focus main > section:not(.on), html.focus #chapters > section:not(.on) { display: none; }
html.focus .chapter, html.focus .explorer { border-top: 0; }

/* Easier-to-read letters */
html.easy body { font-family: "Atkinson Hyperlegible", var(--sans); }
html.easy[lang="kn"] body { font-family: "Noto Sans Kannada", var(--sans); }
html.easy[lang="mr"] body, html.easy[lang="kok"] body { font-family: "Noto Sans Devanagari", var(--sans); }
html.easy .chapter .item h3 { font-family: inherit; }

@media (max-width: 520px) {
  .bar { gap: 0.4rem; padding-left: 0.75rem; padding-right: 0.75rem; }
  .tools { gap: 0.35rem; }
  .menubtn, #textsize { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
  #chapbtn .here { display: none; }
  #chapmenu { left: 0.75rem; }
  #optmenu { right: 0.75rem; }
  .chapend a { width: 100%; justify-content: space-between; }
}

/* Reading memory: pick up where you stopped, ticks for sections read */
.resume {
  display: flex; align-items: center; min-height: 52px; max-width: 46rem; box-sizing: border-box;
  margin: 0 0 1.5rem; padding: 0.6rem 1.15rem; border-radius: 12px;
  background: var(--ink); color: var(--page); font-family: var(--sans); font-size: 1.05rem; text-decoration: none;
}
.resume[hidden] { display: none; }
#chaplist .name { display: inline-flex; align-items: baseline; gap: 0.5rem; }
#chaplist a.done .name::before {
  content: ""; flex: none; width: 0.35rem; height: 0.65rem; margin: 0 0.15rem 0 0.1rem;
  border: solid var(--kaavi); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-0.1rem);
}
#chaplist a[aria-current].done .name::before { border-color: currentColor; }

/* Bullets instead of blocks */
ul.pts { list-style: none; padding: 0; margin: 0 0 1.1rem; max-width: var(--measure); }
ul.pts li { position: relative; padding-left: 1.15rem; margin: 0 0 0.45rem; }
ul.pts li::before { content: ""; position: absolute; left: 0.1rem; top: 0.72em; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--kaavi); }
.chapter .lead + ul.pts { font-size: 1.15rem; }
.item ul.pts { font-size: 1.02rem; margin: 0 0 0.75rem; }
.item ul.pts li { margin-bottom: 0.35rem; line-height: 1.5; }
