:root {
  color-scheme: light;
  --ink: #111a3a;
  --ink-soft: #4b5676;
  --navy: #111a3a;
  --navy-light: #1b2855;
  --indigo: #4054d7;
  --indigo-dark: #3043bf;
  --amber: #f6b84a;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --line: #dfe3ee;
  --success: #147d64;
  --danger: #b83b4b;
  --shadow: 0 18px 50px rgba(21, 31, 68, 0.11);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 18%, rgba(64, 84, 215, 0.08), transparent 25rem),
    var(--surface-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--indigo);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: white;
  background:
    radial-gradient(circle at 12% -45%, rgba(246, 184, 74, 0.23), transparent 20rem),
    linear-gradient(135deg, var(--navy), #172451 72%, #202e63);
  box-shadow: 0 5px 24px rgba(9, 16, 42, 0.2);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 11px;
  color: white;
  font-size: 1.2rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50% 50% 45% 45%;
  color: var(--navy);
  background: var(--amber);
  font-size: 1.12rem;
  font-weight: 700;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-nav a,
.admin-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 13px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.public-nav a:hover,
.public-nav a[aria-current="page"],
.admin-link:hover,
.admin-link[aria-current="page"] {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.admin-link {
  justify-self: end;
  font-size: 1rem;
}

#main {
  min-height: calc(100vh - 68px);
}

.page-shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 50px 0 90px;
}

.page-shell.wide {
  width: min(1120px, calc(100% - 40px));
}

.page-heading {
  max-width: 700px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--indigo-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: inherit;
  font-weight: 760;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.15rem, 5.5vw, 3.25rem);
  line-height: 1.08;
}

.prayer-page-title {
  font-size: clamp(1.65rem, 4.5vw, 2.45rem);
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.16;
}

h3 {
  font-size: 0.88rem;
  line-height: 1.35;
}

.lead {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  max-width: 760px;
  padding: clamp(22px, 4vw, 36px);
}

.field {
  margin-bottom: 22px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 750;
}

.field textarea,
.field input {
  width: 100%;
  border: 1px solid #cbd1e0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 210px;
  padding: 16px;
  resize: vertical;
  font-size: 0.86rem;
  line-height: 1.55;
}

.field input {
  height: 50px;
  padding: 0 14px;
}

.field textarea:focus,
.field input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(64, 84, 215, 0.13);
}

.input-icon {
  position: relative;
  display: block;
}

.input-icon > i {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 150ms ease;
}

.input-icon input {
  padding-left: 44px;
}

.input-icon:focus-within > i {
  color: var(--indigo);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 19px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--indigo);
  box-shadow: 0 8px 20px rgba(64, 84, 215, 0.22);
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 760;
  gap: 8px;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  background: var(--indigo-dark);
  box-shadow: 0 11px 25px rgba(64, 84, 215, 0.28);
  transform: translateY(-1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.prayer-option:focus-within {
  outline: 3px solid rgba(64, 84, 215, 0.28);
  outline-offset: 3px;
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button.secondary {
  color: var(--ink);
  background: #eef0f6;
  box-shadow: none;
}

.button.secondary:hover:not(:disabled) {
  background: #e2e5ef;
  box-shadow: none;
}

.button.danger {
  color: var(--danger);
  background: #fff0f2;
  box-shadow: none;
}

.button.danger:hover:not(:disabled) {
  background: #ffe2e6;
  box-shadow: none;
}

.button.small {
  min-height: 42px;
  padding: 9px 14px;
  font-size: 0.86rem;
}

.status-card,
.empty-state,
.error-state {
  padding: clamp(28px, 6vw, 52px);
  text-align: center;
}

.status-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--success);
  font-size: 1.2rem;
  font-weight: 800;
}

.error-state .status-symbol {
  background: var(--danger);
}

.status-card p,
.empty-state p,
.error-state p {
  max-width: 540px;
  margin-right: auto;
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.prayer-grid {
  display: grid;
  margin: 0 0 26px;
  padding: 0;
  gap: 13px;
  list-style: none;
}

.prayer-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 104px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  gap: 16px;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.prayer-option:hover {
  border-color: #b8c0da;
  transform: translateY(-1px);
}

.prayer-option:has(input:checked) {
  border-color: var(--indigo);
  background: #f5f6ff;
  box-shadow: 0 0 0 1px var(--indigo);
}

.prayer-option input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--indigo);
}

.prayer-text {
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.selection-bar {
  position: sticky;
  z-index: 10;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: white;
  background: rgba(17, 26, 58, 0.96);
  box-shadow: 0 18px 45px rgba(10, 16, 38, 0.27);
  backdrop-filter: blur(16px);
  gap: 18px;
}

.selection-count {
  margin: 0;
  font-weight: 700;
}

.selection-hint {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  font-weight: 500;
}

.session-card {
  overflow: hidden;
}

.session-header {
  padding: clamp(26px, 5vw, 42px);
  color: white;
  background:
    radial-gradient(circle at 85% 0%, rgba(246, 184, 74, 0.25), transparent 16rem),
    var(--navy);
}

.session-header h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
}

.session-header p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.session-body {
  padding: clamp(24px, 5vw, 42px);
}

.session-prayer {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.session-prayer:first-child {
  padding-top: 0;
}

.session-prayer:last-child {
  border-bottom: 0;
}

.session-prayer span {
  display: block;
  margin-bottom: 8px;
  color: var(--indigo-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 14px;
}

.complete-banner {
  margin-top: 26px;
  padding: 15px 17px;
  border-radius: 12px;
  color: #0d6653;
  background: #e7f7f2;
  font-weight: 700;
}

.admin-login {
  max-width: 480px;
  margin: 28px auto 0;
}

.admin-login .panel {
  padding: clamp(25px, 6vw, 38px);
}

.admin-login h1 {
  font-size: clamp(2rem, 7vw, 3rem);
}

.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 24px;
}

.admin-toolbar h1 {
  margin-bottom: 8px;
  font-size: clamp(2.25rem, 6vw, 3.6rem);
}

.admin-toolbar p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 24px;
  gap: 12px;
}

.metric-card {
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.metric-card strong {
  display: block;
  margin: 12px 0 4px;
  font-family: inherit;
  font-size: 2.15rem;
  line-height: 1;
}

.metric-card span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--indigo);
}

.metric-dot.amber { background: var(--amber); }
.metric-dot.green { background: var(--success); }
.metric-dot.red { background: var(--danger); }
.metric-dot.navy { background: var(--navy); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: start;
  gap: 20px;
}

.dashboard-section {
  padding: clamp(20px, 4vw, 30px);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.section-heading span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.review-list,
.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.review-item:first-child,
.activity-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.review-item p {
  margin-bottom: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-meta,
.activity-meta {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.review-actions .button-row {
  flex-wrap: nowrap;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(30, minmax(4px, 1fr));
  height: 150px;
  align-items: end;
  margin: 8px 0 12px;
  gap: 3px;
}

.trend-day {
  display: flex;
  height: 100%;
  align-items: end;
  justify-content: center;
  gap: 2px;
}

.trend-bar {
  width: min(7px, 45%);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--indigo);
}

.trend-bar.claims {
  background: var(--amber);
}

.chart-legend {
  display: flex;
  gap: 18px;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-key {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--indigo);
}

.legend-key.claims {
  background: var(--amber);
}

.activity-item {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.activity-item p {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #32418d;
  background: #edf0ff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: capitalize;
}

.badge.prayed { color: #0c6e58; background: #e6f7f1; }
.badge.rejected { color: #9d2d3d; background: #ffeaed; }
.badge.claimed { color: #7c550a; background: #fff2d6; }

.toast {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 14px 17px;
  border-radius: 12px;
  color: white;
  background: var(--navy);
  box-shadow: 0 16px 40px rgba(9, 16, 42, 0.3);
  font-weight: 650;
}

.toast.error {
  background: #982f3e;
}

.skeleton {
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8eaf1 25%, #f5f6fa 50%, #e8eaf1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-title { width: 54%; height: 58px; margin-bottom: 18px; }
.skeleton-copy { width: 70%; height: 24px; margin-bottom: 40px; }
.skeleton-card { width: 100%; height: 180px; }

.loading-message {
  padding: 52px 0;
  color: var(--ink-soft);
  text-align: center;
}

.noscript {
  margin: 24px;
  padding: 16px;
  border-radius: 10px;
  color: white;
  background: var(--danger);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 900px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    width: min(100% - 28px, 1120px);
    min-height: 64px;
    gap: 10px;
  }

  .public-nav {
    position: fixed;
    z-index: 30;
    right: 14px;
    bottom: 12px;
    left: 14px;
    justify-content: space-around;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 17px;
    background: rgba(17, 26, 58, 0.97);
    box-shadow: 0 16px 40px rgba(9, 16, 42, 0.3);
    backdrop-filter: blur(18px);
    gap: 8px;
  }

  .public-nav a {
    flex: 1;
    min-height: 56px;
    justify-content: center;
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.86rem;
    font-weight: 760;
    text-align: center;
  }

  .public-nav a[aria-current="page"] {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px rgba(5, 10, 28, 0.2);
  }

  .admin-link {
    grid-column: 2;
    grid-row: 1;
  }

  .page-shell,
  .page-shell.wide {
    width: min(100% - 28px, 960px);
    padding: 32px 0 100px;
  }

  .selection-bar {
    bottom: 78px;
  }

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

  .metric-card {
    min-height: 126px;
  }

  .admin-toolbar,
  .session-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-toolbar .button,
  .session-actions .button {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .page-heading {
    margin-bottom: 26px;
  }

  .lead { font-size: 0.82rem; }

  .prayer-option {
    padding: 18px;
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .selection-bar .button {
    width: 100%;
  }

  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions .button-row,
  .review-actions .button {
    width: 100%;
  }

  .metric-grid {
    gap: 9px;
  }

  .metric-card {
    min-height: 114px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
