/* Midtown phone app — standalone PWA. Not for ChabadOne paste. */

:root {
  --cream: #f4ece0;
  --paper: #fffaf2;
  --burgundy: #6b2121;
  --burgundy-deep: #561a1a;
  --copper: #9a4f20;
  --copper-bright: #a85a28;
  --ink: #3a2622;
  --muted: #5c4640;
  --quiet: #6e5850;
  --line: #e3d3bf;
  --header: 56px;
  --chips: 58px;
  --tabs: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--cream); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.5 "Jost", "Futura", "Avenir Next", "Century Gothic", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: rgba(107, 33, 33, 0.12);
  touch-action: manipulation;
  color-scheme: light;
}

img { max-width: 100%; height: auto; display: block; }
button, a { -webkit-tap-highlight-color: rgba(107, 33, 33, 0.12); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.lead, .desc, .coming-note, dd { text-wrap: pretty; }
.time, .tile .dn, .chip span, .m-time {
  font-variant-numeric: tabular-nums lining-nums;
}

a { color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--copper-bright);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 40;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--burgundy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header);
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px 12px;
  background: rgba(244, 236, 224, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: 0 0 36px;
}
.brand .titles { min-width: 0; }
.brand .eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand h1 {
  font: 600 20px/1.1 "Cormorant Garamond", "Cormorant", Garamond, "EB Garamond", Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--burgundy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--burgundy);
  background: var(--paper);
  color: var(--burgundy);
  font: 600 13px/1 "Jost", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.icon-btn:hover, .icon-btn:active {
  background: var(--burgundy);
  color: #fff;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Day chips */
.daynav {
  position: sticky;
  top: calc(var(--header) + env(safe-area-inset-top, 0px));
  z-index: 15;
  display: flex;
  gap: 4px;
  padding: 6px 8px 8px;
  background: rgba(244, 236, 224, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.daynav::-webkit-scrollbar { display: none; }
.chip {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 3px 2px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--burgundy);
}
.chip b {
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.chip span {
  font: 600 18px/1.1 "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
}
.chip:hover, .chip:active, .chip.is-on {
  background: var(--burgundy);
  color: #fff;
  border-color: var(--burgundy);
}

body.is-other .daynav { display: none; }

/* Main */
.main {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 8px 16px calc(var(--tabs) + 24px + env(safe-area-inset-bottom, 0px));
}
.panel[hidden] { display: none; }
.hero {
  padding: 18px 0 8px;
  text-align: center;
}
.hero .kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 600;
}
.hero h2 {
  font: 600 clamp(36px, 11vw, 56px)/1 "Cormorant Garamond", "Cormorant", Garamond, "EB Garamond", Georgia, serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--burgundy);
}
.hero .lead {
  margin: 10px auto 0;
  max-width: 32em;
  color: var(--muted);
  font-size: 16px;
}

.minyan-bar {
  margin: 16px 0 8px;
  border: 1.5px solid var(--burgundy);
  border-radius: 26px;
  background: var(--paper);
  overflow: hidden;
}
.minyan-bar summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  min-height: 48px;
  padding: 8px 40px 8px 16px;
  position: relative;
  font-size: 16px;
}
.minyan-bar summary::-webkit-details-marker { display: none; }
.minyan-bar b {
  font: 600 20px/1 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  margin-right: 6px;
}
.minyan-bar em {
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--quiet);
  margin-right: 5px;
}
.minyan-bar strong { color: var(--copper); font-weight: 600; }
.minyan-bar .chev {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--burgundy);
  border-bottom: 2px solid var(--burgundy);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.minyan-bar[open] > summary .chev {
  transform: rotate(225deg);
  margin-top: -2px;
}
.minyan-bar .panel {
  padding: 4px 16px 14px;
  border-top: 1px solid #ecdcc8;
}
.minyan-bar dl { margin: 0 0 12px; }
.minyan-bar .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f3e3d3;
  font-size: 16px;
}
.minyan-bar dt { color: var(--quiet); }
.minyan-bar dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.acts { display: flex; flex-direction: column; gap: 8px; }

.day {
  margin-top: 22px;
  scroll-margin-top: calc(var(--header) + var(--chips) + env(safe-area-inset-top, 0px) + 8px);
}
.dhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tile {
  flex: 0 0 auto;
  width: 78px;
  padding: 8px 0 7px;
  border-radius: 8px;
  background: var(--burgundy);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.tile .wd { font-size: 13px; letter-spacing: 0.04em; font-weight: 600; }
.tile .dn {
  font: 600 26px/1 "Cormorant Garamond", Garamond, Georgia, serif;
  margin: 2px 0 1px;
}
.tile .hd { font-size: 13px; opacity: 0.9; }
.dhead h2 {
  font: 600 26px/1.15 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
}
.dhead h2 small {
  display: block;
  margin-top: 2px;
  font: 500 14px/1.3 "Jost", system-ui, sans-serif;
  color: var(--quiet);
  letter-spacing: 0;
  text-transform: none;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 0 10px;
  overflow: hidden;
  scroll-margin-top: calc(var(--header) + var(--chips) + env(safe-area-inset-top, 0px) + 8px);
}
.card + .card { margin-top: 10px; }
.card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: 88px;
  padding: 12px 14px;
}
.card summary::-webkit-details-marker { display: none; }
.ctext { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.time {
  color: var(--copper);
  font-size: 13px;
  font-weight: 600;
}
.time .note {
  margin-left: 6px;
  color: var(--burgundy);
  font-weight: 600;
}
.card h3 {
  font: 600 22px/1.2 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
}
.sub { font-size: 14px; color: var(--quiet); }
.desc { font-size: 15px; color: var(--muted); margin-top: 2px; }
.thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  align-self: center;
}
.toggle {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--burgundy);
}
.card[open] .toggle .op { display: none; }
.card:not([open]) .toggle .cl { display: none; }
.card .body {
  padding: 0 14px 14px;
  border-top: 1px solid #f3e3d3;
}
.about, .note-p { margin: 12px 0; font-size: 16px; color: var(--ink); }
.note-p { color: var(--muted); }
.card dl { margin: 0 0 12px; }
.card .row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 5px 0;
  font-size: 15px;
}
.card dt { color: var(--quiet); }
.card dd { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--burgundy);
  background: var(--paper);
  color: var(--burgundy);
  font: 600 15px/1.2 "Jost", system-ui, sans-serif;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn.pri { background: var(--burgundy); color: #fff; }
.btn.pri:hover, .btn.pri:active { background: var(--burgundy-deep); border-color: var(--burgundy-deep); }
.btn:hover, .btn:active { background: var(--burgundy); color: #fff; }

.faq { margin: 32px 0 12px; }
.faq h2 {
  font: 600 28px/1.15 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  margin-bottom: 12px;
}
.faq h2 small {
  display: block;
  margin-top: 4px;
  font: 500 14px/1.3 "Jost", system-ui, sans-serif;
  color: var(--quiet);
  text-transform: none;
  letter-spacing: 0;
}
.qa {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  margin: 0 0 8px;
}
.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa h3 { font: 600 16px/1.3 "Jost", system-ui, sans-serif; color: var(--ink); }
.qa .qchev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--burgundy);
  border-bottom: 2px solid var(--burgundy);
  transform: rotate(45deg);
  flex: 0 0 10px;
  transition: transform 0.2s var(--ease);
}
.qa[open] .qchev { transform: rotate(225deg); }
.qa .ans { padding: 0 14px 14px; color: var(--muted); font-size: 16px; }
.qa .ans p { margin: 0; }
.qa .ans a { color: var(--burgundy); font-weight: 600; }

.foot {
  margin: 28px 0 8px;
  text-align: center;
  color: var(--quiet);
  font-size: 15px;
}
.foot a { color: var(--burgundy); font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 8px;
}

/* Placeholder tabs */
.coming {
  margin: 28px 0 0;
  padding: 22px 20px;
  border: 1.5px dashed #d9bfa6;
  border-radius: 16px;
  background: var(--paper);
}
.coming .badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3e3d3;
  color: var(--burgundy);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.coming h2 {
  font: 600 32px/1.1 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.coming-note { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.times-card {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.times-card h3 {
  font: 600 18px/1.2 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  margin-bottom: 10px;
}
.times-card .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3e3d3;
  font-size: 16px;
}
.times-card .row:last-child { border-bottom: 0; }
.times-card dt { color: var(--quiet); min-width: 0; }
.times-card dd { margin: 0; font-weight: 600; text-align: right; }
.source { margin: 10px 0 0; font-size: 13px; color: var(--quiet); }

.need-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* Bottom tabs */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 250, 242, 0.97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 4px 2px;
  text-decoration: none;
  color: var(--quiet);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  border-radius: 10px;
}
.tab svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab[aria-current="page"] {
  color: var(--burgundy);
  background: #f3e3d3;
}

/* Alerts sheet */
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(58, 38, 34, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-back[hidden] { display: none; }
.sheet {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  color: var(--ink);
}
.sheet h2 {
  font: 600 28px/1.1 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.sheet ol { margin: 12px 0 0; padding-left: 1.2em; color: var(--ink); }
.sheet li { margin: 0 0 6px; }
.sheet .acts { margin-top: 16px; }
.sheet-close { width: 100%; }

.status { margin: 10px 0 0; min-height: 1.4em; font-size: 15px; color: var(--muted); }
.status.ok { color: var(--burgundy); font-weight: 600; }

/* Motion */
.rise {
  animation: rise 0.5s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .rise { opacity: 1; transform: none; }
}

@media (min-width: 800px) {
  body { background: #efe3d2; }
  .main { padding-top: 12px; }
}

@media (max-width: 340px) {
  .brand h1 { font-size: 17px; }
  .icon-btn span { display: none; }
  .hero h2 { font-size: 32px; }
}

/* Install / iOS hint */
.install-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 16px;
  background: #f3e3d3;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.install-hint[hidden] { display: none; }
.install-hint p {
  margin: 0;
  font-size: 14px;
  min-width: 0;
  flex: 1;
}
.install-how {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--burgundy);
  background: var(--burgundy);
  color: #fff;
  font: 600 13px/1 "Jost", system-ui, sans-serif;
  cursor: pointer;
}
.install-how:hover, .install-how:active { background: var(--burgundy-deep); border-color: var(--burgundy-deep); }
.ios-hint {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1.5px solid #d9bfa6;
  border-radius: 14px;
  background: #fbf3e6;
}
.ios-hint p { margin: 0; }
.ios-hint[hidden] { display: none; }
#other-push-hint { margin-top: 12px; }

.btn[hidden], button[hidden], .install-hint[hidden], .ios-hint[hidden], #other-push-hint[hidden] {
  display: none !important;
}
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.btn:disabled:hover, .btn[aria-disabled="true"]:hover {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: #fff;
}

.panel-title {
  margin: 18px 0 8px;
  font: 600 32px/1.1 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.empty-day {
  margin: 0 0 8px;
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 16px;
}
.coming-up { margin: 32px 0 12px; }
.coming-up h2 {
  font: 600 28px/1.15 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
  margin-bottom: 12px;
}
.coming-up h2 small {
  display: block;
  margin-top: 4px;
  font: 500 14px/1.3 "Jost", system-ui, sans-serif;
  color: var(--quiet);
  text-transform: none;
  letter-spacing: 0;
}
.coming-up ul { list-style: none; margin: 0; padding: 0; }
.coming-up li { margin: 0 0 8px; }
.coming-up a {
  display: block;
  padding: 14px 16px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-decoration: none;
}
.coming-up a:hover { border-color: var(--burgundy); }
.coming-up b {
  display: block;
  font: 600 18px/1.3 "Cormorant Garamond", Garamond, Georgia, serif;
  color: var(--burgundy);
}
.coming-up span { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); }
