/* Torah V'Chesed
   Layout: mobile-first app shell (sticky navy top bar, one feed column, bottom tab bar
   with a raised log button); from 1080px it becomes nav rail | feed | "today" rail.
   Identity: techeiles blue for Torah, pomegranate for chesed, gold leaf for achievement,
   and a Shas shelf of leather spines. */

:root {
  --bg: #f1f2f7;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --ink: #141833;
  --muted: #5a6079;
  --line: #e0e3ee;
  --brand: #16204a;
  --on-brand: #f4f5fb;
  --on-brand-muted: #b9bfdc;
  --accent: #2a4bd7;
  --on-accent: #ffffff;
  --torah: #2a4bd7;
  --torah-soft: #e7ecfd;
  --chesed: #be2d4c;
  --chesed-soft: #fbe8ed;
  --chesed-bright: #ec5a78;
  --gold: #8c6200;
  --gold-bright: #e2b33c;
  --gold-soft: #fbf1d4;
  --danger: #b3261e;
  --whatsapp: #17804a;
  --leather-text: #ecc766;
  --shelf: #7a5634;
  --shadow: 0 1px 2px rgb(20 24 51 / 0.06), 0 6px 20px rgb(20 24 51 / 0.05);
  --font-display: "Frank Ruhl Libre", "Noto Serif Hebrew", "Times New Roman", serif;
  --font-ui: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --radius: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e1d; --surface: #141a33; --surface-2: #1a2142; --ink: #e9ebf6; --muted: #9ba1bf; --line: #283053;
    --brand: #101845; --on-brand: #eef0fb; --on-brand-muted: #9aa3d0; --accent: #93a8ff; --on-accent: #0b0e1d;
    --torah: #93a8ff; --torah-soft: #1d2758; --chesed: #ff7f99; --chesed-soft: #3b1b2b; --chesed-bright: #ff6f8e;
    --gold: #f0c75a; --gold-bright: #e9b949; --gold-soft: #2f2914; --danger: #ff8a80; --whatsapp: #3dbe74;
    --shelf: #4a3524; --shadow: 0 1px 2px rgb(0 0 0 / 0.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e1d; --surface: #141a33; --surface-2: #1a2142; --ink: #e9ebf6; --muted: #9ba1bf; --line: #283053;
  --brand: #101845; --on-brand: #eef0fb; --on-brand-muted: #9aa3d0; --accent: #93a8ff; --on-accent: #0b0e1d;
  --torah: #93a8ff; --torah-soft: #1d2758; --chesed: #ff7f99; --chesed-soft: #3b1b2b; --chesed-bright: #ff6f8e;
  --gold: #f0c75a; --gold-bright: #e9b949; --gold-soft: #2f2914; --danger: #ff8a80; --whatsapp: #3dbe74;
  --shelf: #4a3524; --shadow: 0 1px 2px rgb(0 0 0 / 0.3); color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.he { font-family: var(--font-display); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.center { display: flex; justify-content: center; }
.stack { display: grid; gap: 14px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fineprint { font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.lede { color: var(--muted); font-size: 16px; max-width: 60ch; }
.lede.narrow { margin: -6px 0 16px; }
.link { color: var(--accent); font-weight: 500; text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }
.scroll-x { overflow-x: auto; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; vertical-align: 2px; }
.tag.sample { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.whatsapp { background: var(--whatsapp); color: #fff; }
.btn.sm { min-height: 34px; padding: 6px 14px; font-size: 13.5px; }
.btn.lg { min-height: 48px; padding: 12px 22px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn.subtle { color: var(--muted); width: 32px; height: 32px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--torah); border-radius: inherit; }
.bar.chesed > span { background: var(--chesed); }
.bar.gold > span { background: var(--gold-bright); }

/* ---------- avatars ---------- */
.avatar {
  --av: #1f3a68;
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--av); color: #fff; font-weight: 600; letter-spacing: 0.02em;
  width: 40px; height: 40px; font-size: 14px;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.12);
}
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; }
.avatar.club { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.avatar.club .icon { width: 55%; height: 55%; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--brand); color: var(--on-brand);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--brand); }
.topbar-inner {
  display: flex; align-items: center; gap: 12px; min-height: 58px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  max-width: 1280px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.mark { width: 34px; height: 34px; flex: none; }
.mark rect { fill: color-mix(in srgb, var(--on-brand) 10%, transparent); }
.wordmark { display: grid; line-height: 1.1; min-width: 0; }
.wordmark b { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wordmark span { font-family: var(--font-display); font-size: 13px; color: var(--gold-bright); }
.today-he { margin-left: auto; font-size: 13px; color: var(--on-brand-muted); white-space: nowrap; }
.top-actions { margin-left: auto; }
.today-he + .top-actions { margin-left: 0; }
@media (max-width: 479px) { .today-he { display: none; } .today-he + .top-actions { margin-left: auto; } }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .btn.primary { background: var(--gold-bright); color: #1b1606; }
.me-link { display: inline-flex; border-radius: 50%; }

.sidenav { display: none; }

main {
  padding: 18px var(--gutter-r) calc(var(--tabbar-h) + 36px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  max-width: 720px; margin: 0 auto; min-width: 0; outline: none;
}
#rail { display: none; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px var(--gutter-r) env(safe-area-inset-bottom, 0px) var(--gutter-l);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0 8px; color: var(--muted);
  text-decoration: none; font-size: 11px; font-weight: 500;
}
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.on { color: var(--accent); }
.tabbar .tab-log {
  justify-self: center; align-self: center; width: 54px; height: 54px; padding: 0; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); transform: translateY(-14px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tabbar .tab-log.on { color: var(--on-accent); }
.tabbar .tab-log .icon { width: 26px; height: 26px; }

@media (min-width: 1080px) {
  .app {
    display: grid; grid-template-columns: 200px minmax(0, 640px) 320px; gap: 28px;
    max-width: 1280px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 78px; align-self: start; padding-top: 22px;
  }
  .sidenav a { padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
  .sidenav a:hover { background: var(--surface-2); color: var(--ink); }
  .sidenav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .sidenav .log-cta { margin-top: 14px; color: var(--on-accent); }
  .sidenav .log-cta:hover, .sidenav .log-cta.on { background: var(--accent); color: var(--on-accent); }
  main { padding: 22px 0 60px; max-width: none; margin: 0; }
  #rail { display: grid; gap: 16px; align-content: start; padding: 22px 0 60px; min-width: 0; }
  .tabbar { display: none; }
  .only-narrow { display: none; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.card-head h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.view-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.15; margin-bottom: 14px; }
.section-title { font-family: var(--font-display); font-size: 21px; margin: 26px 0 12px; }
main > .card, main > section, main > .feed, main > .stack, main > .challenge-list { margin-bottom: 14px; }
.empty { text-align: center; padding: 34px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 14px; }

/* ---------- welcome ---------- */
.welcome { padding: 10px 0 22px; }
.quote { text-align: left; font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1.3; }
.quote-en { color: var(--muted); font-size: 14px; margin-top: 2px; }
.quote-en cite { font-style: normal; font-weight: 500; }
.welcome h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 6.4vw, 40px); line-height: 1.08; margin: 16px 0 10px; letter-spacing: -0.01em; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sample-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.sample-note .icon { margin-top: 2px; }

/* ---------- daf yomi card ---------- */
.daf-card { background: var(--brand); color: var(--on-brand); border-color: transparent; position: relative; overflow: hidden; }
.daf-card .eyebrow { color: var(--gold-bright); }
.daf-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.daf-date { font-size: 12.5px; color: var(--on-brand-muted); }
.daf-name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 6px 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.1; }
.daf-name .he { color: var(--gold-bright); font-size: 28px; }
.daf-cycle p { font-size: 12.5px; color: var(--on-brand-muted); margin-top: 6px; }
.daf-card .bar { background: rgb(255 255 255 / 0.12); border-color: transparent; }
.daf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.daf-card .btn.primary { background: var(--gold-bright); color: #1b1606; }
.daf-card .btn.ghost { color: var(--on-brand); border-color: rgb(255 255 255 / 0.25); }
.daf-card .btn.ghost:hover { background: rgb(255 255 255 / 0.08); }
.done-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgb(255 255 255 / 0.1); color: var(--gold-bright); font-weight: 600; font-size: 14px; }
.daf-social { font-size: 12.5px; color: var(--on-brand-muted); margin-top: 10px; }

/* ---------- week card ---------- */
.week-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--gold); }
.week-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.week-stats dt, .stat dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.week-stats dd, .stat dd { margin: 0; font-family: var(--font-num); font-weight: 600; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.week-days { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0; margin: 0; }
.week-days li { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.week-days .dot { width: 26px; height: 26px; border-radius: 8px; }
.week-days li.today .dl { color: var(--ink); font-weight: 700; }
.week-days li.future .dot { background: transparent; border: 1px dashed var(--line); }
.dot.l0, .hm.l0, .hm-key.l0 { background: var(--surface-2); fill: var(--surface-2); outline: 1px solid var(--line); outline-offset: -1px; }
.dot.l1, .hm.l1, .hm-key.l1 { background: color-mix(in srgb, var(--torah) 25%, var(--surface)); fill: color-mix(in srgb, var(--torah) 25%, var(--surface)); }
.dot.l2, .hm.l2, .hm-key.l2 { background: color-mix(in srgb, var(--torah) 50%, var(--surface)); fill: color-mix(in srgb, var(--torah) 50%, var(--surface)); }
.dot.l3, .hm.l3, .hm-key.l3 { background: color-mix(in srgb, var(--torah) 75%, var(--surface)); fill: color-mix(in srgb, var(--torah) 75%, var(--surface)); }
.dot.l4, .hm.l4, .hm-key.l4 { background: var(--torah); fill: var(--torah); }
.hm.l0 { outline: none; stroke: var(--line); stroke-width: 1; }

/* ---------- feed ---------- */
.feed-head { display: grid; gap: 8px; margin: 22px 0 10px; }
.feed-head .view-title { margin: 0; }
.feed { display: grid; gap: 14px; }
.activity { display: grid; gap: 10px; }
.act-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.act-who { min-width: 0; flex: 1; }
.act-name { font-weight: 600; font-size: 15px; }
.name-link { color: var(--ink); text-decoration: none; }
.name-link:hover { text-decoration: underline; }
.act-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private { display: inline-flex; align-items: center; gap: 3px; }
.private .icon { width: 12px; height: 12px; }
.kind-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.kind-chip .icon { width: 14px; height: 14px; }
.kind-chip.torah { background: var(--torah-soft); color: var(--torah); }
.kind-chip.chesed { background: var(--chesed-soft); color: var(--chesed); }
.act-title { font-size: 18px; font-weight: 600; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.act-title .he { font-size: 17px; color: var(--muted); font-weight: 500; }
.act-notes { color: var(--ink); opacity: 0.85; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.act-stats { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 2px 0 0; }
.stat.text dd { font-family: var(--font-ui); font-size: 15px; font-weight: 600; padding-top: 4px; }
.activity.chesed .stat:last-child dd { color: var(--chesed); }
.activity.torah .stat:last-child dd { color: var(--torah); }
.act-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.kudos-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); flex: none;
}
.kudos-btn b { font-family: var(--font-num); font-size: 16px; line-height: 1; }
.kudos-btn:hover:not(:disabled) { border-color: var(--gold-bright); }
.kudos-btn.on { background: var(--gold-soft); border-color: var(--gold-bright); color: var(--gold); }
.kudos-btn.on .icon { fill: var(--gold-bright); }
.kudos-btn:disabled { cursor: default; opacity: 0.75; }
.kudos-names { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comments { display: grid; gap: 8px; }
.comments:empty { display: none; }
.more-comments { font-size: 12.5px; color: var(--muted); }
.comment { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment p { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 12px; padding: 6px 10px; overflow-wrap: anywhere; }
.comment .name-link { font-weight: 600; }
.comment-form { display: flex; gap: 6px; align-items: center; }
.comment-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.comment-form .icon-btn { color: var(--accent); }

/* ---------- rail widgets ---------- */
.mini-leaders ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-leaders li { display: grid; grid-template-columns: 18px 32px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.mini-leaders .rank { font-family: var(--font-num); font-weight: 600; color: var(--muted); text-align: center; }
.mini-leaders .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-leaders .val { font-family: var(--font-num); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.mini-leaders li.me .nm a { color: var(--accent); }
.rail-group { display: grid; gap: 10px; }
.rail-group .card-head { margin: 4px 2px 0; }

/* ---------- leaderboard ---------- */
.lb-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.podium { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; padding: 0; margin: 22px 0 10px; }
.podium li { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.podium .crown { height: 22px; color: var(--gold-bright); }
.podium .crown .icon { width: 24px; height: 24px; }
.podium .p-name { font-weight: 600; font-size: 14px; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; }
.podium .p-name .tag { display: none; }
.podium .p-val { font-family: var(--font-num); font-weight: 700; font-size: 22px; line-height: 1; }
.podium .p-val small { font-size: 13px; color: var(--muted); font-weight: 600; }
.podium .p-step {
  width: 100%; display: grid; place-items: center; border-radius: 12px 12px 0 0;
  font-family: var(--font-display); font-weight: 900; font-size: 26px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
}
.podium .p1 .p-step { height: 86px; background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold-bright) 50%, var(--line)); }
.podium .p2 .p-step { height: 62px; }
.podium .p3 .p-step { height: 46px; }
.podium li.me .p-name a { color: var(--accent); }
.lb-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lb-list li, .cup-list li {
  display: grid; grid-template-columns: 26px 32px minmax(0, 1fr) auto; grid-template-areas: "rank av who val" "rank av bar bar";
  align-items: center; column-gap: 10px; row-gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.lb-list li:last-child, .cup-list li:last-child { border-bottom: 0; }
.lb-list li.me, .cup-list li.me { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.lb-list .rank, .cup-list .rank { grid-area: rank; font-family: var(--font-num); font-weight: 700; font-size: 18px; color: var(--muted); text-align: center; }
.lb-list .avatar { grid-area: av; }
.lb-who { grid-area: who; min-width: 0; display: grid; }
.lb-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { grid-area: bar; height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.lb-bar span { display: block; height: 100%; background: var(--torah); border-radius: inherit; }
.lb-val { grid-area: val; font-family: var(--font-num); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.lb-val small { font-size: 12px; color: var(--muted); font-weight: 600; }
.cup-list { list-style: none; padding: 0; margin: 0 -16px -16px; border-top: 1px solid var(--line); }
.cup-list li { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "rank who val" "rank bar bar"; }
.cup-name { grid-area: who; font-weight: 600; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cup .card-head h3 .icon { color: var(--gold-bright); }

/* ---------- challenges ---------- */
.challenge-list { display: grid; gap: 12px; }
.challenge { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.challenge > .btn { grid-column: 2; justify-self: start; margin-top: 6px; }
.ch-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--torah-soft); color: var(--torah); }
.challenge.chesed .ch-badge { background: var(--chesed-soft); color: var(--chesed); }
.challenge.complete .ch-badge { background: var(--gold-soft); color: var(--gold); }
.ch-body { display: grid; gap: 6px; min-width: 0; }
.ch-body h3 { font-size: 16.5px; font-weight: 600; }
.ch-body .muted { font-size: 14px; }
.ch-meta { font-size: 12.5px; color: var(--muted); }
.ch-meta .icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.ch-progress { display: grid; gap: 4px; margin-top: 4px; }
.ch-progress p { font-size: 13px; color: var(--muted); }
.ch-progress b { font-family: var(--font-num); font-size: 18px; color: var(--ink); }
.done-text { color: var(--gold); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.rail-group .challenge { padding: 12px; }
.rail-group .ch-body h3 { font-size: 14.5px; }
@media (min-width: 560px) {
  .challenge:not(:has(.ch-body + .btn)) { grid-template-columns: 44px minmax(0, 1fr); }
  .challenge:has(> .btn) { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .challenge > .btn { grid-column: 3; grid-row: 1; margin-top: 0; }
}
.challenge-strip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.challenge-strip .ch-badge { width: 40px; height: 40px; }
.challenge-strip > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.challenge-strip b { font-weight: 600; }
.challenge-strip small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shas shelf ---------- */
.shas-summary { display: grid; gap: 12px; }
.shas-numbers { display: flex; flex-wrap: wrap; gap: 12px 40px; }
.big { font-family: var(--font-num); font-weight: 700; font-size: 38px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big small { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--muted); }
.seder { margin-top: 22px; }
.seder-name { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.seder-name .he { text-transform: none; letter-spacing: 0; font-size: 17px; color: var(--gold); }
.shelf {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 5px; padding: 0 6px 0;
  border-bottom: 8px solid var(--shelf); border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 0 -4px color-mix(in srgb, var(--shelf) 50%, transparent);
}
.spine {
  --leather: #1f3a68; position: relative; width: 38px; height: var(--h); padding: 0; cursor: pointer;
  border: 0; border-radius: 4px 4px 1px 1px; overflow: hidden; color: var(--leather-text);
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.28), rgb(255 255 255 / 0.08) 30%, rgb(0 0 0 / 0.1) 70%, rgb(0 0 0 / 0.32)),
    var(--leather);
  transition: transform 0.15s;
}
.spine:hover, .spine.open { transform: translateY(-6px); }
.spine-fill { position: absolute; inset: auto 0 0; height: var(--fill); background: linear-gradient(180deg, rgb(226 179 60 / 0.95), rgb(181 134 22 / 0.95)); }
.spine.done .spine-fill { box-shadow: inset 0 0 12px rgb(255 240 190 / 0.7); }
.spine-band { position: absolute; left: 4px; right: 4px; height: 2px; background: currentColor; opacity: 0.8; box-shadow: 0 4px 0 currentColor; }
.spine-band.top { top: 9px; }
.spine-band.bottom { bottom: 15px; }
.spine-title {
  position: absolute; inset: 22px 0 26px; display: grid; place-items: center;
  writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-shadow: 0 1px 1px rgb(0 0 0 / 0.5);
}
.spine.done .spine-title, .spine-fill + .spine-band + .spine-title { mix-blend-mode: normal; }
.spine.done { color: #3a2604; }
.spine.done .spine-title { text-shadow: 0 1px 0 rgb(255 255 255 / 0.3); }
.spine-marker { position: absolute; top: 0; right: 6px; width: 8px; height: 16px; background: var(--chesed-bright); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.masechta-panel { margin-top: 16px; display: grid; gap: 10px; }
.masechta-panel h3 .he { font-size: 18px; color: var(--gold); }
.daf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.daf-cell {
  display: grid; justify-items: center; gap: 0; padding: 5px 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-family: var(--font-num); font-weight: 600; font-size: 15px; line-height: 1.1;
}
.daf-cell .he { font-size: 11px; color: var(--muted); font-weight: 500; }
.daf-cell.on { background: var(--gold-soft); border-color: var(--gold-bright); color: var(--gold); }
.daf-cell.today { box-shadow: inset 0 0 0 2px var(--chesed-bright); }
.daf-cell:disabled { cursor: default; }
.daf-cell:disabled:not(.on) { opacity: 0.7; }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 18px; }
@media (max-width: 559px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .profile-head > .btn { grid-column: 2; justify-self: start; margin-top: -6px; }
}
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.tile .big { font-size: 34px; }
.tile .muted { font-size: 12.5px; }
.streak-tile .eyebrow { color: var(--gold); }
.chart { margin: 0; }
.chart-plot { position: relative; height: 170px; margin: 8px 0 0 26px; }
.chart-plot > i { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); font-style: normal; }
.chart-plot > i span { position: absolute; right: 100%; margin-right: 7px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-bars { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.chart-bars li { display: flex; flex-direction: column-reverse; align-items: center; height: 100%; }
.chart-bars .cseg { width: 68%; max-width: 30px; flex: none; }
.chart-bars .cseg.torah { background: var(--torah); border-radius: 2px; }
.chart-bars .cseg.chesed { background: var(--chesed); border-radius: 2px; }
.chart-x { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin: 6px 0 0 26px; font-size: 11px; color: var(--muted); }
.chart-x span { text-align: center; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.axis { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.axis.he { font-family: var(--font-display); font-weight: 700; }
.b-torah { fill: var(--torah); }
.b-chesed { fill: var(--chesed); }
.chart figcaption { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; margin-top: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.torah { background: var(--torah); }
.key.chesed { background: var(--chesed); margin-left: 8px; }
.chart figcaption .muted { margin-left: auto; }
.heatmap { display: block; height: auto; max-width: none; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.hm-key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 12px; border: 1px dashed var(--line); opacity: 0.55; }
.badge .seal {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; padding: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.05;
  background: var(--surface-2); color: var(--muted); border: 2px solid var(--line);
}
.badge.earned { opacity: 1; border-style: solid; background: var(--surface); }
.badge.earned .seal { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-bright); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold-bright) 18%, transparent); }
.b-name { font-weight: 600; font-size: 13.5px; }
.b-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.siyumim { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--gold); font-weight: 500; }
.profile-head + .stat-grid { margin-bottom: 14px; }
.settings { display: grid; gap: 12px; margin-top: 26px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- forms ---------- */
.log-form { display: grid; gap: 18px; padding: 18px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .label, .field { font-size: 13.5px; font-weight: 600; color: var(--ink); }
legend { padding: 0; margin-bottom: 8px; }
.field { display: grid; gap: 6px; min-width: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field input, .field select, .field textarea, .grid3 input, .grid3 select, .duration input, .share-url input {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; font-weight: 400;
}
.field textarea { resize: vertical; }
.grid2, .grid3 { display: grid; gap: 12px; }
.grid3 label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; min-width: 0; }
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 559px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 .masechta { grid-column: 1 / -1; } }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kind-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind-toggle label { position: relative; }
.kind-toggle input, .type-chips input, .kind-toggle span {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px;
  border: 2px solid var(--line); font-weight: 600; font-size: 16px; cursor: pointer; color: var(--muted);
}
.kind-toggle .torah input:checked + span { border-color: var(--torah); background: var(--torah-soft); color: var(--torah); }
.kind-toggle .chesed input:checked + span { border-color: var(--chesed); background: var(--chesed-soft); color: var(--chesed); }
.kind-toggle input:focus-visible + span, .type-chips input:focus-visible + span, .type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chips label { position: relative; }
.type-chips span { display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.type-chips input:checked + span { background: var(--torah); border-color: var(--torah); color: var(--on-accent); }
.type-chips.chesed input:checked + span { background: var(--chesed); border-color: var(--chesed); color: var(--on-accent); }
.duration { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.duration > label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); }
.duration > label input { width: 76px; text-align: center; font-family: var(--font-num); font-size: 20px; font-weight: 600; padding: 6px 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { padding: 5px 11px; font-size: 13px; }
.switch { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.log-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; flex-wrap: wrap; }
.points-preview { font-size: 15px; color: var(--muted); }
.points-preview b { font-family: var(--font-num); font-size: 28px; color: var(--torah); font-weight: 700; }
.log-form.is-chesed .points-preview b { color: var(--chesed); }

/* ---------- modal, toast, confetti ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}
dialog::backdrop { background: rgb(10 12 30 / 0.55); }
dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; z-index: 40; }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.modal-body h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.join-form { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 1em; }
.form-error:empty { display: none; }
.share-url { display: flex; gap: 8px; }
.share-url input { flex: 1; font-size: 14px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.siyum { display: grid; gap: 12px; text-align: center; }
.hadran { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--gold); line-height: 1.2; }
.siyum .modal-actions { justify-content: center; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 14px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.25); transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
  width: max-content; text-align: center;
}
#toast .icon { margin-right: 6px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1080px) { #toast { bottom: 28px; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; display: none; }
#confetti.on { display: block; }

/* ---------- about ---------- */
.about { display: grid; gap: 14px; }
.prose { display: grid; gap: 10px; }
.prose h3 { font-size: 16.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prose h3 .icon { color: var(--accent); }
.prose p { max-width: 65ch; }
.prose .quote { font-size: 30px; }
.points-table { border-collapse: collapse; width: 100%; max-width: 480px; font-size: 14.5px; }
.points-table th { text-align: left; font-weight: 400; padding: 7px 0; border-bottom: 1px solid var(--line); }
.points-table td { text-align: right; font-family: var(--font-num); font-weight: 600; font-size: 17px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.share-cta { display: grid; gap: 8px; justify-items: start; background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-bright) 40%, var(--line)); }
.share-cta h3 { font-family: var(--font-display); font-size: 22px; }

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

/* ---------- plans ---------- */
@media (min-width: 1080px) {
  main[data-view="pricing"] { grid-column: 2 / 4; }
  main[data-view="pricing"] ~ #rail { display: none; }
}
.free-line { margin-top: 14px; font-size: 14px; color: var(--muted); }
.pricing {
  background: var(--brand); color: var(--on-brand); border-radius: 22px;
  padding: clamp(22px, 4vw, 40px); display: grid; gap: 22px;
}
.pricing .eyebrow { color: var(--gold-bright); }
.pricing h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 6vw, 54px); line-height: 1.05; letter-spacing: -0.01em; margin-top: -12px; }
.plans { display: grid; gap: 16px; }
@media (min-width: 820px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 16px; padding: 26px 24px;
  border-radius: 20px; min-width: 0;
  background: color-mix(in srgb, var(--on-brand) 6%, var(--brand));
  border: 1px solid color-mix(in srgb, var(--on-brand) 14%, var(--brand));
}
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan h3 { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.plan-icon { margin-left: auto; line-height: 0; }
.soon + .plan-icon { margin-left: 0; }
.plan-icon .icon { width: 28px; height: 28px; }
.soon { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; opacity: 0.75; }
.plan-head h3 + .soon { margin-left: auto; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price b { font-family: var(--font-display); font-weight: 900; font-size: clamp(48px, 7vw, 64px); line-height: 1; }
.price span { font-size: 17px; color: var(--on-brand-muted); }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: start; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; line-height: 1.35; }
.plan-features .icon { color: var(--gold-bright); margin-top: 1px; }
.plan-cta {
  min-height: 52px; font-size: 16px; width: 100%;
  background: color-mix(in srgb, var(--on-brand) 12%, var(--brand)); color: var(--on-brand);
}
.plan-cta:hover { background: color-mix(in srgb, var(--on-brand) 18%, var(--brand)); }
.plan.featured { background: var(--gold-bright); border-color: var(--gold-bright); color: #1b1606; }
.plan.featured .price span { color: rgb(27 22 6 / 0.62); }
.plan.featured .plan-features .icon { color: #1b1606; }
.plan.featured .plan-cta { background: #10172f; color: var(--gold-bright); }
.plan.featured .plan-cta:hover { background: #1a2348; }
.plans-note { font-size: 13px; color: var(--on-brand-muted); }
.select { user-select: all; }

/* ---------- retzifut timer ---------- */
.timer-promo, .challenge-strip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.timer-promo { margin-bottom: 14px; }
.timer-promo .ch-badge { width: 40px; height: 40px; background: var(--gold-soft); color: var(--gold); }
.timer-promo > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.timer-promo b { font-weight: 600; }
.timer-promo small { color: var(--muted); font-size: 13px; }
.timer-setup { display: grid; gap: 18px; padding: 18px; }
.timer-go { justify-self: stretch; }
.shul-card { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.shul-head { display: flex; align-items: center; gap: 8px; }
.shul-head h3 { font-size: 15.5px; font-weight: 600; }
.shul-head .icon { color: var(--chesed); }
.shul-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--torah); background: var(--torah-soft); padding: 6px 10px; border-radius: 999px; }
.saved-pill .icon { width: 14px; height: 14px; }
.radius { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.radius select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 14px; }
.shul-card .hint .icon { width: 13px; height: 13px; vertical-align: -2px; }

.timer-card { background: var(--brand); color: var(--on-brand); border-color: transparent; display: grid; gap: 14px; padding: 22px 20px; text-align: center; margin-bottom: 14px; }
.timer-card .eyebrow { color: var(--gold-bright); justify-content: center; text-align: center; }
.timer-with { font-size: 13.5px; color: var(--on-brand-muted); margin-top: 2px; }
.timer-big { font-family: var(--font-num); font-weight: 700; font-size: clamp(64px, 20vw, 104px); line-height: 1; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; color: var(--on-brand); }
.timer-card.running .timer-big { color: var(--gold-bright); }
.timer-card.paused .timer-big { opacity: 0.6; }
.timer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.timer-stats div { background: color-mix(in srgb, var(--on-brand) 7%, transparent); border-radius: 12px; padding: 8px 4px; }
.timer-stats dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-brand-muted); }
.timer-stats dd { margin: 0; font-family: var(--font-num); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; }
.timer-card.done .timer-stats dd { font-size: 30px; }
.geo-status { display: flex; align-items: flex-start; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--on-brand-muted); text-align: left; }
.geo-status .icon { width: 16px; height: 16px; margin-top: 1px; }
.geo-status.ok .icon { color: var(--gold-bright); }
.geo-status.warn { color: var(--gold-bright); }
.wake-status { font-size: 12.5px; color: var(--on-brand-muted); }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.gold { background: var(--gold-bright); color: #1b1606; }
.btn.ghost-light { background: color-mix(in srgb, var(--on-brand) 10%, transparent); color: var(--on-brand); border-color: color-mix(in srgb, var(--on-brand) 22%, transparent); }
.btn.ghost-light:hover { background: color-mix(in srgb, var(--on-brand) 16%, transparent); }
.log-submit #discard-slot .confirm { font-size: 13.5px; }

.timed-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gold-soft); color: var(--gold); flex: none; }
.timed-chip .icon { width: 13px; height: 13px; }
@media (max-width: 420px) { .timed-chip span { display: none; } }

#live-bar {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 999px; text-decoration: none;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 26px rgb(10 12 30 / 0.35);
  font-size: 13.5px; white-space: nowrap;
}
#live-bar b { font-family: var(--font-num); font-size: 19px; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
#live-bar span:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--on-brand-muted); min-width: 0; }
#live-bar.done { background: var(--gold-bright); color: #1b1606; }
#live-bar.done b { color: #1b1606; font-family: var(--font-ui); font-size: 14px; }
#live-bar.done span:last-child { color: rgb(27 22 6 / 0.7); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chesed-bright); flex: none; }
.live-dot.running { animation: pulse 1.6s ease-in-out infinite; }
.live-dot.paused { background: var(--on-brand-muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
body.has-live #toast { bottom: calc(var(--tabbar-h) + 72px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1080px) {
  #live-bar { bottom: 24px; }
  body.has-live #toast { bottom: 84px; }
}

/* ---------- kehillos ---------- */
.seg.scope { margin-bottom: 10px; max-width: 100%; }
.seg.scope button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cup + .cup { margin-top: 14px; }
.cup-name small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.join-form select:disabled { opacity: 0.6; }

/* ---------- accounts ---------- */
.auth-form { display: grid; gap: 14px; }
.auth-form .grid2 { gap: 12px; }
@media (min-width: 440px) { .auth-form .grid2 { grid-template-columns: 1fr 1fr; } }
.auth-form .hint .icon, .fineprint .icon { width: 13px; height: 13px; vertical-align: -2px; }
.auth-form .modal-actions { align-items: center; }
.auth-form .modal-actions .link-btn { margin-right: auto; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.switch-auth { font-size: 14px; color: var(--muted); text-align: center; }
.top-actions .btn.ghost-light { margin-right: 6px; }
@media (max-width: 380px) { .top-actions .btn.ghost-light { display: none; } }
.tag.you { background: var(--torah-soft); color: var(--torah); }
.account-list { display: grid; gap: 10px; margin: 0 0 12px; }
@media (min-width: 560px) { .account-list { grid-template-columns: 1fr 1fr; } }
.account-list dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.account-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.account .card-head .muted { font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.account .card-head .icon { width: 13px; height: 13px; }
.account { margin-top: 26px; }

/* ---------- kehillos ---------- */
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; font-size: 16px; }
.add-kehilla { display: grid; gap: 10px; margin-bottom: 14px; }
.add-kehilla h3 { font-size: 15.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kehilla-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kehilla-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.kehilla-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.kehilla-row.mine { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.kr-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.kr-main b { font-weight: 600; }
.kr-main small { color: var(--muted); font-size: 12.5px; }
.kr-val { font-family: var(--font-num); font-weight: 700; font-size: 20px; text-align: right; white-space: nowrap; }
.kr-val small { display: block; font-family: var(--font-ui); font-size: 11px; font-weight: 500; color: var(--muted); }
.kehilla-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 14px; }
@media (max-width: 559px) { .kehilla-head { grid-template-columns: auto minmax(0, 1fr); } .kehilla-head > .btn { grid-column: 2; justify-self: start; } }
.he-sub { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 18px; text-align: left; }
.member-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.member-note > .icon { color: var(--torah); }
.kol-yisroel { margin-bottom: 8px; }
.kol-yisroel span { font-family: var(--font-display); font-weight: 700; color: var(--gold); }
.chaburah-list { list-style: none; margin: 0 0 12px; padding: 0; }
.chaburah-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chaburah-list li:last-child { border-bottom: 0; }
.ch-name { flex: 1; min-width: 0; font-weight: 600; }
.chaburah-list .muted { font-size: 13px; }
.ch-tools { display: inline-flex; align-items: center; gap: 2px; }
.chaburah-list .inline-form { width: 100%; }
.add-chaburah { margin-top: 4px; }

/* ---------- members (organizers) ---------- */
.members-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.members-table { margin-top: 14px; }
.members-table table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.members-table th { text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.members-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.members-table tr:last-child td { border-bottom: 0; }

/* ---------- sign-in buttons ---------- */
.social { display: grid; gap: 8px; }
.social-btn { width: 100%; min-height: 46px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; }
.social-btn svg { width: 20px; height: 20px; flex: none; }
.social-btn:hover { background: var(--surface-2); }
.social-btn.apple { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.social-btn.apple:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.social-btn.facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn.facebook:hover { background: #166fe5; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.social-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.35); }
.social-btn:disabled:hover { background: inherit; }
.social-btn.apple:disabled:hover { background: var(--ink); }
.social-btn.facebook:disabled:hover { background: #1877f2; }
.social-btn { min-width: 0; }
.social-btn span { overflow: hidden; text-overflow: ellipsis; }
dialog { overflow-x: hidden; }
@media (max-width: 459px) { .soon-tag { display: none; } }
.soon-tag { margin-left: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid currentColor; opacity: 0.85; }
.auth-form .grid2 { align-items: start; }
.field { align-content: start; }
