:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66706c;
  --page: #f7f3ea;
  --surface: #ffffff;
  --line: #ddd5c6;
  --green: #17453b;
  --green-2: #216454;
  --gold: #c79a43;
  --rose: #b4545b;
  --shadow: 0 18px 48px rgba(22, 37, 33, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 16px;
}

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

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell,
.auth-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 22px 18px 112px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  color: var(--green);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

.quiet-link {
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.brand-link {
  color: var(--green);
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 4px;
  background: #050505;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  left: 50%;
  top: 50%;
  border-radius: 1px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.brand-mark::before {
  width: 4px;
  height: 16px;
}

.brand-mark::after {
  width: 14px;
  height: 4px;
}

.welcome-panel,
.auth-panel,
.blessing-stage {
  margin-top: 30px;
}

.welcome-panel,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: clamp(24px, 7vw, 46px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--green);
  font-size: clamp(2.35rem, 10vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-panel h1 {
  max-width: 14ch;
  font-size: clamp(2rem, 8vw, 3.6rem);
}

.muted,
.welcome-panel p:not(.eyebrow) {
  max-width: 42rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.primary-action,
.secondary-action,
.share-button,
.get-blessings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  width: 100%;
  margin-top: 12px;
  padding: 0 20px;
}

.secondary-action {
  background: var(--green-2);
}

.primary-action:hover,
.secondary-action:hover,
.get-blessings:hover {
  filter: brightness(1.05);
}

.get-blessings:disabled {
  background: #9aa39f;
  cursor: not-allowed;
  filter: none;
}

.auth-form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.code-form {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

label {
  color: var(--green);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(33, 100, 84, 0.18);
  outline: 0;
}

[data-valmsg-for],
.field-validation-error {
  color: var(--rose);
  font-size: 0.9rem;
}

.notice {
  border: 1px solid rgba(180, 84, 91, 0.32);
  border-radius: 8px;
  margin: 20px 0;
  background: rgba(180, 84, 91, 0.09);
  color: #722f35;
  padding: 12px 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.notice.success {
  border-color: rgba(33, 100, 84, 0.28);
  background: rgba(33, 100, 84, 0.1);
  color: var(--green);
}

.notice ul {
  margin: 0;
  padding-left: 18px;
}

.blessing {
  border-top: 3px solid var(--gold);
  margin-top: 18px;
  padding-top: 22px;
}

.lection-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.7);
  object-fit: cover;
}

.scripture {
  color: var(--green);
  font-size: clamp(1.35rem, 4.8vw, 2.1rem);
  line-height: 1.35;
}

.message {
  border-left: 4px solid rgba(23, 69, 59, 0.28);
  margin-top: 26px;
  padding-left: 18px;
  color: #2f3936;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.66;
}

.blessing footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.blessing footer span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  padding: 6px 10px;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.share-button {
  min-height: 44px;
  border: 1px solid rgba(23, 69, 59, 0.22);
  background: #fff;
  color: var(--green);
  padding: 0 18px;
}

.share-status {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.notes-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 22px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.install-grid {
  display: grid;
  gap: 14px;
  margin: 24px 0 10px;
}

.install-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.install-card h2 {
  margin: 0 0 10px;
  color: var(--green);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.05rem;
}

.install-card ol {
  margin: 0;
  padding-left: 20px;
  color: #2f3936;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.is-ios .ios-install,
.is-android .android-install {
  border-color: rgba(199, 154, 67, 0.7);
  box-shadow: 0 0 0 3px rgba(199, 154, 67, 0.16);
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.history-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 16px;
  text-decoration: none;
}

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

.history-thumb {
  grid-row: span 4;
  width: 74px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.history-item strong {
  color: var(--green);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.history-item span {
  color: var(--muted);
  line-height: 1.45;
}

.history-date,
.history-item em {
  color: var(--rose);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 750;
}

.bottom-nav,
.public-bottom-action {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  border-top: 1px solid rgba(23, 69, 59, 0.14);
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(14px);
}

.quota-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 33, 30, 0.46);
}

.quota-modal {
  width: min(100%, 380px);
  border: 1px solid rgba(23, 69, 59, 0.16);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(20, 33, 30, 0.28);
  padding: 22px;
}

.quota-modal h2 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 1.2rem;
}

.quota-modal p {
  margin: 0 0 18px;
  color: var(--ink);
  line-height: 1.6;
}

.quota-modal .primary-action {
  width: 100%;
}

.bottom-nav {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.public-bottom-action {
  display: flex;
  justify-content: center;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
}

.nav-item,
.nav-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--green);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.nav-form {
  margin: 0;
}

.nav-form button {
  width: 100%;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.nav-item:not(.nav-form) {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.public-bottom-action .get-blessings {
  width: min(100%, 680px);
  min-height: 58px;
  box-shadow: 0 10px 28px rgba(23, 69, 59, 0.22);
}

@media (min-width: 720px) {
  .app-shell,
  .auth-shell {
    padding-top: 34px;
  }

  .welcome-panel,
  .auth-panel {
    margin-top: 72px;
  }

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