* { box-sizing: border-box; }
html,
body,
button,
input,
select,
textarea,
dialog {
  font-family: var(--font-apple);
}
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-regular); line-height: var(--line-height); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100dvh; background: var(--bg); }
.content { width: min(100%, 520px); margin: 0 auto; padding: calc(100px + env(safe-area-inset-top)) 18px 0; }
.floating-top { position: fixed; z-index: 30; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translateX(-50%); width: min(100%, 520px); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; pointer-events: none; }
.floating-top button { pointer-events: auto; }
.module-pill, .account-button { border: 1px solid var(--floating-border); background: var(--floating-surface); box-shadow: var(--shadow-floating); }
.module-pill { height: 46px; border-radius: 999px; padding: 0 10px 0 8px; display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: var(--text-display); font-weight: var(--weight-bold); }
.module-pill img { width: 22px; height: 22px; object-fit: contain; }
.module-pill img.switcher { width: 14px; height: 20px; margin-left: 1px; }
.account-button { width: 46px; height: 46px; padding: 11px; border-radius: 50%; }
.account-button img { width: 100%; height: 100%; object-fit: contain; }

.top-fade, .bottom-fade { position: fixed; z-index: 20; left: 0; right: 0; pointer-events: none; }
.top-fade { top: 0; height: calc(100px + env(safe-area-inset-top)); background: linear-gradient(to bottom, var(--bg) 35%, var(--bg-fade-strong) 57%, var(--bg-fade-clear)); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); mask-image: linear-gradient(to bottom,var(--mask-solid) 35%,transparent); }
.bottom-fade { bottom: 0; height: calc(112px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, var(--bg-fade-clear), var(--bg-fade-strong) 44%, var(--bg) 75%); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); mask-image: linear-gradient(to bottom,transparent,var(--mask-solid) 67%); }

.location-row { display: flex; justify-content: flex-start; align-items: center; color: var(--secondary); font-size: var(--text-body); margin: 0 3px 12px; }
.location-row span { display: inline-flex; align-items: center; gap: 5px; }
.location-row img { width: 14px; height: 14px; object-fit: contain; }

.hero-card { color: var(--white); min-height: 184px; border-radius: 26px; padding: 18px; text-align: center; background: var(--brand-gradient); box-shadow: var(--shadow-hero); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-hebrew-date { margin-bottom: 5px; border: 0; border-radius: 9px; padding: 3px 8px; color: var(--white); background: none; font-size: var(--text-main-date); font-weight: var(--weight-medium); }
.hero-hebrew-date, .date-display strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hero-hebrew-date.today { color: var(--today); }
.hero-card.today, .hero-card.today .hero-hebrew-date, .hero-card.today .hero-study, .hero-card.today .hero-study strong { color: var(--today); }
.hero-card.today .hero-study span { opacity: 1; }
.hero-card.today .hero-study { border-bottom-color: var(--today-divider); }
.hero-hebrew-date:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.hero-card h1 { font-size: var(--text-display); font-weight: var(--weight-bold); line-height: var(--line-height); margin: 2px 0 9px; }
.hero-card h1 span { display: block; }
.hero-card h1 span + span { margin-top: 2px; }
.hero-learning { width: 100%; padding: 4px 10px; border-radius: 14px; background: var(--glass-surface); }
.hero-study { width: 100%; min-height: 29px; border: 0; border-bottom: 1px solid var(--glass-separator); padding: 4px 2px; color: var(--white); background: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: var(--text-body); font-weight: var(--weight-regular); }
.hero-study:last-child { border-bottom: 0; }
.hero-study span { opacity: .8; }
.hero-study strong { min-width: 0; color: var(--white); font-size: inherit; font-weight: var(--weight-medium); text-align: right; }

.card { background: var(--white); border-radius: 18px; box-shadow: var(--shadow); }
.content > .card, .content > .two-column { margin-top: 20px; }
.week-card {
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
}
.card-title-row { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title-row h2 { margin: 0; color: var(--blue); font-size: var(--text-display); font-weight: var(--weight-medium); }
.week-card h3, .mini-card h3 { margin: 2px 0 0; font-size: var(--text-body); line-height: var(--line-height); font-weight: var(--weight-bold); }
.muted { color: var(--secondary); }
.small { font-size: var(--text-small); }
.week-card p { margin: 2px 0 0; }
.badge { flex: 0 0 auto; min-width: 42px; min-height: 20px; padding: 2px 6px; border-radius: 999px; background: var(--countdown-bg); color: var(--countdown-text); text-align: center; font-size: var(--text-small); font-weight: var(--weight-medium); line-height: var(--line-height); font-variant-numeric: tabular-nums; }
.badge.is-empty { visibility: hidden; }
.badge-blue { color: var(--countdown-text); background: var(--countdown-bg); }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.time-tile { height: 46px; padding: 7px 10px; border-radius: 12px; background: var(--soft-blue); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.time-tile span { font-size: var(--text-small); font-weight: var(--weight-medium); }
.time-tile strong { color: var(--blue); font-size: var(--text-body); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; margin-top: 2px; }
.week-events {
  min-height: 0;
  margin-top: 12px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
}
.week-event {
  padding: 0;
  overflow: hidden;
  border-radius: 13px;
  background: var(--active);
  text-align: center;
}
.week-event.active { background: var(--active); box-shadow: var(--shadow-active-soft); }
.week-event:only-child {
  min-height: 0;
  padding: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}
.week-event-main {
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.week-event:only-child .week-event-main {
  min-height: 0;
  padding: 12px 18px 10px;
  flex: 1 1 auto;
}
.week-event h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  font-weight: var(--weight-regular);
  text-align: center;
}
.week-title-line { display: block; }
.week-title-line + .week-title-line { margin-top: 2px; }
.week-title-lead {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: .011em;
}
.week-special,
.week-title-tail { color: var(--ink); }
.week-title-separator { color: var(--green); }
.week-meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.week-hebrew-date {
  margin: 0;
  color: var(--secondary);
  font-size: 19px;
  line-height: 1.25;
  font-weight: var(--weight-regular);
}
.week-countdown {
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 600;
}
.week-time-grid {
  margin-top: 0;
  overflow: hidden;
  border-top: 1px solid var(--separator);
  border-radius: 0;
  background: var(--soft-green);
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0;
}
.week-time-tile {
  min-width: 0;
  min-height: 58px;
  padding: 9px 7px;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.week-time-tile:nth-child(even) { border-left: 1px solid var(--separator); }
.week-time-tile:nth-child(n + 3) { border-top: 1px solid var(--separator); }
.week-time-tile span { font-size: 17px; font-weight: 600; }
.week-time-tile strong { margin-top: 4px; color: var(--blue); font-size: 17px; font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-event .week-time-tile strong { color: var(--green); }
.week-event:only-child .week-time-grid { margin-top: 0; }
.week-event:only-child .week-time-tile { min-height: 64px; }
.week-time-tile:last-child:nth-child(odd) { grid-column: 1 / -1; align-items: center; text-align: center; }
.week-time-tile:last-child:nth-child(odd) { border-left: 0; }

.list-card { padding: 12px 16px; }
.text-action { border: 0; padding: 5px 0 5px 10px; color: var(--blue); background: none; font-size: var(--text-small); font-weight: var(--weight-medium); }
#holidays-list { display: grid; gap: 8px; margin-top: 12px; }
.appointment-tabs { min-width: 0; margin-top: 10px; overflow: hidden; display: flex; align-items: stretch; justify-content: flex-start; gap: 7px; }
.appointment-tabs.is-spread { justify-content: space-between; }
.appointment-tab { flex: 0 0 auto; min-height: 34px; border: 0; border-radius: 999px; padding: 6px 9px; color: var(--blue); background: var(--soft-blue); font-size: var(--text-body); font-weight: var(--weight-medium); line-height: var(--line-height); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 3px; }
.appointment-tab-label { min-width: 0; }
.appointment-tab[aria-selected="true"] { color: var(--white); background: var(--brand-gradient); box-shadow: var(--shadow-brand-soft); }
.appointment-tab[hidden] { display: none; }
.appointment-more { flex: 0 0 auto; align-self: center; white-space: nowrap; }
.appointment-more-plus { width: 34px; height: 34px; border: 0; border-radius: 999px; padding: 0; color: var(--blue); background: var(--soft-blue); font-size: var(--text-display); font-weight: var(--weight-medium); }
.appointment-more.is-measuring { position: absolute; visibility: hidden; pointer-events: none; }
.holiday-detail { min-width: 0; }
.holiday-compact-shell { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .3s ease, opacity .2s ease; }
.holiday-compact-inner { min-height: 0; overflow: hidden; }
.holiday-expanded-shell { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .34s ease, opacity .22s ease; }
.holiday-expanded-inner { min-height: 0; overflow: hidden; }
.holiday-detail.is-expanded .holiday-compact-shell { grid-template-rows: 0fr; opacity: 0; }
.holiday-detail.is-expanded .holiday-expanded-shell { grid-template-rows: 1fr; opacity: 1; }
.holiday-item { min-height: 56px; padding: 7px 8px; border-radius: 12px; background: var(--soft-blue); }
.holiday-compact-range { min-height: 42px; padding: 7px 6px; display: grid; place-items: center; color: var(--secondary); font-size: var(--text-body); font-weight: var(--weight-medium); line-height: var(--line-height); text-align: center; font-variant-numeric: tabular-nums; }
.holiday-item.active .holiday-compact-range { color: var(--white); }
.holiday-date-rows { display: grid; gap: 2px; }
.holiday-date-row { min-width: 0; min-height: 30px; padding: 5px 9px; border-radius: 8px; display: grid; grid-template-columns: minmax(0,46%) 1fr; align-items: start; gap: 12px; }
.holiday-date-row:nth-child(odd) { background: var(--stripe); }
.holiday-date-rows.single .holiday-date-row { background: transparent; }
.holiday-date-row > strong { min-width: 0; font-size: var(--text-body); font-weight: var(--weight-medium); line-height: var(--line-height); }
.holiday-dates { min-width: 0; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; color: var(--secondary); font-size: var(--text-body); line-height: var(--line-height); font-variant-numeric: tabular-nums; }
.holiday-date-line { margin: 0; padding: 1px 4px; border-radius: 7px; display: inline-flex; align-items: baseline; column-gap: 4px; white-space: nowrap; }
.holiday-date-line > span:first-child { text-align: left; }
.holiday-date-line > span:nth-child(2) { text-align: right; }
.holiday-date-line small { font-size: inherit; text-align: right; }
.holiday-date-line.is-yom-tov { color: var(--blue); }
.holiday-date-line.is-current { background: var(--active); color: var(--green); }
.holiday-item.active .holiday-date-line { color: var(--white); }
.holiday-item.active .holiday-date-line.is-current { background: var(--soft-blue); color: var(--blue-strong); }
.holiday-info-line { margin: 6px 10px 0; display: flex; align-items: center; gap: 7px; color: var(--secondary); font-size: var(--text-body); }
.holiday-info-copy { min-width: 0; display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: baseline; gap: 3px 5px; }
.holiday-info-copy span:last-child { min-width: 0; }
.holiday-detail-toggle { margin: 7px 10px 0; border: 0; padding: 2px 0; color: var(--blue); background: none; font-size: var(--text-body); font-weight: var(--weight-medium); text-decoration: underline; text-underline-offset: 3px; }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.mini-card { min-width: 0; min-height: 150px; padding: 14px; display: flex; flex-direction: column; align-items: stretch; }
.mini-card > strong { display: block; font-size: var(--text-body); font-weight: var(--weight-medium); margin-top: 8px; }
.mini-card > strong + strong { margin-top: 4px; }
.mini-bottom { display: flex; gap: 5px; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.rosh-heading-row h2 { white-space: nowrap; letter-spacing: -.2px; }
.rosh-meta { min-height: 22px; margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#rosh-card .date-lines { margin-top: 8px; }
.date-lines { min-width: 0; min-height: 69px; padding: 7px 5px; border-radius: 10px; font-size: var(--text-body); font-weight: var(--weight-medium); line-height: var(--line-height); font-variant-numeric: tabular-nums; }
.date-lines span { display: block; white-space: nowrap; }
.birkat-dates { margin-top: 8px; }
.birkat-note { margin-top: 0; }
.zmanim-card { overflow: hidden; padding: 8px 0 10px; }
.zmanim-head { height: 36px; padding: 0 16px; }
#zmanim-list { display: grid; gap: 2px; padding: 0 8px; }
.zman-row { min-height: 32px; margin: 0; padding: 0 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink); font-size: var(--text-body); }
.zman-row strong { flex: 0 0 auto; min-width: 44px; color: var(--blue); text-align: right; font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.zman-row.current { min-height: 34px; }
.brand-lockup { display: flex; justify-content: center; align-items: center; margin: 18px auto 0; }
.brand-lockup img { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; }
.bottom-spacer { height: calc(98px + env(safe-area-inset-bottom)); }

.date-bar { position: fixed; z-index: 40; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px),496px); height: 56px; padding: 0 6px; border: 1px solid var(--brand-border); border-radius: 999px; background: var(--brand-gradient); box-shadow: var(--shadow-datebar); display: grid; grid-template-columns: 42px 42px 1fr 42px 42px; align-items: center; gap: 0; }
.date-bar > button { border: 0; background: none; padding: 0; }
.date-bar > button:not(.date-display) { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-control); display: grid; place-items: center; }
.date-bar img { width: 24px; height: 22px; object-fit: contain; }
.date-display { min-width: 0; height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.date-display strong { max-width: 100%; color: var(--white); font-size: var(--text-main-date); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; text-shadow: var(--shadow-date-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-display strong.today { color: var(--today); }
.date-bar.changed .date-display { animation: date-confirm .38s ease-out; }
.hero-hebrew-date.changed { animation: date-confirm .38s ease-out; }
@keyframes date-confirm { 0% { transform: scale(.92); opacity: .45; } 65% { transform: scale(1.035); opacity: 1; } 100% { transform: scale(1); } }

dialog { width: min(calc(100% - 20px),500px); padding: 0; border: 0; border-radius: 26px; background: var(--white); box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: var(--dialog-backdrop); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.date-sheet { padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 38px; height: 5px; margin: 0 auto 12px; border-radius: 999px; background: var(--sheet-handle); }
.sheet-title { min-height: 36px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 6px; }
.sheet-title h2 { margin: 0; font-size: var(--text-display); font-weight: var(--weight-bold); line-height: var(--line-height); text-align: center; }
.sheet-title button { height: 34px; border: 0; color: var(--blue); background: var(--badge); font-size: var(--text-body); font-weight: var(--weight-medium); }
.sheet-close { width: 34px; border-radius: 50%; color: var(--secondary) !important; font-size: var(--text-display); line-height: 1; }
.calendar-toggle { width: min(280px,100%); margin: 14px auto 10px; padding: 3px; border-radius: 12px; background: var(--toggle-surface); display: grid; grid-template-columns: 1fr 1fr; }
.calendar-toggle button { min-height: 34px; border: 0; border-radius: 9px; color: var(--secondary); background: transparent; font-size: var(--text-body); font-weight: var(--weight-medium); }
.calendar-toggle button[aria-selected="true"] { color: var(--blue); background: var(--white); box-shadow: var(--shadow-control); }
.wheel-picker { position: relative; height: 220px; margin: 4px 0 14px; overflow: hidden; border: 1px solid var(--separator); border-radius: 18px; background: var(--picker-surface); display: grid; grid-template-columns: .8fr 1.45fr 1fr; }
.wheel-picker::before, .wheel-picker::after { content: ""; position: absolute; z-index: 4; left: 0; right: 0; height: 78px; pointer-events: none; }
.wheel-picker::before { top: 0; background: linear-gradient(to bottom,var(--picker-surface) 18%,var(--picker-fade-clear)); }
.wheel-picker::after { bottom: 0; background: linear-gradient(to top,var(--picker-surface) 18%,var(--picker-fade-clear)); }
.wheel-selection { position: absolute; z-index: 1; left: 10px; right: 10px; top: 88px; height: 44px; border-radius: 12px; background: var(--picker-selection); pointer-events: none; }
.wheel { position: relative; z-index: 2; height: 220px; overflow-x: hidden; overflow-y: auto; padding: 88px 0; scrollbar-width: none; scroll-snap-type: y mandatory; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wheel::-webkit-scrollbar { display: none; }
.wheel-item { width: 100%; height: 44px; display: block; scroll-snap-align: center; border: 0; padding: 0 5px; color: var(--picker-muted); background: transparent; font-size: var(--text-body); line-height: 44px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .52; }
.wheel-item.selected { color: var(--ink); font-size: var(--text-display); font-weight: var(--weight-medium); opacity: 1; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions button { min-height: 44px; border: 0; border-radius: 12px; background: var(--soft-blue); color: var(--blue); font-size: var(--text-body); font-weight: var(--weight-medium); }
.sheet-actions button:last-child { background: var(--blue); color: var(--white); }
.sheet-actions button:disabled { opacity: .42; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translate(-50%,16px); padding: 10px 16px; border-radius: 999px; background: var(--toast-surface); color: var(--white); font-size: var(--text-body); font-weight: var(--weight-medium); opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 700px) {
  body { background: linear-gradient(135deg,var(--desktop-bg-start),var(--desktop-bg-end)); }
  .app-shell { width: 520px; margin: 0 auto; box-shadow: var(--shadow-shell); }
}

@media (max-width: 430px) {
  .card-title-row h2 { font-size: var(--text-title-phone); }
  .rosh-heading-row h2 { letter-spacing: -.25px; }
  .holiday-date-row { grid-template-columns: minmax(0,42%) 1fr; gap: 8px; padding-left: 6px; padding-right: 6px; }
}

@media (max-width: 365px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .floating-top { padding-left: 12px; padding-right: 12px; }
  .card-title-row h2 { font-size: var(--text-title-compact); }
  .two-column { gap: 8px; }
  .mini-card { padding: 11px; }
  .holiday-item { padding-left: 9px; padding-right: 8px; }
  .holiday-date-row { grid-template-columns: minmax(0,44%) 1fr; gap: 7px; padding-left: 6px; padding-right: 6px; }
  .holiday-date-line { column-gap: 4px; }
  .date-bar { width: calc(100% - 12px); grid-template-columns: 38px 38px 1fr 38px 38px; }
  .sheet-title { grid-template-columns: 42px 1fr 42px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Flat layout v74: full-width sections, restrained 10px inner shapes, no elevation. */
.content { padding-left: 0; padding-right: 0; }
.location-row { margin-left: 18px; margin-right: 18px; }

.hero-card,
.content > .card,
.mini-card {
  border-radius: 0;
  box-shadow: none;
}

.module-pill,
.account-button,
.date-bar,
.date-bar > button:not(.date-display),
.hero-learning,
.badge,
.time-tile,
.week-event,
.week-time-tile,
.appointment-tab,
.appointment-more-plus,
.holiday-item,
.holiday-date-row,
.holiday-date-line,
.date-lines,
.zman-row {
  border-radius: 10px;
}

.module-pill,
.account-button,
.date-bar,
.week-event.active,
.appointment-tab[aria-selected="true"],
.appointment-tab.is-current,
.zman-row.current {
  box-shadow: none;
}

.brand-lockup { margin-left: 18px; margin-right: 18px; }

@media (min-width: 700px) {
  .app-shell { box-shadow: none; }
}

@media (max-width: 365px) {
  .content { padding-left: 0; padding-right: 0; }
  .location-row,
  .brand-lockup { margin-left: 12px; margin-right: 12px; }
}

/* Fixed navigation bands and centered Apple-like section hierarchy. */
.floating-top {
  top: 0;
  height: calc(70px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  background: var(--white);
  border-bottom: 1px solid var(--separator);
}
.module-pill,
.account-button {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.top-fade,
.bottom-fade { display: none; }

.content { padding-top: calc(86px + env(safe-area-inset-top)); }

.date-bar {
  bottom: 0;
  width: min(100%,520px);
  height: calc(64px + env(safe-area-inset-bottom));
  padding: 0 12px env(safe-area-inset-bottom);
  border-width: 1px 0 0;
  border-radius: 0;
}
.bottom-spacer { height: calc(84px + env(safe-area-inset-bottom)); }

.hero-card { min-height: 224px; }
.hero-french-date,
.hero-hebrew-date {
  border: 0;
  border-radius: 9px;
  padding: 3px 8px;
  color: var(--white);
  background: none;
  font-size: var(--text-main-date);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.hero-french-date { margin-bottom: 7px; }
.hero-hebrew-date { margin-top: 7px; margin-bottom: 0; }
.hero-french-date.today,
.hero-hebrew-date.today { color: var(--today); }
.hero-french-date:focus-visible,
.hero-hebrew-date:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.hero-french-date.changed { animation: date-confirm .38s ease-out; }

.card-title-row {
  position: relative;
  justify-content: center;
  text-align: center;
}
.card-title-row h2 {
  width: 100%;
  color: var(--ink);
  font-size: 26px;
  font-weight: var(--weight-bold);
  line-height: 1.05;
  text-align: center;
}
.section-title-stack > span,
.section-title-stack > small { display: block; }
.section-title-stack > small {
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: var(--weight-medium);
  line-height: 1.2;
}
.card-title-row > .text-action { margin-top: 5px; padding-left: 0; }
.list-card > .card-title-row,
.zmanim-head { flex-direction: column; }
.zmanim-head { height: auto; min-height: 58px; padding-top: 5px; padding-bottom: 5px; }
.holiday-info-line,
.holiday-info-copy { justify-content: center; text-align: center; }
.holiday-detail-toggle { display: block; margin-left: auto; margin-right: auto; }
.mini-card { text-align: center; }
.rosh-meta { justify-content: center; }

@media (max-width: 430px) {
  .card-title-row h2 { font-size: 24px; }
  .section-title-stack > small { font-size: 15px; }
}

@media (max-width: 365px) {
  .floating-top { padding-left: 12px; padding-right: 12px; }
  .date-bar { width: 100%; }
  .card-title-row h2 { font-size: 22px; }
  .section-title-stack > small { font-size: 14px; }
}

/* Apple-inspired type scale: SF Pro system stack, 32/19 mobile hierarchy. */
.hero-card h1,
.card-title-row h2 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.125;
  font-weight: 600;
  letter-spacing: .002em;
}
.hero-card h1 span + span,
.section-title-stack > small {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2105263158;
  font-weight: 400;
  letter-spacing: .012em;
}
.card-title-row h2,
.section-title-stack > small { color: var(--headline); }

.hero-french-date,
.hero-hebrew-date {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.4705882353;
  font-weight: 400;
  letter-spacing: -.022em;
}

.text-action,
.holiday-info-line,
.holiday-detail-toggle,
#rosh-duration,
#birkat-duration {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.4705882353;
  font-weight: 400;
  letter-spacing: -.022em;
}

.mini-card .card-title-row h2 {
  font-size: 22px;
  line-height: 1.0909090909;
  letter-spacing: .011em;
}
.mini-card .section-title-stack > small {
  font-size: 17px;
  line-height: 1.2353641176;
  letter-spacing: -.022em;
}

@media (max-width: 365px) {
  .hero-card h1,
  .card-title-row h2 { font-size: 30px; }
  .hero-card h1 span + span,
  .section-title-stack > small { font-size: 18px; }
  .mini-card .card-title-row h2 { font-size: 20px; }
  .mini-card .section-title-stack > small { font-size: 16px; }
}

/* First section: one line per information, fixed to the busiest-day height. */
.hero-card {
  height: 304px;
  min-height: 304px;
  padding-top: 20px;
  padding-bottom: 20px;
  justify-content: flex-start;
}
.hero-card .hero-date-title { margin: 0; }
.hero-date-title .hero-french-date {
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: clamp(21px,6.4vw,28px);
  color: var(--white);
  letter-spacing: inherit;
  line-height: inherit;
  white-space: nowrap;
}
.hero-hebrew-date {
  margin: 2px 0 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2105263158;
  font-weight: 400;
  letter-spacing: .012em;
}
.hero-special {
  width: 100%;
  min-height: 69px;
  margin: 9px 0;
  color: var(--today);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.2352941176;
  font-weight: 600;
  letter-spacing: -.022em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-special span { display: block; }
.hero-special span + span { margin-top: 2px; }
.hero-learning { margin-top: auto; }

.hero-card.today .hero-date-title .hero-french-date,
.hero-card.today .hero-hebrew-date { color: var(--today); }
.hero-card.today .hero-special { color: var(--white); }

@media (max-width: 365px) {
  .hero-card { height: 320px; min-height: 320px; }
  .hero-hebrew-date { font-size: 18px; }
  .hero-special { min-height: 84px; font-size: 16px; }
}

/* Art direction pass: balanced vertical rhythm without a hollow centre. */
.hero-card {
  padding-top: 26px;
  padding-bottom: 26px;
  justify-content: space-between;
}
.hero-card .hero-date-title,
.hero-hebrew-date,
.hero-special,
.hero-learning { flex: 0 0 auto; }
.hero-special {
  min-height: 0;
  margin: 0;
}
.hero-learning {
  margin-top: 0;
  border: 1px solid var(--glass-separator);
}
.hero-date-title .hero-french-date,
.hero-hebrew-date { text-decoration: none; }

@media (max-width: 365px) {
  .hero-card { padding-top: 28px; padding-bottom: 28px; }
  .hero-special { min-height: 0; }
}

/* Shared section grid: every primary card follows the hero height. */
.card:not(.zmanim-card) {
  height: 304px;
  min-height: 304px;
}
.mini-card { justify-content: space-between; }
.list-card.is-expanded {
  height: auto;
  min-height: 304px;
}

@media (max-width: 365px) {
  .card:not(.zmanim-card) {
    height: 320px;
    min-height: 320px;
  }
  .list-card.is-expanded {
    height: auto;
    min-height: 320px;
  }
}

/* Weekly card v82: one information per line and one continuous time band. */
.week-time-grid .week-time-tile { border-radius: 0; }

@media (max-width: 365px) {
  .week-event h3,
  .week-title-lead,
  .week-countdown { font-size: 22px; }
  .week-hebrew-date { font-size: 17px; }
  .week-time-tile span,
  .week-time-tile strong { font-size: 14px; }
}

.week-event:not(:only-child) .week-event-main { padding: 4px 8px; }
.week-event:not(:only-child) h3,
.week-event:not(:only-child) .week-title-lead { font-size: 16px; }
.week-event:not(:only-child) .week-meta { margin-top: 2px; gap: 1px; }
.week-event:not(:only-child) .week-hebrew-date { font-size: 13px; }
.week-event:not(:only-child) .week-countdown { font-size: 15px; }
.week-event:not(:only-child) .week-time-tile {
  min-height: 30px;
  padding: 3px 5px;
}
.week-event:not(:only-child) .week-time-tile span,
.week-event:not(:only-child) .week-time-tile strong {
  margin-top: 0;
  font-size: 12px;
}

/* Weekly card v83: restrained type and the narrowest safe fixed measure. */
.week-events {
  width: min(calc(100% - 32px),400px);
  margin-left: auto;
  margin-right: auto;
}
.week-event h3,
.week-title-lead,
.week-special,
.week-title-tail,
.week-hebrew-date,
.week-time-tile span,
.week-time-tile strong {
  font-family: var(--font-text);
  font-size: var(--text-body);
  line-height: var(--line-height);
  letter-spacing: normal;
}
.week-event h3,
.week-title-lead,
.week-special,
.week-title-tail { font-weight: var(--weight-medium); }
.week-title-line {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.week-meta { margin-top: 6px; gap: 5px; }
.week-countdown {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2105263158;
  font-weight: 400;
  letter-spacing: .012em;
}
.week-event:only-child .week-event-main { padding-top: 10px; padding-bottom: 8px; }
.week-event:only-child .week-time-tile { min-height: 54px; }
.week-time-tile { padding-top: 7px; padding-bottom: 7px; }
.week-time-tile strong { margin-top: 2px; }

@media (max-width: 365px) {
  .week-events { width: calc(100% - 24px); }
  .week-event h3,
  .week-title-lead,
  .week-special,
  .week-title-tail,
  .week-hebrew-date,
  .week-time-tile span,
  .week-time-tile strong { font-size: var(--text-body); }
  .week-countdown { font-size: 18px; }
}

/* Weekly card v89: full-size cumulative cards, capped by the renderer at two. */
.week-card.has-multiple {
  height: auto;
  min-height: 304px;
}
.week-card.has-multiple .week-events {
  margin-top: 18px;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: flex-start;
}
.week-card.has-multiple .week-event,
.week-card.has-multiple .week-event.active {
  min-height: 150px;
  box-shadow: none;
}
.week-card.has-multiple .week-event-main {
  min-height: 94px;
  padding: 10px 18px 8px;
  justify-content: center;
}
.week-card.has-multiple .week-event h3,
.week-card.has-multiple .week-title-lead,
.week-card.has-multiple .week-special,
.week-card.has-multiple .week-title-tail,
.week-card.has-multiple .week-title-separator,
.week-card.has-multiple .week-hebrew-date,
.week-card.has-multiple .week-countdown {
  font-size: 19px;
}
.week-card.has-multiple .week-countdown {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
}
.week-card.has-multiple .week-time-tile {
  min-height: 48px;
  padding: 7px 5px;
}
.week-card.has-multiple .week-time-tile span,
.week-card.has-multiple .week-time-tile strong {
  margin-top: 0;
  font-size: var(--text-body);
}
.week-time-tile.is-continuation strong {
  line-height: var(--line-height);
  white-space: normal;
}
@media (max-width: 365px) {
  .week-card.has-multiple { min-height: 320px; }
  .week-card.has-multiple .week-events { width: calc(100% - 24px); }
}

/* Weekly card v85: uniform bullets, conditional parasha line, compact green card. */
.week-title-primary,
.week-parasha-line { display: block; }
.week-parasha-line {
  margin-top: 2px;
  color: var(--green);
}
.week-card {
  padding-top: 24px;
  padding-bottom: 24px;
  justify-content: space-between;
}
.week-events {
  margin-top: 0;
  flex: 0 0 auto;
}
.week-event:only-child {
  min-height: 0;
  flex: 0 0 auto;
}
.week-event:only-child .week-event-main {
  min-height: 0;
  padding-top: 10px;
  padding-bottom: 8px;
  flex: 0 0 auto;
}
.week-event:only-child .week-time-tile { min-height: 48px; }

@media (max-width: 365px) {
  .week-card { padding-top: 26px; padding-bottom: 26px; }
}

/* Weekly card v86: centre the compact event inside the space below the heading. */
.week-card {
  justify-content: flex-start;
}
.week-card .section-title-stack > small {
  margin-top: 10px;
}
.week-events {
  min-height: 0;
  margin-top: 0;
  flex: 1 1 auto;
  justify-content: center;
}
.week-event:only-child {
  flex: 0 0 auto;
}

/* Weekly card v87: keep the three-line height and centre shorter content. */
.week-event:only-child { min-height: 142px; }
.week-event:only-child .week-event-main {
  flex: 1 1 auto;
  justify-content: center;
}

/* Weekly card v88: restore the light page, lock compact height, and mark today's time. */
html,
body,
.app-shell { background: var(--bg); }
.hero-card { background: var(--brand-gradient); }
.location-row { color: var(--secondary); }
.location-row img { filter: none; }
.week-event:only-child { min-height: 150px; }
.week-time-tile.is-today {
  background: var(--green);
  color: var(--white);
}
.week-event .week-time-tile.is-today strong { color: var(--white); }

@media (min-width: 700px) {
  body { background: linear-gradient(135deg, var(--desktop-bg-start), var(--desktop-bg-end)); }
}

/* Weekly card v84: title and Hebrew date match “Cette semaine”. */
.week-event h3,
.week-title-lead,
.week-special,
.week-title-tail,
.week-title-separator,
.week-hebrew-date {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2105263158;
  font-weight: 400;
  letter-spacing: .012em;
}
.week-event h3,
.week-title-lead,
.week-special,
.week-title-tail { color: var(--headline); }
.week-hebrew-date { color: var(--secondary); }
.week-title-separator { color: var(--green); }

@media (max-width: 365px) {
  .week-event h3,
  .week-title-lead,
  .week-special,
  .week-title-tail,
  .week-title-separator,
  .week-hebrew-date,
  .week-countdown { font-size: 18px; }
}

/* Paracha v96: on its own line, the label and name are green with a black bullet. */
.hero-special .hero-parasha-line,
.week-event .week-parasha-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--green);
}
.hero-special .hero-parasha-line > span,
.week-event .week-parasha-line > span {
  display: inline;
  color: var(--green);
}
.hero-special .hero-parasha-line > .parasha-bullet,
.week-event .week-parasha-line > .parasha-bullet {
  color: var(--headline);
}

/* Layout v94: shared content width and compact location in the fixed header. */
.content { padding-top: calc(70px + env(safe-area-inset-top)); }
.week-events,
.week-card.has-multiple .week-events { width: 100%; }
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.location-button {
  height: 46px;
  border: 0;
  padding: 0 4px;
  color: var(--secondary);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
}
.location-button img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}
.location-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Hero card v98: the detached paracha alternates against the other details. */
.hero-special .hero-parasha-line,
.hero-special .hero-parasha-line > .parasha-label,
.hero-special .hero-parasha-line > .parasha-bullet,
.hero-special .hero-parasha-line > .parasha-name {
  color: var(--white);
}
.hero-card.today .hero-special .hero-parasha-line,
.hero-card.today .hero-special .hero-parasha-line > .parasha-label,
.hero-card.today .hero-special .hero-parasha-line > .parasha-bullet,
.hero-card.today .hero-special .hero-parasha-line > .parasha-name {
  color: var(--today);
}

/* Appointment card v99: compact two-line tabs with duration and countdown. */
.list-card .card-title-row {
  justify-content: center;
  text-align: center;
}
.appointment-tabs {
  align-items: stretch;
}
.appointment-tab {
  width: clamp(78px,22vw,88px);
  min-height: 58px;
  padding: 7px 6px;
  border-radius: 10px;
  flex-direction: column;
  gap: 3px;
  white-space: normal;
  text-align: center;
}
.appointment-tab-label {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.appointment-tab-meta {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  opacity: .86;
}
.appointment-more-plus {
  align-self: stretch;
  width: 34px;
  height: auto;
  min-height: 58px;
  border-radius: 10px;
}
.holiday-info-line {
  margin-top: 7px;
}

/* Definitive colour system v107. */

/* Frame 2: one green identity for every weekly event. */
.week-event,
.week-event.active,
.week-card.has-multiple .week-event {
  background: var(--active);
}
.week-event .week-time-grid,
.week-card.has-multiple .week-event .week-time-grid {
  background: var(--soft-green);
}
.week-event .week-title-separator,
.week-event .week-parasha-line,
.week-event .week-countdown,
.week-event .week-time-tile strong {
  color: var(--green);
}
.week-countdown {
  min-width: 0;
  min-height: 0;
  margin: 0 0 7px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}
.week-card.has-multiple .week-events { gap: 22px; }
.week-card.has-multiple .week-event {
  display: flex;
  flex-direction: column;
}
.week-card.has-multiple .week-event-main { flex: 1 1 auto; }
.week-card.has-multiple .week-time-grid {
  margin-top: auto;
  flex: 0 0 auto;
}
.week-event .week-time-tile.is-today {
  background: var(--green);
}
.week-event .week-time-tile.is-today,
.week-event .week-time-tile.is-today span,
.week-event .week-time-tile.is-today strong {
  color: var(--white);
}

/* Frame 3: blue variants only. */
.list-card .appointment-tab.is-current {
  color: var(--white);
  background: var(--blue-strong);
}
.list-card .holiday-item.active {
  background: var(--blue-strong);
}

/* Green category: one white band, two balanced panels and colour only in the date fields. */
.green-pair {
  position: relative;
  gap: 0;
  padding: 46px 0 32px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.green-pair::after {
  content: '';
  position: absolute;
  top: 38px;
  bottom: 30px;
  left: 50%;
  width: 1px;
  background: var(--green);
  opacity: .22;
  pointer-events: none;
}
.green-panel,
.green-panel.active {
  min-height: 342px;
  padding: 0 18px;
  border-radius: 0;
  background: var(--white);
  box-shadow: none;
  color: var(--ink);
  text-align: center;
}
.green-panel .card-title-row {
  min-height: 58px;
  padding: 0;
  align-items: flex-start;
}
.green-panel .card-title-row h2,
.green-panel.active .card-title-row h2 {
  color: var(--green);
  font-size: 25px;
  line-height: 1.08;
  font-weight: 600;
  text-align: center;
  white-space: normal;
}
.green-subtitles {
  min-height: 62px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}
.green-duration,
.green-panel.active .green-duration {
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 400;
}
.green-context,
.green-panel.active .green-context {
  color: var(--green);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 400;
}
.green-molad,
.green-panel.active .green-molad {
  width: 100%;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.green-panel .date-lines,
.green-panel.active .date-lines {
  min-height: 116px;
  margin-top: 20px;
  padding: 14px 8px;
  border-radius: 12px;
  background: var(--soft-green);
  color: var(--green);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  overflow: hidden;
}
.green-panel.active .date-lines {
  background: var(--green);
  color: var(--white);
}
.green-panel .date-lines > span,
.green-panel.active .date-lines > span,
.green-panel .birkat-note,
.green-panel.active .birkat-note {
  color: inherit;
}
.green-date-entry {
  position: relative;
  min-height: 17px;
  display: grid !important;
  place-items: center;
}
.green-date-copy { white-space: nowrap; }
.green-evening {
  position: absolute;
  right: 0;
  color: inherit;
  font-size: 10px;
  line-height: 1;
  font-weight: 400;
}
.green-countdown {
  min-height: 25px;
  margin-top: 20px;
  color: var(--green);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 400;
  text-align: center;
}
.green-countdown.is-empty { visibility: hidden; }
@media (max-width: 365px) {
  .green-pair { padding-top: 40px; }
  .green-panel,
  .green-panel.active { padding-left: 11px; padding-right: 11px; }
  .green-panel .card-title-row h2,
  .green-panel.active .card-title-row h2 { font-size: 22px; }
  .green-context,
  .green-panel.active .green-context { font-size: 18px; }
  .green-panel .date-lines,
  .green-panel.active .date-lines { padding-left: 6px; padding-right: 6px; font-size: 13px; }
  .green-molad,
  .green-panel.active .green-molad { font-size: 11px; }
}

/* Zmanim: blue information on a white field. */
.zmanim-card {
  background: var(--white);
  padding-top: 45px;
  padding-bottom: 24px;
}
.zmanim-head {
  min-height: auto;
  padding-top: 0;
  padding-bottom: 30px;
}
.zmanim-head .section-title-stack > small { margin-top: 10px; }
.zman-row strong { color: var(--blue); }
.zman-row:nth-child(odd) { background: var(--soft-blue); }
.zman-row.current {
  background: var(--blue-strong);
  color: var(--white);
}
.zman-row.current strong { color: var(--white); }
.zmanim-customize {
  display: block;
  margin: 20px auto 0;
  padding: 2px 0;
  color: var(--blue);
  font-size: 16px;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
