:root {
  color-scheme: light;
  --paper: #f7f1e7;
  --surface: #fffdf8;
  --surface-soft: #fbf7ef;
  --ink: #1f241e;
  --ink-soft: #384036;
  --muted: #75786f;
  --line: #e4dccd;
  --leaf: #285f48;
  --leaf-soft: #e3efe7;
  --gold: #b8893e;
  --lotus: #b76674;
  --sky: #dce9e7;
  --shadow-sm: 0 8px 22px rgba(40, 45, 35, 0.08);
  --shadow-md: 0 18px 46px rgba(40, 45, 35, 0.12);
  --radius: 8px;
  --font-scale: 1;
  --font-main: "IBM Plex Sans Thai", "Sukhumvit Set", "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f9f4ec 0%, #f1f5ed 58%, #f8f0e5 100%);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: calc(16px * var(--font-scale));
  font-weight: 400;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.reader-scroll:focus-visible {
  outline: 3px solid rgba(184, 137, 62, 0.38);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid rgba(40, 95, 72, 0.13);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 28px;
}

.brand strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand small,
.date-line,
.section-kicker,
.muted,
.timer-ring small {
  color: var(--muted);
}

.brand small {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(40, 95, 72, 0.28);
  border-radius: 50%;
  background: #f8f1df;
  box-shadow: inset 0 0 0 7px rgba(40, 95, 72, 0.06);
}

.brand-mark span {
  display: block;
  width: 17px;
  height: 25px;
  border-radius: 18px 18px 4px 4px;
  background: linear-gradient(160deg, var(--leaf), var(--gold));
  clip-path: polygon(50% 0%, 81% 30%, 69% 100%, 50% 87%, 31% 100%, 19% 30%);
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-tab {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #667066;
  text-align: left;
}

.nav-tab.is-active {
  border-color: rgba(40, 95, 72, 0.18);
  background: var(--leaf);
  color: #fffdf8;
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: inherit;
  font-size: 1rem;
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 46px) 54px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(40, 95, 72, 0.14);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--leaf);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.legal-page {
  max-width: 840px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) clamp(18px, 4vw, 36px);
}

.legal-card {
  border: 1px solid rgba(40, 95, 72, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 5vw, 42px);
}

.legal-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.06;
}

.legal-card h2 {
  margin: 28px 0 8px;
  font-size: 1.18rem;
}

.legal-card p,
.legal-card li {
  color: var(--ink-soft);
  line-height: 1.8;
}

.legal-card ul {
  padding-left: 1.25rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.legal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  color: var(--leaf);
  text-decoration: none;
}

.topbar,
.section-heading,
.reader-toolbar,
.mini-panel,
.history-item,
.uposatha-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 18px;
}

.date-line,
.section-kicker {
  margin: 0 0 7px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.12;
}

h2 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.18;
}

h3 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.28;
}

.muted {
  line-height: 1.72;
}

.top-actions,
.reader-actions,
.timer-actions,
.primary-actions,
.chip-row,
.mood-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.icon-button,
.mode-button,
.chip,
.duration-button,
.mood-button,
.primary-button,
.secondary-button {
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 6px 14px rgba(40, 45, 35, 0.06);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 600;
}

.primary-button {
  border-color: var(--leaf);
  background: var(--leaf);
  color: #fffdf8;
  box-shadow: 0 13px 30px rgba(40, 95, 72, 0.22);
}

.secondary-button {
  background: rgba(255, 253, 248, 0.86);
}

.secondary-button.on-hero {
  border-color: rgba(255, 253, 248, 0.4);
  background: rgba(255, 253, 248, 0.18);
  color: #fffdf8;
  backdrop-filter: blur(14px);
}

.small-button {
  min-height: 40px;
  padding-inline: 13px;
  font-size: 0.94rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.install-button {
  min-height: 42px;
  padding-inline: 14px;
}

.view {
  display: none;
}

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

.today-hero {
  position: relative;
  min-height: 510px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(40, 95, 72, 0.14);
  border-radius: var(--radius);
  background: #312b21;
  box-shadow: var(--shadow-md);
}

.today-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(21, 25, 19, 0.78) 0%, rgba(21, 25, 19, 0.54) 34%, rgba(21, 25, 19, 0.08) 72%),
    linear-gradient(0deg, rgba(21, 25, 19, 0.22), transparent 44%);
  pointer-events: none;
}

.today-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.today-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: min(520px, 52%);
  min-height: 510px;
  padding: 48px;
  color: #fffdf8;
}

.today-hero-copy .section-kicker {
  color: rgba(255, 253, 248, 0.78);
}

.today-hero-copy h2 {
  font-size: 2.56rem;
  font-weight: 700;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.today-hero-copy p {
  max-width: 450px;
  margin: 18px 0 0;
  color: rgba(255, 253, 248, 0.82);
  line-height: 1.74;
}

.daily-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(184, 137, 62, 0.22);
  border-radius: var(--radius);
  background: rgba(252, 246, 234, 0.88);
  color: #5a4420;
  font-size: 0.9rem;
  font-weight: 600;
}

.today-hero .meta-badge {
  border-color: rgba(255, 253, 248, 0.28);
  background: rgba(255, 253, 248, 0.16);
  color: #fff8e7;
  backdrop-filter: blur(12px);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.start-section {
  margin: 22px 0 16px;
}

.routine-section {
  margin: 22px 0 14px;
}

.compact-heading {
  margin-bottom: 12px;
}

.compact-heading h2 {
  font-size: 1.54rem;
}

.routine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.routine-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(40, 95, 72, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.05);
}

.routine-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--routine-accent, var(--leaf));
}

.routine-card.is-active {
  border-color: color-mix(in srgb, var(--routine-accent, var(--leaf)) 48%, transparent);
  background: #fffdfa;
  box-shadow: 0 13px 28px rgba(40, 45, 35, 0.09);
}

.routine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--routine-accent, var(--leaf)) 14%, white);
  color: var(--routine-accent, var(--leaf));
  font-size: 0.84rem;
  font-weight: 700;
}

.routine-card strong {
  font-size: 1.08rem;
  line-height: 1.32;
}

.routine-card span:not(.routine-badge),
.routine-card small {
  color: var(--muted);
  line-height: 1.58;
}

.quick-card,
.prayer-card,
.uposatha-item,
.history-item {
  border: 1px solid rgba(40, 95, 72, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
}

.quick-card,
.prayer-card {
  display: grid;
  gap: 10px;
  min-height: 134px;
  padding: 16px;
  text-align: left;
}

.quick-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.05);
}

.quick-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--card-accent, rgba(40, 95, 72, 0.3));
}

.quick-card strong,
.prayer-card strong {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
}

.quick-card span,
.prayer-card span,
.uposatha-item span,
.history-item span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  line-height: 1.55;
}

.mini-panel {
  min-height: 78px;
  padding: 17px 18px;
  border: 1px solid rgba(40, 95, 72, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.share-calm-button {
  border-color: rgba(184, 137, 62, 0.28);
  color: var(--leaf);
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.05);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.chip-row {
  margin-bottom: 16px;
}

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
}

.chip,
.status-chip,
.duration-button,
.mood-button,
.mode-button {
  min-height: 38px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.8);
  font-weight: 600;
}

.chip.is-active,
.status-chip.is-active,
.duration-button.is-active,
.mood-button.is-active,
.mode-button.is-active {
  border-color: rgba(40, 95, 72, 0.62);
  background: var(--leaf-soft);
  color: var(--leaf);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(40, 95, 72, 0.1);
  color: inherit;
  font-size: 0.82rem;
}

.release-safe-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(40, 95, 72, 0.14);
  border-radius: var(--radius);
  background: rgba(227, 239, 231, 0.74);
  color: var(--ink-soft);
  line-height: 1.55;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  color: var(--leaf);
  font-weight: 700;
}

.prayer-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.prayer-list {
  display: grid;
  gap: 10px;
}

.prayer-card {
  min-height: 112px;
  border-left: 4px solid transparent;
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.04);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(40, 95, 72, 0.1);
  color: var(--leaf);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-excerpt {
  background: rgba(184, 137, 62, 0.14);
  color: #7a5a25;
}

.status-variant,
.status-unknown {
  background: rgba(183, 102, 116, 0.13);
  color: #9b4f5c;
}

.status-intention {
  background: rgba(81, 127, 134, 0.13);
  color: #406c72;
}

.empty-state {
  min-height: 96px;
}

.prayer-card.is-active {
  border-left-color: var(--leaf);
  background: #f2f8f2;
}

.reader,
.timer-panel,
.reflection-panel,
.wish-panel,
.uposatha-hero {
  border: 1px solid rgba(40, 95, 72, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-sm);
}

.reader {
  min-height: 620px;
  padding: 18px;
  scroll-margin-top: 18px;
}

.reader.is-updated {
  animation: reader-focus-pulse 850ms ease;
}

@keyframes reader-focus-pulse {
  0% {
    border-color: rgba(184, 137, 62, 0.52);
    box-shadow: 0 0 0 4px rgba(184, 137, 62, 0.14), var(--shadow-sm);
  }

  100% {
    border-color: rgba(40, 95, 72, 0.14);
    box-shadow: var(--shadow-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader.is-updated {
    animation: none;
  }

  .reader-scroll {
    scroll-behavior: auto !important;
  }
}

.reader-toolbar {
  margin-bottom: 12px;
}

.reader-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid rgba(40, 95, 72, 0.12);
  border-radius: var(--radius);
  background: rgba(248, 244, 235, 0.86);
}

.mode-button {
  border-color: transparent;
  min-height: 34px;
}

.routine-player {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(40, 95, 72, 0.13);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.8);
}

.routine-player[hidden] {
  display: none;
}

.routine-player-head,
.routine-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.routine-player h4 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.28;
}

.routine-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.routine-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(40, 95, 72, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink-soft);
  font-weight: 600;
}

.routine-step-pill span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(40, 95, 72, 0.1);
  color: var(--leaf);
  font-size: 0.78rem;
}

.routine-step-pill.is-active {
  border-color: rgba(40, 95, 72, 0.52);
  background: var(--leaf-soft);
  color: var(--leaf);
}

.reader-scroll {
  height: 500px;
  overflow: auto;
  padding: 18px 22px;
  border: 1px solid rgba(40, 95, 72, 0.12);
  border-radius: var(--radius);
  background: #fffdf8;
  scroll-behavior: smooth;
}

.chant-line {
  padding: 18px 0;
  border-bottom: 1px solid rgba(40, 95, 72, 0.1);
}

.chant-line:last-child {
  border-bottom: 0;
}

.chant-text {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.8;
}

.meaning-text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.source-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.chant-counter {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(184, 137, 62, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(184, 137, 62, 0.1), rgba(40, 95, 72, 0.07));
}

.counter-stats {
  display: grid;
  gap: 10px;
}

.counter-stats > div:first-child {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: end;
}

.counter-kicker {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.counter-stats strong {
  grid-row: span 2;
  color: var(--leaf);
  font-size: 2.7rem;
  line-height: 1;
}

.counter-stats small {
  color: var(--muted);
  font-size: 0.95rem;
}

.counter-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(40, 95, 72, 0.12);
}

.counter-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--gold));
  transition: width 180ms ease;
}

.counter-targets,
.counter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.counter-target {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(40, 95, 72, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.74);
  color: var(--ink-soft);
  font-weight: 600;
}

.counter-target.is-active {
  border-color: rgba(184, 137, 62, 0.62);
  background: rgba(184, 137, 62, 0.16);
  color: #70511c;
}

.meditation-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1fr) minmax(250px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.timer-panel,
.reflection-panel {
  padding: 22px;
}

.timer-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.timer-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(280px, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 59%, transparent 60%),
    conic-gradient(var(--leaf) var(--progress, 0deg), rgba(40, 95, 72, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(40, 95, 72, 0.12), 0 16px 36px rgba(40, 95, 72, 0.1);
}

.timer-ring span {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-ring small {
  margin-top: 10px;
  font-weight: 600;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.duration-button {
  width: 100%;
}

.timer-actions {
  justify-content: center;
}

.reflection-panel {
  display: grid;
  gap: 14px;
}

.reflection-note textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  line-height: 1.65;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.history-item {
  min-height: 76px;
  padding: 13px 14px;
}

.wish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wish-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 172px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(40, 95, 72, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.84);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.04);
}

.wish-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--wish-accent, var(--leaf));
}

.wish-card.is-active {
  border-color: color-mix(in srgb, var(--wish-accent, var(--leaf)) 46%, transparent);
  background: #fffdfa;
  box-shadow: 0 12px 28px rgba(40, 45, 35, 0.08);
}

.wish-card-symbol,
.wish-symbol,
.wish-history-symbol {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--wish-accent, var(--leaf)) 14%, white);
  color: var(--wish-accent, var(--leaf));
}

.wish-card-symbol {
  width: 38px;
  height: 38px;
  font-size: 1.12rem;
  font-weight: 700;
}

.wish-card strong {
  font-size: 1.08rem;
  font-weight: 700;
}

.wish-card span:last-child {
  color: var(--muted);
  line-height: 1.58;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.wish-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.wish-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wish-symbol {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  font-size: 1.42rem;
  font-weight: 700;
}

.wish-block,
.wish-action {
  padding: 16px;
  border: 1px solid rgba(40, 95, 72, 0.12);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.78);
}

.wish-block p:last-child,
.wish-action h3,
.wish-action p:last-child {
  margin-bottom: 0;
}

.wish-block p:last-child {
  margin-top: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.wish-note {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 600;
}

.wish-note textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  line-height: 1.65;
}

.wish-action h3 {
  margin-top: 0;
}

.wish-action .muted {
  margin-top: 10px;
}

.wish-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.wish-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(40, 95, 72, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.04);
}

.wish-history-symbol {
  width: 36px;
  height: 36px;
}

.wish-history-item strong,
.wish-history-item span,
.wish-history-item small {
  display: block;
}

.wish-history-item span,
.wish-history-item small {
  color: var(--muted);
  line-height: 1.52;
}

.uposatha-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 158px;
  margin-bottom: 16px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(40, 95, 72, 0.08), rgba(184, 137, 62, 0.15)),
    rgba(255, 253, 248, 0.84);
}

.moon-mark {
  display: grid;
  place-items: center;
  width: 106px;
  aspect-ratio: 1;
  border: 1px solid rgba(40, 95, 72, 0.15);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff8de 0 12%, transparent 13%),
    radial-gradient(circle at center, #efd58b, #b8893e);
  color: #573d14;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(184, 137, 62, 0.18);
}

.uposatha-list {
  display: grid;
  gap: 10px;
}

.uposatha-item {
  min-height: 76px;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(40, 45, 35, 0.04);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid rgba(40, 95, 72, 0.18);
  border-radius: var(--radius);
  background: rgba(31, 36, 30, 0.94);
  color: #fffdf8;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.privacy-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(720px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid rgba(40, 95, 72, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.privacy-notice strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.96rem;
}

.privacy-notice p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.privacy-notice-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.privacy-notice-actions a {
  color: var(--leaf);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

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

body.quiet-mode {
  background: #f7f1e7;
}

body.quiet-mode .today-hero-image {
  filter: saturate(0.7) brightness(0.84);
}

body.dark-mode {
  color-scheme: dark;
  --surface: #211f19;
  --surface-soft: #28251d;
  --ink: #f4ede0;
  --ink-soft: #ded2bf;
  --muted: #aaa193;
  --line: #3c3528;
  --leaf: #78c49b;
  --leaf-soft: #243a2e;
  --gold: #d3ad68;
  --lotus: #d38a96;
  --sky: #2b3936;
  --shadow-sm: 0 12px 28px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.36);
  background:
    radial-gradient(circle at 18% 0%, rgba(120, 196, 155, 0.12), transparent 26rem),
    linear-gradient(180deg, #17150f 0%, #1c1b15 55%, #12120f 100%);
  color: var(--ink);
}

body.dark-mode .rail {
  border-right-color: rgba(211, 173, 104, 0.13);
  border-top-color: rgba(211, 173, 104, 0.13);
  background: rgba(23, 21, 16, 0.88);
}

body.dark-mode .brand-mark {
  border-color: rgba(211, 173, 104, 0.24);
  background: #262318;
  box-shadow: inset 0 0 0 7px rgba(120, 196, 155, 0.07);
}

body.dark-mode .nav-tab {
  color: #b7ae9d;
}

body.dark-mode .nav-tab.is-active {
  border-color: rgba(120, 196, 155, 0.32);
  background: #234f3d;
  color: #f4ede0;
}

body.dark-mode .icon-button,
body.dark-mode .secondary-button,
body.dark-mode .quick-card,
body.dark-mode .routine-card,
body.dark-mode .prayer-card,
body.dark-mode .uposatha-item,
body.dark-mode .history-item,
body.dark-mode .mini-panel,
body.dark-mode .search-box,
body.dark-mode .chip,
body.dark-mode .status-chip,
body.dark-mode .duration-button,
body.dark-mode .mood-button,
body.dark-mode .reader,
body.dark-mode .timer-panel,
body.dark-mode .reflection-panel,
body.dark-mode .wish-panel,
body.dark-mode .wish-card,
body.dark-mode .wish-history-item {
  border-color: rgba(211, 173, 104, 0.14);
  background: rgba(33, 31, 25, 0.88);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

body.dark-mode .primary-button {
  border-color: #68b58c;
  background: #68b58c;
  color: #10140f;
  box-shadow: 0 16px 34px rgba(104, 181, 140, 0.14);
}

body.dark-mode .secondary-button.on-hero {
  border-color: rgba(244, 237, 224, 0.28);
  background: rgba(23, 21, 16, 0.42);
  color: #fff8e9;
}

body.dark-mode .today-hero {
  border-color: rgba(211, 173, 104, 0.16);
  background: #15120d;
}

body.dark-mode .today-hero::after {
  background:
    linear-gradient(90deg, rgba(13, 14, 11, 0.86) 0%, rgba(13, 14, 11, 0.62) 38%, rgba(13, 14, 11, 0.22) 76%),
    linear-gradient(0deg, rgba(13, 14, 11, 0.46), transparent 50%);
}

body.dark-mode .today-hero-image {
  filter: brightness(0.72) saturate(0.9);
}

body.dark-mode .meta-badge {
  border-color: rgba(211, 173, 104, 0.24);
  background: rgba(50, 44, 31, 0.9);
  color: #ead3a2;
}

body.dark-mode .today-hero .meta-badge {
  border-color: rgba(244, 237, 224, 0.22);
  background: rgba(23, 21, 16, 0.38);
  color: #fff2ca;
}

body.dark-mode .quick-card span,
body.dark-mode .prayer-card span,
body.dark-mode .uposatha-item span,
body.dark-mode .history-item span,
body.dark-mode .wish-card span:last-child,
body.dark-mode .wish-history-item span,
body.dark-mode .wish-history-item small {
  color: var(--muted);
}

body.dark-mode .chip.is-active,
body.dark-mode .status-chip.is-active,
body.dark-mode .duration-button.is-active,
body.dark-mode .mood-button.is-active,
body.dark-mode .mode-button.is-active,
body.dark-mode .prayer-card.is-active,
body.dark-mode .wish-card.is-active {
  border-color: rgba(120, 196, 155, 0.42);
  background: rgba(36, 58, 46, 0.9);
  color: #c8f1d9;
}

body.dark-mode .status-chip span {
  background: rgba(120, 196, 155, 0.12);
}

body.dark-mode .release-safe-note {
  border-color: rgba(120, 196, 155, 0.18);
  background: rgba(36, 58, 46, 0.72);
  color: var(--ink-soft);
}

body.dark-mode .text-button {
  border-color: rgba(120, 196, 155, 0.2);
  background: rgba(23, 21, 16, 0.72);
  color: #c8f1d9;
}

body.dark-mode .status-badge {
  background: rgba(120, 196, 155, 0.14);
  color: #c8f1d9;
}

body.dark-mode .status-excerpt {
  background: rgba(211, 173, 104, 0.16);
  color: #ead3a2;
}

body.dark-mode .status-variant,
body.dark-mode .status-unknown {
  background: rgba(211, 138, 150, 0.16);
  color: #f1b6bf;
}

body.dark-mode .status-intention {
  background: rgba(120, 196, 155, 0.1);
  color: #b9dcd2;
}

body.dark-mode .reader-modes {
  border-color: rgba(211, 173, 104, 0.12);
  background: rgba(23, 21, 16, 0.72);
}

body.dark-mode .mode-button {
  background: transparent;
}

body.dark-mode .routine-player {
  border-color: rgba(211, 173, 104, 0.14);
  background: rgba(23, 21, 16, 0.68);
}

body.dark-mode .routine-badge,
body.dark-mode .routine-step-pill span {
  background: color-mix(in srgb, var(--routine-accent, var(--leaf)) 24%, #17150f);
  color: color-mix(in srgb, var(--routine-accent, var(--leaf)) 74%, #f4ede0);
}

body.dark-mode .routine-step-pill {
  border-color: rgba(211, 173, 104, 0.14);
  background: rgba(33, 31, 25, 0.88);
  color: var(--ink-soft);
}

body.dark-mode .routine-step-pill.is-active,
body.dark-mode .routine-card.is-active {
  border-color: rgba(120, 196, 155, 0.42);
  background: rgba(36, 58, 46, 0.9);
  color: #c8f1d9;
}

body.dark-mode .reader-scroll,
body.dark-mode .reflection-note textarea,
body.dark-mode .wish-note textarea {
  border-color: rgba(211, 173, 104, 0.14);
  background: #17150f;
  color: var(--ink);
}

body.dark-mode .chant-line {
  border-bottom-color: rgba(211, 173, 104, 0.1);
}

body.dark-mode .chant-text,
body.dark-mode .wish-block p:last-child {
  color: var(--ink);
}

body.dark-mode .chant-counter {
  border-color: rgba(211, 173, 104, 0.18);
  background: linear-gradient(135deg, rgba(211, 173, 104, 0.1), rgba(104, 181, 140, 0.08));
}

body.dark-mode .counter-stats strong {
  color: #c8f1d9;
}

body.dark-mode .counter-progress {
  background: rgba(211, 173, 104, 0.14);
}

body.dark-mode .counter-target {
  border-color: rgba(211, 173, 104, 0.14);
  background: rgba(33, 31, 25, 0.78);
  color: var(--ink-soft);
}

body.dark-mode .counter-target.is-active {
  border-color: rgba(211, 173, 104, 0.48);
  background: rgba(211, 173, 104, 0.16);
  color: #f3deb3;
}

body.dark-mode .timer-ring {
  background:
    radial-gradient(circle at center, #211f19 0 59%, transparent 60%),
    conic-gradient(#68b58c var(--progress, 0deg), rgba(104, 181, 140, 0.16) 0);
  box-shadow: inset 0 0 0 1px rgba(211, 173, 104, 0.12), 0 18px 40px rgba(0, 0, 0, 0.28);
}

body.dark-mode .wish-card-symbol,
body.dark-mode .wish-symbol,
body.dark-mode .wish-history-symbol {
  background: color-mix(in srgb, var(--wish-accent, var(--leaf)) 22%, #17150f);
  color: color-mix(in srgb, var(--wish-accent, var(--leaf)) 74%, #f4ede0);
}

body.dark-mode .wish-block,
body.dark-mode .wish-action,
body.dark-mode .uposatha-hero {
  border-color: rgba(211, 173, 104, 0.14);
  background:
    linear-gradient(135deg, rgba(120, 196, 155, 0.07), rgba(211, 173, 104, 0.09)),
    rgba(33, 31, 25, 0.86);
}

body.dark-mode .moon-mark {
  border-color: rgba(211, 173, 104, 0.2);
  background:
    radial-gradient(circle at 35% 35%, #fff2c8 0 12%, transparent 13%),
    radial-gradient(circle at center, #d3ad68, #7a5a25);
  color: #20170b;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

body.dark-mode .toast {
  border-color: rgba(211, 173, 104, 0.18);
  background: rgba(244, 237, 224, 0.94);
  color: #17150f;
}

body.dark-mode .privacy-notice {
  border-color: rgba(211, 173, 104, 0.18);
  background: rgba(27, 25, 20, 0.96);
  color: #f7f1e7;
}

body.dark-mode .privacy-notice p {
  color: #bdb5a6;
}

body.dark-mode .privacy-notice-actions a {
  color: #d3ad68;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #7f7768;
}

@media (max-width: 1280px) {
  .meditation-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  }

  .meditation-layout > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 12;
    height: auto;
    padding: 8px 10px;
    border-top: 1px solid rgba(40, 95, 72, 0.14);
    border-right: 0;
  }

  .brand {
    display: none;
  }

  .nav-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    min-height: 58px;
    padding: 4px;
    text-align: center;
    font-size: 0.78rem;
  }

  .nav-tab.is-active {
    box-shadow: 0 8px 20px rgba(40, 95, 72, 0.18);
  }

  .content {
    padding-bottom: 98px;
  }

  .meditation-layout {
    grid-template-columns: 1fr;
  }

  .wish-layout {
    grid-template-columns: 1fr;
  }

  .prayer-workspace {
    grid-template-columns: 1fr;
  }

  .reader {
    min-height: 560px;
  }

  .history-strip,
  .routine-grid,
  .wish-history {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .content {
    padding-inline: 14px;
    padding-top: 18px;
  }

  .top-actions {
    width: 100%;
  }

  .install-button {
    flex: 1 1 calc(100% - 104px);
    min-width: 0;
    width: auto;
    padding-inline: 10px;
  }

  .top-actions .icon-button {
    flex: 0 0 42px;
  }

  .topbar,
  .section-heading,
  .mini-panel,
  .wish-panel-head,
  .uposatha-hero,
  .uposatha-item,
  .history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.86rem;
  }

  .today-hero {
    min-height: 470px;
  }

  .today-hero::after {
    background:
      linear-gradient(180deg, rgba(21, 25, 19, 0.28) 0%, rgba(21, 25, 19, 0.18) 30%, rgba(21, 25, 19, 0.78) 100%),
      linear-gradient(90deg, rgba(21, 25, 19, 0.38), transparent 66%);
  }

  .today-hero-image {
    object-position: 63% center;
  }

  .today-hero-copy {
    align-content: end;
    width: 100%;
    min-height: 470px;
    padding: 24px;
  }

  .today-hero-copy h2 {
    font-size: 1.84rem;
    line-height: 1.14;
  }

  .today-hero-copy p {
    max-width: 100%;
  }

  .routine-grid,
  .wish-grid,
  .duration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .primary-actions,
  .routine-actions,
  .timer-actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .mini-actions {
    width: 100%;
  }

  .wish-panel {
    padding: 16px;
  }

  .wish-history-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wish-history-item small {
    grid-column: 2;
  }

  .reader-scroll {
    height: 440px;
    padding: 14px;
  }

  .timer-ring span {
    font-size: 3.2rem;
  }

  .moon-mark {
    width: 86px;
  }

  .privacy-notice {
    right: 12px;
    bottom: 84px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    width: calc(100vw - 24px);
    padding: 13px;
  }

  .privacy-notice-actions {
    width: 100%;
    margin-left: 0;
  }

  .privacy-notice-actions a,
  .privacy-notice-actions .secondary-button {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }
}
