@font-face { font-family: 'Stam Ashkenaz'; src: url(fonts/StamAshkenazCLM.ttf) format('truetype'); }

:root {
  --bg: #f7f3ea; --paper: #fffdf8; --ink: #2a2520; --muted: #7a6f62;
  --line: #e4dccd; --accent: #8a5a1f; --hi: #f6d77a; --hi-ink: #1d1a16;
  --heb: 'Noto Serif Hebrew', 'SBL Hebrew', 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 Inter, system-ui, sans-serif; }

.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #3b2f22; color: #f7efe2; }
.brand { font-weight: 600; font-size: 18px; letter-spacing: .2px; }
.pickers { display: flex; flex-wrap: wrap; gap: 14px; }
.pickers label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #d9cbb4; }
select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); }

.toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  padding: 10px 24px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.group { display: flex; align-items: center; gap: 8px; }
button { font: inherit; min-width: 38px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 52px; font-size: 16px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; margin-inline-start: 4px; }
.speed { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.speed input { width: 130px; accent-color: var(--accent); }
.speed output { width: 44px; font-variant-numeric: tabular-nums; color: var(--ink); }
.modes { background: #f1ebdf; border-radius: 9px; padding: 3px; gap: 2px; }
.modes label { padding: 6px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.modes input { display: none; }
.modes label:has(input:checked) { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.toggles { gap: 12px; }
.switch { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.switch input { accent-color: var(--accent); }
.switch:has(input:disabled) { opacity: .45; }

.notice { max-width: 900px; margin: 16px auto 0; padding: 10px 14px; border-radius: 8px; background: #fff4d6; border: 1px solid #ecd48c; font-size: 14px; }
.notice a { color: var(--accent); }

.text { max-width: 900px; margin: 20px auto 40px; padding: 28px 40px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; font-family: var(--heb); line-height: 2.1; text-align: justify; }
.text p { margin: 0 0 .6em; }
.aliyah-head { font: 600 14px Inter, sans-serif; color: var(--accent); text-transform: uppercase; letter-spacing: .6px;
  margin: 1.2em 0 .2em; direction: ltr; text-align: right; }
.vnum { font: 600 .45em Inter, var(--heb); color: var(--accent); margin-inline: 2px 4px; vertical-align: .9em; user-select: none; }
.w { cursor: pointer; border-radius: 6px; padding: 0 2px; transition: background .12s; }
.w:hover { background: #f3ead6; }
.w.on { background: var(--hi); color: var(--hi-ink); box-shadow: 0 0 0 2px var(--hi); }
.w.unsynced { cursor: default; }
.w.unsynced:hover { background: none; }
.ketiv { font-size: .55em; color: var(--muted); }
.setuma { display: inline-block; width: 2.5em; }

.text.stam { font-family: 'Stam Ashkenaz', var(--heb); line-height: 1.9; }
.text.stam .aliyah-head { font-family: Inter, sans-serif; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 30px; }

@media (max-width: 700px) {
  .top, .toolbar { padding-inline: 12px; }
  .text { padding: 18px 16px; margin-inline: 8px; }
}
