/* Mishnah Max — the web app's own pieces: Home (/), the account control and
   sign-in dialog in the header, and a mishnah page's bookmark and learned
   mark. Loaded after site.css and reader.css, on their palette and type; the
   shapes follow HomeView.swift (greeting, Continue card, stat chips, seder
   cards, Recently studied). Logical properties throughout, for /he/. */

/* --- Home ------------------------------------------------------------------ */

.reader:has(.home-app) {
  background:
    radial-gradient(ellipse 80% 45% at 50% 100%, rgba(201, 161, 58, 0.16), rgba(201, 161, 58, 0) 70%) fixed,
    linear-gradient(180deg, var(--sky) 0%, var(--blush) 55%, var(--paper) 100%) fixed;
}
.home-app { max-width: 900px; margin: 0 auto; }

.home-app__date {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}
[dir="rtl"] .home-app__date { font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; }
.goal-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-700);
}
.goal-badge.is-met { background: var(--olive); color: var(--paper); }
.goal-badge.is-met::before { content: "✓ "; }

.reader .home-app__greeting {
  margin: 8px 0 22px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
  font-weight: 500;
  color: var(--ink-900);
}
.home-app__greeting em { color: var(--wine); }

.home-app__top { display: grid; gap: 12px; }
@media (min-width: 760px) {
  .home-app__top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
  .home-app__top .stat-chips { grid-template-columns: 1fr; }
}

/* Home's video card: the film on one side, one promise on the other. */
.home-watch {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: center;
  margin-bottom: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: 24px;
  background: var(--paper); box-shadow: var(--shadow-soft); color: var(--ink-900); text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.home-watch[hidden] { display: none; }
.home-watch:hover { transform: translateY(-2px); border-color: rgba(92, 35, 24, 0.3); box-shadow: var(--shadow-lift); }
.home-watch__film { border-radius: 16px; }
.home-watch__film .watch-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.home-watch:hover .watch-play { scale: 1.06; }
.home-watch__body { display: grid; gap: 8px; justify-items: start; min-width: 0; padding: 2px 6px 6px; }
.home-watch__eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wine); }
[dir="rtl"] .home-watch__eyebrow { font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.home-watch__title { font-family: var(--serif-display); font-size: clamp(26px, 3.6vw, 36px); font-weight: 500; line-height: 1.1; text-wrap: balance; }
.home-watch__sub { color: var(--ink-700); font-size: 15px; line-height: 1.45; }
.home-watch__cta { margin-top: 4px; }
@media (min-width: 720px) {
  .home-watch { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; padding: 18px; }
  .home-watch__body { padding: 0 8px 0 0; }
  [dir="rtl"] .home-watch__body { padding: 0 0 0 8px; }
}

.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  color: var(--ink-900);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.continue-card:hover { transform: translateY(-2px); border-color: rgba(92, 35, 24, 0.3); box-shadow: var(--shadow-lift); }
.continue-card__tile {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--gold-on-wine);
  font-family: var(--hebrew);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.continue-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.continue-card__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wine);
}
[dir="rtl"] .continue-card__eyebrow { font-family: var(--sans); font-size: 13px; letter-spacing: 0; font-weight: 600; }
.continue-card__title { font-size: 21px; line-height: 1.2; }
.continue-card__sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-700);
}
.continue-card__sub:empty { display: none; }
.continue-card__go { font-family: var(--sans); font-size: 20px; color: var(--wine); }

.stat-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stat-chip {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
}
.stat-chip__row { display: flex; align-items: center; gap: 8px; }
.stat-chip__icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 9px;
}
.stat-chip__icon svg { width: 15px; height: 15px; }
.stat-chip--streak .stat-chip__icon { background: rgba(201, 161, 58, 0.16); color: var(--gold); }
.stat-chip--read .stat-chip__icon { background: rgba(92, 35, 24, 0.12); color: var(--wine); }
.stat-chip--share .stat-chip__icon { background: rgba(107, 122, 62, 0.16); color: var(--olive); }
.stat-chip__value { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stat-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
}
[dir="rtl"] .stat-chip__label { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; }

.home-sync {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(201, 161, 58, 0.45);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}
.home-sync[hidden] { display: none; }
.home-sync__title { margin: 0; font-size: 18px; color: var(--ink-900); }
.home-sync__body { margin: 4px 0 12px; font-family: var(--sans); font-size: 14.5px; line-height: 1.45; color: var(--ink-700); }
.home-sync__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.home-sync__actions .badge img { height: 40px; }
.home-sync__actions .badge:hover { filter: brightness(1.3); }
.home-sync__actions .get-qr { margin-inline-start: auto; }
.home-sync__actions [hidden] { display: none; }

.section-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-bar::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
[dir="rtl"] .section-bar::after { background: linear-gradient(270deg, var(--gold), transparent); }
.home-sedarim, .home-recent { margin-top: 40px; }
.home-app__sub { margin: 6px 0 16px; font-family: var(--sans); font-size: 14.5px; color: var(--ink-700); }

.home-sedarim__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 759px) { .home-sedarim__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.home-seder { min-height: 184px; padding: 16px 18px 14px; }
@media (max-width: 459px) {
  .home-seder { min-height: 168px; padding: 14px; }
  .home-seder .seder-card__he { font-size: 28px; }
  .home-seder .seder-card__name { font-size: 18px; }
  .home-seder .seder-card__theme { font-size: 12.5px; }
}
.home-seder__bar {
  display: block;
  height: 4px;
  margin-top: auto;
  border-radius: 2px;
  background: rgba(27, 23, 19, 0.08);
  overflow: hidden;
}
.home-seder__bar span {
  display: block;
  width: calc(var(--p, 0) * 100%);
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.home-seder .seder-card__foot { margin-top: 0; padding-top: 10px; }

.home-recent__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 12px;
  margin: 14px calc(-1 * var(--gutter)) 0;
  padding: 2px var(--gutter) 12px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
}
.home-recent__list li { scroll-snap-align: start; }
.recent-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 16px 18px 14px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink-900);
  text-decoration: none;
}
.recent-row:hover { border-color: rgba(92, 35, 24, 0.3); }
.recent-row__he { font-family: var(--hebrew); font-size: 24px; line-height: 1.3; }
.recent-row__name { font-size: 17px; }
.recent-row__name:empty { display: none; }
.recent-row__at { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-500); text-transform: uppercase; }
[dir="rtl"] .recent-row__at { font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.recent-row__bar { display: block; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.recent-row__bar span { display: block; width: calc(var(--p, 0) * 100%); height: 100%; background: var(--wine); }

/* --- The account control (header) ------------------------------------------- */

.account { display: flex; align-items: center; min-width: 34px; min-height: 34px; position: relative; }
/* Inside the header's glass: a raised white capsule, the lens made solid. */
.account__signin {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgba(27, 23, 19, 0.08), 0 4px 12px -6px rgba(27, 23, 19, 0.3);
  color: var(--wine);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.account__signin:hover { color: var(--wine-3); box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgba(92, 35, 24, 0.2), 0 6px 16px -6px rgba(92, 35, 24, 0.4); }
.account__pending { width: 36px; height: 36px; border-radius: 50%; background: rgba(27, 23, 19, 0.06); }
.account__box { position: relative; }
.account__me {
  position: relative;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
/* A small dot on the initial: olive when in step, gold while syncing. */
.account__me::after {
  content: "";
  position: absolute;
  inset-block-end: -1px;
  inset-inline-end: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--olive);
}
.account__me--syncing::after { background: var(--gold); }
.account__me--error::after { background: var(--ink-300); }
.account__menu {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 60;
  width: min(280px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 1px 0.5px #fff, 0 0 0 0.5px rgba(27, 23, 19, 0.12), var(--shadow-lift);
  font-family: var(--sans);
}
.account__name { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-900); }
.account__email { margin: 2px 0 0; font-size: 13px; color: var(--ink-500); overflow-wrap: anywhere; text-align: start; }
.account__sync { margin: 10px 0 12px; font-size: 13px; color: var(--olive); }
.account__sync--syncing { color: var(--ink-500); }
.account__sync--error { color: var(--wine); }
.account__out {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.account__out:hover { border-color: var(--ink-300); }
.account__error {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(280px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--wine);
}

/* --- The sign-in dialog ------------------------------------------------------ */

.signin {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink-900);
}
.signin::backdrop { background: rgba(27, 23, 19, 0.42); backdrop-filter: blur(3px); }
.signin__card {
  position: relative;
  padding: 30px 28px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--sky) 0%, var(--blush) 60%, var(--paper) 100%);
  text-align: center;
}
.signin__close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-500);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.signin__close:hover { background: rgba(27, 23, 19, 0.06); }
.signin__mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--gold-on-wine);
  font-family: var(--hebrew);
  font-size: 32px;
  font-weight: 700;
}
.signin h2 { margin: 14px 0 6px; font-size: 26px; font-weight: 500; }
.signin__body { margin: 0 auto 20px; max-width: 32ch; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink-700); }
.signin__buttons { display: grid; gap: 10px; }
.signin__provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.signin__provider:hover { border-color: var(--ink-300); }
.signin__provider:disabled { opacity: 0.6; cursor: progress; }
.signin__provider--apple { background: #000; border-color: #000; color: #fff; }
.signin__fine { margin: 18px 0 0; font-family: var(--sans); font-size: 12.5px; color: var(--ink-500); }
.signin__fine a { color: var(--wine); }

/* --- Pro: the account menu's row and the paywall ------------------------------ */

.account__pro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.account__pro.is-pro { border: 1px solid var(--rule); background: var(--card); color: var(--ink-900); font-weight: 500; }
.account__pro-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(201, 161, 58, 0.18);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.paywall .signin__card { text-align: start; }
.paywall__kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
[dir="rtl"] .paywall__kicker { letter-spacing: 0.08em; }
.paywall h2 { margin: 8px 0 6px; padding-inline-end: 28px; }
.paywall__why { margin: 0 0 10px; font-family: var(--sans); font-size: 14.5px; color: var(--wine); }
.paywall__features { margin: 14px 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; }
.paywall__features li {
  position: relative;
  padding-inline-start: 26px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-900);
}
.paywall__features li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--olive);
  font-weight: 700;
}
.paywall__price { margin: 0 0 10px; font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink-900); }
.paywall__cta { width: 100%; min-height: 48px; font-size: 16px; }
.paywall__terms { margin: 8px 0 0; font-family: var(--sans); font-size: 13px; color: var(--ink-700); text-align: center; }
.paywall__note { margin: 10px 0 0; font-family: var(--sans); font-size: 13.5px; color: var(--wine); text-align: center; }
.paywall__sandbox {
  margin: 12px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-700);
}
.paywall__fine { margin: 14px 0 0; font-family: var(--sans); font-size: 11.5px; line-height: 1.45; color: var(--ink-500); }
.paywall__status { margin: 16px 0; font-family: var(--sans); font-size: 15px; color: var(--ink-700); }
.paywall__have { margin: 8px 0 18px; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink-700); }
.paywall .button { display: inline-flex; justify-content: center; text-decoration: none; }
.paywall .signin__fine { text-align: center; }

/* --- A mishnah's tools ------------------------------------------------------ */
/* Watch, Ask, Bookmark and Learned live in the reading capsule at the foot of
   the window (reader.css .readbar; reader.ts fills it). */

/* A small confirmation (ui/toast.ts): glass rising from the foot of the window,
   above the reading capsule and the phone's tab bar, and sinking back. */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 6px 18px 6px 6px;
  border-radius: 999px;
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 130%);
  transition: transform 0.5s var(--glide), opacity 0.25s ease;
}
[dir="rtl"] .toast { padding: 6px 6px 6px 18px; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
body:has(.readbar) .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.toast__mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--olive); color: #fff; }
.toast__mark--star { background: var(--gold); }
.toast__mark svg { width: 15px; height: 15px; }
/* The system face throughout (site.css's :lang() rules would make the spans serif). */
.toast > span { font-family: inherit; }
.toast__detail { overflow: hidden; color: var(--ink-500); font-weight: 400; text-overflow: ellipsis; }
@media (max-width: 760px) {
  /* Above the tab bar's row (and the capsule sharing it). */
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transform: translate(-50%, 0); transition: opacity 0.25s ease; }
}

/* --- The tab bar: the app's FloatingTabBar --------------------------------------- */
/* Home, Learn, Review, You in one glass capsule (site.css .glass). The tab
   you're in is the app's wine pill with its name; on a computer the others
   keep their names too, and a lens glides under the one you point at. On a
   phone the bar floats at the foot of the screen, as in the app: symbols
   only, the current tab opening to show its name. */
.reader-header .site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
.reader-header .brand { justify-self: start; }
.site-header__aside { display: flex; align-items: center; gap: 12px; justify-self: end; }
.tabbar { border-radius: 999px; padding: 4px; }
.tabbar__list { position: relative; display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tabbar__list li { position: relative; z-index: 1; display: flex; }
.tabbar__tab {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  color: var(--ink-700);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.25s, box-shadow 0.25s, scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tabbar__icon { flex: none; width: 18px; height: 18px; }
/* The app sets tab names in the system face; :lang() would make them serif. */
.tabbar__label { font: inherit; }
.tabbar__tab:hover { color: var(--ink-900); }
.tabbar__list:not(.has-lens) .tabbar__tab:not([aria-current]):hover { background: rgba(255, 255, 255, 0.75); }
.tabbar__tab[aria-current] {
  background: var(--wine);
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 14px -8px rgba(92, 35, 24, 0.75);
}
/* The app's press: a quick dip and a springy release. */
.tabbar__tab:active { scale: 0.94; transition-duration: 0.2s, 0.25s, 0.25s, 0.1s; }
.tabbar .nav-badge { margin-inline-start: 0; }
.tabbar__tab[aria-current] .nav-badge { background: var(--cream); color: var(--wine); }

@media (max-width: 760px) {
  .reader-header .site-header__inner { display: flex; justify-content: space-between; }
  .reader-header .brand__name { display: none; }
  .tabbar {
    position: fixed;
    z-index: 55;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    /* Five tabs since Watch: the wine pill keeps room for its name. */
    width: min(340px, calc(100vw - 24px));
    padding: 6px;
    transform: translateX(-50%);
  }
  /* The bar keeps one width whichever tab is current: each other tab is an
     icon-sized slot, and the wine pill takes the rest, room for the longest
     name ("Review"; in Hebrew "פרופיל"). Otherwise the bar grew and shrank
     with the name as you moved between tabs. With no current tab (About),
     the four share the bar evenly. */
  .tabbar__list li { flex: 1 1 0; min-width: 0; }
  .tabbar__list:has([aria-current]) li { flex: 0 0 48px; }
  .tabbar__list li:has(> [aria-current]) { flex: 1 1 auto; }
  .tabbar__tab { width: 100%; justify-content: center; gap: 6px; min-height: 46px; padding: 0 10px; font-size: 13px; }
  .tabbar__icon { width: 20px; height: 20px; }
  /* Unselected, a tab shows its symbol; its name stays for screen readers. */
  .tabbar__tab:not([aria-current]) .tabbar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .tabbar__tab:not([aria-current]) .nav-badge {
    position: absolute;
    top: 5px;
    inset-inline-end: 5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }
  /* Room at the foot of every page for the floating bar. */
  body.reader { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* On a mishnah page (one with the reading capsule) the bar folds into one
     glass circle, the tab you're in, at the row's start, and the capsule takes
     the rest of the row: the iPhone's tab bar minimizing while you read.
     Folded from the first paint; reader.js opens it on a tap (.tabs-open)
     and folds it again on a scroll. Without script the circle is just the
     Learn tab. */
  body:has(.readbar) .tabbar {
    left: auto;
    inset-inline-start: 12px;
    width: 56px;
    padding: 0;
    transform: none;
    transition: width 0.45s var(--glide), inset-inline-start 0.45s var(--glide), padding 0.3s;
  }
  html:not(.tabs-open) body:has(.readbar) .tabbar__list li:not(:has(> [aria-current])) { display: none; }
  html:not(.tabs-open) body:has(.readbar) .tabbar__tab[aria-current] {
    min-height: 56px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: var(--wine);
  }
  html:not(.tabs-open) body:has(.readbar) .tabbar__tab[aria-current] .tabbar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  html:not(.tabs-open) body:has(.readbar) .tabbar__icon { width: 22px; height: 22px; }
  .tabs-open body:has(.readbar) .tabbar {
    inset-inline-start: max(12px, calc(50% - 170px));
    width: min(340px, calc(100vw - 24px));
    padding: 6px;
  }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  body:has(.readbar) .tabbar { transition: none; }
}

/* Five tabs since Watch: between a phone and a wide window the header gives
   up the brand's name first, then the names of the tabs you're not on. */
@media (min-width: 761px) and (max-width: 1100px) {
  .reader-header .brand__name { display: none; }
  /* Equal sides would squeeze the badge and Sign in off the edge: the sides
     take what they need, and the tabs centre in what's left. */
  .reader-header .site-header__inner { grid-template-columns: auto 1fr auto; column-gap: 12px; }
  .reader-header .tabbar { justify-self: center; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .tabbar__tab:not([aria-current]) { padding: 0 11px; }
  .tabbar__tab:not([aria-current]) .tabbar__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* Choosing another tab, the wine pill glides from the tab you're leaving to
   the one you chose while its page loads, as the app's matchedGeometryEffect
   does (reader.js glide(); no wait is added). Not a cross-document View
   Transition: Chrome drops those on some of these pages and logs an error. */
.tabbar__glide {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--gw, 0);
  border-radius: 999px;
  background: var(--wine);
  box-shadow: var(--wine-shadow);
  transform: translateX(var(--gx, 0));
  transition: transform 0.42s cubic-bezier(0.3, 1.35, 0.5, 1), width 0.42s cubic-bezier(0.3, 1.35, 0.5, 1);
  pointer-events: none;
}
.tabbar__list.is-gliding > .glass-lens { opacity: 0; }
.tabbar__tab.is-leaving { background: transparent; box-shadow: none; color: var(--ink-700); }
.tabbar__tab.is-arriving { color: var(--cream); }

/* --- The sidebar: the Mac app's (MacSidebar.swift) --------------------------------- */
/* A wide window gets the Mac's navigation in place of the bar above: a column
   down the window's side (the right in Hebrew: every rule is inline-start)
   with Search, the tabs, the mishnah to continue with, and the account at the
   foot. reader.py writes it into every page; below 1024px it is not shown and
   the tab bar is exactly as it was. The sizes are MacSidebar's: 224 wide,
   36-high rows with a 9px corner, the search field 32 high. */
.sidebar { display: none; }
@media (min-width: 1024px) {
  html:has(.sidebar) { --header-h: 0px; }
  body:has(> .sidebar) { padding-inline-start: 224px; }
  body:has(> .sidebar) > .reader-header { display: none; }
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: 224px;
    padding-top: 20px;
    overflow-y: auto;
    background: rgba(236, 234, 229, 0.92);
    border-inline-end: 1px solid rgba(27, 23, 19, 0.08);
    font-family: var(--sans);
  }
  /* A page starts a little lower than under the bar's 32px: there is no bar. */
  body:has(> .sidebar) .reader__main { padding-top: 40px; }
  /* Centred in the page beside the sidebar, not in the window. */
  body:has(> .sidebar) .toast { left: calc(50% + 112px); }
  [dir="rtl"] body:has(> .sidebar) .toast { left: calc(50% - 112px); }
}
.sidebar__brand { margin: 0 18px 16px; gap: 10px; }
.sidebar__brand .brand__icon { width: 28px; height: 28px; border-radius: 7px; }
.sidebar__brand .brand__name { font-size: 17px; }
.sidebar__icon { flex: none; width: 22px; height: 17px; }
/* The app sets these in the system face; :lang() would make them serif. */
.sidebar__row, .sidebar__search, .sidebar__error { font-family: var(--sans); }
.sidebar__name { flex: 1; min-width: 0; overflow: hidden; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
/* Looks like the field it opens (ui/search.tsx); ⌘K does the same. */
.sidebar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 0 10px 12px;
  padding: 0 10px;
  border: 1px solid rgba(27, 23, 19, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-500);
  font-size: 14px;
  text-decoration: none;
  cursor: text;
}
.sidebar__search:hover { border-color: rgba(27, 23, 19, 0.16); }
.sidebar__search .sidebar__icon { width: 14px; height: 14px; }
.sidebar__key { flex: none; font-family: var(--mono); font-size: 11px; }
.sidebar__tabs { display: grid; gap: 2px; margin: 0; padding: 0 10px; list-style: none; }
.sidebar__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.sidebar__row:not([aria-current]):hover { background: rgba(27, 23, 19, 0.05); }
.sidebar__row[aria-current] { background: var(--wine); color: var(--paper); }
.sidebar__row .nav-badge { flex: none; margin-inline-start: 0; }
.sidebar__row[aria-current] .nav-badge { background: var(--paper); color: var(--wine); }
.sidebar__continue[hidden] { display: none; }
.sidebar__continue .sidebar__row { margin: 0 10px; }
.sidebar__label {
  margin: 0;
  padding: 22px 20px 6px;
  color: var(--ink-500);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
[dir="rtl"] .sidebar__label { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.sidebar__foot { margin-top: auto; padding-top: 12px; }
.sidebar__foot::before { content: ""; display: block; height: 1px; margin: 0 14px; background: rgba(27, 23, 19, 0.08); }
.sidebar__foot .sidebar__row { margin: 10px; }
/* Choosing another tab, the one wine pill slides to it while its page loads
   (reader.js sideGlide(), the tab bar's glide turned on its side). */
.sidebar__glide {
  position: absolute;
  z-index: 0;
  top: 0;
  inset-inline: 10px;
  height: var(--gh, 36px);
  border-radius: 9px;
  background: var(--wine);
  transform: translateY(var(--gy, 0));
  transition: transform 0.42s cubic-bezier(0.3, 1.35, 0.5, 1);
  pointer-events: none;
}
.sidebar__row.is-leaving { background: transparent; color: var(--ink-900); }
.sidebar__row.is-arriving { color: var(--paper); }

.sidebar__error { margin: 10px 14px 0; font-size: 12.5px; line-height: 1.35; color: var(--wine); }

/* Search (ui/search.tsx): the field the sidebar's row stands for, and what it
   finds, near the top of the window as a Mac's search opens. */
.search {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 14vh - 24px);
  margin-top: 14vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink-900);
}
.search::backdrop { background: rgba(27, 23, 19, 0.32); backdrop-filter: blur(3px); }
.search__card {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 0 0 0.5px rgba(27, 23, 19, 0.12), var(--shadow-lift);
  font-family: var(--sans);
  overflow: hidden;
}
.search__field, .search__note, .search__result { font-family: var(--sans); }
.search__field { flex: none; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-bottom: 1px solid rgba(27, 23, 19, 0.08); }
.search__icon { flex: none; width: 18px; height: 18px; color: var(--ink-500); }
.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-900);
  font: inherit;
  font-size: 17px;
  appearance: none;
}
.search__input::placeholder { color: var(--ink-300); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__key { flex: none; padding: 2px 6px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink-500); font-family: var(--mono); font-size: 11px; }
.search__body { min-height: 0; overflow-y: auto; }
.search__note { margin: 0; padding: 18px 20px 20px; font-size: 14px; line-height: 1.45; color: var(--ink-500); }
.search__results { margin: 0; padding: 6px; list-style: none; }
.search__result { display: grid; gap: 3px; padding: 10px 12px; border-radius: 9px; color: inherit; text-decoration: none; }
.search__result.is-lit { background: rgba(27, 23, 19, 0.05); }
/* The system face throughout (site.css's :lang() rules would make the spans serif). */
.search__title, .search__text { font-family: inherit; text-align: start; }
.search__title { font-size: 15px; font-weight: 600; }
.search__text { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 13.5px; line-height: 1.4; color: var(--ink-500); }

/* The store badges left the header for Home's "Save your progress" card
   (home.py) and the install bar at the top of a phone's page (site.css). */
@media (max-width: 760px) {
  .site-header__aside { gap: 8px; }
}
@media (max-width: 420px) {
  .reader-header .site-header__end { gap: 4px; padding-inline-start: 11px; }
  .reader-header .account__signin { padding: 0 12px; font-size: 13px; }
}

/* PressableCard (SharedComponents.swift): every tappable card and row dips
   to 96.5% while pressed and springs back on release. */
:is(.continue-card, .seder-card, .tile, .row, .recent-row, .pager__link, .chip, .button, .account__signin, .badge) {
  transition-property: transform, box-shadow, border-color, background-color, color, scale;
  transition-duration: 0.2s, 0.2s, 0.2s, 0.2s, 0.2s, 0.42s;
  transition-timing-function: ease, ease, ease, ease, ease, cubic-bezier(0.3, 1.6, 0.5, 1);
}
:is(.continue-card, .seder-card, .tile, .row, .recent-row, .pager__link, .chip, .button, .account__signin, .badge):active {
  scale: 0.965;
  transition-duration: 0.2s, 0.2s, 0.2s, 0.2s, 0.2s, 0.1s;
  transition-timing-function: ease;
}
@media (prefers-reduced-motion: reduce) {
  :is(.continue-card, .seder-card, .tile, .row, .recent-row, .pager__link, .chip, .button, .account__signin, .tabbar__tab):active { scale: 1; }
}


/* --- "Finished this mishnah?" at a mishnah's end ----------------------------- */

.mishnah__done {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 36px 0 8px;
  padding: 22px 20px 20px;
  border: 1px solid rgba(201, 161, 58, 0.45);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--fade), var(--paper));
  text-align: center;
}
.mishnah__done[hidden] { display: none; }
.mishnah__done.is-learned { border-color: rgba(107, 122, 62, 0.4); background: rgba(107, 122, 62, 0.07); }
.mishnah__done [hidden] { display: none; }
.mishnah__done-ask { margin: 0; font-size: 21px; color: var(--ink-900); }
.mishnah__done-how { margin: 0 0 10px; max-width: 46ch; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink-700); }
.mishnah__done-yes { margin: 0; font-size: 19px; color: var(--olive); }
.mishnah__done-yes::before { content: "✓ "; }
.mishnah__done-undo {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--ink-500);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.mishnah__done-undo:hover { color: var(--wine); }

/* --- Review (chazara) -------------------------------------------------------- */

.reader:has(.review-app) {
  background:
    radial-gradient(ellipse 80% 45% at 50% 100%, rgba(201, 161, 58, 0.16), rgba(201, 161, 58, 0) 70%) fixed,
    linear-gradient(180deg, var(--sky) 0%, var(--blush) 55%, var(--paper) 100%) fixed;
}
.review-app { max-width: 760px; margin: 0 auto; }
.review-app__body { margin-top: 26px; }
.review-app__loading, .review-card__loading { font-family: var(--sans); color: var(--ink-500); }

/* The due card: the iPhone's indigo hero. */
.review-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #46437A, #2C2A4A);
  color: #fff;
  text-align: start;
  font: inherit;
  box-shadow: var(--shadow-soft);
}
button.review-hero { cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
button.review-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.review-hero > span:nth-child(2), .review-hero > div { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.review-hero__icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px;
}
.review-hero__title { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.review-hero__sub { font-family: var(--sans); font-size: 14px; line-height: 1.45; opacity: 0.85; }
.review-hero__go { font-size: 16px; opacity: 0.9; }
.review-hero--calm { background: var(--paper); color: var(--ink-900); border: 1px solid var(--rule); }
.review-hero--calm .review-hero__icon { background: rgba(107, 122, 62, 0.14); color: var(--olive); }
.review-hero--calm .review-hero__sub { color: var(--ink-700); opacity: 1; }
.review-hero--muted { background: var(--paper); color: var(--ink-900); border: 1px solid rgba(201, 161, 58, 0.45); flex-wrap: wrap; }
.review-hero--muted .review-hero__sub { color: var(--ink-700); opacity: 1; }

/* A session's bar floats as glass under the header: close, the wine track, the count. */
.review-session__bar {
  position: sticky;
  top: calc(var(--header-h) + 6px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 5px 18px 5px 5px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
[dir="rtl"] .review-session__bar { padding: 5px 5px 5px 18px; }
.review-session__track { flex: 1; height: 8px; border-radius: 999px; background: rgba(27, 23, 19, 0.08); overflow: hidden; }
.review-session__track span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 999px; background: var(--wine); transition: width 0.45s var(--glide); }
.review-session__close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-700);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, scale 0.42s var(--spring);
}
.review-session__close:hover { background: var(--paper); box-shadow: var(--lens-shadow); }
.review-session__close:active { scale: 0.9; }

.review-card {
  padding: 24px 24px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.review-card__kicker { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wine); }
[dir="rtl"] .review-card__kicker { font-family: var(--sans); font-size: 13px; letter-spacing: 0; font-weight: 600; }
.review-card--perek .review-card__kicker { color: var(--olive); }
.review-card h2 { margin: 6px 0 14px; font-size: 24px; font-weight: 500; }
.review-card__recall { padding: 18px 0 4px; text-align: center; }
.review-card__cue { margin: 0; font-size: 19px; color: var(--ink-700); }
.review-card__title { margin: 8px 0 0; font-style: italic; color: var(--ink-500); }
[dir="rtl"] .review-card__title { font-style: normal; }
.review-card__then { margin: 14px 0 0; font-family: var(--sans); font-size: 13.5px; color: var(--ink-500); }
.review-card__recall .quiz__foot { justify-content: center; }
.review-card__fail p { font-family: var(--sans); color: var(--wine); }
.review-card__link { margin: 16px 0 0; font-family: var(--sans); font-size: 14px; }
.review-card__link a { color: var(--wine); }
.review-outcome {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(92, 35, 24, 0.07);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-700);
}
.review-outcome strong { font-size: 15px; color: var(--ink-900); }
.review-outcome.is-good { background: rgba(107, 122, 62, 0.10); }
.review-mishnah { display: grid; gap: 18px; }
.review-mishnah__he { margin: 0; font-family: var(--hebrew); font-size: 24px; line-height: 1.75; color: var(--ink-900); text-align: right; }
.review-mishnah__en { margin: 4px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-700); }
.review-mishnah__en strong { color: var(--ink-900); }
.review-card--done { text-align: center; }
.review-done__mark { display: inline-grid; place-items: center; width: 56px; height: 56px; margin: 0; border-radius: 50%; background: var(--olive); color: var(--paper); font-size: 26px; }
.review-done__he { margin: 0; font-family: var(--hebrew); font-size: 26px; color: var(--wine); }
.review-card--done .quiz__foot { justify-content: center; }

/* --- Questions ------------------------------------------------------------------- */

.quiz__q { display: grid; gap: 14px; }
.quiz__meta { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }
[dir="rtl"] .quiz__meta { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; }
.quiz__prompt { margin: 0; font-size: 21px; line-height: 1.35; font-weight: 500; outline: none; }
.quiz__hint { margin: -6px 0 0; font-family: var(--sans); font-size: 13px; color: var(--ink-500); }
/* Answers as pills, in the tab bar's language: a paper pill, the lens (solid
   white) under the one pointed at, the wine pill for the one picked; once
   checked, the right answer olive and a wrong pick brick. A list answer leads
   with a small mark: a ring, the picked dot, ✓ or ✕. */
.quiz__options { display: grid; gap: 8px; }
.quiz__options--words { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.quiz__option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 11px 20px;
  border: 0;
  border-radius: 26px;
  background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(27, 23, 19, 0.1);
  color: var(--ink-900);
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.35;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.25s, color 0.2s, box-shadow 0.25s, scale 0.42s var(--spring);
}
[dir="rtl"] .quiz__option { font-family: var(--hebrew); font-size: 18px; }
.quiz__options--list .quiz__option { padding-inline-start: 52px; }
.quiz__options--list .quiz__option::before {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink-300);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.quiz__options--words .quiz__option { align-items: center; text-align: center; }
.quiz__options--words .quiz__option-text { font-family: var(--hebrew); font-size: 24px; }
@media (hover: hover) and (pointer: fine) {
  .quiz__option:hover:not(:disabled):not(.is-chosen) { background: var(--paper); box-shadow: var(--lens-shadow); }
}
.quiz__option:active:not(:disabled) { scale: 0.975; transition-duration: 0.25s, 0.2s, 0.25s, 0.1s; }
.quiz__option.is-chosen { background: var(--wine); color: var(--cream); box-shadow: var(--wine-shadow); }
.quiz__option.is-chosen::before { content: "•"; background: var(--cream); color: var(--wine); box-shadow: none; font-size: 20px; }
.quiz__option.is-right { background: var(--olive); color: #fff; box-shadow: var(--olive-shadow); }
.quiz__option.is-right::before { content: "✓"; background: #fff; color: #4A5A36; box-shadow: none; }
.quiz__option.is-wrong { background: rgba(164, 67, 58, 0.09); color: #7E2E26; box-shadow: inset 0 0 0 1px rgba(164, 67, 58, 0.45); }
.quiz__option.is-wrong::before { content: "✕"; background: var(--brick); color: #fff; box-shadow: none; }
.quiz__option:disabled { cursor: default; }
.quiz__option:disabled:not(.is-right):not(.is-wrong) { color: var(--ink-500); }
.quiz__option-gloss { font-family: var(--sans); font-size: 13px; color: var(--ink-500); }
.quiz__option.is-right .quiz__option-gloss { color: rgba(255, 255, 255, 0.85); }
.quiz__option:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
/* True / False: the segmented control (site.css .seg), the width of the card. */
.quiz__tf .seg__item { min-height: 46px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .quiz__option:active:not(:disabled) { scale: 1; } }
.quiz__match { display: grid; gap: 12px; }
.quiz__match-left { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quiz__match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 18px;
  border: 0;
  border-radius: 26px;
  background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(27, 23, 19, 0.1);
  color: var(--ink-900);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s;
}
@media (hover: hover) and (pointer: fine) {
  .quiz__match-row:hover:not(:disabled):not(.is-active) { background: var(--paper); box-shadow: var(--lens-shadow); }
}
.quiz__match-l { font-size: 17px; }
.quiz__match-l [lang="he"], .quiz__match-l:lang(he) { font-family: var(--hebrew); font-size: 20px; }
.quiz__match-r { font-family: var(--sans); font-size: 14.5px; color: var(--ink-700); }
/* The row being paired is the wine pill; checked rows are olive or brick tints. */
.quiz__match-row.is-active { background: var(--wine); box-shadow: var(--wine-shadow); color: var(--cream); }
.quiz__match-row.is-active .quiz__match-r { color: rgba(244, 236, 218, 0.8); }
.quiz__match-row.is-right { background: rgba(107, 122, 62, 0.12); box-shadow: inset 0 0 0 1px rgba(107, 122, 62, 0.5); }
.quiz__match-row.is-wrong { background: rgba(164, 67, 58, 0.07); box-shadow: inset 0 0 0 1px rgba(164, 67, 58, 0.45); }
.quiz__match-fix { display: block; margin-top: 2px; color: var(--olive); font-weight: 600; }
.quiz__match-fix::before { content: "→ "; }
.quiz__match-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz__chip {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(27, 23, 19, 0.1);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, scale 0.42s var(--spring);
}
@media (hover: hover) and (pointer: fine) {
  .quiz__chip:hover:not(:disabled) { background: var(--paper); box-shadow: var(--lens-shadow); }
}
.quiz__chip:active:not(:disabled) { scale: 0.94; }
.quiz__chip:disabled { opacity: 0.55; cursor: default; }
.quiz__chip.is-used { opacity: 0.45; }
.quiz__because { padding: 12px 16px; border-radius: 16px; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; }
.quiz__because p { margin: 4px 0 0; color: var(--ink-700); }
.quiz__because.is-right { background: rgba(107, 122, 62, 0.10); }
.quiz__because.is-right strong { color: var(--olive); }
.quiz__because.is-wrong { background: rgba(164, 67, 58, 0.07); }
.quiz__because.is-wrong strong { color: #A4433A; }
.quiz__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.quiz__foot .button:disabled { opacity: 0.45; cursor: default; }

.quiz-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink-900);
}
.quiz-dialog::backdrop { background: rgba(27, 23, 19, 0.42); backdrop-filter: blur(3px); }
.quiz-dialog__card { position: relative; padding: 26px 24px 22px; border-radius: 22px; background: var(--paper); }
.quiz-dialog__kicker { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--olive); }
[dir="rtl"] .quiz-dialog__kicker { font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.quiz-dialog h2 { margin: 4px 0 18px; padding-inline-end: 36px; font-size: 24px; font-weight: 500; }
.quiz-result { text-align: center; padding: 10px 0 4px; }
.quiz-result__score { margin: 0; font-family: var(--serif); font-size: 30px; }
.quiz-result__verdict { margin: 6px 0 16px; font-family: var(--sans); font-size: 15px; color: var(--wine); }
.quiz-result__verdict.is-pass { color: var(--olive); font-weight: 600; }
.quiz-result .quiz__foot { justify-content: center; }

/* --- Review elsewhere: the header count, tractate pages, a mishnah's check ------- */

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-inline-start: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--wine);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}
.nav-badge[hidden] { display: none; }
.perek__review { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.perek__review[hidden] { display: none; }
.perek__review-button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(107, 122, 62, 0.45);
  border-radius: 999px;
  background: var(--paper);
  color: var(--olive);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.perek__review-button:hover { border-color: var(--olive); }
.perek__review-badge, .mishnah__done-badge { font-family: var(--sans); font-size: 13px; color: var(--ink-500); }
.row.is-learned .row__n::after { content: " ✓"; color: var(--olive); }
.mishnah__done-more { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 10px 0 0; }
.mishnah__done-check {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(107, 122, 62, 0.45);
  border-radius: 999px;
  background: var(--paper);
  color: var(--olive);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}


/* --- Chavruta: the buttons, the panel, the AI consent -------------------------- */

/* Ask at a mishnah's end: a paper pill, the lens made solid (the done block's
   one wine is Mark as learned). In the reading capsule it is a tool. */
.mishnah__chat {
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--lens-shadow);
  color: var(--wine);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s, scale 0.42s var(--spring);
}
.mishnah__chat::before { content: "✦ "; color: var(--gold); }
.mishnah__chat:hover { box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgba(92, 35, 24, 0.2), 0 6px 16px -6px rgba(92, 35, 24, 0.4); }
.mishnah__chat:active { scale: 0.95; }
.mishnah__done-more .mishnah__chat { min-height: 36px; padding: 0 14px; font-size: 14px; }

.account__item {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-700);
  font: inherit;
  font-size: 14px;
  text-align: start;
  cursor: pointer;
}
.account__item:hover { background: var(--card); color: var(--ink-900); }

.consent .signin__card { text-align: start; }
.consent h2 { padding-inline-end: 28px; }
.consent__lead { margin: 6px 0 14px; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-900); }
.consent__providers { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--rule); }
.consent__provider-title { margin: 0; font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--ink-900); }
.consent__provider-detail { margin: 3px 0 0; font-family: var(--sans); font-size: 14px; color: var(--ink-700); }
.consent__note { margin: 14px 0 0; font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--ink-500); }
.consent__status { margin: 14px 0 0; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink-900); }
.consent__buttons { display: grid; gap: 8px; margin-top: 18px; }
.consent__buttons .button { justify-content: center; }
.consent__later { min-height: 36px; border: 0; background: transparent; color: var(--ink-500); font-family: var(--sans); font-size: 14.5px; cursor: pointer; }
.consent .signin__fine { text-align: center; }

.chat {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-inline-start: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-900);
  box-shadow: var(--shadow-lift);
}
[dir="rtl"] .chat { inset: 0 auto 0 0; }
.chat:not([open]) { display: none; }
.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--sky), var(--paper));
}
.chat__titles { min-width: 0; }
.chat__head h2 { margin: 0; font-size: 22px; font-weight: 500; }
.chat__ref { margin: 2px 0 0; font-family: var(--sans); font-size: 13px; color: var(--ink-500); }
.chat__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.chat__close { position: static; }
.chat__new, .chat__earlier {
  max-width: 150px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-700);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}
.chat__new { white-space: nowrap; }
.chat__new:disabled { opacity: 0.45; cursor: default; }
.chat__list { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.chat__empty { margin: auto 0; text-align: center; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink-700); }
/* Suggestions are paper pills; the one pointed at is the lens, solid white. */
.chat__suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chat__suggestion {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(27, 23, 19, 0.1);
  color: var(--ink-700);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.25s, color 0.2s, box-shadow 0.25s, scale 0.42s var(--spring);
}
.chat__suggestion:hover { background: var(--paper); color: var(--wine); box-shadow: var(--lens-shadow); }
.chat__suggestion:active { scale: 0.95; }
.chat__msg { max-width: 88%; font-family: var(--sans); font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.chat__msg p, .chat__msg ul, .chat__msg ol { margin: 0 0 8px; }
.chat__msg > :last-child { margin-bottom: 0; }
.chat__msg ul, .chat__msg ol { padding-inline-start: 20px; }
.chat__msg--user {
  align-self: flex-end;
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--paper);
}
[dir="rtl"] .chat__msg--user { border-radius: 18px 18px 18px 4px; }
.chat__msg--chevrusa { align-self: flex-start; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: var(--card); }
[dir="rtl"] .chat__msg--chevrusa { border-radius: 18px 18px 4px 18px; }
.chat__status { color: var(--ink-500); font-style: italic; }
.chat__picture { margin: 0; }
.chat__picture img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--paper); }
.chat__picture-wait { aspect-ratio: 4 / 3; border-radius: 12px; background: linear-gradient(90deg, var(--card), var(--paper), var(--card)); }
.chat__picture figcaption { margin-top: 6px; font-size: 13.5px; color: var(--ink-700); }
.chat__error { align-self: stretch; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(92, 35, 24, 0.3); font-family: var(--sans); font-size: 14.5px; color: var(--wine); }
.chat__error p { margin: 0 0 8px; }
/* The Ask bar: a glass capsule floating at the panel's foot, Send its wine. */
.chat__compose {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 6px 12px 4px;
  padding: 5px;
  border-radius: 26px;
}
.chat__compose:focus-within { box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.95), 0 0 0 2px rgba(92, 35, 24, 0.28), 0 10px 28px -12px rgba(70, 48, 36, 0.38); }
.chat__compose textarea {
  flex: 1;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 6px 11px 14px;
  border: 0;
  background: none;
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.chat__compose textarea::placeholder { color: var(--ink-500); }
.chat__send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wine);
  box-shadow: var(--wine-shadow);
  color: var(--cream);
  cursor: pointer;
  transition: background-color 0.25s, color 0.2s, box-shadow 0.25s, scale 0.42s var(--spring);
}
.chat__send svg { width: 18px; height: 18px; }
.chat__send:active:not(:disabled) { scale: 0.9; }
.chat__send:disabled { background: rgba(27, 23, 19, 0.07); box-shadow: none; color: var(--ink-300); cursor: default; }
.chat__send--stop { background: var(--paper); box-shadow: var(--lens-shadow); color: var(--wine); }
.chat__fine { margin: 0; padding: 4px 16px 14px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-500); }
@media (max-width: 599px) {
  .chat { width: 100vw; border: 0; }
  .chat__earlier { max-width: 96px; }
  .chat__new { max-width: none; }
}

/* --- Profile ------------------------------------------------------------------- */

a.account__item { display: flex; align-items: center; text-decoration: none; }
.profile-app { max-width: 720px; margin: 0 auto; }
.profile { display: grid; gap: 14px; margin-bottom: 48px; }
.profile__me {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--sky), var(--paper));
}
.profile__avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--wine-2), var(--wine-3));
  color: var(--paper);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
}
.profile__name { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--ink-900); }
.profile__email { margin: 2px 0 0; font-family: var(--sans); font-size: 14px; color: var(--ink-500); overflow-wrap: anywhere; text-align: start; }
.profile__section { padding: 18px; border: 1px solid var(--rule); border-radius: 18px; background: var(--paper); }
.profile__section h2 { margin: 0; font-size: 19px; font-weight: 500; color: var(--ink-900); }
.profile__hint { margin: 4px 0 12px; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink-700); }
.profile__section h2 + .button, .profile__section h2 + .profile__row { margin-top: 12px; }
.profile__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.profile__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 16px;
}
.profile__input:focus { outline: 2px solid rgba(92, 35, 24, 0.35); outline-offset: 1px; }
.profile__textarea { display: block; width: 100%; margin: 10px 0; resize: vertical; line-height: 1.45; }
/* Daily goal, language and the kind of feedback: segmented controls (site.css .seg). */
.profile__feedback > .seg { margin-bottom: 2px; }
.profile__about { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 0; font-family: var(--sans); font-size: 14px; color: var(--ink-700); }
.profile__link { border: 0; background: none; padding: 0; color: var(--wine); font-family: var(--sans); font-size: 14px; text-decoration: underline; cursor: pointer; }
.profile__ok { font-family: var(--sans); font-size: 14px; color: var(--olive); }
.profile__error { margin: 10px 0 0; font-family: var(--sans); font-size: 14px; color: var(--wine); }
.profile__error a { color: var(--wine); font-weight: 600; }
.profile__fine { margin: 10px 0 0; font-family: var(--sans); font-size: 12px; color: var(--ink-500); }
.profile__danger { border-color: rgba(160, 30, 30, 0.45); color: #A01E1E; }
.profile__confirm { padding: 14px; border: 1px solid rgba(160, 30, 30, 0.35); border-radius: 14px; background: rgba(160, 30, 30, 0.04); }
.profile__confirm-title { margin: 0 0 10px; font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink-900); }
.profile__check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--sans); font-size: 14.5px; color: var(--ink-900); }
.profile__danger-solid { border: 0; background: #A01E1E; color: #fff; }
.profile__danger-solid:disabled { opacity: 0.45; }
.profile__signed-out { margin: 24px 0 48px; font-family: var(--sans); font-size: 16px; color: var(--ink-700); }
.profile__deleted { margin: 24px 0 48px; font-size: 16px; }

/* Concepts in chazara: the row under the hero, and the flashcard. */
.review-concepts {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 14px;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-900);
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.review-concepts:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.review-concepts > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.review-concepts__icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(70, 67, 122, 0.12);
  color: #46437A;
  font-size: 18px;
}
.review-concepts__title { font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.review-concepts__sub { font-family: var(--sans); font-size: 13.5px; color: var(--ink-700); }
.review-concepts__go { color: var(--ink-500); }
.concept-card__term { margin: 14px 0 0; font-family: var(--hebrew, serif); font-size: 40px; line-height: 1.25; color: var(--ink-900); text-align: start; }
.concept-card__say { margin: 4px 0 0; font-style: italic; color: var(--ink-500); }
.concept-card__short { margin: 0 0 8px; font-weight: 600; color: var(--ink-900); }
.concept-card__def { margin: 0 0 10px; color: var(--ink-700); line-height: 1.6; }

/* Marking earlier study: under each perek, and the masechet's under its heading. */
.prior-study { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; flex-basis: 100%; }
.tractate__mark { margin-top: 14px; }
.prior-study__button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px dashed rgba(107, 122, 62, 0.55);
  border-radius: 999px;
  background: transparent;
  color: var(--olive);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.prior-study__button:hover { border-style: solid; }
.prior-study__status { font-family: var(--sans); font-size: 13px; color: var(--ink-700); }
.prior-study__undo { border: 0; background: none; padding: 0; color: var(--wine); font-family: var(--sans); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.prior-study__undo[hidden] { display: none; }

/* Notes: saving a Chavruta picture, and the list on the Profile page. */
.chat__save { margin-top: 8px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); padding: 4px 12px; color: var(--ink-700); font-family: var(--sans); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chat__save.is-saved { border-color: rgba(107, 122, 62, 0.45); color: var(--olive); cursor: default; }
.notes { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.note { padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.note__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-family: var(--sans); font-size: 13px; }
.note__ref { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #46437A; }
.note__when { flex: 1; color: var(--ink-500); }
.note__img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--card); }
.note__caption { margin: 10px 0 0; font-family: var(--sans); font-size: 14px; color: var(--ink-700); line-height: 1.5; }


/* --- Video lessons: the button, and the film docked over the page (contract §11) --- */


.lesson-dock {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  margin: 18px 0 8px;
}
/* It floats over the page, so it is glass (site.css .glass recipe). */
.lesson-dock__inner {
  padding: 10px 12px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.9);
  backdrop-filter: blur(22px) saturate(1.9);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
    0 0 0 0.5px rgba(27, 23, 19, 0.11),
    0 1px 2px rgba(27, 23, 19, 0.05),
    0 14px 34px -14px rgba(70, 48, 36, 0.4);
  font-family: var(--sans);
}
.lesson-dock__bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lesson-dock__title { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--ink-900); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.lesson-dock__fold, .lesson-dock__close {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--lens-shadow);
  color: var(--ink-700);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, scale 0.42s var(--spring);
}
.lesson-dock__fold:hover, .lesson-dock__close:hover { color: var(--wine); }
.lesson-dock__fold:active, .lesson-dock__close:active { scale: 0.94; }
.lesson-dock__close { width: 32px; padding: 0; font-size: 18px; line-height: 1; }
/* At most 38% of the window tall, so the text it follows stays in view. */
.lesson-dock__film { max-width: calc(38vh * 16 / 9); margin-inline: auto; overflow: hidden; border-radius: 10px; background: #D8D4C0; aspect-ratio: 16 / 9; }
.lesson-dock__film video { display: block; width: 100%; height: 100%; }
/* Folded: the film keeps playing, out of sight; captions and parts stay. */
.is-folded .lesson-dock__film { height: 0; aspect-ratio: auto; }
.lesson-dock__caption { min-height: 1.5em; margin: 8px 0 0; color: var(--ink-500); font-size: 15px; line-height: 1.5; text-align: center; }
.lesson-dock__caption .is-spoken { color: var(--ink-900); font-weight: 600; }
/* The film's parts: one paper well, the part playing its wine pill. */
.lesson-dock__parts {
  display: flex;
  gap: 2px;
  margin: 8px 0 0;
  padding: 3px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
  border-radius: 999px;
  background: #F2F0EC;
  box-shadow: inset 0 1px 2px rgba(27, 23, 19, 0.08), inset 0 0 0 0.5px rgba(27, 23, 19, 0.1);
}
.lesson-dock__parts button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-700);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s, color 0.2s, box-shadow 0.25s;
}
.lesson-dock__parts button:hover:not([aria-current]) { background: var(--paper); box-shadow: var(--lens-shadow); color: var(--ink-900); }
.lesson-dock__parts button[aria-current] { background: var(--wine); box-shadow: var(--wine-shadow); color: var(--cream); }
.lesson-dock__note { margin: 8px 0 0; color: var(--ink-500); font-size: 12px; }
.lesson-dock__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0; color: var(--ink-700); font-size: 14px; }
.lesson-dock__status p { margin: 0; }
/* The phrase the narrator is on: the reader's own highlight. */
.w.lesson-lit, .unit__en b.lesson-lit { background: var(--lit); box-shadow: inset 0 -2px 0 var(--lit-line); }
@media (max-width: 560px) {
  .lesson-dock { margin-inline: -8px; }
  .lesson-dock__caption { font-size: 14px; }
}

/* --- Watch: the tab, a course, a lesson (src/ui/watch.tsx) ---------------------- */
/* The iPhone's Watch tab on a wider page: posters on shelves, a course per
   tractate in its seder's colours, and the lesson's own page with the film,
   its parts as chapters and the mishnah lit as the narrator explains it. */
.watch-app { max-width: 1140px; margin: 0 auto; font-family: var(--sans); }
.watch-app--lesson { max-width: 1240px; }
.watch-app__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px 24px; }
.watch-app__head > div { max-width: 640px; }
.watch-app__head h1 { margin: 8px 0 10px; font-family: var(--serif-display); font-size: clamp(40px, 6vw, 56px); font-weight: 500; line-height: 1; letter-spacing: -0.015em; }
.watch-app__head .lede { margin: 0; }
.watch-app__head--course { display: block; margin-bottom: -18px; }
.watch-app--course { display: grid; gap: 40px; }
.watch-app__body { display: grid; gap: 52px; margin-top: 34px; }
.watch-app__noscript { font-family: var(--sans); }
.watch-app--course .watch-app__body > section h2 { font-size: 20px; }

.watch-mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }
[dir="rtl"] .watch-mono { font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.watch-mono a { color: var(--wine); text-decoration: none; }
.watch-mono--wine { color: var(--wine); }
.watch-mono--olive { color: #4A5A36; }
.watch-mono--link { color: var(--wine); text-decoration: none; padding: 10px 0; }
.watch-muted { color: var(--ink-500); font-size: 13.5px; }
.watch-link { padding: 8px 2px; border: 0; background: none; color: var(--wine); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.watch-link:hover { text-decoration: underline; }
.watch-empty { margin: 0; padding: 18px 20px; border-radius: 16px; background: var(--card); color: var(--ink-700); }
.watch-status { flex: none; }

/* The free count, Pro, or Sign in: one chip by the heading. */
.watch-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.watch-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid #E3CF8E; border-radius: 999px; background: #F7EDCF; color: var(--ink-900);
  font: inherit; font-size: 14px; font-weight: 600; cursor: default;
}
button.watch-chip { cursor: pointer; }
button.watch-chip:hover { border-color: var(--gold); }
.watch-chip--pro { border-color: transparent; background: #F3ECEA; color: var(--wine); }

/* A film's poster: the frame from the middle of its first sentence. */
.watch-poster { position: relative; display: block; overflow: hidden; border-radius: 14px; background: #F1EBDF; aspect-ratio: 16 / 9; }
.watch-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.watch-poster__ref {
  position: absolute; top: 9px; inset-inline-start: 9px; padding: 2px 7px; background: #F2C230; color: var(--ink-900);
  font-family: var(--mono); font-size: 11px; font-weight: 700; transform: rotate(-2deg);
}
.watch-poster__time {
  position: absolute; bottom: 9px; inset-inline-end: 8px; padding: 2px 6px; border-radius: 6px;
  background: rgba(27, 23, 19, 0.82); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
/* An open lesson: plays for anyone, account or not (contract §11). */
.watch-poster__free {
  position: absolute; top: 9px; inset-inline-end: 8px; padding: 2px 7px; border-radius: 6px;
  background: var(--wine); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.watch-poster__bar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(27, 23, 19, 0.2); }
.watch-poster__bar span { display: block; height: 100%; background: var(--wine); }
.watch-poster:has(.watch-poster__bar) .watch-poster__time { bottom: 12px; }
.watch-poster--soon { background: repeating-linear-gradient(-45deg, #F4ECDA 0 10px, #EFE5CF 10px 20px); }

.watch-play {
  display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 0; border: 0;
  border-radius: 999px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 10px 28px rgba(27, 23, 19, 0.3); color: var(--wine); cursor: pointer;
  transition: scale 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* Play points right in every language, as the app's play.fill does: media
   symbols are not mirrored for Hebrew. The nudge right centres the triangle by eye. */
.watch-play svg { width: 40%; height: 40%; fill: currentColor; margin-left: 6%; }
.watch-play:hover { scale: 1.06; }
.watch-play--big { width: 84px; height: 84px; }
.watch-play:disabled { cursor: progress; scale: 1; }
.watch-spinner { width: 30px; height: 30px; border: 3px solid rgba(92, 35, 24, 0.2); border-top-color: var(--wine); border-radius: 50%; animation: watch-spin 0.8s linear infinite; }
@keyframes watch-spin { to { transform: rotate(360deg); } }

/* Continue (or Start here). */
.watch-continue {
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 20px; border-radius: 28px;
  background: var(--paper); box-shadow: var(--shadow-soft);
}
.watch-continue__film { position: relative; flex: 3 1 420px; display: block; border-radius: 18px; }
.watch-continue__film .watch-poster { border-radius: 18px; }
.watch-continue__film .watch-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.watch-continue__body { flex: 2 1 280px; display: grid; gap: 12px; min-width: 0; }
.watch-continue__body > * { margin: 0; }
.watch-continue__title { font-family: var(--serif-display); font-size: clamp(28px, 3.4vw, 36px); font-weight: 500; line-height: 1.08; }
.watch-continue__ref { color: var(--ink-500); font-size: 15px; }
.watch-continue__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.watch-continue__note { display: flex; align-items: center; gap: 8px; color: var(--ink-700); font-size: 14px; }

/* Shelves. */
.watch-section { display: grid; gap: 16px; }
.watch-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.watch-section__head h2, .watch-section > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.watch-section__h--small, .watch-section > h2.watch-section__h--small { font-size: 25px; }
.watch-section__he { font-family: var(--hebrew); font-size: 0.75em; font-weight: 500; color: var(--ink-700); }
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 22px; }
.watch-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 8px; color: var(--ink-900); text-decoration: none; }
.watch-card .watch-poster { grid-column: 1 / -1; box-shadow: 0 10px 24px -14px rgba(70, 48, 36, 0.45); transition: translate 0.25s, box-shadow 0.25s; }
.watch-card:hover .watch-poster { translate: 0 -2px; box-shadow: var(--shadow-lift); }
.watch-card__text { display: grid; gap: 4px; min-width: 0; }
.watch-card__title { font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.2; }
.watch-card__meta { color: var(--ink-500); font-size: 13px; }
.watch-card__meta.is-wine { color: var(--wine); font-weight: 600; }
.watch-card .watch-status { margin-top: 3px; }

.watch-soon { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.watch-soon a { display: grid; gap: 6px; height: 100%; box-sizing: border-box; padding: 14px 16px; border: 1px dashed #D6CFC2; border-radius: 14px; background: rgba(245, 244, 241, 0.7); color: var(--ink-900); text-decoration: none; }
.watch-soon a:hover { border-color: var(--ink-300); background: var(--paper); }
.watch-soon__title { font-family: var(--serif); font-size: 18px; line-height: 1.25; }

/* Courses. */
.watch-courses { display: flex; flex-wrap: wrap; gap: 18px; }
.watch-course-card {
  --t1: #DCE6CC; --t2: #C5D2B0;
  flex: 2 1 460px; display: grid; gap: 16px; padding: 28px; border-radius: 24px;
  background: linear-gradient(160deg, var(--t1), var(--t2)); color: var(--ink-900); text-decoration: none;
  box-shadow: 0 14px 34px -20px rgba(62, 50, 30, 0.6); transition: translate 0.25s, box-shadow 0.25s;
}
.watch-course-card:hover { translate: 0 -2px; box-shadow: var(--shadow-lift); }
.watch-course-card .watch-mono { color: rgba(27, 23, 19, 0.72); }
.watch-course-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.watch-course-card__he { font-family: var(--hebrew); font-size: 44px; font-weight: 700; line-height: 1; }
.watch-course-card__name { font-family: var(--serif-display); font-size: 38px; font-weight: 500; line-height: 1; }
.watch-course-card__stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: rgba(27, 23, 19, 0.8); }
.watch-course-card__progress { display: flex; align-items: center; gap: 14px; }
.watch-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 6px; background: rgba(27, 23, 19, 0.12); }
.watch-bar span { display: block; height: 100%; border-radius: 6px; background: #4A5A36; }
.watch-courses__more { flex: 1 1 260px; display: grid; align-content: space-between; gap: 14px; padding: 28px; border: 1px solid var(--fill); border-radius: 24px; background: var(--card); }
.watch-courses__more p { margin: 0; color: var(--ink-700); font-size: 15px; line-height: 1.5; }
.watch-courses__more .watch-courses__more-title { color: var(--ink-900); font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.1; }
.watch-courses__more a { color: var(--wine); font-size: 15px; font-weight: 600; text-decoration: none; }

.watch-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.watch-how li { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 1px solid var(--fill); border-radius: 18px; background: var(--paper); }
.watch-how span { display: grid; gap: 4px; color: var(--ink-700); font-size: 14px; line-height: 1.45; }
.watch-how b { color: var(--ink-900); font-size: 16px; }

/* A course: its seder's colours, then its chapters. */
.watch-hero {
  --t1: #DCE6CC; --t2: #C5D2B0;
  display: flex; flex-wrap: wrap; gap: 28px; padding: clamp(22px, 4vw, 36px); border-radius: 30px;
  background: linear-gradient(160deg, var(--t1), var(--t2)); box-shadow: 0 18px 40px -24px rgba(62, 50, 30, 0.6);
}
.watch-hero .watch-mono { color: rgba(27, 23, 19, 0.75); }
.watch-hero__main { flex: 3 1 420px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.watch-hero__main h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 0; font-family: var(--serif-display); font-size: clamp(44px, 6vw, 64px); font-weight: 500; line-height: 1; letter-spacing: -0.015em; }
.watch-hero__he { font-family: var(--hebrew); font-size: 0.66em; font-weight: 700; }
.watch-hero__blurb { max-width: 600px; margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; color: rgba(27, 23, 19, 0.86); }
.watch-hero__stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: 15px; color: rgba(27, 23, 19, 0.82); }
.watch-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.watch-hero .button--ghost { background: rgba(255, 255, 255, 0.82); }
.watch-hero__side { flex: 2 1 280px; display: grid; gap: 16px; align-content: start; padding: 22px; border-radius: 22px; background: rgba(255, 255, 255, 0.88); }
.watch-hero__ring { display: flex; align-items: center; gap: 16px; }
.watch-hero__ring > span { display: grid; gap: 2px; }
.watch-hero__ring b { font-family: var(--serif); font-size: 23px; font-weight: 500; }
.watch-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; margin: 0; padding: 0; list-style: none; color: var(--ink-700); font-size: 13px; }
.watch-legend li { display: flex; align-items: center; gap: 8px; }
.watch-hero__side .watch-chip { justify-content: center; }

.watch-perek { display: grid; gap: 16px; }
.watch-perek__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; padding-bottom: 12px; border-bottom: 1px solid #E8D9B8; }
.watch-perek__head h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 500; }
.watch-perek__gloss { margin: 6px 0 0; font-family: var(--serif); font-size: 17px; font-style: italic; color: var(--ink-500); }
.watch-rows { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--fill); border-radius: 22px; background: var(--paper); list-style: none; }
.watch-rows li + li { border-top: 1px solid var(--fill); }
.watch-rows li.is-current { background: #FBF7F5; }
.watch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; padding: 18px 22px; color: var(--ink-900); text-decoration: none; }
.watch-row:hover { background: rgba(245, 244, 241, 0.6); }
.watch-row__thumb { flex: none; width: 192px; }
.watch-row__thumb .watch-poster { border-radius: 12px; }
.watch-row__text { flex: 1 1 300px; display: grid; gap: 6px; min-width: 0; }
.watch-row__title { display: flex; align-items: baseline; gap: 12px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; }
.watch-row__hint { font-family: var(--serif); font-size: 16px; line-height: 1.45; color: var(--ink-500); }
.watch-row__meta { color: var(--ink-500); font-size: 13px; }
.watch-row__end { flex: none; display: flex; align-items: center; gap: 12px; }
.watch-row__left { color: var(--wine); font-size: 13px; font-weight: 600; }
.watch-pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--wine); color: #fff; font-size: 14px; font-weight: 600; }
.watch-rows li.is-soon .watch-row__thumb { width: 120px; }
.watch-rows li.is-soon .watch-row { opacity: 0.85; }
.watch-rest { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px; border: 1px solid var(--fill); border-radius: 20px; background: var(--card); }
.watch-rest p { margin: 0; color: var(--ink-700); font-size: 15px; }
.watch-rest .watch-rest__title { margin-bottom: 4px; color: var(--ink-900); font-family: var(--serif); font-size: 24px; font-weight: 500; }
.watch-none { display: grid; gap: 14px; justify-items: start; padding: 32px; border-radius: 24px; background: var(--card); }
.watch-none h1 { margin: 0; font-family: var(--serif-display); font-size: 36px; font-weight: 500; }

/* A lesson: the film and what it explains, the parts beside it. 560px of
   film keeps the rail (and the read-along in it) beside the film from a
   1280px window with the sidebar open; narrower, the rail wraps under it. */
.watch-lesson { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }
.watch-lesson__main { flex: 999 1 560px; display: grid; gap: 18px; min-width: 0; }
.watch-lesson__rail { flex: 1 1 320px; max-width: 420px; display: grid; gap: 22px; min-width: 0; }
/* 16:9, but a gate with more to say than fits (a phone) makes it taller rather than clipping. */
.watch-player { display: grid; min-width: 0; border-radius: 18px; background: #1B1713; box-shadow: var(--shadow-lift); aspect-ratio: 16 / 9; }
/* min-width 0: with aspect-ratio, a taller gate would otherwise widen the
   player (the ratio carries its height over to a minimum width). */
.watch-player[hidden] { display: none; }
.watch-player video { display: block; width: 100%; height: 100%; border-radius: 18px; background: #1B1713; }
.watch-player video::cue { background: rgba(27, 23, 19, 0.8); color: #fff; font-family: var(--sans); font-size: 0.95em; }
/* No overflow clip on the gate itself (that would stop it growing): the
   blurred poster is clipped on its own, the overlay rounded to match. */
.watch-gate { position: relative; display: grid; min-width: 0; border-radius: 18px; }
.watch-gate__poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; clip-path: inset(0 round 18px); }
.watch-gate__body { border-radius: 18px; }
.watch-gate.is-dim .watch-gate__poster { filter: blur(3px); scale: 1.04; }
.watch-gate__body {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(27, 23, 19, 0.05), rgba(27, 23, 19, 0.45));
}
.watch-gate.is-dim .watch-gate__body { background: rgba(27, 23, 19, 0.64); }
.watch-gate.is-wine .watch-gate__body { background: linear-gradient(160deg, rgba(58, 24, 16, 0.92), rgba(27, 23, 19, 0.86)); }
.watch-gate__body p { max-width: 440px; margin: 0; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, 0.9); }
.watch-gate__body .watch-gate__title { color: #fff; font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); font-weight: 500; line-height: 1.1; }
.watch-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px !important; }
.watch-gate__primary { background: #fff; border-color: #fff; color: var(--wine); font-weight: 700; }
.watch-gate__secondary { background: transparent; border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.watch-gate__secondary:hover { background: rgba(255, 255, 255, 0.12); }
.watch-gate__pill { padding: 6px 14px; border-radius: 999px; background: rgba(27, 23, 19, 0.8); color: #fff; font-size: 13.5px; font-weight: 600; max-width: 90%; }

/* Left to right on Hebrew pages too: it sits under the player's own timeline. */
.watch-parts { display: flex; gap: 4px; margin: -6px 0 0; padding: 0; list-style: none; direction: ltr; }
.watch-parts li { flex: 1 1 0; min-width: 0; container-type: inline-size; }
/* A part too short for its name keeps only its bar (the rail names them all). */
@container (max-width: 62px) { .watch-parts__label { visibility: hidden; } }
.watch-parts button { display: grid; gap: 6px; width: 100%; padding: 6px 0; border: 0; background: none; color: var(--ink-500); font: inherit; font-size: 11.5px; text-align: start; cursor: pointer; }
.watch-parts__bar { display: block; height: 5px; overflow: hidden; border-radius: 3px; background: var(--fill); transition: height 0.2s; }
.watch-parts__bar span { display: block; height: 100%; background: var(--wine); }
.watch-parts__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-parts button:hover .watch-parts__bar, .watch-parts button[aria-current] .watch-parts__bar { height: 7px; }
.watch-parts button[aria-current] { color: var(--wine); font-weight: 600; }

.watch-lesson__title { display: grid; gap: 10px; }
.watch-lesson__title > * { margin: 0; }
.watch-lesson__title h1 { font-family: var(--serif-display); font-size: clamp(30px, 3.6vw, 38px); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; }
.watch-lesson__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.watch-lesson__tools [aria-pressed="true"] { border-color: var(--wine); color: var(--wine); }
.watch-learned { display: inline-flex; align-items: center; gap: 6px; color: #4A5A36; font-size: 14px; font-weight: 600; }

.watch-read { display: grid; gap: 12px; padding: 20px 24px; border: 1px solid var(--fill); border-radius: 20px; background: var(--card); }
.watch-read__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.watch-read__head p { margin: 0; }
.watch-read__text { display: grid; gap: 12px; }
.watch-read__text .unit__he { margin: 0; }
.watch-read__text .unit__en { margin: 0; }
.watch-read__frame p { margin: 0; }
.watch-read__q { margin-top: 6px !important; font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--ink-900); }
/* Beside the film, in the rail: the reader's 34px Hebrew would fill the
   column, so the words step down (as the Mac's and the iPad's column does)
   and the parts stay in sight under them. */
.watch-lesson__rail .watch-read { gap: 10px; padding: 16px 18px; }
.watch-lesson__rail .watch-read__text { gap: 10px; }
.watch-lesson__rail .watch-read__text .unit__he { font-size: 23px; line-height: 1.75; }
.watch-lesson__rail .watch-read__text .unit__en { font-size: 16px; line-height: 1.55; }
.watch-lesson__rail .watch-read__q { font-size: 19px; }
.watch-ends { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; border: 1px dashed var(--gold); border-radius: 18px; background: #FCF7E8; color: var(--ink-700); font-size: 15px; }

.watch-rail-card { display: grid; gap: 4px; padding: 16px 12px; border: 1px solid var(--fill); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow-soft); }
.watch-rail-card h2, .watch-next h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 8px 8px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.watch-next h2 { margin-inline: 0; }
.watch-parts-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.watch-parts-list button {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 50px; padding: 9px 12px; border: 0; border-radius: 18px;
  background: transparent; color: var(--ink-900); font: inherit; font-size: 15px; line-height: 1.3; text-align: start; cursor: pointer;
  transition: background-color 0.25s, color 0.2s, box-shadow 0.25s;
}
.watch-parts-list button:hover:not([aria-current]) { background: var(--paper); box-shadow: var(--lens-shadow); }
.watch-parts-list button[aria-current] { background: var(--wine); box-shadow: var(--wine-shadow); color: var(--cream); }
.watch-parts-list .watch-mono { flex: none; width: 40px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.watch-parts-list button > span:last-child { display: grid; gap: 1px; }
.watch-parts-list b { color: var(--ink-500); font-size: 12px; font-weight: 600; }
.watch-parts-list button[aria-current] b { color: rgba(244, 236, 218, 0.75); }
.watch-parts-list button[aria-current] .watch-mono { color: var(--gold-on-wine); }
.watch-next { display: grid; gap: 12px; }
.watch-next__item { display: flex; align-items: center; gap: 12px; color: var(--ink-900); text-decoration: none; }
.watch-next__thumb { flex: none; width: 136px; }
.watch-next__thumb .watch-poster { border-radius: 10px; }
.watch-next__thumb .watch-poster__ref { display: none; }
.watch-next__item > span:last-child { display: grid; gap: 3px; min-width: 0; }
.watch-next__ref { color: var(--ink-500); font-size: 12px; }
.watch-next__ref.is-wine { color: var(--wine); font-weight: 600; }
.watch-next__title { font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.watch-keys { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 14px 16px; border-radius: 16px; background: var(--card); color: var(--ink-700); font-size: 13px; }
.watch-keys kbd { padding: 1px 6px; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); font-family: var(--mono); font-size: 12px; }

/* When the film ends: the Mishnah Check in its place. */
.watch-check { overflow: hidden; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow-lift); }
.watch-check__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #1B1713; color: #fff; }
.watch-check__thumb { flex: none; width: 112px; overflow: hidden; border-radius: 8px; aspect-ratio: 16 / 9; }
.watch-check__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.watch-check__what { flex: 1; display: grid; gap: 2px; min-width: 0; }
.watch-check__what .watch-muted { color: rgba(255, 255, 255, 0.75); }
.watch-check__what b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.watch-check__again { background: transparent; border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.watch-check__body { min-height: 420px; padding: clamp(22px, 4vw, 36px) clamp(18px, 4vw, 40px); }
.watch-check__run { display: grid; gap: 14px; max-width: 760px; }
.watch-check__run .watch-mono { margin: 0; }
.watch-check__msg { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.watch-check__result { display: grid; justify-items: center; gap: 12px; padding-top: 16px; text-align: center; }
.watch-check__result > * { margin: 0; }
.watch-check__result h2 { font-family: var(--serif-display); font-size: clamp(30px, 4vw, 42px); font-weight: 500; line-height: 1.05; }
.watch-check__result > p:not(.watch-mono) { max-width: 520px; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--ink-700); }
.watch-check__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px !important; }

/* Learn pages: ▶ beside a mishnah with a film, and the course under a tractate's heading. */
.rows li.has-watch { position: relative; }
.rows li.has-watch > .row { padding-inline-end: 104px; }
.row__watch {
  position: absolute; top: 16px; inset-inline-end: 16px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  color: var(--wine); font-family: var(--sans); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none;
}
.row__watch:hover { border-color: var(--wine); }
.row__watch.is-started { border-color: transparent; background: #F7EFED; }
.watch-banner {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(160deg, #DCE6CC, #C5D2B0); color: var(--ink-900); font-family: var(--sans); text-decoration: none;
  transition: translate 0.25s, box-shadow 0.25s;
}
.watch-banner:hover { translate: 0 -1px; box-shadow: var(--shadow-soft); }
.watch-banner__play { flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; background: #fff; color: var(--wine); font-size: 15px; }
.watch-banner__body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.watch-banner__title { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.watch-banner__sub { color: #2F3A23; font-size: 14px; }
.watch-banner__go { flex: none; color: #3E4C2E; font-size: 14px; font-weight: 600; }

@media (max-width: 640px) {
  .watch-app__body { gap: 40px; margin-top: 24px; }
  .watch-continue { padding: 12px; gap: 18px; border-radius: 22px; }
  .watch-row { padding: 14px; gap: 12px 14px; }
  .watch-row__thumb { width: 128px; }
  .watch-row__title { font-size: 19px; }
  .watch-row__hint { display: none; }
  .watch-rows li.is-soon .watch-row__thumb { display: none; }
  .watch-parts__label { display: none; }
  .watch-read { padding: 16px; }
  .watch-gate__body { padding: 18px 14px; gap: 8px; }
  .watch-gate__body p { font-size: 14px; }
  .watch-banner__go { display: none; }
  .rows li.has-watch > .row { padding-inline-end: 16px; padding-bottom: 54px; }
  .row__watch { top: auto; bottom: 12px; }
}
