:root {
  --ink: #15333b;
  --ink-soft: #617479;
  --paper: #f8f5ee;
  --paper-deep: #eee8dd;
  --surface: #fffefa;
  --surface-raised: #ffffff;
  --line: rgba(23, 50, 59, 0.11);
  --brand: #173b44;
  --brand-soft: #285967;
  --gold: #c89b49;
  --gold-ink: #76521c;
  --gold-soft: #f2dfb9;
  --chumash: #3e6e91;
  --chumash-soft: #e3edf4;
  --tehillim: #b77d25;
  --tehillim-soft: #f6ead1;
  --tanya: #785f87;
  --tanya-soft: #eee7f2;
  --success: #32725d;
  --danger: #a74d45;
  --shadow-sm: 0 8px 24px rgba(21, 47, 55, 0.065);
  --shadow-md: 0 16px 38px rgba(21, 47, 55, 0.1);
  --shadow-lg: 0 28px 74px rgba(18, 43, 50, 0.2);
  --reader-size: 23px;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  color-scheme: light;
  font-family: "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
}

html[data-theme="dark"] {
  --ink: #edf4f2;
  --ink-soft: #aebfbc;
  --paper: #0f2025;
  --paper-deep: #13282e;
  --surface: #162b31;
  --surface-raised: #1a333a;
  --line: rgba(234, 244, 241, 0.11);
  --brand: #1d4a55;
  --brand-soft: #347081;
  --gold: #d5aa59;
  --gold-ink: #e4bd75;
  --gold-soft: #493d26;
  --chumash: #74a9d0;
  --chumash-soft: #203b4d;
  --tehillim: #e0ae57;
  --tehillim-soft: #463921;
  --tanya: #b497c2;
  --tanya-soft: #3b3042;
  --success: #67b298;
  --danger: #e58b83;
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-width: 300px;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.sheet-open {
  overflow: hidden;
}

button,
select,
input {
  font: inherit;
}

button,
a {
  -webkit-touch-callout: none;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(197, 151, 69, 0.08), transparent 26rem),
    var(--paper);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 13px;
  background: rgba(246, 242, 233, 0.9);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

html[data-theme="dark"] .app-header {
  background: rgba(15, 32, 37, 0.9);
}

.app-header.is-scrolled {
  border-bottom-color: var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 6px 16px rgba(17, 50, 59, 0.17);
}

.brand-block h1,
.brand-block p,
.section-heading h2,
.section-heading p,
.sheet-header h2,
.sheet-header p {
  margin: 0;
}

.brand-block h1 {
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.eyebrow {
  color: var(--gold-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.icon-button,
.round-button,
.date-arrow,
.refresh-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.icon-button svg,
.round-button svg,
.refresh-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

main {
  width: 100%;
}

.screen {
  display: none;
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 13px 18px calc(44px + env(safe-area-inset-bottom));
  animation: screen-in 260ms ease both;
}

.screen.is-active {
  display: block;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 280px;
  padding: 22px;
  color: #fffdf7;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.05), transparent 45%),
    linear-gradient(135deg, #245560 0%, #173b44 54%, #102f38 100%);
  border-radius: var(--radius-xl);
  box-shadow: 0 22px 54px rgba(17, 51, 60, 0.22);
}

.hero-card::after {
  content: "חת״ת";
  position: absolute;
  z-index: -1;
  inset-inline-start: -13px;
  bottom: -42px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 118px;
  font-weight: 900;
  letter-spacing: -0.12em;
  white-space: nowrap;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  display: block;
  border-radius: 50%;
  filter: blur(3px);
}

.hero-glow-one {
  width: 170px;
  height: 170px;
  inset-inline-end: -85px;
  top: -85px;
  background: rgba(213, 173, 95, 0.2);
}

.hero-glow-two {
  width: 110px;
  height: 110px;
  inset-inline-start: 18%;
  bottom: -75px;
  background: rgba(92, 159, 171, 0.17);
}

.date-navigation {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: start;
  gap: 9px;
}

.date-copy {
  text-align: center;
}

.date-copy p,
.date-copy h3 {
  margin: 0;
}

.date-copy p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.date-copy h3 {
  margin-top: 4px;
  font-size: clamp(25px, 7vw, 33px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.date-arrow {
  width: 38px;
  height: 38px;
  margin-top: 2px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 27px;
  line-height: 1;
}

.date-arrow:active,
.icon-button:active,
.round-button:active,
.refresh-button:active {
  transform: scale(0.95);
}

.today-link {
  margin-top: 8px;
  padding: 5px 10px;
  color: #f8e3b8;
  background: rgba(197, 151, 69, 0.13);
  border: 1px solid rgba(236, 194, 116, 0.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.daily-progress {
  display: grid;
  grid-template-columns: 98px 1fr;
  align-items: center;
  gap: 20px;
  margin-top: 27px;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  background: conic-gradient(#e9bb64 var(--progress), rgba(255, 255, 255, 0.12) 0);
  border-radius: 50%;
  box-shadow: 0 8px 28px rgba(5, 24, 29, 0.18);
  transition: background 450ms ease;
}

.progress-ring-inner {
  display: grid;
  place-content: center;
  width: 81px;
  height: 81px;
  text-align: center;
  background: #173b44;
  border-radius: 50%;
}

.progress-ring strong {
  font-size: 23px;
  line-height: 1;
}

.progress-ring span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.progress-message h3,
.progress-message p {
  margin: 0;
}

.progress-message h3 {
  margin-top: 9px;
  font-size: clamp(19px, 5vw, 24px);
  letter-spacing: -0.025em;
}

.progress-message p {
  max-width: 330px;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 13px;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.status-pill i {
  width: 6px;
  height: 6px;
  background: #6fd0a8;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(111, 208, 168, 0.1);
}

.status-pill.is-offline i {
  background: #e9b66d;
  box-shadow: 0 0 0 4px rgba(233, 182, 109, 0.1);
}

.streak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 17px 3px 25px;
}

.streak-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.streak-chip strong {
  font-size: 14px;
}

.flame {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff8e8;
  background: linear-gradient(145deg, #e0ad56, #b77924);
  border-radius: 9px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 3px;
  margin-bottom: 13px;
}

.section-heading h2 {
  margin-top: 2px;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.refresh-button {
  width: 38px;
  height: 38px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.refresh-button.is-loading svg {
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.study-list {
  display: grid;
  gap: 12px;
}

.study-card {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 116px;
  padding: 17px;
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.study-card:active {
  transform: scale(0.985);
  box-shadow: 0 4px 16px rgba(21, 47, 55, 0.08);
}

.study-card.is-complete {
  border-color: rgba(50, 114, 93, 0.28);
}

.study-monogram {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 19px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.chumash-card .study-monogram,
.study-intro[data-kind="chumash"] .study-monogram {
  color: var(--chumash);
  background: var(--chumash-soft);
}

.tehillim-card .study-monogram,
.study-intro[data-kind="tehillim"] .study-monogram {
  color: var(--tehillim);
  background: var(--tehillim-soft);
}

.tanya-card .study-monogram,
.study-intro[data-kind="tanya"] .study-monogram {
  color: var(--tanya);
  background: var(--tanya-soft);
}

.study-card-content {
  display: block;
  min-width: 0;
}

.study-card-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.study-card-topline strong {
  font-size: 19px;
  letter-spacing: -0.015em;
}

.duration {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.study-ref,
.study-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-ref {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 720;
}

.study-note {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.card-chevron {
  color: var(--ink-soft);
  font-family: Arial, sans-serif;
  font-size: 27px;
  opacity: 0.65;
}

.completion-mark {
  position: absolute;
  inset-inline-start: 10px;
  top: 10px;
  display: none;
  place-items: center;
  width: 23px;
  height: 23px;
  color: #fff;
  background: var(--success);
  border: 3px solid var(--surface);
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
}

.study-card.is-complete .completion-mark {
  display: grid;
  animation: check-pop 280ms cubic-bezier(.2, .9, .3, 1.3) both;
}

@keyframes check-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.daily-thought {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 17px 18px;
  background: linear-gradient(120deg, var(--gold-soft), rgba(197, 151, 69, 0.08));
  border: 1px solid rgba(197, 151, 69, 0.2);
  border-radius: var(--radius-lg);
}

.quote-mark {
  align-self: flex-start;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 0.8;
}

.daily-thought p,
.daily-thought span {
  margin: 0;
}

.daily-thought p {
  font-size: 14px;
  font-weight: 780;
}

.daily-thought div span {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.source-credit {
  margin: 18px 14px 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

/* Reader */
.study-screen {
  padding-top: 2px;
}

.study-screen.is-active ~ * .app-header,
body.reader-open .app-header {
  display: none;
}

.study-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin: 0 -18px;
  padding: calc(13px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(246, 242, 233, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .study-toolbar {
  background: rgba(15, 32, 37, 0.92);
}

.round-button {
  width: 41px;
  height: 41px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  font-size: 24px;
}

.study-toolbar-title {
  min-width: 0;
  text-align: center;
}

.study-toolbar-title p,
.study-toolbar-title h2 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-toolbar-title p {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.study-toolbar-title h2 {
  margin-top: 2px;
  font-size: 17px;
}

.study-intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 19px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.study-monogram.large {
  flex: 0 0 auto;
  width: 67px;
  height: 67px;
  border-radius: 21px;
  font-size: 34px;
}

.study-intro p,
.study-intro h3,
.study-intro div span {
  margin: 0;
}

.study-intro p {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.study-intro h3 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.35;
}

.study-intro div span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.reader-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.font-control,
.rashi-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
}

.font-control span,
.rashi-toggle > span:last-child {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
}

.font-control button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: var(--paper-deep);
  border: 0;
  border-radius: 9px;
  font-family: Georgia, serif;
  font-size: 14px;
}

.font-control .font-larger {
  font-size: 19px;
}

.rashi-toggle {
  cursor: pointer;
}

.rashi-toggle input,
.setting-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 41px;
  height: 24px;
  background: #aeb9b9;
  border-radius: 999px;
  transition: background 170ms ease;
}

.toggle-track i {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 170ms ease;
}

.rashi-toggle input:checked + .toggle-track,
.setting-check input:checked + .toggle-track {
  background: var(--success);
}

.rashi-toggle input:focus-visible + .toggle-track,
.setting-check input:focus-visible + .toggle-track {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.rashi-toggle input:checked + .toggle-track i,
.setting-check input:checked + .toggle-track i {
  transform: translateX(-17px);
}

.reader-state {
  display: grid;
  justify-items: center;
  padding: 70px 24px;
  text-align: center;
}

.reader-state h3,
.reader-state p {
  margin: 0;
}

.reader-state h3 {
  margin-top: 18px;
  font-size: 18px;
}

.reader-state p {
  max-width: 310px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.loader {
  width: 44px;
  height: 44px;
  border: 4px solid var(--paper-deep);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--danger);
  background: rgba(167, 77, 69, 0.1);
  border-radius: 17px;
  font-size: 24px;
  font-weight: 900;
}

.secondary-button {
  margin-top: 17px;
  padding: 10px 18px;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-weight: 800;
}

.reader-content {
  margin-top: 18px;
  padding: 3px 4px 20px;
  font-family: "Noto Serif Hebrew", "David Libre", David, serif;
  font-size: var(--reader-size);
  line-height: 1.85;
}

.text-group + .text-group {
  margin-top: 35px;
}

.text-group h3 {
  position: sticky;
  top: calc(69px + env(safe-area-inset-top));
  z-index: 5;
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 11px;
  color: var(--brand-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.4;
}

.text-paragraph {
  position: relative;
  margin: 0 0 15px;
  text-align: start;
}

.verse-block {
  margin: 0 0 22px;
}

.verse-block > .text-paragraph {
  margin-bottom: 0;
}

.verse-number {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-inline-end: 7px;
  color: var(--gold-ink);
  background: rgba(197, 151, 69, 0.1);
  border-radius: 7px;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.13em;
}

.verse-commentary {
  position: relative;
  margin-top: 11px;
  padding: 13px 15px 15px;
  color: var(--ink);
  background: var(--chumash-soft);
  border: 1px solid rgba(62, 110, 145, 0.16);
  border-inline-start: 4px solid var(--chumash);
  border-radius: 15px;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: calc(var(--reader-size) * 0.84);
  line-height: 1.75;
}

.verse-commentary-label {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  color: #fff;
  background: var(--chumash);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.rashi-paragraph {
  margin: 9px 0 0;
}

.commentary-section {
  margin-top: 40px;
  padding: 22px 18px;
  background: var(--chumash-soft);
  border: 1px solid rgba(62, 110, 145, 0.16);
  border-radius: var(--radius-lg);
}

.commentary-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--chumash);
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 16px;
}

.commentary-heading span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: #fff;
  background: var(--chumash);
  border-radius: 10px;
  font-size: 15px;
}

.commentary-section .text-paragraph {
  font-size: calc(var(--reader-size) * 0.88);
  line-height: 1.75;
}

.commentary-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  padding: 14px;
  color: var(--ink-soft);
  background: var(--surface);
  border-radius: 14px;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 11px;
}

.commentary-loading .loader {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.study-actions {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 10px -3px calc(-15px + env(safe-area-inset-bottom));
  padding: 12px 3px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 75%, transparent);
}

.source-link {
  padding: 13px 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.complete-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, #2f7361, #245b50);
  border: 0;
  border-radius: 17px;
  box-shadow: 0 12px 28px rgba(38, 100, 83, 0.23);
  font-weight: 850;
}

.complete-button.is-complete {
  color: var(--success);
  background: var(--surface);
  border: 1px solid rgba(50, 114, 93, 0.25);
  box-shadow: none;
}

.complete-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  font-family: Arial, sans-serif;
}

.complete-button.is-complete .complete-icon {
  color: #fff;
  background: var(--success);
}

/* Settings */
.sheet-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(4, 20, 24, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-sheet {
  position: fixed;
  z-index: 100;
  inset-inline: 0;
  bottom: 0;
  width: min(100%, 620px);
  max-height: 86vh;
  margin-inline: auto;
  padding: 9px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--surface-raised);
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 240ms cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 16px;
  background: var(--line);
  border-radius: 999px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.sheet-header h2 {
  margin-top: 2px;
  font-size: 24px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 2px;
  border-top: 1px solid var(--line);
}

.setting-copy {
  display: block;
}

.setting-copy strong,
.setting-copy span {
  display: block;
}

.setting-copy strong {
  font-size: 14px;
}

.setting-copy span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.setting-row input[type="range"] {
  width: 125px;
  accent-color: var(--brand-soft);
}

.setting-row select {
  max-width: 135px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.setting-check {
  position: relative;
  cursor: pointer;
}

.cache-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  color: var(--danger);
  background: rgba(167, 77, 69, 0.06);
  border: 1px solid rgba(167, 77, 69, 0.14);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 790;
}

.settings-note {
  margin: 14px 10px 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 150;
  inset-inline: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: fit-content;
  max-width: calc(100% - 36px);
  margin-inline: auto;
  padding: 11px 16px;
  color: #fff;
  background: #18363e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
  animation: toast-in 220ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Visual refresh */
.app-shell {
  background:
    radial-gradient(circle at 100% 2%, rgba(197, 151, 69, 0.11), transparent 23rem),
    radial-gradient(circle at 0% 36%, rgba(62, 110, 145, 0.07), transparent 25rem),
    var(--paper);
}

.app-header {
  padding-block-end: 14px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}

html[data-theme="dark"] .app-header {
  background: rgba(15, 32, 37, 0.88);
}

.app-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(20, 46, 54, 0.07);
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(17, 50, 59, 0.2);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.icon-button,
.round-button,
.refresh-button,
.font-control button,
.complete-button,
.study-card {
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button {
  width: 46px;
  height: 46px;
  color: var(--brand);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

:where(button, a, select, input):focus-visible {
  outline: 3px solid rgba(197, 151, 69, 0.45);
  outline-offset: 3px;
}

.screen {
  padding-top: 16px;
}

.hero-card {
  min-height: 304px;
  padding: 23px 22px 24px;
  background:
    radial-gradient(circle at 16% 16%, rgba(244, 204, 126, 0.18), transparent 24%),
    radial-gradient(circle at 90% 96%, rgba(98, 170, 183, 0.16), transparent 34%),
    linear-gradient(142deg, #245d68 0%, #163d47 52%, #0d2e36 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  box-shadow: 0 25px 64px rgba(14, 46, 55, 0.25), inset 0 1px rgba(255, 255, 255, 0.08);
}

.hero-card::after {
  bottom: -45px;
  color: rgba(255, 255, 255, 0.045);
  font-size: 124px;
}

.date-navigation {
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: start;
  gap: 8px;
}

.date-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 58px;
  height: auto;
  margin: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

.date-arrow:active {
  transform: none;
}

.date-arrow-disc {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(3, 24, 29, 0.18), inset 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 160ms ease, background 180ms ease;
}

.date-arrow:active .date-arrow-disc {
  transform: scale(0.93);
  background: rgba(255, 255, 255, 0.19);
}

.date-arrow svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-arrow-caption {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0;
}

.date-copy p {
  margin-top: 6px;
  font-size: 12px;
}

.date-copy h3 {
  margin-top: 0;
  font-size: clamp(27px, 7.4vw, 35px);
}

.today-link {
  min-height: 30px;
  margin-top: 7px;
  padding: 5px 12px;
}

.daily-progress {
  grid-template-columns: 104px 1fr;
  gap: 21px;
  margin-top: 24px;
}

.progress-ring {
  width: 104px;
  height: 104px;
  padding: 7px;
  background: conic-gradient(#edbd64 var(--progress), rgba(255, 255, 255, 0.11) 0);
  box-shadow: 0 12px 32px rgba(4, 25, 31, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.progress-ring-inner {
  width: 90px;
  height: 90px;
  background: radial-gradient(circle at 32% 24%, #245560, #123640 72%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.progress-ring strong {
  font-size: 25px;
}

.progress-message h3 {
  font-size: clamp(20px, 5.2vw, 25px);
}

.status-pill {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.095);
}

.streak-row {
  margin: 18px 2px 28px;
}

.streak-chip {
  padding: 8px 12px 8px 9px;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow: 0 10px 25px rgba(20, 46, 54, 0.075);
}

.flame {
  width: 27px;
  height: 27px;
  background: linear-gradient(145deg, #e6b760, #b87724);
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(183, 121, 36, 0.22);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 25px;
}

.refresh-button {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.study-list {
  gap: 14px;
}

.study-card {
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: 64px minmax(0, 1fr) 38px;
  gap: 15px;
  min-height: 124px;
  padding: 18px 17px;
  background: var(--surface);
  border-radius: 26px;
  box-shadow: 0 12px 32px rgba(19, 47, 55, 0.075), inset 0 1px rgba(255, 255, 255, 0.65);
}

.study-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block: 17px;
  inset-inline-start: 0;
  width: 4px;
  background: var(--subject-color);
  border-radius: 999px 0 0 999px;
}

.study-card::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 150px;
  height: 150px;
  inset-inline-start: -78px;
  top: -82px;
  background: var(--subject-soft);
  border-radius: 50%;
  opacity: 0.45;
}

.chumash-card {
  --subject-color: var(--chumash);
  --subject-soft: var(--chumash-soft);
}

.tehillim-card {
  --subject-color: var(--tehillim);
  --subject-soft: var(--tehillim-soft);
}

.tanya-card {
  --subject-color: var(--tanya);
  --subject-soft: var(--tanya-soft);
}

.study-card:active {
  transform: scale(0.978);
}

.study-card.is-complete {
  border-color: rgba(50, 114, 93, 0.34);
  box-shadow: 0 10px 30px rgba(50, 114, 93, 0.1);
}

.study-monogram {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 21px;
  box-shadow: 0 9px 22px rgba(18, 47, 55, 0.08), inset 0 1px rgba(255, 255, 255, 0.5);
}

.study-card-topline strong {
  font-size: 20px;
}

.duration {
  padding: 4px 7px;
  background: var(--paper-deep);
  border-radius: 999px;
  font-size: 9px;
}

.study-ref {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.study-note {
  margin-top: 4px;
}

.card-chevron {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--subject-color);
  background: var(--subject-soft);
  border-radius: 13px;
  opacity: 0.9;
}

.card-chevron svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.completion-mark {
  inset-inline-start: auto;
  inset-inline-end: 12px;
  top: 10px;
  gap: 5px;
  width: auto;
  height: 26px;
  padding: 3px 8px 3px 5px;
  color: var(--success);
  background: var(--surface-raised);
  border: 1px solid rgba(50, 114, 93, 0.22);
  border-radius: 999px;
  font-size: 9px;
  box-shadow: 0 6px 16px rgba(50, 114, 93, 0.12);
}

.completion-mark i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-style: normal;
}

.daily-thought {
  margin-top: 22px;
  padding: 19px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.35), transparent 42%),
    linear-gradient(125deg, var(--gold-soft), rgba(197, 151, 69, 0.07));
  border-color: rgba(197, 151, 69, 0.24);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(159, 113, 39, 0.07);
}

.study-toolbar {
  padding-block: calc(12px + env(safe-area-inset-top)) 11px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  box-shadow: 0 8px 25px rgba(18, 44, 52, 0.055);
}

html[data-theme="dark"] .study-toolbar {
  background: rgba(15, 32, 37, 0.9);
}

.round-button {
  width: 44px;
  height: 44px;
  color: var(--brand-soft);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  border-radius: 16px;
}

.stroke-icon {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.study-intro {
  margin-top: 21px;
  padding: 20px;
  border-radius: 26px;
  box-shadow: var(--shadow-md);
}

.study-intro[data-kind="chumash"] {
  background: linear-gradient(110deg, var(--surface) 55%, var(--chumash-soft));
}

.study-intro[data-kind="tehillim"] {
  background: linear-gradient(110deg, var(--surface) 55%, var(--tehillim-soft));
}

.study-intro[data-kind="tanya"] {
  background: linear-gradient(110deg, var(--surface) 55%, var(--tanya-soft));
}

.study-monogram.large {
  width: 70px;
  height: 70px;
  border-radius: 23px;
  box-shadow: 0 10px 26px rgba(20, 47, 55, 0.1), inset 0 1px rgba(255, 255, 255, 0.55);
}

.reader-tools {
  margin-top: 13px;
  padding: 11px 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 47, 55, 0.05);
}

.font-control button {
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.reader-content {
  margin-inline: auto;
  padding: 7px 4px 24px;
  line-height: 1.92;
}

.text-group + .text-group {
  margin-top: 42px;
}

.text-group h3 {
  padding: 7px 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 6px 18px rgba(21, 47, 55, 0.06);
}

.verse-block {
  margin-bottom: 27px;
  padding: 0 3px 22px;
  border-bottom: 1px dashed var(--line);
}

.verse-block:last-child {
  border-bottom: 0;
}

.verse-number {
  min-width: 25px;
  height: 25px;
  margin-inline-end: 8px;
  background: var(--gold-soft);
  border: 1px solid rgba(197, 151, 69, 0.2);
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(159, 113, 39, 0.08);
  font-size: 10px;
}

.verse-commentary {
  margin-top: 13px;
  padding: 15px 16px 16px;
  background: linear-gradient(120deg, var(--chumash-soft), color-mix(in srgb, var(--surface) 88%, var(--chumash-soft)));
  border-color: rgba(62, 110, 145, 0.2);
  border-inline-start-width: 3px;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(48, 89, 120, 0.06);
}

.verse-commentary-label {
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 9px;
  box-shadow: 0 5px 12px rgba(62, 110, 145, 0.16);
}

.rashi-paragraph {
  margin-top: 10px;
  font-family: "Noto Serif Hebrew", "David Libre", David, serif;
}

.study-actions {
  margin-top: 15px;
  padding-top: 16px;
  background: linear-gradient(to top, var(--paper) 78%, transparent);
}

.complete-button {
  min-height: 55px;
  border-radius: 19px;
  box-shadow: 0 14px 30px rgba(38, 100, 83, 0.24), inset 0 1px rgba(255, 255, 255, 0.12);
}

.settings-sheet {
  padding-inline: 22px;
  border-radius: 34px 34px 0 0;
}

.setting-row {
  margin-top: 9px;
  padding: 16px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.setting-row + .setting-row {
  margin-top: 10px;
}

.cache-button {
  min-height: 47px;
  border-radius: 16px;
}

.toast {
  padding: 13px 17px;
  background: rgba(20, 51, 59, 0.96);
  border-radius: 16px;
}

.study-card.is-complete .completion-mark {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
}

.study-card.is-content-loading .study-monogram,
.study-card.is-content-loading .study-ref {
  animation: soft-pulse 1.25s ease-in-out infinite alternate;
}

.study-card.is-content-loading .study-ref {
  opacity: 0.58;
}

.hero-card.date-changed .date-copy {
  animation: date-refresh 260ms ease both;
}

@keyframes soft-pulse {
  from { opacity: 0.52; }
  to { opacity: 0.88; }
}

@keyframes date-refresh {
  from { opacity: 0.35; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) {
  .study-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 39px rgba(19, 47, 55, 0.11);
  }

  .date-arrow:hover .date-arrow-disc,
  .icon-button:hover,
  .round-button:hover,
  .refresh-button:hover {
    transform: translateY(-1px);
  }
}

@media (min-width: 620px) {
  .screen {
    padding-inline: 28px;
  }

  .home-screen {
    padding-top: 22px;
  }

  .hero-card {
    padding: 27px 34px;
  }

  .study-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .study-card {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 205px;
  }

  .study-card .study-monogram {
    width: 64px;
    height: 64px;
  }

  .study-card-topline {
    display: block;
  }

  .duration {
    display: block;
    margin-top: 4px;
  }

  .card-chevron {
    display: none;
  }

  .study-toolbar {
    margin-inline: -28px;
    padding-inline: 28px;
  }
}

@media (max-width: 360px) {
  .app-header {
    padding-inline: 14px;
  }

  .screen {
    padding-inline: 13px;
  }

  .hero-card {
    padding: 18px;
  }

  .daily-progress {
    grid-template-columns: 86px 1fr;
    gap: 14px;
  }

  .progress-ring {
    width: 86px;
    height: 86px;
  }

  .progress-ring-inner {
    width: 70px;
    height: 70px;
  }

  .study-card {
    grid-template-columns: 52px minmax(0, 1fr) 34px;
    gap: 11px;
    padding: 14px;
  }

  .study-monogram {
    width: 52px;
    height: 52px;
  }

  .date-navigation {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .date-arrow {
    width: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Direct navigation and an adjacent date picker. */
.quick-actions { margin:20px 0 0; }
.quick-actions .complete-button { width:100%; min-height:52px; }
.complete-button { font-family: Arial, sans-serif; font-weight:700; letter-spacing:0; }
.date-copy .date-picker-label { position:relative; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; margin-top:12px; padding:7px 12px; color:#fffdf7; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.28); border-radius:999px; font-size:12px; font-weight:700; cursor:pointer; }
.date-picker-label svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.date-picker-label:focus-within { outline:3px solid var(--gold); outline-offset:3px; }
.study-card { border-inline-start:4px solid var(--chumash); }
.tehillim-card { border-inline-start-color:var(--tehillim); }
.tanya-card { border-inline-start-color:var(--tanya); }
.date-arrow-disc { border-radius:16px; box-shadow:0 4px 12px #0002; }
.date-arrow-disc svg { stroke-width:2.4; }
.focus-reader { margin-block:12px; min-height:44px; }
.reading-focus .app-header, .reading-focus .study-intro, .reading-focus .reader-tools { display:none; }
.reader-content { max-width:720px; margin-inline:auto; }
.reading-focus .reader-content { box-shadow:none; border-color:transparent; }
.study-actions { flex-wrap:wrap; gap:12px; }
.study-actions { position:static; bottom:auto; margin:24px 0 0; padding:18px 3px; background:none; }
.study-actions button { min-height:48px; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline:3px solid var(--gold); outline-offset:4px; }

.backup-panel { border:1px solid var(--line); border-radius:var(--radius-md); padding:16px; margin-block:18px; background:var(--surface); display:grid; gap:10px; }
.backup-panel p { margin:0; color:var(--ink-soft); font-size:14px; line-height:1.6; }
.backup-panel label { color:var(--ink-soft); font-size:13px; }
.backup-panel textarea { width:100%; min-height:78px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); padding:10px; direction:ltr; text-align:left; resize:vertical; font-size:13px; }
.backup-actions { display:flex; gap:8px; flex-wrap:wrap; }
.backup-actions button { min-height:44px; flex:1; }
.source-attribution, .rashi-attribution { max-width:720px; margin:14px auto; color:var(--ink-soft); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.privacy-link { display:inline-block; padding:12px 0; color:var(--brand-soft); text-decoration:underline; }

.home-load-error { display:grid; gap:10px; margin-top:12px; padding:15px; background:var(--surface); border:1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius:var(--radius-md); }
.home-load-error p { margin:0; color:var(--danger); font-size:14px; line-height:1.55; }
.home-load-error .secondary-button { min-height:44px; justify-self:start; }
.quick-actions .complete-button:disabled, .study-card:disabled { opacity:.58; cursor:default; }
.date-arrow-caption { font-size:11px; }
.eyebrow { font-size:12px; }
.round-button, .secondary-button, .privacy-link { color:var(--ink); }

body.date-picker-open { overflow:hidden; }
.date-dialog { width:min(430px, calc(100% - 24px)); max-height:calc(100dvh - 32px); padding:22px; border:1px solid var(--line); border-radius:26px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-lg); }
.date-dialog::backdrop { background:rgba(7, 23, 29, .58); backdrop-filter:blur(4px); }
.date-dialog .sheet-header { margin:0 0 18px; }
.calendar-tabs { display:flex; gap:4px; padding:4px; margin-bottom:20px; border-radius:14px; background:var(--paper-deep); }
.calendar-tabs button { flex:1; min-height:42px; border:0; background:transparent; border-radius:11px; cursor:pointer; font-weight:700; }
.calendar-tabs button[aria-selected="true"] { background:var(--surface-raised); color:var(--ink); box-shadow:0 2px 7px #0001; }
.calendar-navigation { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:16px; }
.calendar-navigation .round-button { flex:0 0 42px; font-size:28px; }
.calendar-selects { display:flex; gap:4px; min-width:0; }
.calendar-selects select { min-width:0; max-width:110px; min-height:44px; border:0; border-radius:10px; padding:4px; background:var(--surface); color:var(--ink); font-weight:700; }
.calendar-weekdays, .calendar-grid { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:4px; }
.calendar-weekdays { text-align:center; margin-bottom:7px; color:var(--ink-soft); font-size:13px; }
.calendar-grid [role="row"] { display:contents; }
.calendar-grid button { min-height:44px; width:100%; border:1px solid transparent; border-radius:12px; background:transparent; cursor:pointer; font-size:16px; }
.calendar-grid button:hover { background:var(--paper-deep); }
.calendar-grid button[aria-current="date"] { border-color:var(--gold); color:var(--gold-ink); font-weight:700; }
.calendar-grid button[aria-selected="true"] { background:var(--brand); color:#fff; font-weight:700; }
.calendar-footer { border-top:1px solid var(--line); margin-top:18px; padding-top:16px; display:flex; align-items:center; gap:12px; }
.calendar-footer p { margin:0; color:var(--ink-soft); font-size:12px; line-height:1.5; }
.calendar-footer .secondary-button { min-height:42px; }
#gregorian-calendar { padding:10px 0 22px; }
#gregorian-calendar label { display:block; font-size:14px; margin-bottom:12px; }
#date-picker { width:100%; min-height:52px; background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:12px; }
.resume-reading { max-width:720px; margin:16px auto; padding:17px; background:var(--gold-soft); border:1px solid var(--line); border-radius:18px; }
.resume-reading p { margin:6px 0 12px; font-size:14px; line-height:1.5; color:var(--ink-soft); }
.resume-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.resume-actions button { min-height:44px; }
.text-button { border:0; background:transparent; text-decoration:underline; cursor:pointer; padding:8px; }
[data-reading-anchor] { scroll-margin-top:100px; }
.reading-highlight { background:var(--gold-soft); border-radius:10px; transition:background .3s; }
.commentary-error { border:1px solid var(--line); border-radius:16px; padding:16px; margin-top:20px; background:var(--paper); font-family:Arial, sans-serif; }
.commentary-error p { font-size:15px; line-height:1.6; margin:0 0 12px; color:var(--danger); }
@media (max-width:360px) { .date-dialog { padding:15px; } .calendar-grid, .calendar-weekdays { gap:1px; } .calendar-selects select { max-width:94px; font-size:14px; } }
