:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --card: #fffdf8;
  --ink: #192b37;
  --ink-soft: #40505a;
  --muted: #5e696d;
  --line: #e1dbce;
  --gold: #e5c38a;
  --gold-dark: #77532b;
  --night: #152631;
  --sans: "Instrument Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", Georgia, serif;
  --hebrew: "Noto Serif Hebrew", "Times New Roman", "David", "DejaVu Serif", serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
:where(h1, h2, h3, p) { margin: 0; }
:where(a) { color: inherit; text-decoration: none; }
:where(button, select, input, textarea) { font: inherit; color: inherit; }
:where(button, select) { cursor: pointer; }
:where(button, select, input, textarea, a):focus-visible { outline: 2px solid #9a642d; outline-offset: 4px; }
:where(button):disabled { opacity: .42; cursor: default; }
:where(section, header)[id] { scroll-margin-top: 20px; }
:where([lang="he"]) { font-family: var(--hebrew); }
.visually-hidden { position: absolute; height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden; white-space: nowrap; border: 0; clip-path: inset(50%); }
.skip { position: fixed; left: 12px; top: 12px; padding: .7rem 1rem; background: var(--ink); color: white; transform: translateY(-180%); z-index: 4; }
.skip:focus { transform: none; }
.container { width: min(100% - 80px, 1232px); margin: 0 auto; }
.masthead { min-height: 85px; border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 26px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { display: grid; width: 45px; height: 45px; place-items: center; padding-bottom: 2px; border-radius: 8px; font-size: 30px; line-height: 1; border: 1px solid var(--night); background: var(--night); color: var(--gold); }
.brand-words { display: grid; gap: 3px; }
.brand-words strong { font: 700 22px/1.15 var(--serif); letter-spacing: .04em; white-space: nowrap; }
.brand-words small { font: 600 10px/1.2 var(--sans); letter-spacing: .18em; white-space: nowrap; color: var(--gold-dark); }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 43px); }
.main-nav a { position: relative; display: grid; align-items: center; color: var(--ink-soft); min-height: 48px; font-size: 14px; white-space: nowrap; }
.main-nav a:first-child { color: var(--ink); font-weight: 700; }
.main-nav a:first-child::after { content: ""; width: 20px; height: 2px; background: #a27440; position: absolute; bottom: 4px; left: calc(50% - 10px); }
.main-nav a:hover, .text-action:hover { color: var(--gold-dark); }
.region-select { position: relative; justify-self: end; }
.region-select select { padding: 9px 30px 9px 34px; border: 1px solid #d9d2c3; border-radius: 7px; min-height: 40px; background: transparent; font-size: 13px; }
.calendar-icon { position: absolute; left: 12px; top: 13px; pointer-events: none; width: 14px; height: 13px; border: 1.4px solid #645139; border-top-width: 4px; border-radius: 2px; }
.page { padding-top: 30px; padding-bottom: 70px; }
.hero { position: relative; isolation: isolate; border-radius: 15px; min-height: 466px; overflow: hidden; display: grid; align-items: center; background: var(--night); color: #fff9ee; }
.hero-image { position: absolute; inset: 0 0 0 38%; background: #a89173 url("torah-scroll.webp") 60% 46% / cover; filter: sepia(.22) saturate(.83) contrast(1.07) brightness(.80); z-index: -2; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, var(--night) 31%, #152631fa 43%, #152631bf 53%, #15263139 71%, transparent 100%), linear-gradient(0deg, #101e27a0, transparent 24%); }
.hero-content { width: min(58%, 680px); padding: 47px 0 58px clamp(32px, 5.4vw, 76px); }
.eyebrow { color: var(--gold-dark); font-size: 12px; font-weight: 700; letter-spacing: .16em; line-height: 1.6; }
.hero-kicker { display: flex; gap: 10px; align-items: center; color: var(--gold); }
.hero-kicker > span:first-child { display: block; height: 1px; width: 29px; background: currentColor; }
.hero h1 { margin: 17px 0 8px; font: 700 clamp(42px, 5.25vw, 76px)/1.13 var(--serif); letter-spacing: .045em; text-wrap: balance; }
.hero-name { display: flex; align-items: center; gap: 15px; color: #ebcd9a; }
.hero-name [lang="he"] { font-size: clamp(26px, 3.3vw, 37px); line-height: 1.4; }
#hero-en { font: 400 italic clamp(16px, 2vw, 22px)/1.3 Georgia, serif; overflow-wrap: anywhere; }
.hero-divider { flex: 0 0 1px; height: 20px; background: #b59565; }
.hero-intro { margin-top: 18px; max-width: 350px; color: #e8ded1; font-size: 16px; line-height: 1.95; }
.hero-actions { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 13px; padding: 11px 19px; min-height: 43px; border-radius: 7px; font-size: 14px; font-weight: 700; border: 1px solid transparent; text-align: center; line-height: 1.45; }
.primary { background: var(--gold); color: #202b32; box-shadow: 0 2px 8px #0a151716; }
.primary:hover { background: #f0d3a1; }
.outline { border-color: #cfc2ab; background: var(--card); }
.outline:hover { border-color: #97754b; background: #f9f4e8; }
.hero-link { padding: 8px 0; font-size: 14px; color: #ebe3d7; border-bottom: 1px solid #d9c8b273; }
.hero-link > span { margin-left: 3px; color: var(--gold); }
.hero-link:hover { color: var(--gold); border-color: var(--gold); }
.photo-credit { position: absolute; color: #fff3df; bottom: 13px; right: 16px; background: #14242cca; padding: 5px 8px; border-radius: 4px; font-size: 11px; line-height: 1.35; }
.photo-credit:hover { text-decoration: underline; }
.week-bar { margin: 17px 0 27px; background: var(--card); display: flex; align-items: center; justify-content: space-between; min-height: 82px; gap: 17px; border: 1px solid var(--line); border-radius: 11px; padding: 13px 21px; }
.week-date { display: flex; align-items: center; gap: 13px; }
.date-tile { display: grid; flex: 0 0 52px; min-height: 52px; padding: 5px 0; place-content: center; justify-items: center; background: #f2eadb; border: 1px solid #eee2d0; border-radius: 6px; color: #70502b; }
.date-tile strong { font: 400 25px/.94 Georgia, serif; }
.date-tile small { font-size: 10px; font-weight: 700; letter-spacing: .04em; margin-top: 4px; }
.week-date time { font-weight: 700; font-size: 14px; }
.week-date p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.week-actions { display: flex; align-items: center; gap: clamp(2px, 1.25vw, 19px); flex-wrap: wrap; }
.plain-button { border: 0; background: transparent; border-radius: 6px; min-height: 41px; padding: 8px 9px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.plain-button:hover:enabled { background: #eee7da; }
.plain-button span { color: var(--gold-dark); padding: 0 2px; }
.share { border: 1px solid #dfd6c6; }
.return-week { color: var(--gold-dark); }
.share-detail { margin: -10px 0 22px; display: grid; gap: 7px; background: var(--card); padding: 12px 17px; border: 1px solid var(--line); border-radius: 8px; }
.share-detail label { font-size: 13px; color: var(--ink-soft); }
.share-detail input { min-height: 41px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; }
.reading-grid { display: grid; grid-template-columns: minmax(0, 2.13fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.reader { padding: 28px 30px 22px; }
.reader-heading { display: flex; gap: 14px; align-items: end; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader h2, .section-heading h2, .guide h2, .notes h2 { font: 700 clamp(24px, 2.6vw, 36px)/1.38 var(--serif); }
.reader h2 { margin-top: 5px; }
.reader h2 span { font: 400 .9em/1.18 Georgia, serif; }
.view-switch { border: 0; padding: 3px; margin: 0; display: flex; width: fit-content; background: #f0ede4; border-radius: 7px; font-size: 12px; white-space: nowrap; }
.view-switch label { position: relative; cursor: pointer; }
.view-switch input { position: absolute; opacity: 0; pointer-events: none; }
.view-switch span { display: grid; place-items: center; padding: 7px 9px; min-height: 34px; color: var(--ink-soft); }
.view-switch input:checked + span { background: var(--card); border-radius: 5px; color: var(--ink); box-shadow: 0 1px 3px #2b261b16; font-weight: 700; }
.view-switch input:focus-visible + span { outline: 2px solid #9a642d; outline-offset: -1px; }
.reading-range { display: flex; gap: 11px; align-items: center; padding-top: 16px; color: var(--muted); font-size: 13px; }
.reading-range select, .calendar-controls select, .calendar-controls input { min-height: 40px; padding: 8px 10px; border: 1px solid #d9d2c3; border-radius: 7px; background: var(--card); font-size: 13px; }
.reading-range select { min-width: min(210px, 65%); }
.verse-area { padding: 10px 0 5px; min-height: 72px; overflow-wrap: anywhere; }
.verse-group { padding: 13px 0; border-bottom: 1px solid #ede8dd; }
.verse-group:last-child { border-bottom: 0; }
.verse-version { display: grid; grid-template-columns: minmax(43px, 62px) minmax(0, 1fr); align-items: first baseline; gap: 8px; }
.verse-version + .verse-version { margin-top: 7px; }
.verse-num { font: 400 13px/1.4 Georgia, serif; color: var(--gold-dark); white-space: nowrap; }
.verse-he { text-align: right; font-size: 25px; line-height: 1.73; }
.verse-zh { font: 500 17px/1.85 var(--serif); letter-spacing: .01em; color: #273844; }
.chapter-heading { margin-top: 15px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--gold-dark); font: 700 13px/1.4 var(--sans); }
.chapter-heading:first-child { margin-top: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.75; padding: 8px 0; }
.reader-actions { margin-top: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.text-action { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 7px 0; display: inline-block; }
.text-action span { color: var(--gold-dark); }
.reader-note { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.reading-aside { display: grid; gap: 17px; }
.upcoming-card { padding: 23px 23px 12px; }
.section-top { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.section-top h2, .calendar-note h2 { font: 700 23px/1.4 var(--serif); }
.upcoming-list { margin-top: 9px; }
.upcoming-row { display: grid; width: 100%; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; text-align: left; gap: 12px; min-height: 64px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: transparent; }
.upcoming-row:hover { color: var(--gold-dark); }
.upcoming-date { font: 400 16px/1.2 Georgia, serif; color: var(--gold-dark); }
.upcoming-row strong { display: block; font-size: 15px; line-height: 1.45; }
.upcoming-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.arrow { color: var(--gold-dark); }
.calendar-note { padding: 20px 23px; background: #ede9df; border: 1px solid #e6e0d3; border-radius: 12px; }
.gold-rule { display: block; height: 2px; width: 25px; background: #a47647; margin-bottom: 10px; }
.calendar-note h2 { font-size: 20px; }
.calendar-note p { margin-top: 7px; color: var(--ink-soft); font-size: 13px; line-height: 1.85; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; align-items: stretch; }
.guide, .notes { padding: 28px 30px; }
.guide h2, .notes h2 { margin-top: 6px; font-size: clamp(24px, 2.6vw, 31px); }
.guide-intro { font-size: 15px; line-height: 1.9; color: var(--ink-soft); margin-top: 11px; }
.guide-points { display: grid; gap: 15px; margin: 16px 0 4px; }
.guide-point { padding-left: 13px; border-left: 2px solid #d5b384; }
.guide-point h3 { font: 700 16px/1.45 var(--serif); }
.guide-point p { color: var(--ink-soft); font-size: 14px; line-height: 1.8; margin-top: 4px; }
.notes { display: flex; flex-direction: column; background: var(--night); border: 1px solid #31434c; border-radius: 13px; color: #fff9ef; }
.notes .eyebrow { color: var(--gold); }
.notes .prompt { color: #e3d8c6; margin: 10px 0 19px; font-size: 15px; line-height: 1.8; }
.notes form { margin-top: auto; display: grid; gap: 9px; }
.notes label { font-size: 13px; color: #eae0d2; }
.notes textarea { background: #21343e; color: #fff9ef; border: 1px solid #748086; border-radius: 7px; resize: vertical; min-height: 100px; width: 100%; padding: 11px; line-height: 1.6; font-size: 15px; }
.notes textarea::placeholder { color: #bac3c4; }
.note-actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.note-actions span { color: #ded5c8; font-size: 12px; }
.calendar-section, .festival-section { margin-top: 51px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 17px; }
.section-heading h2 { margin: 4px 0 6px; }
.section-heading div > p:last-child { font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.calendar-controls { flex-shrink: 0; display: flex; align-items: end; gap: 8px; }
.calendar-controls input { max-width: 190px; }
.calendar-card { overflow: hidden; }
.calendar-card table { width: 100%; text-align: left; border-collapse: collapse; font-size: 14px; }
.calendar-card thead { background: #eeeade; color: #4a504c; font-size: 12px; }
.calendar-card :where(th, td) { padding: 13px 18px; }
.calendar-card tbody tr { border-bottom: 1px solid #eee8da; }
.calendar-card tbody tr.current-row { background: #faf2e1; }
.calendar-card tbody td:first-child, .calendar-card tbody td.range-column { color: var(--ink-soft); font-size: 13px; }
.calendar-card td:nth-child(2) strong { margin-right: 7px; }
.calendar-card td:nth-child(2) small { color: var(--muted); font-size: 12px; }
.calendar-card td:last-child { text-align: right; padding-left: 0; }
.calendar-card td:last-child .plain-button { min-height: 33px; color: var(--gold-dark); }
.calendar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; color: var(--ink-soft); font-size: 13px; }
.calendar-empty { padding: 25px 18px; }
.festival-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.festival-card { display: flex; flex-direction: column; min-height: 212px; padding: 20px 22px 14px; border-top: 2px solid #c3a06d; }
.festival-card time { font-size: 13px; color: var(--gold-dark); font-weight: 700; }
.festival-card h3 { font: 700 24px/1.4 var(--serif); margin: 7px 0 2px; }
.festival-hebrew { margin-left: 6px; font-size: 20px; font-weight: 400; color: var(--gold-dark); }
.festival-card p { font-size: 14px; line-height: 1.75; color: var(--ink-soft); margin: 6px 0 9px; }
.festival-card .text-action { margin-top: auto; width: fit-content; }
.footer { border-top: 1px solid var(--line); background: #efebe1; }
.footer-inner { display: flex; justify-content: space-between; align-items: start; gap: 30px; padding-block: 28px 31px; }
.footer-inner p { color: var(--ink-soft); font-size: 12px; line-height: 1.8; margin-top: 9px; }
.credits { max-width: 580px; }
.credits summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--ink-soft); }
.credits a { text-decoration: underline; text-underline-offset: 2px; }
.notice { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 17px; }
@media (max-width: 950px) {
  .container { width: min(100% - 48px, 1232px); }
  .hero { min-height: 410px; }
  .hero-content { width: 63%; }
  .reader, .guide, .notes { padding: 23px; }
  .upcoming-card, .calendar-note { padding-inline: 17px; }
  .upcoming-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 32px, 1232px); }
  .masthead-inner { grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 12px 0 0; }
  .masthead .region-select { grid-column: 2; grid-row: 1; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; gap: 8px; justify-content: space-between; margin-top: 7px; }
  .main-nav a { min-height: 44px; font-size: 13px; }
  .main-nav a:first-child::after { bottom: 3px; }
  .brand-mark { width: 39px; height: 39px; font-size: 26px; }
  .brand-words strong { font-size: 19px; }
  .page { padding-top: 16px; padding-bottom: 45px; }
  .hero { min-height: 366px; border-radius: 11px; }
  .hero-content { width: min(88%, 450px); padding: 37px 0 54px 25px; }
  .hero-image { inset: 0 0 0 26%; background-position: 56% center; }
  .hero::before { background: linear-gradient(90deg, var(--night) 18%, #152631ef 41%, #152631bb 67%, #15263162 100%), linear-gradient(0deg, #101e277d, transparent 24%); }
  .hero h1 { margin-top: 12px; font-size: clamp(37px, 8vw, 55px); }
  .hero-intro { max-width: 300px; margin-top: 12px; font-size: 15px; }
  .hero-actions { gap: 15px; margin-top: 19px; }
  .photo-credit { right: 9px; bottom: 9px; }
  .week-bar { margin: 12px 0 17px; padding: 12px; flex-wrap: wrap; gap: 9px; }
  .week-date { gap: 9px; }
  .week-actions { margin-left: auto; gap: 4px; }
  .week-actions .plain-button { padding-inline: 7px; }
  .date-tile { min-height: 44px; flex-basis: 44px; }
  .date-tile strong { font-size: 22px; }
  .week-date time { font-size: 13px; }
  .reading-grid, .study-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .reading-aside { grid-template-columns: 1fr 1fr; align-items: start; gap: 12px; }
  .study-grid { margin-top: 14px; }
  .reader, .guide, .notes { padding: 18px; }
  .reader-heading { align-items: start; gap: 10px; padding-bottom: 12px; }
  .reader h2 { margin-top: 4px; }
  .verse-he { font-size: 22px; }
  .verse-zh { font-size: 16px; }
  .section-heading { flex-wrap: wrap; align-items: start; gap: 12px; }
  .calendar-section, .festival-section { margin-top: 33px; }
  .calendar-controls { width: 100%; }
  .calendar-controls input { flex: 1; max-width: none; min-width: 0; }
  .festival-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .festival-card { padding: 15px; }
}
@media (max-width: 480px) {
  .masthead-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .region-select select { padding-right: 8px; }
  .reading-aside, .festival-list { grid-template-columns: minmax(0, 1fr); }
  .festival-card { min-height: 0; }
  .week-actions { width: 100%; justify-content: space-between; }
  .calendar-card :where(th, td) { padding: 10px 8px; }
  .calendar-card td:first-child { width: 82px; overflow-wrap: anywhere; }
  .calendar-card td:nth-child(2) small { display: block; margin-top: 4px; }
  .calendar-card .range-column { display: none; }
  .calendar-card td:last-child .plain-button { font-size: 12px; }
  .footer-inner { flex-direction: column; gap: 16px; }
}

.guide-sources { display:flex; gap:8px 20px; flex-wrap:wrap; margin-top:14px; border-top:1px solid var(--line); padding-top:8px; }
.guide-sources .text-action { font-size:12px; text-decoration:underline; text-underline-offset:4px; }
.daily-section { margin-top:24px; padding:28px 30px; }
.daily-section .section-heading { align-items:start; }
.daily-section .section-heading h2 { max-width:800px; }
.daily-paragraphs { max-width:880px; }
.daily-paragraphs p { font:500 17px/2 var(--serif); margin-top:16px; }
.daily-question { max-width:880px; margin-top:20px; padding:14px 18px; border-left:2px solid #c3a06d; background:#f2eadb; font-size:15px; line-height:1.8; }
.daily-date-label { flex-shrink:0; display:grid; gap:5px; color:var(--muted); font-size:12px; }
.daily-date-label select { border:1px solid var(--line); padding:8px; border-radius:6px; background:var(--card); }
@media(max-width:760px) { .daily-section { padding:20px 18px; } }
