/* Tikun -- site styles */

@font-face { font-family: "Tikun Chumash"; src: url("../fonts/TikunChumash.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Tikun Chumash Safe"; src: url("../fonts/TikunChumashSafe.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Tikun Scroll"; src: url("../fonts/TikunScroll.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Tikun Scroll Safe"; src: url("../fonts/TikunScrollSafe.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Tikun Trope"; src: url("../fonts/TikunTrope.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Tikun Trope Letters"; src: url("../fonts/TikunTropeLetters.woff2") format("woff2"); font-display: block; }

:root {
  --paper: #faf7f0;
  --panel: #ffffff;
  --ink: #1f1b16;
  --muted: #6b6358;
  --rule: #e3dccd;
  --accent: #2b4c7e;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecf5;
  --gold: #a8741a;
  --gold-soft: #f6ecd6;
  --hl: #fff2b8;
  --radius: 10px;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-size: 28px;
  color-scheme: light dark;
}
/* theme: follows the device unless the header button picks Light or Dark (data-theme on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17150f; --panel: #211e17; --ink: #ece6da; --muted: #a59c8c; --rule: #3a352a;
    --accent: #8fb0e0; --accent-ink: #10131a; --accent-soft: #24304a; --gold: #e0b45a; --gold-soft: #3a3020; --hl: #4a3f12;
  }
}
:root[data-theme="dark"] {
  --paper: #17150f; --panel: #211e17; --ink: #ece6da; --muted: #a59c8c; --rule: #3a352a;
  --accent: #8fb0e0; --accent-ink: #10131a; --accent-soft: #24304a; --gold: #e0b45a; --gold-soft: #3a3020; --hl: #4a3f12;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--ui); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- header: brand, the reading, what to do with it, and three menus ---------- */
.site-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px 18px; padding: 8px 20px; border-bottom: 1px solid var(--rule); background: var(--panel); }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-he { font: 30px/1 "Tikun Chumash", serif; }
.brand-en { font-weight: 650; letter-spacing: .02em; color: var(--accent); }
.reading-btn { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 24em; font: inherit; text-align: left; color: var(--ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; padding: 5px 10px 5px 12px; cursor: pointer; }
.reading-btn:hover, .reading-btn:focus-visible { border-color: var(--accent); }
.rb-text { display: flex; flex-direction: column; min-width: 0; }
.rb-main { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-btn .chev { flex: none; width: 16px; height: 16px; color: var(--accent); }
.tabs { display: flex; gap: 2px; }
.tabs a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 550; white-space: nowrap; }
.tabs a:hover { background: var(--accent-soft); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.hdr-tools { display: flex; gap: 6px; margin-left: auto; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 36px; padding: 0 10px; font: inherit; font-weight: 550; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 9px; cursor: pointer; }
.tool-btn:hover, .tool-btn:focus-visible { color: var(--ink); border-color: var(--accent); }
.tool-btn svg { width: 17px; height: 17px; flex: none; }
.tool-btn .aa { font: 600 17px/1 Georgia, serif; letter-spacing: -.02em; }
/* only what applies to this page: Cards has nothing to set in "Aa", Practice only the size */
body[data-view="fonts"] :is(.reading-btn, #view-btn, #btn-print), body[data-view="about"] :is(.reading-btn, #view-btn, #btn-print),
body[data-view="cards"] #view-btn, body[data-view="practice"] .look-group { display: none; }

/* ---------- controls ---------- */
select, input[type="text"], input[type="date"], .btn { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 9px; min-height: 34px; }
select { max-width: 15em; }
.btn { cursor: pointer; font-weight: 550; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { font: inherit; font-weight: 550; border: 0; background: transparent; color: var(--muted); padding: 6px 11px; cursor: pointer; min-height: 34px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.size input { width: 110px; }
.link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---------- menus (popovers) ---------- */
.pop { position: fixed; inset: auto; margin: 0; width: min(380px, calc(100vw - 16px)); overflow: auto; padding: 14px 16px 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08); }
.pop::backdrop { background: transparent; }
#pop-view { width: min(340px, calc(100vw - 16px)); }
#pop-settings { width: min(330px, calc(100vw - 16px)); }
.pop .seg-full { display: flex; width: 100%; }
.pop .seg-full button { flex: 1; }
.pop .field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.pop .field label, .pop .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.pop .field select, .pop .field input { width: 100%; max-width: none; }
.pop .field-row { display: flex; gap: 10px; }
.pop .field-row .field { flex: 1; min-width: 0; }
.pop .opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.pop-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.pop-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.pop-row { display: flex; margin-top: 14px; }
.pop .check { white-space: normal; align-items: flex-start; }
.pop .check input { margin-top: 3px; }
.pop .check small { display: block; }
.pop .size input { flex: 1; width: auto; }
.pop-h { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 6px; }
.pop-h + .looks + .pop-h, .looks + .pop-h { margin-top: 14px; }
.looks { display: flex; flex-direction: column; gap: 2px; }
.looks button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; font: inherit; text-align: left; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.looks button:hover { background: var(--accent-soft); }
.looks button small { color: var(--muted); font-size: 12.5px; }
.looks button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.looks button[aria-pressed="true"] b::after { content: " ✓"; color: var(--accent); }

/* ---------- layout ---------- */
main { max-width: 980px; margin: 0 auto; padding: 18px 20px 60px; outline: none; }
.view { animation: fade .15s ease-out; }
@keyframes fade { from { opacity: .4; } }
.loading { color: var(--muted); text-align: center; padding: 40px; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
.panel h2 { margin: 0 0 8px; font-size: 18px; }
.hint { color: var(--muted); margin: 4px 0 12px; }
.sheet-title { font-size: 20px; font-weight: 600; margin: 6px 0 16px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.sheet-title .he { font: 30px/1.2 "Tikun Chumash", serif; }
.sheet-title .ref { color: var(--muted); font-weight: 450; font-size: 15px; }
.site-footer { max-width: 980px; margin: 0 auto; padding: 16px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); }
.foot-links { margin-top: 8px; font-size: 14px; }
.foot-links a[aria-current="page"] { font-weight: 650; color: var(--ink); text-decoration: none; }

/* ---------- Hebrew text ---------- */
.heb { direction: rtl; text-align: justify; text-align-last: right; font-size: var(--text-size); line-height: 1.95; color: var(--ink); font-feature-settings: normal; }
.f-chumash { font-family: "Tikun Chumash", serif; }
.f-chumash-safe { font-family: "Tikun Chumash Safe", serif; }
.f-scroll { font-family: "Tikun Scroll", serif; line-height: 1.75; }
.f-scroll-safe { font-family: "Tikun Scroll Safe", serif; line-height: 1.75; }
.f-trope { font-family: "Tikun Trope", serif; line-height: 2.25; }
.f-tropeL { font-family: "Tikun Trope Letters", serif; line-height: 2.25; text-align: right; }
.heb p { margin: 0 0 .55em; }
.vn { font: 600 0.42em/1 var(--ui); color: var(--muted); vertical-align: 0.55em; padding: 0 .15em 0 .3em; direction: ltr; unicode-bidi: isolate; }
.no-vn .vn:not(.ch) { display: none; }
.vn.ch { color: var(--accent); font-size: .5em; }
.lg { font-size: 1.35em; line-height: 0; }
.sm { font-size: .7em; }
.ketiv { font-size: .55em; color: var(--muted); }
.setuma { display: inline-block; width: 2.5em; }
.aliyah { display: inline-block; direction: rtl; font: 600 .45em/1 var(--ui); background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 999px; padding: .25em .7em .3em; margin: 0 .3em; vertical-align: .35em; white-space: nowrap; }
.aliyah .he { font-family: "Tikun Chumash", serif; font-size: 1.35em; font-weight: 400; }

/* a reading in several parts (e.g. a maftir read from a second scroll) */
.part-head { font: 600 15px/1.3 var(--ui); color: var(--muted); margin: 1.6em 0 .6em; direction: ltr; text-align: left; letter-spacing: .02em; }
.tk .part-head { text-align: center; }
.tikkun .part-row td { border: 0; padding-top: .6em; }
.note .btn { margin: 0 8px 0 0; }

/* side-by-side (tikkun) */
.tikkun { border-collapse: collapse; width: 100%; direction: rtl; }
.tikkun td { vertical-align: top; padding: .15em .6em .35em; width: 50%; border-bottom: 1px solid var(--rule); }
.tikkun td + td { border-right: 1px solid var(--rule); }
.tikkun .heb { text-align: right; }
.tikkun tr.brk td { border-bottom: 2px solid var(--muted); }
.tikkun .aliyah-row td { border: 0; padding-top: .6em; }

/* Side by side with Scroll, laid out like a tikun: the Chumash line for line beside the
   scroll's own lines (only the lines that hold the reading).
   --ws / --wc: column widths in each pane's em (about the 90th-percentile natural line);
   columns.js sets each line's --sx to stretch or narrow its letters to the width. */
/* scroll views (Scroll, and Side by side with Scroll) may use the whole window, so they can be
   zoomed up to full width; Chumash and Trope text keeps a readable measure */
body[data-view="read"][data-layout="columns"] main { max-width: none; }
.tk { container-type: inline-size; direction: rtl; --k: .9; --pitch: 1.8; --ws: 19; --wc: 22;
  /* ems needed across the page: side by side, and stacked on a phone */
  --wide: calc(var(--ws) + var(--k) * var(--wc) + 1.8); --narrow: max(var(--ws), var(--k) * var(--wc)); }
/* the Scroll typeface on its own: the scroll's lines with a verse-number margin */
.tk.solo { --wide: calc(var(--ws) + 4); --narrow: var(--wide); }
/* the text shrinks to fit rather than wrap, so the scroll's line breaks hold at any size */
.tk-spread { width: max-content; margin: 0 auto .6em; font-size: min(var(--text-size), calc((100cqw - 8px) / var(--wide))); }
.tk-head { display: flex; align-items: center; gap: .8em; font: 500 11px/1 var(--ui); color: var(--muted); direction: ltr; margin: .3em 0 .5em; letter-spacing: .03em; }
.tk-head::before, .tk-head::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.tk-row { display: flex; column-gap: 1.8em; row-gap: 1.2em; align-items: flex-start; }
.tk-pane { display: flex; flex-direction: column; }
.tk-scroll { width: calc(var(--ws) * 1em); }
.tk-chumash { font-size: calc(var(--k) * 1em); width: calc(var(--wc) * 1em); }
.tk .ln { display: flex; justify-content: space-between; align-items: baseline; column-gap: 1.6em; white-space: nowrap; height: calc(var(--pitch) * 1em); line-height: calc(var(--pitch) * 1em);
  width: calc(100% / var(--sx, 1)); transform: scaleX(var(--sx, 1)); transform-origin: right center; }
.tk-chumash .ln { height: calc(var(--pitch) * 1em / var(--k)); line-height: calc(var(--pitch) * 1em / var(--k)); }
.tk .ln.two { column-gap: 2.4em; }
.tk .hf { flex: 1 1 0; display: flex; justify-content: space-between; column-gap: 1.6em; min-width: 0; }
.tk .fr { flex: none; display: flex; column-gap: .3em; }
.tk .hf.solo > .fr { flex: 1 1 auto; justify-content: space-between; }
.tk .ln.open .fr { flex: none; justify-content: flex-start; }
.tk .w.out { opacity: .3; }
.tk .vn { padding: 0 0 0 .2em; }
.tk.measure .ln, .tk.measure .hf, .tk.measure .fr { width: max-content; flex: none; justify-content: flex-start; transform: none; }
.tk-margin { display: flex; flex-direction: column; width: 2em; }
.tk-margin .ln { justify-content: flex-start; align-items: center; gap: .25em; width: auto; transform: none; }
.tk-margin .vn { padding: 0; vertical-align: 0; }
.tk-al { font: 650 .38em/1 var(--ui); background: var(--gold-soft); color: var(--gold); border-radius: 999px; padding: .3em .55em; margin-inline-end: .25em; vertical-align: .55em; }
@container (max-width: 640px) {
  .tk-spread { font-size: min(var(--text-size), calc((100cqw - 4px) / var(--narrow))); }
  .tk:not(.solo) .tk-row { flex-direction: column; }
}

/* ---------- practice ---------- */
.fam { margin: 14px 0 4px; font-size: 15px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 10px; align-items: baseline; }
.fam .he { font: 20px "Tikun Chumash", serif; text-transform: none; letter-spacing: 0; color: var(--ink); }
.combo { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(160px, 1.6fr) 64px 70px; gap: 6px 14px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.combo:hover { background: var(--accent-soft); }
.combo[aria-expanded="true"] { border-color: var(--rule); background: var(--paper); }
.combo .pat { direction: rtl; font: 30px/1.9 "Tikun Trope", serif; text-align: right; white-space: nowrap; overflow: hidden; }
.combo .names { direction: rtl; text-align: right; }
.combo .names .he { font: 21px/1.5 "Tikun Chumash", serif; display: block; }
.combo .names .en { color: var(--muted); font-size: 13px; display: block; direction: ltr; text-align: right; }
.combo .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.combo .n small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.combo-head { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(160px, 1.6fr) 64px 70px; gap: 14px; padding: 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.combo-head span:nth-child(n+3) { text-align: right; }
.oncard { display: inline-block; font: 600 11px/1 var(--ui); background: var(--gold-soft); color: var(--gold); border-radius: 999px; padding: 3px 6px; margin-inline-start: 6px; vertical-align: middle; }
.occ { margin: 2px 0 12px 0; padding: 4px 12px 10px; border-left: 3px solid var(--accent-soft); }
.occ-row { display: grid; grid-template-columns: 82px 1fr 1fr; gap: 12px; align-items: center; padding: 3px 0; border-bottom: 1px dashed var(--rule); }
.occ-row .ref { color: var(--muted); font-size: 13px; }
.occ-row .heb { font-size: 22px; line-height: 1.8; text-align: right; }
.more { color: var(--muted); font-size: 13px; padding-top: 6px; }

.drill-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.drill-line { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 6px 12px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.drill-line .num { color: var(--muted); font-weight: 650; padding-top: .6em; text-align: right; }
.drill-line .heb { text-align: right; line-height: 2.1; }
.drill-line .ans { display: none; margin-top: 4px; }
.drill-line.open .ans, .reveal-all .drill-line .ans { display: block; }
.ans .names-he { direction: rtl; font: 20px/1.7 "Tikun Chumash", serif; }
.ans .names-en { color: var(--muted); font-size: 13px; }
.ans .words { direction: rtl; font-size: 22px; line-height: 1.8; }
.ans .ref { color: var(--muted); font-size: 12px; }
.phr { white-space: nowrap; }
.phr + .phr::before { content: ""; display: inline-block; width: .5em; }

/* ---------- fonts / about ---------- */
.font-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.font-card header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.font-card h3 { margin: 0; font-size: 18px; }
.font-card .lic { color: var(--muted); font-size: 12px; }
.font-card .sample { margin: 10px 0 6px; font-size: 30px; }
.font-card p { margin: 6px 0; }
.try { width: 100%; font: 22px/1.6 "Tikun Chumash", serif; direction: rtl; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; background: var(--panel); color: var(--ink); }
.prose { max-width: 720px; }
.prose h2 { margin-top: 28px; }
.prose li { margin: 4px 0; }
.prose code, .font-card code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend .g { font: 30px/1.8 "Tikun Trope", serif; direction: rtl; min-width: 48px; text-align: center; }

/* ---------- flash cards (screen preview) ---------- */
#card-sheets { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.sheet { background: #fff; color: #111; box-shadow: 0 1px 4px rgba(0,0,0,.18); position: relative; overflow: hidden; }
.sheet.index { width: 5in; height: 3in; }
.sheet.letter { width: 8.5in; height: 11in; padding: 0.5in 0.5in; display: grid; }
.sheet.duplex { grid-template-columns: 3.75in 3.75in; grid-template-rows: repeat(4, 2.5in); }
.sheet.fold { grid-template-columns: 3.75in 3.75in; grid-template-rows: repeat(4, 2.5in); }
.card { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: .2in .25in; overflow: hidden; width: 100%; height: 100%; }
.sheet.letter .card { outline: 1px dashed #bbb; outline-offset: -0.5px; }
.sheet.fold .card.back { border-left: 1px dashed #888; }
.card .c-trope { font-family: "Tikun Trope", serif; direction: rtl; font-size: 44px; line-height: 2; }
.card .c-tropeL { font-family: "Tikun Trope Letters", serif; direction: rtl; font-size: 34px; line-height: 2; }
.card .c-names { font-family: "Tikun Chumash", serif; direction: rtl; font-size: 30px; line-height: 1.75; }
.card .c-en { font: 14px/1.35 var(--ui); color: #555; margin-top: 4px; }
.card .c-words { direction: rtl; font-size: 26px; line-height: 1.7; }
.card .c-ref { font: 11px var(--ui); color: #777; margin-top: 6px; }
.card .c-tag { position: absolute; font: 10px var(--ui); color: #aaa; }
.sheet.index .card .c-trope { font-size: 54px; }
.sheet.index .card .c-names { font-size: 34px; }

/* ---------- print ---------- */
@media print {
  /* paper is always light, whatever the screen theme (these selectors outrank the dark ones) */
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    --paper: #fff; --panel: #fff; --ink: #000; --muted: #555; --rule: #bbb; --gold: #6b4a0e; --gold-soft: #fff;
    --accent: #2b4c7e; --accent-ink: #fff; --accent-soft: #e6ecf5; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .site-header, .pop, .site-footer, .loading { display: none !important; }
  main { max-width: none; padding: 0; }
  .panel { border: 0; padding: 0; margin: 0; }
  .view { animation: none; }
  .heb p { orphans: 2; widows: 2; }
  .tikkun tr { break-inside: avoid; }
  .part-head { break-after: avoid; }
  /* scroll views fill the page width; a long column runs on to the next page between lines */
  .tk-spread { margin: 0 auto; font-size: calc((100cqw - 4px) / var(--wide)); }
  .tk .ln { break-inside: avoid; }
  .tk-head, .part-head { break-after: avoid; }
  .tk .w.out { opacity: .38; }
  .drill-line { break-inside: avoid; cursor: default; }
  .drill-line .ans { display: none !important; }
  .answer-key { break-before: page; }
  .answer-key .drill-line .ans { display: block !important; }
  .print-only { display: block !important; }
  #card-sheets { display: block; gap: 0; }
  .sheet { box-shadow: none; break-after: page; margin: 0; }
  .sheet:last-child { break-after: auto; }
  body[data-view="cards"] main { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  /* two rows: brand and the reading; then the tabs and the three menus. It scrolls away with the page. */
  .site-header { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand reading reading" "tabs tabs tools"; padding: 8px 12px; gap: 8px 10px; }
  .brand { grid-area: brand; }
  .reading-btn { grid-area: reading; }
  .tabs { grid-area: tabs; }
  .hdr-tools { grid-area: tools; }
  .brand-he { font-size: 26px; }
  .brand-en { display: none; }
  .reading-btn { max-width: none; }
  .tabs a { padding: 7px 9px; }
  .hdr-tools { gap: 4px; }
  .tool-btn { min-width: 36px; padding: 0 8px; }
  .tool-label { display: none; }
  main { padding: 14px 16px 50px; }
  .heb { text-align: right; }
  .combo, .combo-head { grid-template-columns: 1fr 52px 58px; }
  .combo .pat { grid-column: 1 / -1; }
  .combo-head span:nth-child(1) { display: none; }
  .occ-row { grid-template-columns: 1fr; gap: 2px; }
  .tikkun td { padding: .15em .3em .3em; }
  #card-sheets { overflow-x: auto; align-items: flex-start; }
}
