/* ==========================================================================
   The Today board — the apps' widgets on the home page (js/today-board.js,
   js/today-widgets.js). Ian, 2026-10-01: "bringing all our mobile widgets to
   .com home page and allow customimzation hide and show".

   The board is the phone's own grid: a small widget takes one square, a
   medium two side by side, a large a block of two by two; two columns on a
   phone, four from 700px. Every face is drawn at the phone's points (a small
   widget on a 170-point square, a medium on 364 × 170, a large on 364 × 364)
   and scaled to its square, so a widget keeps the proportions it has on the
   home screen at any width. Their surfaces are the widgets' own tokens
   (KodeshWayUI: parchment #F0EAD6 by day, warm brown #2A1F14 by night, the
   reader's accent), set here rather than borrowed from the page, which runs
   its own darker ground by night.
   ========================================================================== */

.tb {
  --tw-bg: #F0EAD6;            /* KodeshWayParchment */
  --tw-text: #1A1A26;          /* KodeshWayTextPrimary */
  --tw-text2: #333340;         /* KodeshWayTextSecondary */
  --tw-text3: #4C4C59;         /* KodeshWayTextTertiary */
  --tw-gold: #A8742A;          /* the accent the widgets read (gold) */
  --tw-gold-faint: #BD9E6B;    /* kodeshWayAccentFaint, gold */
  --tw-gold-muted: #D6C299;    /* kodeshWayAccentMuted, gold */
  --tw-ink: #1C1408;           /* KodeshWayInk: numerals on a gold square */
  --tw-card: #E8DFC8;          /* KodeshWayCardSurface: behind a moed square */
  --tw-lumen: #7A6B45;
  --tw-lumen-glow: #FFF3D2;
  --tw-edge: rgba(168, 116, 42, 0.18);
  --tw-lift: 0 1px 2px rgba(28, 20, 8, 0.05), 0 8px 22px rgba(28, 20, 8, 0.09);
  /* The Light page's Shabbat card: the inverted inset (near-black by day,
     parchment by night), His light in its glow. */
  --tws-bg: #1C1410;
  --tws-text: #F5EDD8;
  --tws-muted: #9A8A6A;
  --tws-border: rgba(168, 116, 42, 0.22);
  --tws-eyebrow: #A8742A;      /* kodeshWayAccentOnParchment, day */
  --tws-light: #F5915A;        /* KodeshWayYeshuaLight */
  position: relative;
  margin: clamp(40px, 6vw, 56px) 0 0;
}
[data-theme="dark"] .tb {
  --tw-bg: #2A1F14;
  --tw-text: #F2F2F2;
  --tw-text2: #D9D6D1;
  --tw-text3: #BFBDB8;
  --tw-gold-faint: #73572E;
  --tw-gold-muted: #574529;
  --tw-card: #221C18;
  --tw-lumen: #EFE4C6;
  --tw-lumen-glow: #F7ECCF;
  --tw-edge: rgba(196, 144, 64, 0.16);
  --tw-lift: 0 6px 20px rgba(0, 0, 0, 0.38);
  --tws-bg: #E8DFC8;
  --tws-text: #2C2318;
  --tws-muted: #6A5A3A;
  --tws-border: rgba(44, 35, 24, 0.12);
  --tws-eyebrow: #C49040;
}
/* The reader's accent, as the widgets take it: the theme's own colour in both
   appearances (kodeshWayAccent(for:)), its muted steps blended toward the page. */
[data-accent="crimson"] .tb { --tw-gold: #CD4623; }
[data-accent="ruach"] .tb { --tw-gold: #3B5DD4; }
[data-accent="crimson"] .tb, [data-accent="ruach"] .tb {
  --tw-gold-faint: color-mix(in srgb, var(--tw-gold) 45%, var(--tw-bg));
  --tw-gold-muted: color-mix(in srgb, var(--tw-gold) 35%, var(--tw-bg));
  --tws-eyebrow: var(--tw-gold);
}

/* ── The grid ─────────────────────────────────────────────────────────────
   --cols, --cell, --gap and --z are set by the board from its own width. */
.tb-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), var(--cell, 160px));
  grid-auto-rows: minmax(var(--cell, 160px), auto);
  gap: var(--gap, 22px);
  grid-auto-flow: row dense;
  justify-content: center;
}
.tb-item { position: relative; min-width: 0; border-radius: calc(22px * var(--z, 1)); }
.tb-item--s { grid-column: span 1; grid-row: span 1; }
.tb-item--m { grid-column: span 2; grid-row: span 1; }
.tb-item--l { grid-column: span 2; grid-row: span 2; }
.tb-item--row { grid-column: 1 / -1; }
.tb-item[hidden] { display: none; }
.tb-item--row #portion-card .portion-card { margin-top: 0; }
.tb-item--row #portion-card { min-height: 0; }
/* A press dims and settles the whole widget, as a tap on the home screen does. */
.tb-press {
  position: absolute; inset: 0;
  transition: transform var(--kw-tap-release, 0.24s) var(--kw-ease-settle, cubic-bezier(0.2, 0, 0, 1));
}
.tb-press:active { transform: scale(0.97); transition-duration: var(--kw-tap-press, 0.06s); }

/* ── A widget's face ──────────────────────────────────────────────────── */
.tw {
  position: absolute; left: 0; top: 0;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 16px;
  border-radius: 22px;
  overflow: hidden; isolation: isolate;
  background: var(--tw-bg); color: var(--tw-text);
  box-shadow: 0 0 0 0.5px var(--tw-edge), var(--tw-lift);
  transform: scale(var(--z, 1)); transform-origin: 0 0;
  font-family: var(--kw-font-ui);
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.tw:focus-visible { outline: 2px solid var(--tw-gold); outline-offset: 2px; }
.tw p { margin: 0; }
.tw .kwg { display: block; flex: none; }
.tw-spacer { flex: 1 1 0; min-height: 0; }

.tw-eyebrow { display: flex; align-items: center; gap: 5px; min-width: 0; flex: none; color: var(--tw-gold); }
.tw-eyebrow .tw-icon { width: 9px; height: 9px; }
.tw-eyebrow .tw-flame { width: 10px; height: 10px; margin: -1px 0; }
.tw-eyebrow__label {
  font: 500 9px/1.25 var(--kw-font-ui); letter-spacing: 1px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tw-eyebrow__trail { margin-left: auto; padding-left: 6px; font: 400 9px/1.25 var(--kw-font-ui); color: var(--tw-text2); white-space: nowrap; }

/* WidgetDiamondRule: ──── ❖ ──── */
.tw-rule { display: flex; align-items: center; gap: 8px; flex: none; color: var(--tw-gold); }
.tw-rule i { flex: 1; height: 0.5px; background: currentColor; opacity: 0.45; }
.tw-rule b { font: 400 9px/1 Georgia, serif; }
.tw-rule--below6 { margin-bottom: 6px; }
.tw-rule--v6 { margin: 6px 0; }
.tw-rule--v8 { margin: 8px 0; }

.tw-kicker { font: 500 9px/1.25 var(--kw-font-ui); letter-spacing: 1px; color: var(--tw-gold); white-space: nowrap; }
.tw-kicker--semi { font-weight: 600; letter-spacing: 0.8px; }
.tw-vrule { flex: none; width: 0.5px; align-self: stretch; margin: 4px 0; background: var(--tw-text3); }
.tw-vrule--dim { margin: 0; }

/* A widget with no place yet: the browser's own location, asked for here. */
.tw-locate {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; flex: none;
  margin: 0 0 7px; padding: 7px 12px 7px 10px;
  border: 0.5px solid color-mix(in srgb, var(--tw-gold) 45%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--tw-gold) 12%, transparent);
  color: var(--tw-text); font: 600 12px/1 var(--kw-font-ui); cursor: pointer;
}
.tw-locate:hover { background: color-mix(in srgb, var(--tw-gold) 20%, transparent); }
.tw-locate:focus-visible { outline: 2px solid var(--tw-gold); outline-offset: 2px; }
.tw-locate__mark { width: 11px; height: 11px; color: var(--tw-gold); }
.tw-locate.is-asking { opacity: 0.6; pointer-events: none; }
/* In a small square the button keeps to one line. */
.tw.is-s .tw-locate { gap: 5px; padding: 6px 10px 6px 8px; font-size: 11px; white-space: nowrap; }
.tw.is-s .tw-locate__mark { width: 10px; height: 10px; }
.tw-hint {
  font: 400 11px/1.3 var(--kw-font-ui); color: var(--tw-text2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── The Calendar ─────────────────────────────────────────────────────── */
.twc-ivri { min-width: 0; }
.twc-ivri__date { font-family: var(--kw-font-serif); font-weight: 500; line-height: 1.15; color: var(--tw-text); white-space: nowrap; }
.twc-ivri__feast { font: 600 10px/1.3 var(--kw-font-serif); color: var(--tw-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twc-ivri__year { font: 400 11px/1.3 var(--kw-font-serif); color: var(--tw-gold); }
.twc-next-name { font: 600 13px/1.25 var(--kw-font-serif); color: var(--tw-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twc-next-name--m { font-size: 15px; }
.twc-next-count { font: 400 11px/1.3 var(--kw-font-serif); color: var(--tw-gold); white-space: nowrap; }
.twc-next-count--l { font-size: 10px; }
.twc-row { display: flex; align-items: flex-start; gap: 14px; flex: none; min-width: 0; }
.twc-row--large { align-items: baseline; gap: 10px; justify-content: space-between; }
.twc-divider { flex: none; width: 0.5px; align-self: stretch; background: var(--tw-gold-muted); }
.twc-nextcol { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.twc-nextcol--trail { flex: none; align-items: flex-end; gap: 1px; text-align: right; max-width: 55%; }
.twc-kicker { font: 500 8px/1.25 var(--kw-font-serif); letter-spacing: 1px; color: var(--tw-gold); }
.twc-next-meta { font: 400 10px/1.3 var(--kw-font-serif); color: var(--tw-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twc-marks { display: flex; justify-content: center; gap: 2px; color: var(--tw-gold); }
.twc-week { display: flex; gap: 3px; flex: none; }
.twc-weekday {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
  border-radius: 8px; font-family: var(--kw-font-serif); color: var(--tw-text);
}
.twc-wd { font: 500 8px/1.2 var(--kw-font-serif); color: var(--tw-text2); }
.twc-wivri { font: 400 13px/1.15 var(--kw-font-serif); }
.twc-wcivil { font: 400 8px/1.15 var(--kw-font-serif); color: var(--tw-text2); }
.twc-weekday .twc-marks { height: 6px; }
.twc-weekday .twc-marks .kwg { width: 5px; height: 5px; }
.twc-monthhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex: none; }
.twc-monthname { font: 600 12px/1.2 var(--kw-font-serif); color: var(--tw-text); }
.twc-monthspan { font: 400 11px/1.2 var(--kw-font-serif); color: var(--tw-gold); }
.twc-grid { display: flex; flex-direction: column; gap: 2px; flex: none; }
.twc-gridhead, .twc-gridrow { display: flex; gap: 2px; }
.twc-gridhead span { flex: 1 1 0; text-align: center; font: 500 8px/1.3 var(--kw-font-serif); color: var(--tw-text2); }
.twc-sq {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; padding: 2px 0;
  border-radius: 4px; color: var(--tw-text);
}
.twc-sqivri { font: 400 12px/1.15 var(--kw-font-serif); }
.twc-sqcivil { font: 400 8px/1.15 var(--kw-font-serif); color: var(--tw-text2); }
.twc-sq .twc-marks { height: 5px; }
.twc-sq .twc-marks .kwg { width: 4px; height: 4px; }
/* Today is a gold square with ink numerals; a moed square sits on the card
   surface behind a muted gold hairline — the in-app cell's pairing. */
.twc-sq.is-today, .twc-weekday.is-today { background: var(--tw-gold); color: var(--tw-ink); }
.twc-sq.is-today .twc-sqivri, .twc-weekday.is-today .twc-wivri { font-weight: 600; }
.is-today .twc-sqcivil, .is-today .twc-wcivil, .is-today .twc-wd, .is-today .twc-marks { color: var(--tw-ink); }
.twc-sq.is-moed, .twc-weekday.is-moed { background: var(--tw-card); box-shadow: inset 0 0 0 0.5px var(--tw-gold-muted); }

/* ── Hebrew Calendar ──────────────────────────────────────────────────── */
.twh-date { font: 500 22px/1.2 var(--kw-font-ui); color: var(--tw-text); white-space: nowrap; }
.twh-year { font: 500 11px/1.3 var(--kw-font-ui); color: var(--tw-gold); }
.twh-feast { font: italic 400 10px/1.3 var(--kw-font-ui); color: var(--tw-gold); }
.twh-civil { font: 400 10px/1.3 var(--kw-font-ui); color: var(--tw-gold); }

/* ── Moon Phase ───────────────────────────────────────────────────────── */
.twl-phase { font: 500 17px/1.2 var(--kw-font-serif); color: var(--tw-text); }
.twl-lit { font: 400 11px/1.3 var(--kw-font-ui); color: var(--tw-text2); }
.twl-feast { font: italic 400 10px/1.3 Georgia, serif; color: var(--tw-gold); margin-bottom: 4px !important; }
.twl-bars { display: flex; gap: 4px; flex: none; }
.twl-bars i { flex: 1; height: 2.5px; border-radius: 2px; background: color-mix(in srgb, var(--tw-gold) 22%, transparent); }
.twl-bars i.is-lit { background: var(--tw-gold); }

/* ── Next Zman and Shabbat Times ──────────────────────────────────────── */
.twz-name { font: 500 14px/1.25 var(--kw-font-ui); color: var(--tw-text); }
.twz-time { font: 500 24px/1.15 var(--kw-font-ui); color: var(--tw-gold); white-space: nowrap; }
.twz-time--m { font-size: 32px; }
.twz-rel { font: 400 10px/1.3 var(--kw-font-ui); color: var(--tw-gold); white-space: nowrap; }
.twz-rel--m { font: 500 15px/1.3 var(--kw-font-ui); color: var(--tw-text); }
.twz-sub { font: 400 13px/1.3 var(--kw-font-ui); color: var(--tw-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twz-feast { font: 400 12px/1.3 var(--kw-font-ui); color: var(--tw-text2); }
.twz-right { gap: 8px; }
.twt-row { display: flex; flex: 1; min-height: 0; }
.twt-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.twt-col--right { padding-left: 16px; }
.twt-candles { font: 500 22px/1.15 var(--kw-font-ui); color: var(--tw-text); white-space: nowrap; }
.twt-candles--m { font-size: 28px; }
.twt-hav { font: 500 14px/1.2 var(--kw-font-ui); color: var(--tw-text2); white-space: nowrap; }
.twt-hav--m { font-size: 22px; }
.twt-hebrew { font: 400 10px/1.3 var(--kw-font-ui); color: var(--tw-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twt-ends { font: 500 13px/1.3 var(--kw-font-ui); color: var(--tw-text2); white-space: nowrap; }

/* ── Commandments ─────────────────────────────────────────────────────── */
.twk-block, .twk-half { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
.twk-row { display: flex; align-items: stretch; gap: 12px; flex: 1; min-height: 0; }
.twk-half { color: inherit; text-decoration: none; border-radius: 6px; }
.twk-half:focus-visible { outline: 2px solid var(--tw-gold); outline-offset: 2px; }
.twk-divider { flex: none; width: 0.5px; background: var(--tw-gold); opacity: 0.45; }
.twk-word { font: italic 400 14px/calc(1.2em + 3px) var(--kw-font-serif); flex: 0 1 auto; min-height: 0; overflow: hidden; }
.twk-title { font: 400 14px/calc(1.2em + 3px) var(--kw-font-serif); color: var(--tw-text); flex: 0 1 auto; min-height: 0; overflow: hidden; }
.twk-word.is-clamped, .twk-title.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; }
.twk-kind { font: 400 10px/1.3 var(--kw-font-ui); color: var(--tw-text2); }
.twk-ref { font: 500 10px/1.3 var(--kw-font-ui); color: var(--tw-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Your Place ───────────────────────────────────────────────────────── */
.twp-book { font: 400 20px/1.2 var(--kw-font-serif); color: var(--tw-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twp-sub { font: italic 300 13px/1.3 var(--kw-font-serif); color: var(--tw-text2); padding-top: 3px; }
.twp-sub--m { padding-top: 2px; }
.twp-bar { position: relative; height: 2px; flex: none; border-radius: 1px; background: color-mix(in srgb, var(--tw-gold) 22%, transparent); }
.twp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 1px; background: var(--tw-gold); }
.twp-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.twp-empty__mark { width: 24px; height: 24px; color: var(--tw-gold); }
.twp-empty p { font: 400 13px/1.2 var(--kw-font-serif); color: var(--tw-text); }

/* ── Ask Lumen: the parchment with the lamp's light from the corner ───── */
.twa-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 180px at 85% 0, color-mix(in srgb, var(--tw-lumen-glow) 55%, transparent),
    color-mix(in srgb, var(--tw-lumen-glow) 0%, transparent));
}
.tw--lumen .tw-eyebrow { color: var(--tw-lumen); }
.tw--lumen .tw-eyebrow .tw-icon { width: 10px; height: 10px; }
.twa-prompt { font: italic 400 13px/calc(1.2em + 3px) var(--kw-font-serif); color: var(--tw-text); }
.twa-cta {
  flex: none; padding: 8px 0; border-radius: 10px; text-align: center;
  font: 600 11px/1.2 var(--kw-font-ui); color: var(--tw-lumen);
  background: color-mix(in srgb, var(--tw-lumen) 14%, transparent);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--tw-lumen) 30%, transparent);
}

/* ── Moedim: the Way page's card at the large widget's measure ────────── */
.tw--moedim {
  --twm-tint: #C9922A;         /* the fall, the Father's gold (StoryEraBeginning) */
  padding: 0; background: #1C1410; color: #F5EDD8; color-scheme: dark;
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--twm-tint) 45%, transparent), var(--tw-lift);
}
.tw--moedim.is-spring { --twm-tint: #C05820; }   /* the spring, His crimson (StoryEraDeliverance) */
.twm-art { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }
.twm-art picture, .twm-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.twm-art img { object-fit: cover; }
.twm-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(28, 20, 16, 0) 35%, rgba(28, 20, 16, 0.35) 70%, #1C1410 100%);
}
/* The words stand where a lamp-lit wall can sit behind them, so they carry the
   soft shadow the home page's card gave them (2026-10-01). */
.twm-words {
  position: absolute; left: 20px; right: 20px; bottom: 8px; z-index: 1; display: flex; flex-direction: column; gap: 6px;
  text-shadow: 0 1px 12px rgba(12, 8, 6, 0.65);
}
.twm-when { font: 800 10px/1.2 var(--kw-font-ui); letter-spacing: 1.8px; color: var(--twm-tint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twm-name { display: flex; align-items: baseline; gap: 10px; min-width: 0; font: 400 30px/1.1 Georgia, serif; color: #F5EDD8; }
.twm-name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.twm-hebrew { flex: none; font: 400 20px/1.1 var(--kw-font-hebrew); color: var(--twm-tint); }
.twm-meaning { font: italic 400 14px/1.35 Georgia, serif; color: #F5EDD8; }
.twm-year {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  height: 16px; margin: 22px 24px 0; flex: none;
}
.twm-year::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(168, 116, 42, 0.25); }
.twm-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #C9922A; opacity: 0.55; }
.twm-dot.is-spring { background: #C05820; }
.twm-dot.is-next { width: 14px; height: 14px; margin: 0 -3px; opacity: 1; box-shadow: 0 0 12px rgba(201, 146, 42, 0.8); }
.twm-dot.is-next.is-spring { box-shadow: 0 0 12px rgba(192, 88, 32, 0.8); }
.twm-seasons { display: flex; justify-content: space-between; gap: 8px; margin: 8px 24px 0 !important; flex: none; font: 700 9px/1.2 var(--kw-font-ui); letter-spacing: 1.4px; color: #C9922A; white-space: nowrap; }
.twm-seasons .is-spring { color: #C05820; }
.twm-cta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 20px 0 !important; flex: none; font: 400 24px/1.2 Georgia, serif; color: var(--tw-gold); }
.twm-arrow { width: 15px; height: 15px; }
.twm-sub { margin: 4px 20px 22px !important; flex: none; font: italic 400 14px/1.3 Georgia, serif; color: #9A8A6A; }

/* ── The Light page's Shabbat card, as a widget ───────────────────────── */
.tw--shabbat {
  padding: 0; background: var(--tws-bg); color: var(--tws-text);
  box-shadow: 0 0 0 0.5px var(--tws-border), var(--tw-lift);
}
.tws-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background: radial-gradient(ellipse 95% 100% at 13% 18%, color-mix(in srgb, var(--tws-light) 42%, transparent) 0%,
    color-mix(in srgb, var(--tws-light) 14%, transparent) 45%, transparent 100%);
}
.tws-moon { position: absolute; z-index: -1; }
.tws-halo {
  position: absolute; left: -35%; top: -35%; width: 170%; height: 170%; border-radius: 50%; opacity: 0.5;
  background: radial-gradient(circle, color-mix(in srgb, var(--tws-light) 55%, transparent) 0%,
    color-mix(in srgb, var(--tws-light) 18%, transparent) 34%, transparent 62%);
}
.tws-disc {
  position: relative; display: block; width: 100%; height: 100%; opacity: 0;
  filter: drop-shadow(-3px 9px 18px rgba(0, 0, 0, 0.55));
  transition: opacity 0.6s var(--kw-ease-settle, ease);
}
.tws-disc.is-drawn { opacity: 1; }
.tws-signs { position: absolute; display: flex; }
.tws-sign { display: flex; align-items: center; justify-content: center; }
.tws-sign .kwg { width: 100%; height: 100%; }
.tws-sign--father { color: #A8742A; }   /* the Father's gold, sealed, never the accent */
.tws-sign--son { color: #F5915A; }      /* KodeshWayYeshuaLight */
.tws-sign--ruach { color: #6A8ACC; }    /* KodeshWayJourneyRingRuach */
.tws-words { position: absolute; display: flex; flex-direction: column; min-width: 0; }
.tws-eyebrow { font: 800 10px/1.2 var(--kw-font-ui); letter-spacing: 1.8px; color: var(--tws-eyebrow); font-variant-caps: all-small-caps; }
.tws-title { font: 400 26px/1.15 Georgia, serif; color: var(--tws-text); }
.tws-times { font: italic 400 14px/1.35 Georgia, serif; color: var(--tws-muted); }
.tws-count { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tws-count__lead { font: 800 9px/1 var(--kw-font-ui); letter-spacing: 1.8px; color: var(--tws-eyebrow); }
.tws-count__num { font: 600 15px/1.2 var(--kw-font-ui); color: var(--tw-gold); }
.tws-chevron { position: absolute; right: 14px; bottom: 15px; width: 11px; height: 11px; color: var(--tw-gold); }
.tws-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--tw-gold) 18%, transparent); }
.tws-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tw-gold); }
.tw-locate--card { margin: 10px 0 0; color: var(--tws-text); }

/* Medium: the card itself, 364 × 170. */
.tw--shabbat.is-m .tws-moon { right: 8px; top: 50%; width: 112px; height: 112px; margin-top: -60px; }
.tw--shabbat.is-m .tws-signs { left: 20px; top: 14px; gap: 5px; }
.tw--shabbat.is-m .tws-sign { width: 24px; height: 24px; }
.tw--shabbat.is-m .tws-sign .kwg { width: 19px; height: 19px; }
.tw--shabbat.is-m .tws-words { left: 20px; right: 128px; top: 48px; }
.tw--shabbat.is-m .tws-title { font-size: 23px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw--shabbat.is-m .tws-times { font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw--shabbat.is-m .tws-count { margin-top: 9px; }
.tw--shabbat.is-m .tw-locate--card { margin-top: 8px; padding: 6px 11px 6px 9px; font-size: 11px; }
/* Large: the same card given the room — the moon whole in the upper corner,
   the words standing under her. */
.tw--shabbat.is-l .tws-moon { right: 14px; top: 18px; width: 168px; height: 168px; }
.tw--shabbat.is-l .tws-signs { left: 22px; top: 22px; gap: 6px; }
.tw--shabbat.is-l .tws-sign { width: 30px; height: 30px; }
.tw--shabbat.is-l .tws-sign .kwg { width: 23px; height: 23px; }
.tw--shabbat.is-l .tws-words { left: 22px; right: 22px; bottom: 30px; }
.tw--shabbat.is-l .tws-title { font-size: 30px; margin-top: 6px; }
.tw--shabbat.is-l .tws-times { font-size: 15px; margin-top: 6px; }
.tw--shabbat.is-l .tws-count { margin-top: 14px; }
.tw--shabbat.is-l .tws-count__num { font-size: 17px; }

/* The candles burn, each flame on its own beat over a light that breathes
   with them; the moon holds still. Nothing moves under Reduce Motion. */
@keyframes tws-flicker { from { transform: scale(0.92); } to { transform: scale(1.10); } }
@keyframes tws-flame-breath { from { opacity: 0.82; } to { opacity: 1; } }
@keyframes tws-glow { from { opacity: 0.34; } to { opacity: 0.72; } }
/* On the sign's own box, not its <svg>: a transform or opacity animation on an
   HTML box runs on the compositor, where on an SVG it is restyled each frame. */
.tws-sign { animation: tws-flicker var(--p, 1.6s) ease-in-out infinite alternate, tws-flame-breath calc(var(--p, 1.6s) * 0.7) ease-in-out infinite alternate; }
.tws-sign--father { --p: 1.6s; }
.tws-sign--son { --p: 2.05s; animation-delay: -1.02s, 0s; }
.tws-sign--ruach { --p: 2.5s; animation-delay: -2.5s, 0s; }
.tws-glow { animation: tws-glow 3.4s ease-in-out infinite alternate; }
.tws-halo { animation: tws-glow 5.2s ease-in-out infinite alternate; }
.tb.is-still .tws-sign, .tb.is-still .tws-glow, .tb.is-still .tws-halo { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .tws-sign, .tws-glow, .tws-halo { animation: none; }
  .tb-press, .tws-disc { transition: none; }
  .tb-press:active { transform: none; }
}

/* ── The head's door to the sheet ─────────────────────────────────────── */
.today__headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.today__headrow > div { min-width: 0; }
.tb-open {
  appearance: none; -webkit-appearance: none; flex: none;
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; padding: 9px 15px 9px 13px;
  border: 1px solid var(--kw-card-border); border-radius: 999px; background: transparent;
  color: var(--kw-accent); font: 600 13px/1 var(--kw-font-ui); letter-spacing: 0.02em; cursor: pointer;
  transition: background var(--kw-dur-quick, 0.2s) var(--kw-ease-settle, ease), border-color var(--kw-dur-quick, 0.2s) var(--kw-ease-settle, ease);
}
.tb-open .kwg { width: 14px; height: 14px; }
.tb-open:hover { background: var(--kw-fill); border-color: var(--kw-rule-gold); }
.tb-open:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 2px; }
.tb-open[hidden] { display: none; }

/* ── The customise sheet: the app's Light Page Layout, on the web ──────── */
.tb-sheet {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 860px); padding: 0;
  border: 1px solid var(--kw-card-border); border-radius: 20px;
  background: var(--kw-bg-base); color: var(--kw-label);
  box-shadow: 0 30px 80px rgba(20, 12, 4, 0.35);
  overflow: hidden;
}
.tb-sheet[open] { display: flex; flex-direction: column; }
.tb-sheet::backdrop { background: rgba(14, 10, 6, 0.46); }
@media (max-width: 600px) {
  .tb-sheet { width: 100vw; max-width: 100vw; max-height: 90vh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; }
}
.tb-sheet__scroll { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 24px; }
.tb-sheet__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 22px 20px 16px; border-bottom: 1px solid var(--kw-separator);
}
.tb-sheet__eyebrow { margin: 0 0 6px; font: 700 11px/1.3 var(--kw-font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--kw-accent); }
.tb-sheet__title { margin: 0; font: 400 28px/1.1 var(--kw-font-serif); color: var(--kw-label); }
.tb-sheet__sub { margin: 6px 0 0; font: italic 400 15px/1.4 var(--kw-font-verse); color: var(--kw-label-2); }
.tb-sheet__close {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--kw-fill); color: var(--kw-label-2); cursor: pointer;
}
.tb-sheet__close .kwg { width: 14px; height: 14px; }
.tb-sheet__close:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 2px; }
.tb-sheet__info {
  margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--kw-surface);
  border-left: 3px solid var(--kw-accent);
}
.tb-sheet__info p { margin: 0; font: 400 14px/1.45 var(--kw-font-ui); color: var(--kw-label-2); }
.tb-sheet__info .tb-sheet__info-head { margin: 0 0 4px; font: 700 11px/1.3 var(--kw-font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--kw-accent); }
.tb-sheet__label { margin: 22px 4px 8px; font: 700 11px/1.3 var(--kw-font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--kw-label-3); }
.tb-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--kw-surface); overflow: hidden; }
.tb-row {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px 6px 4px;
  background: var(--kw-surface); touch-action: pan-y;
}
.tb-row + .tb-row { box-shadow: inset 0 0.5px 0 var(--kw-separator); }
.tb-row.is-dragging { z-index: 2; box-shadow: 0 10px 28px rgba(20, 12, 4, 0.22); background: var(--kw-surface-hero); }
.tb-row.is-off .tb-row__name { color: var(--kw-label-3); }
.tb-row__grip {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--kw-label-3);
  cursor: grab; touch-action: none;
}
.tb-row__grip:active { cursor: grabbing; }
.tb-row__grip .kwg { width: 17px; height: 17px; }
.tb-row__grip:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: -2px; }
.tb-row__name { flex: 1; min-width: 0; font: 500 15px/1.3 var(--kw-font-ui); color: var(--kw-label); }
.tb-sizes { display: inline-flex; flex: none; padding: 2px; border-radius: 9px; background: var(--kw-fill); box-shadow: inset 0 0 0 1px var(--kw-separator); }
.tb-size {
  appearance: none; -webkit-appearance: none; min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--kw-label-2); font: 600 12px/1 var(--kw-font-ui); cursor: pointer;
}
.tb-size[aria-checked="true"] { background: var(--kw-accent); color: var(--kw-label-on-accent); }
.tb-size:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 1px; }
.tb-row.is-off .tb-sizes { opacity: 0.45; }
/* KodeshWayToggle: the accent track when on. */
.tb-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; padding: 0;
  border: 0; border-radius: 14px; background: color-mix(in srgb, var(--kw-label) 16%, transparent); cursor: pointer;
  transition: background var(--kw-dur-quick, 0.2s) var(--kw-ease-settle, ease);
}
.tb-switch::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--kw-dur-quick, 0.2s) var(--kw-ease-settle, ease);
}
.tb-switch[aria-checked="true"] { background: var(--kw-accent); }
.tb-switch[aria-checked="true"]::after { transform: translateX(18px); }
.tb-switch:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 2px; }
.tb-reset {
  appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 0; border-radius: 14px; background: var(--kw-surface); text-align: left; cursor: pointer; color: var(--kw-label);
}
.tb-reset .kwg { width: 18px; height: 18px; color: var(--kw-accent); flex: none; }
.tb-reset strong { display: block; font: 500 15px/1.3 var(--kw-font-ui); }
.tb-reset span span { display: block; font: 400 13px/1.35 var(--kw-font-ui); color: var(--kw-label-2); }
.tb-reset:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 2px; }
.tb-sheet__note { margin: 14px 4px 0; font: 400 13px/1.45 var(--kw-font-ui); color: var(--kw-label-2); }
.tb-sheet__done {
  appearance: none; -webkit-appearance: none; display: block; margin: 20px auto 0; padding: 12px 34px;
  border: 0; border-radius: 999px; background: var(--kw-accent); color: var(--kw-label-on-accent);
  font: 600 15px/1 var(--kw-font-ui); cursor: pointer;
}
.tb-sheet__done:focus-visible { outline: 2px solid var(--kw-accent); outline-offset: 3px; }
.tb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .tb-switch, .tb-switch::after, .tb-open { transition: none; }
}
