:root {
  --primary: #003d33;
  --primary-2: #0b5a45;
  --primary-3: #1f6f55;
  --secondary: #b8860b;
  --secondary-2: #d8b35a;
  --tertiary: #f4efe6;
  --paper: #fffdfa;
  --panel: #fffaf2;
  --ink: #1a1a1a;
  --muted: #485350;
  --line: #e7ddcd;
  --danger: #c91d1d;
  --shadow: 0 16px 38px rgba(26, 26, 26, 0.1);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(216, 179, 90, 0.18), transparent 24rem),
    linear-gradient(120deg, rgba(244, 239, 230, 0.82), rgba(255, 253, 250, 0.98) 38%, rgba(244, 239, 230, 0.68)),
    var(--paper);
  color: var(--ink);
  min-width: 320px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset-block: 90px auto;
  inline-size: 360px;
  block-size: 360px;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(30deg, transparent 46%, rgba(184, 134, 11, 0.26) 47%, rgba(184, 134, 11, 0.26) 53%, transparent 54%),
    linear-gradient(150deg, transparent 46%, rgba(184, 134, 11, 0.26) 47%, rgba(184, 134, 11, 0.26) 53%, transparent 54%);
  background-size: 36px 36px;
  z-index: -1;
}

body::before {
  inset-inline-start: -110px;
}

body::after {
  inset-inline-end: -120px;
  transform: rotate(12deg);
}

body[data-auth-view="loading"] .site-header,
body[data-auth-view="loading"] main,
body[data-auth-view="loading"] .bottom-nav,
body[data-auth-view="signed-out"] .site-header,
body[data-auth-view="signed-out"] main,
body[data-auth-view="signed-out"] .bottom-nav,
body[data-auth-view="error"] .site-header,
body[data-auth-view="error"] main,
body[data-auth-view="error"] .bottom-nav {
  display: none;
}

body[data-auth-view="signed-in"] .auth-gate {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.skip-link {
  background: var(--secondary);
  color: var(--ink);
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -6rem;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header {
  background: linear-gradient(105deg, #00382f, #0c5d45);
  box-shadow: 0 8px 30px rgba(0, 61, 51, 0.18);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 6;
}

.auth-gate {
  align-items: center;
  display: grid;
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 3rem);
}

.auth-gate-shell {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 520px);
  margin: 0 auto;
  max-width: 1120px;
  width: 100%;
}

.auth-gate-brand {
  align-items: center;
  color: var(--primary);
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  font-weight: 700;
  gap: 0.85rem;
  grid-column: 1 / -1;
}

.auth-gate-brand img {
  block-size: 78px;
  inline-size: 62px;
}

.auth-gate-copy {
  align-self: center;
}

.auth-gate-copy h1 {
  color: var(--primary);
  font-size: clamp(2.6rem, 5vw, 5rem);
  margin: 0.3rem 0 1rem;
}

.auth-gate-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.5;
  max-width: 620px;
}

.auth-gate-panel {
  align-self: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 420px;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.auth-gate-status {
  color: var(--muted);
  font-weight: 750;
  margin: 0;
}

.top-nav {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  margin: 0 auto;
  max-width: 1720px;
  min-height: 82px;
  padding: 0 5vw;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 700;
  gap: 0.85rem;
  min-width: 0;
}

.brand img {
  block-size: 72px;
  inline-size: 58px;
  margin-block: 0.2rem -1.1rem;
}

.nav-links,
.nav-actions {
  align-items: center;
  display: flex;
}

.nav-links {
  gap: clamp(0.5rem, 2vw, 2rem);
  justify-content: center;
}

.nav-links a,
.nav-disabled {
  border-bottom: 3px solid transparent;
  font-weight: 650;
  padding: 1.9rem 0 1.35rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
}

.nav-disabled {
  color: rgba(255, 255, 255, 0.38);
  cursor: not-allowed;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  border-color: var(--secondary-2);
  color: #fff;
}

.nav-actions {
  gap: 0.75rem;
  justify-content: flex-end;
  position: relative;
}

.icon-button,
.menu-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  justify-content: center;
}

.icon-button {
  border-radius: var(--radius);
  min-height: 44px;
  min-width: 44px;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: 2px solid transparent;
}

.auth-slot {
  align-items: center;
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  gap: 0.65rem;
  min-height: 44px;
  min-width: 152px;
  justify-content: flex-end;
}

.auth-status {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 650;
}

.auth-button {
  background: var(--tertiary);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: var(--primary);
  font-weight: 850;
  min-height: 40px;
  padding: 0 0.9rem;
}

.auth-button:hover,
.auth-button:focus-visible {
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 42, 35, 0.18);
}

.clerk-user-button {
  align-items: center;
  display: inline-flex;
}

.clerk-user-button[hidden],
.auth-button[hidden],
.auth-status[hidden] {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  justify-self: end;
  min-height: 44px;
  min-width: 44px;
}

.menu-toggle span:not(.sr-only) {
  background: #fff;
  border-radius: 999px;
  height: 2px;
  width: 22px;
}

main {
  margin: 0 auto;
  max-width: 1720px;
  padding: 0 5vw 6rem;
}

.hero {
  align-items: stretch;
  border-bottom: 1px solid rgba(184, 134, 11, 0.17);
  display: grid;
  gap: clamp(1rem, 2.4vw, 2rem);
  grid-template-columns: minmax(420px, 1.15fr) minmax(480px, 1fr);
  min-height: 320px;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3rem) 0 1.9rem;
  position: relative;
}

.hero-copy {
  align-self: center;
  grid-column: 1;
  max-width: 650px;
  padding-inline-start: clamp(0rem, 8vw, 8rem);
  position: relative;
}

.hero-copy::after {
  background: linear-gradient(var(--secondary-2), transparent);
  content: "";
  height: 170px;
  position: absolute;
  right: -6vw;
  top: 0.35rem;
  width: 1px;
}

.eyebrow {
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 3.25vw, 3.15rem);
  max-width: 770px;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.65;
  margin: 1rem 0 1.35rem;
  max-width: 600px;
}

.button {
  align-items: center;
  border-radius: 5px;
  border: 1px solid transparent;
  display: inline-flex;
  font-weight: 800;
  gap: 0.55rem;
  justify-content: center;
  line-height: 1;
  min-height: 48px;
  padding: 0 1.05rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  box-shadow: 0 10px 20px rgba(0, 61, 51, 0.14);
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
}

.button.secondary {
  background: var(--tertiary);
  border-color: var(--line);
  color: var(--primary);
}

.button.light {
  background: var(--tertiary);
  color: var(--primary);
  width: 100%;
}

.button.slim {
  min-height: 40px;
  padding-inline: 1rem;
}

.hero-art {
  display: none;
}

.dome {
  background: linear-gradient(180deg, #fff, #d6d0c3);
  border-radius: 60% 60% 0 0;
  bottom: -20px;
  height: 126px;
  left: -32px;
  position: absolute;
  width: 260px;
}

.dome::after {
  background: #f7f3e8;
  border-radius: 50%;
  box-shadow: 48px 14px 0 -13px #d9d2c5, 96px 10px 0 -9px #ece7dc, 143px 18px 0 -15px #d0c9ba;
  content: "";
  height: 44px;
  left: 80px;
  position: absolute;
  top: -34px;
  width: 44px;
}

.minaret {
  background: linear-gradient(90deg, #e9e4d9, #fff, #c8c1b5);
  border-radius: 36px 36px 0 0;
  bottom: -20px;
  height: 220px;
  left: 150px;
  position: absolute;
  width: 52px;
}

.minaret::before {
  background: #f8f4ea;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 36px 0 -12px #cfc6b5;
  content: "";
  height: 72px;
  left: 6px;
  position: absolute;
  top: -68px;
  width: 40px;
}

.minaret::after {
  background: var(--secondary-2);
  content: "";
  height: 46px;
  left: 25px;
  position: absolute;
  top: -105px;
  width: 2px;
}

.featured-quizzes {
  display: grid;
  gap: clamp(1rem, 2vw, 1.75rem);
  grid-column: 2;
  grid-template-columns: minmax(260px, 1fr);
}

.feature-card,
.panel,
.rewards-band {
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 245px;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  text-align: center;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0.65rem auto 1.2rem;
  max-width: 430px;
}

.feature-card h2 {
  font-size: 1.75rem;
}

.featured-dark {
  background:
    linear-gradient(135deg, rgba(0, 61, 51, 0.95), rgba(31, 111, 85, 0.92)),
    repeating-linear-gradient(45deg, transparent, transparent 13px, rgba(255, 255, 255, 0.07) 14px, transparent 15px);
  color: #fff;
}

.featured-dark h2,
.featured-dark p {
  color: #fff;
}

.round-icon {
  align-items: center;
  border: 2px solid var(--secondary-2);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  height: 82px;
  justify-content: center;
  margin-bottom: 0.85rem;
  width: 82px;
}

.round-icon svg {
  height: 42px;
  width: 42px;
}

.round-icon.gold {
  color: var(--primary);
}

.dashboard-grid,
.lower-grid {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.dashboard-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(200px, 0.75fr) minmax(230px, 1fr);
}

.lower-grid {
  grid-template-columns: minmax(0, 2.1fr) minmax(340px, 1fr);
}

.panel {
  min-width: 0;
  padding: 1rem;
}

.progress-panel {
  grid-column: span 1;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding-bottom: 0.75rem;
}

.panel-header h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.panel-header a,
.panel-link {
  color: var(--primary-2);
  font-size: 0.86rem;
  font-weight: 700;
}

.category-list,
.leaderboard-list {
  display: grid;
  gap: 0.35rem;
}

.category-row,
.leaderboard-row {
  align-items: center;
  display: grid;
  gap: 0.75rem;
}

.topic-icon {
  align-items: center;
  background: var(--primary-2);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.category-row span:first-child,
.leaderboard-name {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.87rem;
  font-weight: 650;
}

.category-row span:last-child,
.leaderboard-points {
  color: var(--muted);
  font-size: 0.78rem;
}

.leaderboard-empty {
  background: rgba(244, 239, 230, 0.72);
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
  list-style: none;
  padding: 0.85rem;
}

.progress-empty {
  background: rgba(244, 239, 230, 0.72);
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
  list-style: none;
  padding: 0.85rem;
}

.progress-breakdown {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  overflow: hidden;
  min-width: 0;
}

.streak p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0.55rem 0 0.8rem;
}

.streak-number {
  align-items: baseline;
  color: var(--primary-2);
  display: flex;
  gap: 0.55rem;
  justify-content: center;
}

.streak-number strong {
  font-size: 3rem;
  line-height: 1;
}

.friday-track {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.friday-track span {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 32px;
  justify-content: center;
  padding: 0.25rem;
  text-align: center;
}

.friday-track .done {
  background: var(--primary-2);
  color: #fff;
}

.friday-track .current {
  border-color: var(--secondary-2);
  box-shadow: inset 0 0 0 2px var(--secondary-2);
}

.friday-track .missed,
.friday-track .available {
  background: rgba(255, 250, 242, 0.86);
}

.streak-status {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
  margin-top: 0.85rem;
}

.streak-status span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.streak-status strong {
  color: var(--primary);
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.rank-badge {
  align-items: center;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.2), rgba(0, 61, 51, 0.08));
  border: 1px solid rgba(184, 134, 11, 0.36);
  border-radius: var(--radius);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 52px 1fr;
  padding: 0.75rem;
}

.rank-badge svg {
  background: var(--primary);
  border: 2px solid var(--secondary-2);
  border-radius: 999px;
  color: #fff;
  height: 52px;
  padding: 0.65rem;
  width: 52px;
}

.rank-badge span {
  display: block;
  margin-bottom: 0.2rem;
}

.rank-path {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
}

.rank-step {
  align-items: center;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  min-height: 30px;
  padding: 0.25rem 0.45rem;
  text-align: center;
}

.rank-step.achieved,
.rank-step.current {
  background: rgba(0, 61, 51, 0.1);
  border-color: rgba(0, 61, 51, 0.24);
  color: var(--primary);
}

.rank-step.current {
  box-shadow: inset 0 0 0 2px var(--secondary-2);
}

.rank-step.locked {
  color: var(--muted);
  opacity: 0.72;
}

.next-rank {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

.best-streak {
  background: var(--tertiary);
  border-radius: 6px;
  color: var(--primary) !important;
  font-size: 0.82rem;
  padding: 0.4rem;
  text-align: center;
}

.chart-wrap {
  height: 132px;
  justify-self: center;
  position: relative;
  width: 132px;
}

.donut {
  background: conic-gradient(#1c8d4a 0 34%, #65a7a7 34% 47%, #6c5087 47% 56%, #d5aa42 56% 78%, #e4c87d 78% 100%);
  border-radius: 50%;
  height: 132px;
  position: relative;
  width: 132px;
}

.donut::after {
  background: var(--panel);
  border-radius: 50%;
  content: "";
  inset: 28px;
  position: absolute;
}

.chart-center {
  align-items: center;
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.chart-center strong {
  color: var(--primary);
  font-size: 1.45rem;
}

.chart-center span {
  color: var(--muted);
  font-size: 0.76rem;
}

.mastery-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.mastery-list li,
.category-row {
  border-bottom: 1px solid rgba(231, 221, 205, 0.86);
  padding-bottom: 0.42rem;
}

.mastery-list li {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  gap: 0.45rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.mastery-list li span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mastery-list li strong {
  white-space: nowrap;
}

.dot {
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.category-row {
  grid-template-columns: 1fr auto;
}

.panel-link {
  display: block;
  padding-top: 0.8rem;
  text-align: center;
}

.compact-search {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0 0.6rem;
}

.compact-search input {
  background: transparent;
  border: 0;
  min-width: 120px;
  outline: 0;
  width: 12vw;
}

.topic-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(220px, 360px);
}

.topic-card {
  background:
    linear-gradient(rgba(255, 250, 242, 0.92), rgba(255, 250, 242, 0.92)),
    repeating-linear-gradient(45deg, rgba(216, 179, 90, 0.18) 0 1px, transparent 1px 14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  min-height: 174px;
  padding: 1rem;
  text-align: center;
}

.topic-card h3 {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.topic-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.topic-count {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 850;
}

.leaderboard-list {
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-toggle {
  background: var(--tertiary);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  gap: 0.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.75rem;
  padding: 0.2rem;
}

.leaderboard-toggle button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0.25rem 0.35rem;
}

.leaderboard-toggle button.active,
.leaderboard-toggle button:focus-visible {
  background: var(--primary);
  color: #fff;
}

.leaderboard-row {
  grid-template-columns: 28px 36px 1fr auto auto;
  min-height: 42px;
  padding: 0.25rem 0.35rem;
}

.leaderboard-row.current {
  background: rgba(0, 61, 51, 0.08);
}

.rank {
  align-items: center;
  background: #ebe4d6;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 0.78rem;
  font-weight: 850;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.rank.top {
  background: var(--secondary-2);
  color: var(--primary);
}

.face {
  align-items: center;
  background: linear-gradient(135deg, var(--primary-3), #e7d9b7);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 0.8rem;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.trophy {
  color: var(--secondary);
}

.rewards-band {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
}

.rewards-band h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.bottom-nav {
  display: none;
}

dialog {
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  max-width: min(92vw, 650px);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 42, 35, 0.45);
}

.sermons-dialog {
  max-height: calc(100dvh - 2rem);
  max-width: min(92vw, 1120px);
  width: min(92vw, 1120px);
}

.search-dialog form,
.sermons-screen,
.quiz-card,
.auth-card {
  background: var(--paper);
  color: var(--ink);
  padding: 1rem;
}

.dialog-header {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dialog-header h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.icon-button.inverted {
  background: var(--tertiary);
  color: var(--ink);
  font-size: 1.3rem;
}

.search-field {
  align-items: center;
  border: 2px solid var(--line);
  display: flex;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0 1rem;
}

.search-field input {
  background: transparent;
  border: 0;
  flex: 1;
  font-size: 1.05rem;
  outline: 0;
}

.search-results {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.result-row {
  background: var(--tertiary);
  border-radius: 6px;
  padding: 0.75rem;
}

.result-row strong {
  color: var(--primary);
}

.sermons-screen {
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.sermon-date-list {
  display: grid;
  gap: 0.85rem;
}

.sermon-date-card {
  background:
    linear-gradient(rgba(255, 250, 242, 0.92), rgba(255, 250, 242, 0.92)),
    repeating-linear-gradient(45deg, rgba(216, 179, 90, 0.15) 0 1px, transparent 1px 16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 34%);
  padding: 1rem;
}

.sermon-date {
  color: var(--secondary);
  font-size: 0.84rem;
  font-weight: 850;
  margin: 0 0 0.35rem;
}

.sermon-date-card h3 {
  color: var(--primary);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15rem;
}

.sermon-date-card p:not(.sermon-date) {
  color: var(--muted);
  line-height: 1.45;
  margin: 0.45rem 0 0;
}

.sermon-actions {
  align-content: start;
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.sermon-actions .button {
  min-height: 64px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

.button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.quiz-card {
  min-width: min(92vw, 600px);
}

.auth-card {
  min-width: min(92vw, 430px);
}

.quiz-progress {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

progress {
  accent-color: var(--primary-2);
  height: 10px;
  width: 100%;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.9rem;
}

.answers {
  display: grid;
  gap: 0.65rem;
}

.answer-option {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
}

.answer-option.correct {
  border-color: #1c8d4a;
}

.answer-option.incorrect {
  border-color: var(--danger);
}

.feedback {
  min-height: 1.5rem;
}

.feedback.good {
  color: #176b3d;
}

.feedback.bad {
  color: var(--danger);
}

.quiz-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .recent,
  .streak,
  .categories {
    grid-column: span 3;
  }

  .topic-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 1040px) {
  .auth-gate-shell {
    grid-template-columns: 1fr;
  }

  .auth-gate-copy {
    text-align: center;
  }

  .auth-gate-copy p:not(.eyebrow) {
    margin-inline: auto;
  }

  .top-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
  }

  .nav-links {
    background: var(--primary);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    display: none;
    grid-column: 1 / -1;
    justify-content: start;
    margin-inline: -5vw;
    overflow-x: auto;
    padding: 0 5vw;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-disabled {
    padding: 0.9rem 0 0.75rem;
    white-space: nowrap;
  }

  .nav-actions {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .nav-actions > .icon-button {
    display: none;
  }

  .auth-slot {
    min-width: 0;
  }

  .auth-status {
    display: none;
  }

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

  .hero-copy {
    padding-inline-start: 0;
  }

  .hero-copy::after,
  .hero-art {
    display: none;
  }

  .featured-quizzes {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid > *,
  .lower-grid > * {
    grid-column: auto;
  }

  .sermon-date-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 74px;
  }

  body[data-auth-view="loading"],
  body[data-auth-view="signed-out"],
  body[data-auth-view="error"] {
    padding-bottom: 0;
  }

  .auth-gate {
    align-items: start;
  }

  .auth-gate-shell {
    gap: 1rem;
  }

  .auth-gate-brand {
    font-size: 1.25rem;
  }

  .auth-gate-brand img {
    block-size: 60px;
    inline-size: 48px;
  }

  .auth-gate-copy h1 {
    font-size: 2.2rem;
  }

  .auth-gate-panel {
    min-height: 360px;
  }

  .site-header {
    position: static;
  }

  .top-nav {
    min-height: 72px;
  }

  .brand span {
    font-size: 1.05rem;
  }

  .brand img {
    block-size: 56px;
    inline-size: 45px;
  }

  main {
    padding-inline: 1rem;
  }

  .hero {
    padding-top: 1.4rem;
  }

  h1 {
    font-size: 2.1rem;
  }

  .featured-quizzes,
  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    justify-self: center;
  }

  .compact-search {
    width: 100%;
  }

  .compact-search input {
    width: 100%;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .leaderboard-row {
    grid-template-columns: 28px 34px 1fr auto;
  }

  .trophy {
    display: none;
  }

  .rewards-band {
    align-items: stretch;
    flex-direction: column;
  }

  .sermon-date-card {
    grid-template-columns: 1fr;
  }

  .sermon-actions {
    min-width: 0;
  }

  .bottom-nav {
    align-items: center;
    background: rgba(244, 239, 230, 0.98);
    border: 1px solid var(--line);
    border-radius: 999px;
    bottom: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    left: 50%;
    padding: 0.45rem;
    position: fixed;
    transform: translateX(-50%);
    z-index: 5;
  }

  .bottom-nav a {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    height: 46px;
    justify-content: center;
    width: 50px;
  }

  .bottom-nav a.active {
    background: var(--primary);
    color: #fff;
  }
}

@media (max-width: 430px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .quiz-actions {
    flex-direction: column-reverse;
  }
}
