[hidden] { display: none !important; }
:root {
  --navy: #16233B;
  --navy-2: #22345A;
  --gold: #D4AE5C;
  --gold-ink: #7E5F1C;
  --paper: #F4EFE4;
  --card: #FFFDF8;
  --line: #E3D9C6;
  --ink: #1B1A17;
  --muted: #5E574B;
  --green: #2F6B3A;
  --green-bg: #E3EFDF;
  --red: #9A3412;
  --red-bg: #F7E3D8;
  --yt: #7B2D1A;
  --serif: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --sans: 'Assistant', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.5 var(--sans); overflow-x: hidden; }
a { color: var(--navy-2); }
.he { font-family: var(--serif); direction: rtl; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- hero ---------- */
.hero { background: var(--navy); color: #F4EFE4; position: relative; overflow: hidden; }
.hero::after { /* quiet border pattern, like a sefer's edge */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 24px, transparent 24px 32px); opacity: .55;
}
.bar { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark { width: 40px; height: 40px; border-radius: 10px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font: 700 24px/1 var(--serif); }
.brand b { font: 700 18px/1.1 var(--sans); display: block; }
.brand small { font: 500 13px/1.2 var(--sans); color: #C9C3B6; display: block; }
.nav { display: none; gap: 4px; }
.nav a, .nav button { display: inline-flex; align-items: center; gap: 8px; color: #E9E3D6; text-decoration: none; font: 600 16px var(--sans); padding: 10px 14px; border-radius: 10px; background: none; border: 0; cursor: pointer; min-height: 44px; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.08); }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; color: #E9E3D6; background: rgba(255,255,255,.08); border: 0; border-radius: 12px; min-height: 48px; padding: 0 14px; font: 600 16px var(--sans); cursor: pointer; }
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 8px 16px 40px; display: grid; gap: 12px; }
.hero-date { font: 700 40px/1.1 var(--serif); color: var(--gold); margin: 0; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: #DCD5C6; font-size: 17px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(212,174,92,.16); color: #F1DDAE; font: 600 16px var(--serif); }
.hero h1 { font: 700 40px/1.08 var(--serif); margin: 8px 0 0; max-width: 18ch; color: #FFFDF8; }
.hero .lead { font-size: 20px; color: #DCD5C6; max-width: 40ch; margin: 0; }
.hero .cta { margin-top: 12px; max-width: 360px; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: -24px auto 0; padding: 0 12px 120px; position: relative; z-index: 1; }
.grid { display: grid; gap: 16px; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.pair { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 16px; box-shadow: 0 1px 2px rgba(22,35,59,.05), 0 8px 24px -16px rgba(22,35,59,.25); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.card-h h2 { font: 700 21px/1.2 var(--serif); margin: 0; flex: 1; }
.card-h .ico { color: var(--gold-ink); }
.card-h .he { color: var(--gold-ink); font-size: 20px; font-weight: 700; }

/* today */
.today-card { border-top: 6px solid var(--gold); }
.eyebrow { font: 700 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.piece { font: 700 42px/1.05 var(--serif); margin: 8px 0 4px; letter-spacing: -.01em; }
.piece-he { font: 700 30px/1.3 var(--serif); color: var(--navy-2); margin: 0 0 16px; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.standing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: 17px; }
.pill.good { color: var(--green); background: var(--green-bg); }
.pill.behind { color: var(--red); background: var(--red-bg); }
.pill.neutral { color: var(--muted); background: #EEE8DC; }
.pill .ico { width: 18px; height: 18px; }

/* buttons */
.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 14px; border: 2px solid var(--navy); background: var(--navy); color: #FFFDF8; font: 700 19px var(--sans); cursor: pointer; padding: 0 20px; text-decoration: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.small { min-height: 48px; font-size: 16px; width: auto; padding: 0 16px; border-radius: 12px; }
.btn.danger { background: transparent; color: var(--red); border-color: #E2B9A6; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; }
.btn .ico { width: 22px; height: 22px; }
.row { display: flex; gap: 12px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* progress */
.prog { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.ring { width: 96px; height: 96px; flex: none; }
.ring text { font: 700 22px var(--serif); fill: var(--ink); }
.facts { margin: 0; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; font-weight: 700; text-align: right; }
.catch { background: #F3ECDD; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }

/* message */
.msg { font: 500 20px/1.45 var(--serif); background: #F7F1E4; border-left: 4px solid var(--gold); padding: 14px 16px; border-radius: 0 12px 12px 0; margin: 0 0 12px; }

/* panels + forms */
.panel { background: #FBF7EE; border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px; margin: 16px 0 0; }
.panel h3 { font: 700 20px/1.2 var(--serif); margin: 0 0 14px; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: center; }
.stepper button { height: 64px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: 700 30px var(--sans); color: var(--ink); cursor: pointer; }
.stepper input { height: 64px; text-align: center; font: 700 34px var(--serif); border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; color: var(--ink); }
.stepper-cap { text-align: center; font-size: 15px; color: var(--muted); margin-top: 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { min-height: 52px; border: 0; border-right: 1px solid var(--line); background: transparent; font: 600 17px var(--sans); color: var(--ink); cursor: pointer; padding: 0 8px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #FFFDF8; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; min-width: 56px; padding: 0 16px; border-radius: 24px; border: 1px solid var(--line); background: #fff; font: 600 17px var(--sans); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #FFFDF8; }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.preview { font: 600 17px var(--sans); margin: 14px 0; }
label.field { display: block; margin: 0 0 16px; }
label.field > span, .lbl { display: block; font-weight: 700; margin-bottom: 6px; }
label.field small, .hint { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 52px; font: 400 18px var(--sans); color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 18px; }
.check input { width: 26px; height: 26px; accent-color: var(--navy); flex: none; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list b { display: block; }
.list .sub { font-size: 15px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #EDE4D2; color: var(--navy); display: grid; place-items: center; font: 700 17px var(--serif); flex: none; }
.x { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.x .ico { width: 20px; height: 20px; }
.done-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; flex: none; }

/* reminders */
.rem { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #fff; }
.rem-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rem-time { font: 700 26px/1 var(--serif); }
.rem-days { font-weight: 700; color: var(--gold-ink); }
.rem-text { margin: 8px 0; font: 500 18px/1.4 var(--serif); }
.rem-meta { font-size: 15px; color: var(--muted); display: grid; gap: 2px; }
.rem-next { color: var(--green); font-weight: 700; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); background: #F3ECDD; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.note .ico { color: var(--gold-ink); margin-top: 2px; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { flex: 1; min-width: 160px; }
.cal-title b { font: 700 24px/1.15 var(--serif); display: block; }
.cal-title span { font: 600 17px var(--serif); color: var(--gold-ink); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.cal-nav .today-btn { width: auto; padding: 0 12px; font: 600 15px var(--sans); }
.cal-mode { margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-dow { text-align: center; font: 700 12px/1.2 var(--sans); color: var(--muted); padding: 8px 2px; background: #F3ECDD; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-dow .he { display: block; font-size: 14px; color: var(--ink); }
.cal-day { position: relative; min-height: 64px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 2px; border-top: 0; border-left: 0; }
.cal-day.blank { background: #FAF7F0; cursor: default; }
.cal-day.shabbos { background: #F2F0F7; }
.cal-day.yt { background: #F8E9E2; }
.cal-day.sel { outline: 3px solid var(--gold); outline-offset: -3px; z-index: 1; }
.cal-day .nums { display: flex; justify-content: space-between; align-items: baseline; gap: 2px; }
.cal-day .hd { font: 700 17px/1 var(--serif); }
.cal-day .gd { font: 600 11px/1 var(--sans); color: var(--muted); }
.cal-day.today .gd { background: var(--navy); color: #fff; border-radius: 8px; padding: 2px 5px; }
.cal-day .marks { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.mk { width: 8px; height: 8px; border-radius: 50%; }
.mk.plan { background: var(--gold); }
.mk.done { background: var(--green); }
.mk.miss { background: var(--red); }
.mk.yt { background: var(--yt); }
.mk.rc { background: var(--navy-2); }
.cal-day .ev, .cal-day .pp { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-detail { margin-top: 12px; border-radius: 12px; background: #F7F1E4; padding: 14px 16px; }
.day-detail h3 { margin: 0 0 6px; font: 700 20px/1.2 var(--serif); }
.day-detail ul { margin: 6px 0 0; padding-left: 20px; }

/* phone tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--navy); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: #D9D2C3; text-decoration: none; font: 600 12px var(--sans); background: none; border: 0; cursor: pointer; }
.tabbar .ico { width: 24px; height: 24px; }

/* setup */
.step { padding: 20px 0; border-bottom: 1px solid var(--line); }
.step:last-of-type { border-bottom: 0; }
.step-n { font: 700 13px var(--sans); color: var(--gold-ink); letter-spacing: .08em; text-transform: uppercase; }
.step h3 { font: 700 23px/1.2 var(--serif); margin: 4px 0 14px; }
.person { background: #FBF7EE; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.person-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.sticky-save { position: sticky; bottom: 60px; background: linear-gradient(transparent, var(--card) 30%); padding: 20px 0 8px; }

/* intro */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.features li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.features li:last-child { border-bottom: 0; }
.features .ico { width: 28px; height: 28px; color: var(--gold-ink); margin-top: 2px; }
.features b { display: block; font: 700 19px/1.3 var(--serif); }

.share { display: flex; gap: 8px; align-items: center; }
.share input { flex: 1; min-width: 0; font-size: 15px; }
.notice { background: #F1E6C9; border: 1px solid #E2CF9C; border-radius: 14px; padding: 14px 16px; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #FFFDF8; padding: 14px 20px; border-radius: 12px; font-weight: 600; max-width: 90vw; z-index: 20; }
.foot { font-size: 14px; color: var(--muted); text-align: center; margin-top: 24px; }

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .cal-day { min-height: 84px; padding: 6px; }
  .cal-day .hd { font-size: 20px; }
  .cal-day .gd { font-size: 12px; }
}
@media (min-width: 760px) {
  .wrap { padding: 0 24px 64px; }
  .bar, .hero-inner { padding-left: 24px; padding-right: 24px; }
  .card { padding: 24px; }
  .pair { grid-template-columns: 1fr 1fr; }
  .tabbar { display: none; }
  .nav { display: flex; }
  .icon-btn.setup-mobile { display: none; }
  .sticky-save { bottom: 0; }
  #toast { bottom: 24px; }
  .hero-date { font-size: 52px; }
  .hero h1 { font-size: 56px; }
  .hero-inner { padding-bottom: 56px; }
}
@media (min-width: 1000px) {
  .grid.dash { grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
  .grid.dash > .col:first-child { position: sticky; top: 16px; }
  .grid.intro { grid-template-columns: 1fr 1.3fr; }
  .cal-day { min-height: 104px; }
  .cal-day .ev, .cal-day .pp { display: block; font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-day .ev { font-family: var(--serif); font-weight: 700; font-size: 13px; direction: rtl; text-align: right; }
  .cal-day .ev.parsha { color: var(--navy-2); }
  .cal-day .ev.yomtov, .cal-day .ev.chm, .cal-day .ev.erev { color: var(--yt); }
  .cal-day .ev.rc { color: var(--gold-ink); }
  .cal-day .ev.fast, .cal-day .ev.minor { color: var(--muted); }
  .cal-day .pp { font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #F6EBCF; color: var(--gold-ink); }
  .cal-day .pp.done { background: var(--green-bg); color: var(--green); }
  .cal-day .pp.miss { background: var(--red-bg); color: var(--red); }
  .cal-day .marks { display: none; }
}

/* send now + time picker */
.send-box { background: linear-gradient(180deg, #FBF3DF, #F8EED6); border: 1px solid #E2CF9C; border-radius: 14px; padding: 14px; margin: 0 0 18px; }
.send-box .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.send-box .actions .btn { min-width: 0; }
.sub-h { display: flex; align-items: center; gap: 8px; font: 700 19px/1.2 var(--serif); margin: 4px 0 10px; }
.sub-h .ico { width: 20px; height: 20px; color: var(--gold-ink); }
.own { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.own-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.own-row > span { flex: 1 1 100%; font-weight: 700; }
.own-row .btn { flex: 1 1 0; }
.btn.wa { background: #1F8F4E; color: #fff; border-color: #1F8F4E; }
.timepick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timepick select { width: auto; min-width: 76px; font-size: 20px; min-height: 48px; }
.timepick .seg { margin: 0; flex: 0 0 auto; }
.sends { list-style: none; margin: 12px 0 0; padding: 0; font-size: 15px; }
.sends li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.sends .ico { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.notice.bad { background: #F8E1DC; border-color: #E5B4A9; }
.send-box .actions { flex-direction: column; }
.send-box .actions .btn { width: 100%; flex: none; }
@media (min-width: 560px) { .send-box .actions { flex-direction: row; } .send-box .actions .btn { width: auto; flex: 1 1 0; } }
.timepick > div:not(.seg) { flex: 0 0 auto; width: auto; min-width: 84px; }
.timepick > b { display: inline; }
.goes-to { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 14px; font-size: 16px; }
/* "Who are you?" prompt (visit log) */
.notice.who { position: relative; margin: 0 0 16px; padding-right: 52px; }
.who-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: transparent; font: 400 26px/1 var(--sans); color: var(--muted); cursor: pointer; border-radius: 22px; }
.linkbtn { border: 0; background: none; padding: 4px 2px; font: inherit; color: var(--navy); text-decoration: underline; cursor: pointer; }
/* boss link */
.boss-badge { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--gold, #D4AE5C); color: #16233B; font: 700 12px/1.5 var(--sans, sans-serif); letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.lock-note { display: flex; align-items: center; gap: 6px; color: var(--muted, #6b6455); }
.lock-note .ico, .field small .ico, .notice .ico { width: 16px; height: 16px; vertical-align: -3px; }
