:root {
  --bg: #f8efe5;
  --surface: #fff9f2;
  --surface-strong: #fff;
  --line: #e8d5c2;
  --text: #342821;
  --muted: #6f5a4d;
  --primary: #c6784a;
  --primary-deep: #9c5432;
  --success: #4f8d69;
  --warn: #d3aa61;
  --soft-orange: #efc8a5;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
  background: radial-gradient(circle at 15% 10%, #fff5eb, transparent 35%),
    radial-gradient(circle at 80% 0%, #ffe8d2, transparent 30%),
    var(--bg);
  overflow-x: hidden;
}

.app-bg-glow {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}

.app-bg-glow-left {
  top: -18rem;
  left: -12rem;
  background: rgba(239, 200, 165, 0.42);
}

.app-bg-glow-right {
  top: -14rem;
  right: -14rem;
  background: rgba(215, 171, 117, 0.34);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(248, 239, 229, 0.78);
  border-bottom: 1px solid rgba(232, 213, 194, 0.6);
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.4rem;
}

.brand-link {
  text-decoration: none;
  color: var(--primary-deep);
  font-family: "Noto Serif TC", serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
  margin-right: 0.4rem;
}

.brand-link-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-link-with-logo i {
  font-size: 1.1rem;
}

.brand-logo-image {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.daily-brand-logo-image {
  width: 1.8rem;
  height: 1.8rem;
}

.daily-topbar-inner {
  justify-content: center;
  padding: 0.72rem 0.4rem;
}

.daily-brand-block {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.daily-brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-nav-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.top-nav a:hover {
  color: var(--primary-deep);
}

.top-nav-login {
  border: 1px solid rgba(156, 84, 50, 0.2);
  border-radius: 999px;
  padding: 0.42rem 0.92rem;
  background: linear-gradient(135deg, #fffaf5, #f5dfc8);
  color: var(--primary-deep) !important;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(156, 84, 50, 0.14);
}

.top-nav-login-compact {
  font-weight: 700;
}

.top-auth-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.avatar-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0;
  background: #fff7ef;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--primary-deep);
  font-weight: 700;
}

.user-menu {
  border-radius: 0.8rem;
  border-color: #ead3be;
}

.top-auth-link,
.top-auth-logout {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  text-decoration: none;
  font-weight: 600;
  background: #fff7ef;
  color: var(--muted);
}

.top-auth-logout {
  cursor: pointer;
}

.top-auth-link:hover,
.top-auth-logout:hover {
  color: var(--primary-deep);
}

.app-shell {
  padding-top: 1.4rem;
  padding-bottom: 2rem;
}

.app-shell.with-bottom-nav {
  padding-bottom: 6.2rem;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 249, 242, 0.93));
  box-shadow: 0 18px 36px rgba(112, 73, 38, 0.09);
  padding: 1.25rem;
}

.section-title {
  margin: 0;
  font-family: "Noto Serif TC", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.62rem;
}

.pill.success {
  color: #f3fff8;
  background: var(--success);
}

.pill.soft {
  color: #4f3d31;
  background: #f4e3d1;
}

.primary-btn {
  border: 0;
  border-radius: 0.9rem;
  padding: 0.68rem 1rem;
  color: #fff9f2;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 10px 22px rgba(165, 95, 58, 0.26);
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.62rem 0.9rem;
  color: var(--text);
  font-weight: 600;
  background: var(--surface-strong);
}

.field,
.field:focus {
  border-radius: 0.85rem;
  border-color: #d8bfa8;
  box-shadow: 0 0 0 0.15rem rgba(198, 120, 74, 0.18);
}

.alert-bubble {
  border-radius: 0.9rem;
  padding: 0.62rem 0.9rem;
  margin-bottom: 0.8rem;
  border: 1px solid;
}

.alert-bubble.success {
  background: #eaf7ef;
  border-color: #b8dcc8;
  color: #29543c;
}

.alert-bubble.error {
  background: #fff0ec;
  border-color: #efc2b5;
  color: #7e3f2f;
}

.alert-bubble.info {
  background: #fdf5e7;
  border-color: #ecd7b2;
  color: #6e5530;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 2.6rem;
  transform: translateX(-50%);
  width: min(92vw, 860px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 1rem;
  border: 1px solid rgba(222, 195, 167, 0.9);
  background: rgba(255, 250, 244, 0.92);
  box-shadow: 0 18px 32px rgba(121, 75, 44, 0.2);
  backdrop-filter: blur(10px);
  z-index: 30;
  overflow: hidden;
}

.bottom-nav-indicator {
  position: absolute;
  top: 0.45rem;
  left: 0;
  bottom: 0.45rem;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 8px 18px rgba(156, 84, 50, 0.18);
  transition: transform 0.28s ease, width 0.28s ease;
}

.bottom-nav-item {
  text-decoration: none;
  text-align: center;
  border-radius: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.2rem;
  position: relative;
  z-index: 1;
  transition: color 0.24s ease;
}

.bottom-nav-item.active {
  color: #fff9f2;
}

.reading-day-ref {
  color: var(--primary-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.daily-page-loading {
  position: fixed;
  left: 50%;
  bottom: 7.4rem;
  transform: translateX(-50%) translateY(8px);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(222, 195, 167, 0.88);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 12px 24px rgba(121, 75, 44, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 31;
}

.daily-page-loading.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.daily-page-loading-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 2px solid #e9d3bf;
  border-top-color: var(--primary-deep);
  animation: daily-spin 0.7s linear infinite;
}

.daily-page-loading-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-deep);
}

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

.reading-note-box {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 0.95rem;
  border: 1px solid #ead4bf;
  background: #fff8f0;
}

.reading-note-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.reading-note-body {
  color: var(--text);
  line-height: 1.7;
}

.reading-complete-banner-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.1rem;
}

.reading-complete-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #8c5334, #6f4127);
  color: #f8efe5;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 22px rgba(111, 65, 39, 0.18);
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 0.35rem;
}

.progress-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
}

.progress-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.progress-legend-chip {
  width: 46px;
  height: 26px;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.7rem;
  font-weight: 700;
}

.progress-legend-chip.book-marker {
  background: #5c4033;
  color: #fff;
}

.progress-legend-chip.completed {
  background: #5aa37a;
  color: #f5fff8;
}

.progress-legend-chip.pending {
  background: #dfbe92;
  color: #4f341d;
}

.progress-legend-chip.future-ready {
  background: #edd2ad;
  color: #5d452d;
}

.progress-legend-chip.future-empty {
  background: #f5ece2;
  color: #9f8978;
}

.progress-cell {
  aspect-ratio: 1;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 700;
}

.progress-cell.completed {
  background: #5aa37a;
  color: #f5fff8;
}

.progress-cell.future-ready {
  background: #edd2ad;
  color: #5d452d;
}

.progress-cell.future-empty {
  background: #f5ece2;
  color: #9f8978;
}

.progress-cell.pending {
  background: #dfbe92;
  color: #4f341d;
}

.progress-cell.pending-empty {
  background: #eee0d1;
  color: #866f5d;
}

.progress-cell.book-marker {
  background: #5c4033;
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  cursor: default;
  text-align: center;
  line-height: 1;
}

a.progress-cell {
  display: grid;
  place-items: center;
  text-decoration: none;
  aspect-ratio: 1;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.66rem;
  font-weight: 700;
}

a.progress-cell:hover {
  opacity: 0.85;
}

a.progress-cell.completed {
  background: #5aa37a;
  color: #f5fff8;
}

a.progress-cell.future-ready {
  background: #edd2ad;
  color: #5d452d;
}

a.progress-cell.pending {
  background: #dfbe92;
  color: #4f341d;
}

div.progress-cell.future-empty,
div.progress-cell.pending-empty {
  cursor: default;
}

.auth-wrap {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
}

.landing-hero {
  border: 1px solid rgba(222, 195, 167, 0.75);
  border-radius: 1.4rem;
  padding: 1.35rem;
  background: linear-gradient(140deg, rgba(255, 248, 238, 0.96), rgba(239, 200, 165, 0.35));
  box-shadow: 0 20px 36px rgba(112, 73, 38, 0.1);
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 960px) {
  .landing-hero {
    grid-template-columns: 1.1fr 1fr;
  }
}

.landing-kicker {
  margin: 0 0 0.5rem;
  color: var(--primary-deep);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.landing-hero h1 {
  margin: 0;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.landing-hero-image {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(209, 170, 133, 0.65);
  box-shadow: 0 16px 28px rgba(124, 80, 47, 0.12);
}

.landing-lead {
  margin: 1rem 0 1.4rem;
  max-width: 52rem;
  color: var(--muted);
  line-height: 1.75;
}

.landing-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-grid,
.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.landing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.about-hero {
  background: linear-gradient(145deg, rgba(255, 250, 243, 0.96), rgba(247, 227, 204, 0.55));
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .about-hero {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

.about-hero-image {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #ebd5bf;
}

.about-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.6;
}

.code-block {
  margin: 0;
  padding: 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid #e6d7c7;
  background: #fffaf4;
  color: #4a372b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.plan-card {
  border: 1px solid #ead4bf;
  border-radius: 1rem;
  padding: 0.95rem;
  background: #fff8f1;
}

.plan-progress-wrap {
  position: relative;
  height: 1.7rem;
  border-radius: 999px;
  background: #efdfcf;
  overflow: hidden;
}

.plan-progress-wrap.done {
  background: #d4e8db;
}

.plan-progress-bar {
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(120deg, var(--primary), var(--primary-deep));
}

.plan-progress-wrap.done .plan-progress-bar {
  background: linear-gradient(120deg, #6ab28a, #3f865f);
}

.plan-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #3f3229;
}

.scripture-picker-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  border: 1px solid #e2c9af;
  border-radius: 999px;
  padding: 0.4rem;
  background: #fff7ef;
}

.scripture-picker-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid #7a4a2e;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(140deg, #8a5636, #6b3f27);
  box-shadow: 0 8px 18px rgba(74, 44, 27, 0.26);
}

.scripture-picker-row {
  display: flex;
  justify-content: center;
}

.scripture-picker-inline .scripture-pill-segment {
  flex: 0 0 auto;
  min-width: 128px;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0.38rem 0.75rem;
  color: #fff;
  font-weight: 800;
}

.scripture-picker-inline .scripture-pill-segment + .scripture-pill-segment {
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.scripture-picker-inline .scripture-pill-caption {
  font-size: 0.66rem;
  opacity: 0.82;
}

.scripture-picker-inline strong {
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.recent-completion-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.recent-completion-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(132, 84, 52, 0.12);
}

.gender-radio-group {
  display: flex;
  gap: 0.55rem;
}

.gender-radio-btn {
  border: 1px solid #dec6af;
  border-radius: 999px;
  background: #fff7ef;
  color: #6a4a34;
  font-weight: 700;
  min-width: 68px;
  padding: 0.42rem 0.78rem;
}

.gender-radio-btn.active {
  background: linear-gradient(140deg, #c6784a, #9c5432);
  color: #fff;
  border-color: #9c5432;
}

.scripture-pill-segment {
  flex: 1 1 220px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  padding: 0.5rem 0.8rem;
  text-align: left;
}

.scripture-pill-caption {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.1rem;
}

.scripture-version-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.scripture-chip {
  border: 1px solid #ddc4ad;
  border-radius: 999px;
  background: #fffaf4;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
}

.scripture-chip.active {
  background: #f2ddca;
  border-color: #c99368;
  color: #6a3f26;
}

.scripture-book-item {
  border: 1px solid #ecd8c4;
  border-radius: 0.8rem;
  overflow: hidden;
}

.scripture-book-item .accordion-button {
  font-weight: 600;
}

.scripture-book-item .accordion-button:not(.collapsed) {
  background: #fff1e3;
  color: #5a3824;
}

.scripture-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 0.45rem;
}

.scripture-chapter-btn {
  border: 1px solid #dfc4ab;
  border-radius: 0.55rem;
  background: #fff9f3;
  min-height: 38px;
  font-weight: 600;
}

.scripture-chapter-btn.active {
  background: #d28a59;
  border-color: #b06d40;
  color: #fff;
}

.profile-logout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-logout-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.54rem 1.1rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #c96d58, #8c3f32);
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.profile-avatar-preview,
.profile-avatar-fallback {
  width: 104px;
  height: 104px;
  border-radius: 999px;
  border: 1px solid #ddc3ad;
}

.profile-avatar-preview {
  object-fit: cover;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #fff3e6;
  color: var(--primary-deep);
  font-size: 1.6rem;
  font-weight: 700;
}

.auth-panel {
  width: min(100%, 960px);
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .auth-panel {
    grid-template-columns: 1.2fr 1fr;
  }
}

.auth-hero {
  border-radius: 1.3rem;
  border: 1px solid rgba(222, 195, 167, 0.7);
  background: linear-gradient(150deg, rgba(230, 179, 129, 0.35), rgba(255, 244, 231, 0.8));
  padding: 1.3rem;
}

.auth-title {
  font-family: "Noto Serif TC", serif;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.auth-card {
  border-radius: 1.3rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 1.15rem;
  box-shadow: 0 16px 30px rgba(122, 78, 44, 0.13);
}

.scripture-verses {
  display: grid;
  gap: 0.55rem;
}

.scripture-verse-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: baseline;
  gap: 0.6rem;
  line-height: 1.85;
}

.verse-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.65rem;
  background: #ede5d9;
  color: var(--muted);
  border-radius: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
}

.verse-text {
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text);
}

.devotion-body {
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 1.02rem;
  margin-bottom: 0;
}

.devotion-text {
  white-space: pre-wrap;
  line-height: 1.8;
  margin-bottom: 0;
  color: var(--text);
}

@media (max-width: 768px) {
  .brand-subtitle {
    display: none;
  }

  .top-nav {
    gap: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav a,
  .top-auth-link,
  .top-auth-logout {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .app-topbar-inner {
    gap: 0.75rem;
  }

  .top-nav-wrap {
    gap: 0.55rem;
  }

  .top-nav-login {
    padding: 0.38rem 0.8rem;
  }

  .bottom-nav {
    width: calc(100vw - 1rem);
    bottom: 2.1rem;
    gap: 0.2rem;
    padding: 0.36rem;
  }

  .daily-page-loading {
    bottom: 6rem;
  }

  .bottom-nav-item {
    font-size: 0.71rem;
    padding: 0.45rem 0.1rem;
  }
}
