:root {
  --paper: #F7F4EC; --sand: #EFE7D6; --ink: #1F2A3C; --copper: #9A4E14; --muted: #5A6475; --card: #FFFDF7;
  --serif: 'EB Garamond', Georgia, serif; --sans: 'IBM Plex Sans', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #141B26; --sand: #1F2A3C; --ink: #EDE7DA; --copper: #E9B27A; --muted: #A9B2C0; --card: #1B2433; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 var(--sans); }
a { color: var(--copper); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1100px; margin: 0 auto; padding: 20px 24px; }
.brand { font: 600 32px var(--serif); color: var(--ink); text-decoration: none; }
.top nav a { margin-left: 20px; font-weight: 500; text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 8px 24px 48px; }
h1 { font: 600 clamp(36px, 6vw, 60px)/1.1 var(--serif); margin: 16px 0 12px; }
h2 { font: 600 32px/1.2 var(--serif); margin: 40px 0 16px; }
.he { font-family: 'Frank Ruhl Libre', 'David', serif; font-weight: 400; color: var(--muted); font-size: .7em; margin-left: .3em; }
.lede { font-size: 22px; color: var(--muted); max-width: 46em; }
.crumbs { font-size: 15px; color: var(--muted); margin: 0; }
.crumbs a { text-decoration: none; }
.btn { display: inline-block; background: var(--copper); color: #FFFDF7; padding: 12px 22px; border-radius: 8px;
  text-decoration: none; font-weight: 600; }
@media (prefers-color-scheme: dark) { .btn { color: #141B26; } }
.hero { padding: 32px 0 8px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; height: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--sand); border-radius: 14px; padding: 22px; text-decoration: none; }
.card:hover { border-color: var(--copper); }
.card strong { font: 600 24px/1.25 var(--serif); }
.card span { color: var(--muted); font-size: 16px; }
.card .daf { color: var(--copper); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.soon { opacity: .7; }
.slides { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.frame { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; box-shadow: 0 2px 14px rgba(0,0,0,.12); position: relative; }
.scaler { width: 1920px; height: 1080px; transform-origin: 0 0; position: absolute; top: 0; left: 0; }
.scaler > section { width: 1920px; height: 1080px; }
.foot { max-width: 1100px; margin: 0 auto; padding: 24px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--sand); }
@media print { .top, .foot, .actions { display: none; } .frame { box-shadow: none; break-inside: avoid; } }
/* Slides keep their own look: site text styles must not reach into a deck. */
.deck .lede, .deck p { color: inherit; max-width: none; }
.deck { font-family: var(--sans); line-height: 1.4; }
/* Home page: the dictionary entry in the middle of the page. */
.entry { text-align: center; padding: clamp(48px, 10vw, 112px) 0 clamp(40px, 8vw, 88px); }
.entry p { margin: 0; }
.entry-word { font: 600 clamp(64px, 13vw, 120px)/1 var(--serif); }
.entry-say { margin-top: 16px !important; font-size: clamp(18px, 2.6vw, 24px); color: var(--muted); }
.entry-say .sep { margin: 0 .4em; }
.entry-ico { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: .3em; }
.entry-pos { margin-top: 6px !important; font-style: italic; font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); }
.entry-def { margin: 24px auto 0 !important; max-width: 18em; font: 400 clamp(26px, 4.2vw, 38px)/1.3 var(--serif); }
.home-sec { border-top: 1px solid var(--sand); padding-top: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sec-head a { text-decoration: none; font-weight: 500; white-space: nowrap; }
.sec-sub { color: var(--muted); margin: 0 0 16px; }
/* Suggestion box (public/js/suggest.js): a tab on the right edge of every page and a side panel. */
.sg-tab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 19; writing-mode: vertical-rl;
  background: var(--copper); color: #FFFDF7; border: 0; border-radius: 10px 0 0 10px; padding: 16px 9px;
  font: 600 14px var(--sans); letter-spacing: .04em; cursor: pointer; box-shadow: -2px 2px 10px #0003; }
@media (prefers-color-scheme: dark) { .sg-tab { color: #141B26; } }
.sg-tab:hover { filter: brightness(1.1); }
.sg-panel { position: fixed; top: 0; right: 0; height: 100%; width: min(390px, 100vw); z-index: 20; background: var(--paper);
  color: var(--ink); border-left: 1px solid var(--sand); box-shadow: -10px 0 30px #0003; padding: 20px 20px 30px; overflow: auto;
  transform: translateX(105%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
.sg-panel.open { transform: none; visibility: visible; transition: transform .25s ease; }
.sg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sg-head h3 { margin: 0; font: 600 26px var(--serif); }
.sg-x { border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.sg-panel p { color: var(--muted); font-size: 16px; }
.sg-panel label { font-size: 15px; font-weight: 600; display: block; }
.sg-panel .opt { font-weight: 400; color: var(--muted); }
.sg-panel textarea, .sg-panel input { width: 100%; font: 16px var(--sans); padding: 10px; border: 1px solid var(--sand);
  border-radius: 8px; background: var(--card); color: var(--ink); margin: 4px 0 14px; }
.sg-panel .btn { border: 0; cursor: pointer; font: 600 16px var(--sans); }
.sg-panel .btn:disabled { opacity: .7; cursor: wait; }
.sg-err { color: #B3261E !important; min-height: 1em; margin: 0 0 10px; }
@media (prefers-color-scheme: dark) { .sg-err { color: #F2B8B5 !important; } }
.sg-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sg-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; z-index: 21; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-size: 16px; transition: opacity .2s, transform .2s; }
.sg-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .sg-panel, .sg-panel.open, .sg-toast { transition: none; } }
@media print { .sg-tab, .sg-panel, .sg-toast { display: none; } }

/* Admin page (/admin/, owner only). */
.adm-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 20px; }
.adm-filters button { border: 1px solid var(--sand); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: 15px var(--sans); }
.adm-filters button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.adm-item { background: var(--card); border: 1px solid var(--sand); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.adm-item .meta { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.adm-item .txt { white-space: pre-wrap; margin: 0 0 12px; font-size: 17px; }
.adm-item textarea { width: 100%; font: 15px var(--sans); padding: 8px; border: 1px solid var(--sand); border-radius: 8px; background: var(--paper); color: var(--ink); }
.adm-item .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.adm-item .row button { border: 1px solid var(--sand); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 6px 14px; cursor: pointer; font: 15px var(--sans); }
.adm-item .badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sand); margin-left: 6px; }
/* Daf pages: Hebrew heading, and the Gemara text that opens with a tap. */
.h1-he, .h2-he { font-family: 'Frank Ruhl Libre', 'David', serif; text-align: left; }
.card .daf[lang="he"] { font-family: 'Frank Ruhl Libre', 'David', serif; font-size: 18px; letter-spacing: 0; }
.gemara { margin-top: 32px; background: var(--card); border: 1px solid var(--sand); border-radius: 14px; padding: 4px 22px; }
.gemara summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--copper); }
.gemara-text { font: 400 22px/1.9 'Frank Ruhl Libre', 'David', serif; }
.gemara-text p { margin: 0 0 10px; }
.gemara .credit { font-size: 14px; color: var(--muted); }
.card [lang="he"] { font-family: 'Frank Ruhl Libre', 'David', serif; }
