/* A quiet family almanac over a living sky. The sky carries the decoration; the information
   uses two lightly frosted meal surfaces and an open, divided facts row. */
.shabbat-screen {
    --shabbat-text: #f4f7ff;
    --shabbat-muted: #b8c9df;
    --shabbat-accent: #d7e9ff;
    --shabbat-surface: rgba(12, 28, 51, .88);
    --shabbat-menu-glass: rgba(12, 28, 51, .62);
    --shabbat-menu-ink: #f8faff;
    --shabbat-border: rgba(186, 211, 245, .23);
    --shabbat-yes: #b5e7cf;
    --shabbat-no: #f2c5ab;
    --shabbat-shadow: rgba(3, 10, 28, .45);
    /* Each meal's own colour, for its title and its sign: warm gold for Friday night, dawn blue for
       the morning. */
    --shabbat-evening: #f2d593;
    --shabbat-morning: #cfe2ff;
    --shabbat-havdalah: #cfcaf6;
    position: absolute;
    inset: 0;
    z-index: 15;
    isolation: isolate;
    overflow: hidden;
    color: var(--shabbat-text);
    background: #08172d;
    font-family: 'Heebo', 'Segoe UI', sans-serif;
}
.shabbat-screen[data-sky-theme='day'] {
    --shabbat-text: #15334d;
    --shabbat-muted: #3c5b70;
    --shabbat-accent: #214d70;
    --shabbat-surface: rgba(242, 249, 255, .91);
    --shabbat-menu-glass: rgba(242, 249, 255, .60);
    --shabbat-menu-ink: #102d45;
    --shabbat-border: rgba(30, 75, 105, .2);
    --shabbat-yes: #23644d;
    --shabbat-no: #865033;
    --shabbat-shadow: rgba(255, 255, 255, .25);
    /* By day: the kiddush wine for the evening, deep sea blue for the morning. */
    --shabbat-evening: #7a2a37;
    --shabbat-morning: #1b4a68;
    --shabbat-havdalah: #473f82;
}
#stage.with-chores .shabbat-screen { left: 25%; }
.shabbat-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2vmin;
    padding: 4vmin 4.5vmin 1.6vmin;
    overflow-y: auto;
    scrollbar-width: thin;
}
.shabbat-header {
    position: relative;
    isolation: isolate;
    color: #f4f7ff;
    min-height: 25vmin;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3vmin;
    padding-bottom: 1vmin;
    text-shadow: 0 2px 22px var(--shabbat-shadow);
}
.shabbat-header::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -4vmin -4.5vmin -1.5vmin;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(4, 20, 40, .57), transparent 33%, transparent 55%, rgba(4, 20, 40, .6));
    -webkit-mask-image: linear-gradient(#000 85%, transparent);
    mask-image: linear-gradient(#000 85%, transparent);
}
.shabbat-eyebrow { margin: 0 0 .5vmin; font-size: 2vmin; font-weight: 500; }
.shabbat-title { margin: 0; font-size: clamp(42px, 9.2vmin, 128px); font-weight: 300; line-height: 1.08; letter-spacing: -.055em; }
.shabbat-atmosphere { margin: 1.6vmin 0 0; font-size: 2.1vmin; font-weight: 400; }
.shabbat-times { display: flex; gap: 2.8vmin; padding-bottom: .5vmin; flex-shrink: 0; }
.shabbat-times:empty { display: none; }
.shabbat-time { display: flex; flex-direction: column; gap: .25vmin; }
.shabbat-time + .shabbat-time { padding-inline-start: 2.8vmin; border-inline-start: 1px solid var(--shabbat-border); }
.shabbat-time-label { font-size: 1.8vmin; }
.shabbat-time strong { font-size: 3.8vmin; font-weight: 400; font-variant-numeric: tabular-nums; direction: ltr; }
.shabbat-menus { flex: 1 0 24vmin; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2vmin; min-height: 0; }
/* The two meals, set like a printed Shabbat menu on the glass: a large serif title in the meal's
   own colour, a hairline rule with the meal's sign in its middle, and the dishes centred under it
   in the screen's own sans, with room around them. A faint inner frame and a breath of the meal's
   colour at the top are the only ornament. */
.shabbat-menu,
.shabbat-sched-col {
    --shabbat-meal: var(--shabbat-accent);
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 2vmin 3vmin 1.8vmin;
    text-align: center;
    color: var(--shabbat-menu-ink);
    border-radius: 2.1vmin;
    background-color: var(--shabbat-surface);
    background-image: radial-gradient(70% 46% at 50% 0%, color-mix(in srgb, var(--shabbat-meal) 11%, transparent), transparent);
    border: 1px solid var(--shabbat-border);
    outline: 1px solid color-mix(in srgb, var(--shabbat-meal) 20%, transparent);
    outline-offset: -.9vmin;
}
.shabbat-menu.evening, .shabbat-sched-col.evening { --shabbat-meal: var(--shabbat-evening); }
.shabbat-menu.morning, .shabbat-sched-col.morning { --shabbat-meal: var(--shabbat-morning); }
.shabbat-sched-col.havdalah { --shabbat-meal: var(--shabbat-havdalah); }
/* Blur only the card backgrounds (the two meals and the schedule's three sections); text stays sharp.
   Older hosts keep the opaque tint above. The schedule cards share this base and add only layout below. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .shabbat-menu,
    .shabbat-sched-col {
        background-color: var(--shabbat-menu-glass);
        -webkit-backdrop-filter: blur(12px) saturate(1.08);
        backdrop-filter: blur(12px) saturate(1.08);
    }
}
.shabbat-menu-heading { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .7vmin; margin: 0 0 1.1vmin; }
.shabbat-menu h3,
.shabbat-sched-col h3 {
    margin: 0;
    font-family: 'Frank Ruhl Libre', 'Heebo', serif;
    font-size: 3.5vmin;
    font-weight: 600;
    line-height: 1.1;
    color: var(--shabbat-meal);
}
/* The rule: two hairlines fading out from the sign. Drawn left to right whatever the language, so
   the fades always run outward. */
.shabbat-menu-rule { display: flex; align-items: center; gap: 1.3vmin; width: min(72%, 30vmin); height: 1.5vmin; direction: ltr; color: var(--shabbat-meal); }
.shabbat-menu-rule::before,
.shabbat-menu-rule::after { content: ''; flex: 1 1 0; height: 1px; }
.shabbat-menu-rule::before { background: linear-gradient(to left, color-mix(in srgb, currentColor 70%, transparent), transparent); }
.shabbat-menu-rule::after { background: linear-gradient(to right, color-mix(in srgb, currentColor 70%, transparent), transparent); }
.shabbat-meal-symbol { position: relative; display: block; flex: 0 0 auto; width: 1.5vmin; height: 1.5vmin; border-radius: 50%; }
/* Friday night: a crescent (the shadow of a circle, the circle itself left empty). */
.evening .shabbat-meal-symbol { box-shadow: -.42vmin .2vmin 0 .02vmin currentColor; transform: translate(.25vmin, -.15vmin) rotate(-8deg); }
/* The morning: a small sun with a soft ring of light. */
.morning .shabbat-meal-symbol { width: 1.1vmin; height: 1.1vmin; background: currentColor; box-shadow: 0 0 0 .32vmin color-mix(in srgb, currentColor 22%, transparent), 0 0 1.2vmin .2vmin color-mix(in srgb, currentColor 30%, transparent); }
/* Saturday night: a small four-pointed star. */
.havdalah .shabbat-meal-symbol { width: 1.2vmin; height: 1.2vmin; border-radius: 0; background: currentColor; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
/* The dishes sit in the middle of what room the card has; a long list overflows from the top
   instead (auto margins give way), and fitMenus shrinks it to fit. */
.shabbat-menu ul { margin: auto 0; padding: 0; list-style: none; font-size: 2.9vmin; font-weight: 400; line-height: 1.32; }
.shabbat-menu ul.two-columns { column-count: 2; column-gap: 3vmin; column-rule: 1px solid var(--shabbat-border); }
.shabbat-menu li { margin: .3vmin 0; font-size: inherit; overflow-wrap: anywhere; text-wrap: balance; break-inside: avoid; }
.shabbat-menu .shabbat-unknown { margin: auto 0; font-size: 2.6vmin; color: var(--shabbat-menu-ink); }
.shabbat-unknown { margin: 2vmin 0; font-size: 2.5vmin; color: var(--shabbat-muted); }
.shabbat-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1.9vmin 0; border-block: 1px solid var(--shabbat-border); background: var(--shabbat-surface); border-radius: 1vmin; }
.shabbat-fact { min-width: 0; padding: 0 1.6vmin; text-align: center; }
.shabbat-fact + .shabbat-fact { border-inline-start: 1px solid var(--shabbat-border); }
.shabbat-q { font-size: 1.9vmin; font-weight: 400; color: var(--shabbat-muted); }
.shabbat-a { margin-top: .4vmin; font-size: 2.7vmin; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.shabbat-a.yes { color: var(--shabbat-yes); }
.shabbat-a.no { color: var(--shabbat-no); }
.shabbat-a.info { color: var(--shabbat-accent); }
.shabbat-a.unknown { color: var(--shabbat-muted); }
.shabbat-activity { display: flex; align-items: baseline; gap: 2vmin; padding: 1.6vmin 2vmin; border-radius: 1vmin; background: var(--shabbat-surface); }
.shabbat-activity .shabbat-q { flex: 0 0 auto; }
.shabbat-activity .shabbat-a { margin: 0; font-size: 2.1vmin; }
.shabbat-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 1vmin 2vmin; margin-top: auto; font-size: 1.5vmin; padding: .5vmin 1.2vmin; border-radius: 1vmin; background: var(--shabbat-surface); }
.shabbat-next { margin-inline-end: auto; }
.shabbat-motion { color: inherit; font: inherit; border: 1px solid var(--shabbat-border); border-radius: 6px; padding: .3vmin 1vmin; min-height: 32px; background: var(--shabbat-surface); cursor: pointer; }
.shabbat-motion:focus-visible { outline: 2px solid var(--shabbat-text); outline-offset: 3px; }
/* One week's event schedule (schedule.js) in place of the one-line activity: three sections in the
   meal cards' own glass, right to left, and a compacted page around them (no scrolling in the
   kitchen layout, where the roster takes a quarter of the width). */
.shabbat-schedule { display: flex; flex-direction: column; gap: .6vmin; min-height: 0; flex: 0 0 auto; }
.shabbat-sched-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr) minmax(0, 1fr); gap: 1.6vmin; min-height: 0; }
.shabbat-sched-col { min-width: 0; min-height: 0; overflow: hidden; padding: 1.5vmin 2vmin 1.2vmin; text-align: start; }
.shabbat-sched-col .shabbat-menu-heading { margin: 0 0 .8vmin; }
.shabbat-sched-col h3 { font-size: 3vmin; }
.shabbat-sched-col ul { margin: 0; padding: 0; list-style: none; font-size: 2.3vmin; font-weight: 400; line-height: 1.22; }
.shabbat-sched-col li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); column-gap: .6em; align-items: baseline; padding: .28em .1em; overflow-wrap: anywhere; }
.shabbat-sched-col li + li { border-top: 1px solid color-mix(in srgb, var(--shabbat-border) 70%, transparent); }
.shabbat-sched-time { direction: ltr; text-align: end; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--shabbat-meal); }
.shabbat-sched-time.none, .shabbat-sched-time.later { font-weight: 400; color: var(--shabbat-muted); }
.shabbat-sched-time.none { opacity: .7; }
.shabbat-sched-time.later { direction: rtl; font-size: .8em; }
.shabbat-sched-what { text-wrap: balance; }
.shabbat-sched-note { align-self: flex-end; font-size: 1.6vmin; color: var(--shabbat-muted); }
/* Landscape (the kitchen display, the roster taking a quarter of the width): the page is compacted so
   everything fits with no scrolling. Portrait keeps its own flow, below. */
@media (orientation: landscape) {
    .shabbat-content.with-schedule { gap: 1.2vmin; padding: 2.2vmin 4.5vmin 1vmin; }
    .with-schedule .shabbat-header { min-height: 11.5vmin; padding-bottom: .2vmin; gap: 2vmin; }
    .with-schedule .shabbat-header::before { inset: -2.2vmin -4.5vmin -1vmin; }
    .with-schedule .shabbat-eyebrow { margin-bottom: .2vmin; font-size: 1.7vmin; }
    .with-schedule .shabbat-title { font-size: clamp(34px, 7.2vmin, 100px); }
    .with-schedule .shabbat-atmosphere { margin-top: .6vmin; font-size: 1.8vmin; }
    .with-schedule .shabbat-time strong { font-size: 3.1vmin; }
    .with-schedule .shabbat-time-label { font-size: 1.6vmin; }
    .with-schedule .shabbat-menus { flex: 1 1 18vmin; gap: 1.6vmin; }
    .with-schedule .shabbat-menu { padding: 1.3vmin 2.4vmin 1.1vmin; }
    .with-schedule .shabbat-menu-heading { gap: .4vmin; margin-bottom: .6vmin; }
    .with-schedule .shabbat-menu h3 { font-size: 2.8vmin; }
    .with-schedule .shabbat-menu-rule { height: 1.1vmin; }
    .with-schedule .shabbat-menu .shabbat-unknown { font-size: 2.2vmin; }
    .with-schedule .shabbat-menu ul { line-height: 1.24; }
    .with-schedule .shabbat-menu li { margin: .12vmin 0; }
    .with-schedule .shabbat-facts { padding: 1vmin 0; }
    .with-schedule .shabbat-q { font-size: 1.7vmin; }
    .with-schedule .shabbat-a { margin-top: .2vmin; font-size: 2.3vmin; }
    .with-schedule .shabbat-footer { padding: .2vmin 1vmin; font-size: 1.5vmin; }
    .with-schedule .shabbat-motion { min-height: 26px; padding: .1vmin .8vmin; }
    /* The schedule has a fixed height budget (fitSchedule shrinks the rows into it); the menus take what is left. */
    .shabbat-sched-cols { grid-template-rows: minmax(0, 1fr); max-height: 43vmin; }
}
@media (orientation: portrait) {
    #stage.with-chores .shabbat-screen { left: 30%; }
    .shabbat-content { padding: 4vmin 3vmin 2vmin; gap: 2.5vmin; }
    .shabbat-header { min-height: 29vmin; align-items: flex-start; flex-direction: column; gap: 2vmin; }
    .shabbat-header::before { inset-inline: -3vmin; }
    .shabbat-title { font-size: 10vmin; }
    .shabbat-menus { grid-template-columns: 1fr; flex-basis: 54vmin; }
    .shabbat-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2vmin 0; }
    .shabbat-fact:nth-child(3) { border-inline-start: 0; }
    .shabbat-activity { flex-direction: column; gap: .8vmin; }
    .shabbat-sched-cols { grid-template-columns: 1fr; }
    .with-schedule .shabbat-menus { flex: 0 0 auto; }
    .with-schedule .shabbat-menu { overflow: visible; }
    .with-schedule .shabbat-menu ul { font-size: max(14px, 2.4vmin) !important; }
    /* The schedule week in portrait: every section in its natural height, one scroll in the page, rows
       at least 15px (the inline size the landscape fit sets is overridden, nothing is shrunk). */
    .shabbat-sched-col { overflow: visible; padding: 2vmin 2.4vmin 1.6vmin; }
    .shabbat-sched-col h3 { font-size: max(20px, 3.5vmin); }
    .shabbat-sched-col ul { font-size: max(15px, 2.6vmin) !important; }
    .shabbat-sched-time.later { font-size: 1em; }
    .shabbat-sched-note { font-size: max(12px, 1.8vmin); }
}
@media (max-width: 600px) {
    .shabbat-eyebrow, .shabbat-atmosphere, .shabbat-q, .shabbat-time-label { font-size: max(12px, 2.1vmin); }
    .shabbat-a { font-size: max(16px, 2.7vmin); }
    .shabbat-menu h3 { font-size: max(20px, 3.5vmin); }
    .shabbat-menu ul { font-size: max(14px, 2.9vmin) !important; }
    .shabbat-activity .shabbat-a, .shabbat-unknown { font-size: 14px; }
    .shabbat-footer { font-size: 11px; }
    .shabbat-menus { flex: 0 0 auto; }
    .shabbat-menu ul.two-columns { column-count: 1; }
    .shabbat-motion { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .shabbat-screen *, .shabbat-screen *::before, .shabbat-screen *::after { animation: none !important; transition: none !important; } }
