:root {
  --bg: #F6F5F2;
  --card: #FFFFFF;
  --ink: #1A1D21;
  --ink-2: #3F434A;
  --muted: #5C6067;
  --line: #E4E2DD;
  --line-2: #EEECE8;
  --soft: #F0EEE9;
  --accent: #1F4E8C;
  --accent-soft: #EEF2F8;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: #163a69; }
.he { font-family: "Frank Ruhl Libre", "David", serif; }
.muted { color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1480px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* Top bar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-en { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-he { font-size: 14px; color: var(--muted); text-align: left; }
.search { position: relative; flex: 1 1 320px; max-width: 580px; }
.search-icon { position: absolute; left: 14px; top: 13px; color: #6B6F76; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid #D9D6D0; border-radius: 10px; background: #FAFAF8; font: inherit; color: var(--ink); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.source-note { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.source-note a { font-weight: 600; }
.dot-green { width: 8px; height: 8px; border-radius: 4px; background: #0F6B5C; }

/* Book picker */
.books { background: var(--card); border-bottom: 1px solid var(--line); }
.books .wrap { padding-top: 14px; padding-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.sections { display: flex; flex-wrap: wrap; gap: 6px; }
.section-btn { height: 40px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; background: var(--soft); color: var(--ink-2); }
.section-btn[aria-selected="true"] { background: var(--ink); color: #fff; }
.section-btn .he { font-weight: 500; opacity: .8; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #E0DDD7; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: #8B8F96; }
.chip .he { font-size: 14px; opacity: .75; }
.chip b { font-weight: 600; }
.chip .count { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: var(--soft); color: var(--ink-2); }
.chip.empty { color: #6B6F76; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,.2); color: #fff; }

/* Layout */
.layout { display: grid; grid-template-columns: 330px minmax(0, 1fr) 390px; gap: 24px; align-items: start; padding-top: 24px; padding-bottom: 40px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; }

/* List */
.place-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 640px; overflow-y: auto; }
.place-btn { width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; font: inherit; color: inherit; padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 12px; }
.place-btn:hover { background: #F4F2EE; }
.place-btn[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.conf-dot { width: 10px; height: 10px; border-radius: 5px; flex: 0 0 auto; }
.place-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.place-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.place-en { font-weight: 600; }
.place-he { font-size: 17px; }
.place-sub { font-size: 12.5px; color: var(--muted); }
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* Map */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.map { height: 640px; background: #DCE7EF; }
.map-tip { background: #fff; border: none; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.25); font-family: Inter, sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); padding: 3px 8px; }
.map-tip.leaflet-tooltip-top:before { border-top-color: #fff; }
.map-error { padding: 40px; color: var(--muted); text-align: center; }

/* Detail */
.detail-panel { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.detail-he { font-size: 40px; font-weight: 700; line-height: 1.1; text-align: right; }
.detail-en { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.today { border-radius: 12px; background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.today-site { font-size: 17px; font-weight: 600; }
.today-region { font-size: 14px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact span { font-size: 12px; color: var(--muted); }
.fact b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.note { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.verse { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.verse-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.verse-ref { font-weight: 600; }
.verse-he { padding: 14px 14px 6px; font-size: 21px; line-height: 1.7; text-align: right; }
.verse-he mark { background: #FBE7B8; color: inherit; border-radius: 3px; padding: 0 2px; }
.verse-en { padding: 4px 14px 14px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.verse-meta { padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.check-ok { color: #0F6B5C; font-weight: 600; }
.check-warn { color: #9A4A12; font-weight: 600; }
.loading { padding: 18px 14px; color: var(--muted); font-size: 14px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 0 14px; }
.btn:hover { border-color: #8B8F96; color: var(--ink); }
.also { display: flex; flex-wrap: wrap; gap: 6px; }
.also button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); min-height: 36px; }
.also button:hover { border-color: #8B8F96; }
.also button[aria-current="true"] { background: var(--soft); border-color: var(--soft); font-weight: 600; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--card); }
.footer-inner { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* Responsive */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 320px minmax(0, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
  .map-panel { order: -1; }
  .map { height: 380px; }
  .place-list { max-height: 420px; }
  .source-note { margin-left: 0; }
  .detail-he { font-size: 34px; }
}
