:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6877;
  --line: #dce3ea;
  --paper: #f7f9fb;
  --white: #ffffff;
  --teal: #0f9f9a;
  --teal-dark: #08736f;
  --coral: #f06449;
  --yellow: #f4bd35;
  --mint: #cdeee8;
  --focus: #101828;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 8px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(220, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Logo image variants */
.brand-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  display: block;
}
.brand-logo--footer  { height: 40px; }
.brand-logo--auth    { height: 86px; margin: 0 auto 4px; }
.brand-logo--sidebar { height: 36px; flex-shrink: 0; }

/* Fallback: keep brand-mark for any place that still uses it */
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--yellow);
}

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

.main-nav {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
}

.main-nav a,
.ghost-button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 10px 12px;
}

.main-nav a:hover,
.ghost-button:hover {
  background: #edf2f5;
  color: var(--ink);
}

.topbar-info-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-info-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.topbar-info-nav a:hover {
  background: #edf2f5;
  color: var(--ink);
}

/* Donate button in topbar */
.donate-btn {
  background: linear-gradient(135deg, #f97316, #fbbf24) !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 6px 14px !important;
  font-weight: 700 !important;
  margin-left: 6px;
}
.donate-btn:hover {
  opacity: .88;
  background: linear-gradient(135deg, #f97316, #fbbf24) !important;
  color: #fff !important;
}

/* Auth CTAs in the topbar user-menu when signed out */
.nav-cta {
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 10px;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 900px) {
  .topbar-info-nav { display: none; }
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: min(780px, calc(100vh - 68px));
  padding: clamp(26px, 5vw, 64px) clamp(16px, 5vw, 72px) 32px;
  background: linear-gradient(180deg, #ffffff 0%, #edf8f6 100%);
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(3rem, 8vw, 7.2rem);
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.12;
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.6;
  margin: 24px 0;
  max-width: 58ch;
}

.hero-actions,
.builder-actions,
.host-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.auto-advance-btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.auto-advance-btn.auto-on {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  color: var(--teal);
}

.start-quiz-btn {
  min-width: 180px;
  font-size: 1.05rem;
  padding: 14px 36px;
  letter-spacing: 0.03em;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
}

.primary-button {
  background: var(--ink);
  color: var(--white);
}

.primary-button:hover {
  background: #000000;
}

.secondary-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--ink);
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: center;
  min-height: min(760px, calc(100vh - 68px));
  padding: clamp(34px, 6vw, 78px) clamp(16px, 5vw, 72px) 34px;
  background: linear-gradient(180deg, #ffffff 0%, #eef8f6 100%);
}

.landing-copy {
  max-width: 720px;
}

.landing-copy h1 {
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.95;
}

.landing-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.landing-pin {
  width: 100%;
  margin: 0;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: clamp(40px, 6vw, 80px) clamp(16px, 5vw, 72px);
  background: #f8fafc;
}

.feature-card {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
}

.feature-card--1::before { background: linear-gradient(90deg, #1e3a6e, #3b6cb7); }
.feature-card--2::before { background: linear-gradient(90deg, #f97316, #fbbf24); }
.feature-card--3::before { background: linear-gradient(90deg, #0d9488, #10b981); }

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.10);
}

.feature-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.feature-card--1 .feature-icon-wrap { background: #e8eef8; color: #1e3a6e; }
.feature-card--2 .feature-icon-wrap { background: #fff3e0; color: #c2410c; }
.feature-card--3 .feature-icon-wrap { background: #d1fae5; color: #065f46; }

.feature-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.feature-step {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.feature-card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 24px;
  flex: 1;
}

.feature-cta {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.feature-card--1 .feature-cta { color: #1e3a6e; }
.feature-card--2 .feature-cta { color: #c2410c; }
.feature-card--3 .feature-cta { color: #065f46; }

.feature-cta:hover { text-decoration: underline; }

.landing-proof {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a6e 65%, #0c4a6e 100%);
  padding: clamp(56px, 7vw, 96px) clamp(16px, 5vw, 72px);
  text-align: center;
}

.proof-intro {
  max-width: 600px;
  margin: 0 auto 52px;
}

.proof-intro h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 8px 0 14px;
}

.proof-sub {
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.eyebrow--light {
  color: #fbbf24;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  letter-spacing: .1em;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.proof-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: clamp(20px, 3vw, 32px) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: background .2s, transform .2s;
}

.proof-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-4px);
}

.proof-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.proof-card-icon svg { width: 28px; height: 28px; }

.proof-card-icon--1 { background: rgba(99,102,241,.25); color: #a5b4fc; }
.proof-card-icon--2 { background: rgba(249,115,22,.25);  color: #fdba74; }
.proof-card-icon--3 { background: rgba(16,185,129,.25);  color: #6ee7b7; }
.proof-card-icon--4 { background: rgba(251,191,36,.25);  color: #fde68a; }

.proof-card strong {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}

.proof-card span {
  color: rgba(255,255,255,.5);
  font-size: 0.83rem;
  line-height: 1.55;
}

.pin-panel {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
}

.pin-panel label,
label span,
.search-box span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.pin-panel div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 159, 154, 0.35);
  outline-offset: 2px;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.stats-band div {
  background: var(--white);
  padding: 24px clamp(16px, 5vw, 72px);
}

.stats-band strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 3rem);
}

.stats-band span {
  color: var(--muted);
  font-weight: 700;
}

.content-band,
.page-band {
  padding: clamp(28px, 5vw, 64px) clamp(16px, 5vw, 72px);
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.page-band .section-heading h1 {
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quiz-card {
  display: grid;
  gap: 16px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.quiz-swatch {
  height: 88px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--yellow));
}

.quiz-card:nth-child(2n) .quiz-swatch {
  background: linear-gradient(135deg, var(--coral), #ffe7a3);
}

.quiz-card:nth-child(3n) .quiz-swatch {
  background: linear-gradient(135deg, #31525b, var(--mint));
}

.quiz-card h3 {
  font-size: 1.2rem;
  margin: 0;
}

.quiz-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.pill {
  border-radius: 999px;
  background: #edf2f5;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 9px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-actions .primary-button,
.card-actions .secondary-button {
  flex: 1;
  min-width: 0;
}

.danger-button {
  border: 1px solid var(--coral) !important;
  color: var(--coral);
  font-size: 0.82rem;
  padding: 6px 10px;
  min-height: 36px;
}

.danger-button:hover {
  background: #fff0ee;
  border-color: var(--coral);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.builder-layout {
  max-width: 1040px;
  margin: 0 auto;
}

.question-type-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.question-type-row select {
  width: auto;
  min-height: 36px;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.optional-label {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

input[readonly] {
  background: #f0f4f8;
  color: var(--muted);
  cursor: default;
}

.builder-form,
.host-stage,
.side-panel,
.player-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.07);
  padding: clamp(16px, 3vw, 28px);
}

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

.question-list {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.import-export-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px;
}

.import-export-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-export-panel p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin: 0;
}

.question-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.question-editor header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.question-editor h2 {
  font-size: 1rem;
}

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

.answer-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.answer-option input[type="radio"] {
  width: 18px;
  min-height: 18px;
}

.host-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.host-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.host-header h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.pin-code {
  min-width: 132px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 12px;
  text-align: center;
}

.pin-code span {
  display: block;
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 800;
}

.pin-code strong {
  font-size: 1.7rem;
}

.player-count-badge {
  display: block;
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  margin-top: 4px;
}

.question-stage {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 8px;
  overflow-y: auto;
}

.timer-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 0.1s linear, background-color 0.4s;
}

.timer-fill.urgent {
  background: var(--coral);
}

.question-image {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.question-stage p,
.player-question p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.connection-status {
  border-radius: 8px;
  background: #edf2f5;
  color: var(--muted) !important;
  font-size: 0.82rem;
  padding: 8px 10px;
}

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

.answer-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  padding: 18px;
  text-align: left;
}

.answer-tile strong {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--white);
  font-size: 1.2rem;
}

.answer-tile:nth-child(1) {
  background: var(--coral);
}

.answer-tile:nth-child(2) {
  background: var(--teal);
}

.answer-tile:nth-child(3) {
  background: #31525b;
}

.answer-tile:nth-child(4) {
  background: #bd8a13;
}

.answer-tile.correct {
  outline: 5px solid rgba(16, 185, 129, 0.45);
}

.answer-tile.selected {
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.answer-tile.correct-reveal {
  outline: 5px solid rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.answer-tile.wrong-reveal {
  opacity: 0.42;
  filter: grayscale(0.4);
}

.side-panel {
  align-self: start;
  display: grid;
  gap: 16px;
}

.side-panel h2 {
  font-size: 1rem;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.qr-panel {
  display: grid;
  gap: 10px;
}

.qr-panel img {
  width: min(100%, 220px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px;
}

.compact-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  padding: 10px;
  text-align: left;
}

.compact-list button.active {
  border-color: var(--teal);
  background: #e7f7f5;
}

.joined-players {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.joined-players li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 7px 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.joined-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #e7f7f5;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.joined-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-hint {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.leaderboard {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  padding: 7px 0;
}

.lb-rank {
  min-width: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.play-layout {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
}

.player-card {
  width: min(100%, 680px);
}

.player-card h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  margin-bottom: 20px;
}

.player-card form {
  display: grid;
  gap: 12px;
}

.player-question {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.player-score-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.player-score-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.player-total-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}

.player-complete-card {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: center;
}

.player-complete-card strong {
  color: var(--teal-dark);
  font-size: 3rem;
  line-height: 1;
}

.player-complete-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-line {
  font-weight: 700;
  font-size: 0.9rem;
}

.score-line.correct-feedback {
  color: #0e9060;
}

.score-line.wrong-feedback {
  color: var(--coral);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 32px;
  text-align: center;
}

/* empty-state with CTA overrides defined in auth section */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 16px;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.db-error-card {
  max-width: 540px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.db-error-card h2 {
  color: var(--coral);
  margin-bottom: 12px;
}

.db-error-card p {
  color: var(--muted);
  margin-bottom: 16px;
}

.db-error-card pre {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  margin: 0 0 20px;
  padding: 12px 16px;
}

/* ── Auth ──────────────────────────────────────────────────────────────────── */

.auth-layout {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
  padding: 32px clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, #ffffff 0%, #edf8f6 100%);
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-tagline {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.auth-tab {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--ink);
  color: var(--white);
}

.auth-tab:not(.active):hover {
  background: var(--paper);
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 4px;
}

.auth-error {
  margin: 0;
  border-radius: 6px;
  background: #fff0ee;
  color: var(--coral);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 12px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.player-join-auth {
  margin-top: 0;
  box-shadow: none;
  border-color: var(--line);
  background: var(--paper);
}

.player-join-auth label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.full-width {
  width: 100%;
}

/* ── User menu in topbar ───────────────────────────────────────────────────── */

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  border-radius: 6px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 10px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Empty state with CTA ──────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state .primary-button {
  min-width: 200px;
}

/* ── Per-question reveal bars (shown between questions on host) ────────────── */

.reveal-row {
  display: grid;
  grid-template-columns: 14px 1fr 160px 44px 40px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--paper);
  transition: border-color 0.2s;
}

.reveal-row.reveal-correct {
  border-color: var(--teal);
  background: var(--mint);
}

.reveal-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--tile-color, var(--muted));
  flex-shrink: 0;
}

.reveal-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-correct .reveal-label { color: var(--teal-dark); }

.reveal-track {
  height: 14px;
  background: var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.reveal-fill {
  height: 100%;
  border-radius: 7px;
  background: var(--muted);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-correct .reveal-fill { background: var(--teal); }

.reveal-pct {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-align: right;
}

.reveal-correct .reveal-pct { color: var(--teal-dark); }

.reveal-count {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

/* Override answer-board grid when showing reveal rows */
.answer-board:has(.reveal-row) {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ── Quiz results view ─────────────────────────────────────────────────────── */

.results-loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.quiz-results {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.qr-header { text-align: center; }
.qr-header h2 { margin: 0 0 4px; font-size: 1.6rem; }
.qr-meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.qr-save-results { margin-top: 14px; }

.results-showcase {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(135deg, #fff 0%, #f0faf8 58%, #fff7e6 100%);
}

.results-showcase--empty {
  text-align: center;
}

.showcase-head {
  text-align: center;
}

.showcase-head h3,
.results-showcase--empty h3 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.showcase-head p,
.results-showcase--empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.podium-platform {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.18fr) minmax(0, 0.9fr);
  gap: 14px;
  align-items: end;
  max-width: 860px;
  width: 100%;
  margin: 4px auto 0;
}

.podium-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 178px;
  padding: 20px 14px 18px;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.08);
  text-align: center;
}

.podium-card--first {
  min-height: 224px;
  padding-top: 28px;
  background: linear-gradient(180deg, #fff8db 0%, #ffffff 100%);
  border-color: #f3d46b;
}

.podium-card--second {
  min-height: 194px;
}

.podium-card--third {
  min-height: 184px;
}

.podium-rank {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
}

.podium-card strong {
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  overflow-wrap: anywhere;
}

.podium-card small {
  color: var(--muted);
  font-weight: 700;
}

.podium-card b {
  color: var(--teal-dark);
  font-size: 1.05rem;
}

.ranking-board {
  display: grid;
  gap: 10px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.ranking-board h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.ranking-row span {
  color: var(--muted);
  font-weight: 800;
}

.ranking-row strong {
  overflow-wrap: anywhere;
}

.ranking-row b {
  color: var(--teal-dark);
  white-space: nowrap;
}

.ranking-empty {
  margin: 0;
  color: var(--muted);
}

/* Question cards */
.qr-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--white);
}

.qr-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.qr-num {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  background: var(--teal);
  border-radius: 4px;
  padding: 2px 7px;
}

.qr-prompt {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.qr-pct {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 2px 8px;
  border-radius: 20px;
}
.qr-pct.pct-high { background: #d4f5e9; color: #0d6b4f; }
.qr-pct.pct-mid  { background: #fff3cd; color: #7d4c00; }
.qr-pct.pct-low  { background: #fde8e8; color: #9b1c1c; }

/* ── Pie chart ──────────────────────────────────────────────────────────── */
.qr-pie-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 4px 4px;
}

.qr-pie-svg { flex-shrink: 0; }

.qr-pie-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-pie-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink);
}

.qr-pie-row--correct .qr-pie-label {
  font-weight: 700;
  color: #065f46;
}

.qr-pie-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.qr-pie-label {
  flex: 1;
  line-height: 1.3;
}

.qr-pie-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 20px;
  text-align: right;
}

@media (max-width: 480px) {
  .podium-platform {
    grid-template-columns: 1fr;
  }

  .podium-card,
  .podium-card--first,
  .podium-card--second,
  .podium-card--third {
    min-height: 0;
  }

  .podium-card--first { order: 1; }
  .podium-card--second { order: 2; }
  .podium-card--third { order: 3; }

  .ranking-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .ranking-row b {
    grid-column: 2;
  }

  .qr-pie-wrap { flex-direction: column; align-items: flex-start; }
  .qr-pie-svg  { align-self: center; }
}

/* Answer bars (kept for potential reuse) */
.qr-answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-answer {
  display: grid;
  grid-template-columns: minmax(80px, 30%) 1fr 32px;
  align-items: center;
  gap: 8px;
}

.qr-ans-label {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-answer.qr-correct .qr-ans-label {
  color: var(--teal-dark);
  font-weight: 600;
}

.qr-bar-track {
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.qr-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--muted);
  transition: width 0.4s ease;
}

.qr-answer.qr-correct .qr-bar-fill {
  background: var(--teal);
}

.qr-votes {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}

/* Player table */
.qr-players h3 { margin: 0 0 10px; font-size: 1rem; }

.qr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.qr-table th,
.qr-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.qr-table tbody tr:last-child td { border-bottom: none; }

.qr-table th {
  background: var(--paper);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-rank   { font-weight: 700; color: var(--muted); }
.qr-name   { text-align: left !important; font-weight: 600; }
.qr-score  { font-weight: 700; color: var(--teal-dark); }
.qr-yes    { color: var(--teal); font-weight: 700; }
.qr-no     { color: var(--coral); font-weight: 700; }
.qr-skip   { color: var(--muted); }

.qr-no-players { color: var(--muted); text-align: center; padding: 20px; }

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero-band,
  .landing-hero,
  .host-layout {
    grid-template-columns: 1fr;
  }

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

  .hero-band,
  .landing-hero {
    min-height: 0;
  }

  .landing-features {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 32px clamp(16px, 4vw, 40px);
  }

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

  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: -1;
  }

  .admin-page {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .ghost-button {
    display: none;
  }

  .pin-panel div,
  .stats-band,
  .answer-board,
  .answers-editor {
    grid-template-columns: 1fr;
  }

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

  .card-actions .danger-button {
    text-align: center;
  }

  .hero-actions,
  .builder-actions,
  .host-controls {
    align-items: stretch;
    flex-direction: column;
  }

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

  .host-header {
    flex-direction: column;
  }

  .admin-menu {
    grid-template-columns: 1fr 1fr;
  }

  .admin-section-header,
  .admin-settings-list div {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.85);
  padding: 48px clamp(16px, 5vw, 72px) 32px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
}

.site-footer .brand-mark {
  background: var(--yellow);
  color: var(--ink);
}

.footer-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  margin: 0 0 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 28px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  margin: 0;
}

/* ── Full-page info pages (contact, support, dmca, terms, privacy) ─────────── */

.fp-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 68px);
}

/* Hero banner */
.fp-hero {
  padding: clamp(48px, 7vw, 96px) clamp(16px, 5vw, 72px);
  text-align: center;
}

.fp-hero--teal  { background: linear-gradient(135deg, #0a7874 0%, var(--teal) 100%); color: #fff; }
.fp-hero--yellow{ background: linear-gradient(135deg, #b8870a 0%, var(--yellow) 100%); color: var(--ink); }
.fp-hero--dark  { background: linear-gradient(135deg, #101828 0%, #1e2d3d 100%); color: #fff; }

.fp-hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.fp-hero .eyebrow {
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}
.fp-hero--yellow .eyebrow { color: rgba(0,0,0,0.5); }

.fp-hero-icon {
  display: block;
  font-size: 3.2rem;
  margin-bottom: 16px;
  line-height: 1;
}

.fp-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 0 0 16px;
  line-height: 1;
}

.fp-hero-sub {
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
  opacity: 0.82;
  margin: 0;
  max-width: 52ch;
  margin-inline: auto;
}

/* Body */
.fp-body {
  flex: 1;
  padding: clamp(40px, 6vw, 80px) clamp(16px, 5vw, 72px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.fp-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

/* CTA band */
.fp-cta-band {
  text-align: center;
  padding: 0 0 8px;
}

.fp-cta-band h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.fp-cta-band p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.fp-cta-band a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Contact page ─────────────────────────────────────────── */

.fp-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 0;
}

.fp-contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
}

.fp-contact-icon {
  font-size: 1.9rem;
  margin-bottom: 14px;
  line-height: 1;
}

.fp-contact-card h2 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.fp-contact-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

.fp-contact-link {
  display: inline-block;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Support / FAQ page ───────────────────────────────────── */

.fp-faq-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.fp-faq-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin: 0 0 16px;
}

.fp-faq {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
}

.fp-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.96rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.fp-faq summary::-webkit-details-marker { display: none; }

.fp-faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.fp-faq[open] summary::after {
  transform: rotate(45deg);
}

.fp-faq p {
  padding: 0 20px 16px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  font-size: 0.93rem;
  border-top: 1px solid var(--line);
}

/* ── DMCA / Terms / Privacy legal layout ─────────────────── */

.fp-legal-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 56px;
  align-items: start;
}

.fp-toc {
  position: sticky;
  top: 88px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fp-toc-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.fp-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-toc a {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}

.fp-toc a:hover {
  background: var(--paper);
  color: var(--ink);
}

.fp-legal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fp-legal-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.fp-legal-section:first-child { padding-top: 0; }
.fp-legal-section:last-child  { border-bottom: 0; }

.fp-legal-num {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

.fp-legal-section h2 {
  font-size: 1.15rem;
  margin: 0 0 14px;
}

.fp-legal-section p,
.fp-legal-section li {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.fp-legal-section ul {
  padding-left: 20px;
  margin: 8px 0 12px;
}

.fp-legal-section a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fp-legal-section a:hover { color: var(--teal); }

.fp-legal-section code {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
}

/* ── Privacy summary pills ────────────────────────────────── */

.fp-privacy-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.fp-privacy-pill {
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  color: var(--teal-dark);
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 0.88rem;
  font-weight: 700;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .fp-faq-layout    { grid-template-columns: 1fr; }
  .fp-legal-layout  { grid-template-columns: 1fr; }
  .fp-toc           { position: static; }
  .fp-contact-grid  { grid-template-columns: 1fr; }
}

/* ── Admin panel ─────────────────────────────────────────── */

.admin-nav-link {
  font-weight: 600;
  color: var(--teal-dark);
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.admin-header h1 { font-size: 1.8rem; margin: 0 0 4px; }
.admin-subtitle  { color: var(--muted); margin: 0; }

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 28px;
}

.admin-tab {
  padding: 10px 22px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover  { color: var(--ink); }
.admin-tab.active { color: var(--teal-dark); border-bottom-color: var(--teal); }

.admin-section-header    { margin-bottom: 16px; }
.admin-section-header h2 { font-size: 1.15rem; margin: 0 0 4px; }
.admin-section-desc      { color: var(--muted); font-size: 0.88rem; margin: 0; }

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  background: var(--paper);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-user-name    { font-weight: 600; }
.admin-user-email   { color: var(--muted); font-size: 0.85rem; }
.admin-user-date    { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.admin-user-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-badge {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.self-badge {
  display: inline-block;
  background: var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
}

.small-btn { padding: 5px 12px !important; font-size: 0.82rem !important; }

.danger-button {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.danger-button:hover { background: #fecaca; }
.muted-text { color: var(--muted); }

.admin-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.admin-page-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-page-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-page-icon { font-size: 1.3rem; }
.admin-page-name { flex: 1; font-size: 0.9rem; }
.admin-page-arrow { color: var(--muted); }

/* ── Admin: settings form ─────────────────────────────────── */

.admin-settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
}

.email-settings-form {
  max-width: 720px;
}

.admin-settings-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.admin-section-header--compact {
  margin-bottom: 18px;
}

.admin-settings-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-settings-row input,
.admin-settings-row select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--ink);
  width: 100%;
}

.admin-settings-row input:focus,
.admin-settings-row select:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  border-color: transparent;
}

.admin-settings-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 172px;
}

.admin-save-status {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-help-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.auth-help-link:hover {
  text-decoration: underline;
}

.auth-success {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

/* ── Audit trail ──────────────────────────────────────────── */

.audit-filter-bar {
  margin-bottom: 14px;
}

.audit-search {
  width: 100%;
  max-width: 360px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--white);
  color: var(--ink);
}

.audit-search:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}

.audit-table .audit-time    { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.audit-table .audit-user    { font-weight: 600; }
.audit-table .audit-ip      { font-size: 0.8rem; color: var(--muted); font-family: monospace; }
.audit-table .audit-details { font-size: 0.85rem; color: var(--muted); max-width: 260px; }

.audit-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.audit-tag--ok      { background: #d1fae5; color: #065f46; }
.audit-tag--warn    { background: #fef9c3; color: #713f12; }
.audit-tag--danger  { background: #fee2e2; color: #991b1b; }
.audit-tag--admin   { background: #ede9fe; color: #5b21b6; }
.audit-tag--neutral { background: var(--line); color: var(--muted); }

/* ── Security panel ───────────────────────────────────────── */

.sec-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.sec-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  background: var(--white);
}

.sec-card--ok { border-color: #a7f3d0; background: #f0fdf4; }

.sec-card-icon { font-size: 1.5rem; margin-bottom: 4px; }
.sec-card strong { font-size: 1.4rem; font-weight: 800; }
.sec-card span   { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.sec-policy { margin-bottom: 32px; }
.sec-policy h3 { font-size: 1rem; margin: 0 0 12px; }

.sec-policy-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sec-policy-list li {
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.sec-policy-list li strong { color: var(--ink); }

.sec-danger-zone {
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 20px 24px;
  background: #fff5f5;
}

.sec-danger-zone h3 { margin: 0 0 6px; font-size: 1rem; color: #991b1b; }
.sec-danger-zone p  { margin: 0 0 16px; font-size: 0.88rem; color: var(--muted); }

/* ── 2FA section ────────────────────────────────────────────────────────── */
.sec-2fa {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--surface);
}
.sec-2fa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sec-2fa-header h3 { margin: 0 0 4px; font-size: 1rem; }
.sec-2fa-header p  { margin: 0; font-size: 0.85rem; color: var(--muted); }
.sec-2fa-badge {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.sec-2fa-badge--on  { background: #dcfce7; color: #166534; }
.sec-2fa-badge--off { background: #f1f5f9; color: var(--muted); }
.sec-2fa-note { font-size: 0.88rem; color: var(--muted); margin: 0 0 16px; }
.sec-2fa-setup-btn { margin-bottom: 4px; }
.sec-2fa-setup-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 14px;
}
.sec-2fa-key-label { font-size: 0.8rem; color: var(--muted); margin: 0 0 6px; }
.sec-2fa-key-row { display: flex; align-items: center; gap: 10px; }
.sec-2fa-key {
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  word-break: break-all;
  flex: 1;
}
.sec-2fa-uri-link {
  display: inline-block;
  margin: 8px 0;
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
}
.sec-2fa-qr {
  display: block;
  width: 160px;
  height: 160px;
  margin: 8px 0 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
}
.sec-2fa-enable-row,
.sec-2fa-disable-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sec-2fa-code {
  width: 140px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-align: center;
}
.sec-2fa-err { color: #dc2626; font-size: 0.85rem; margin: 8px 0 0; }

/* ── 2FA OTP login step ──────────────────────────────────────────────────── */
.totp-step { text-align: center; padding: 16px 0; }
.totp-step-icon  { font-size: 2.5rem; margin-bottom: 12px; }
.totp-step-title { font-size: 1.3rem; margin: 0 0 8px; }
.totp-step-hint  { font-size: 0.9rem; color: var(--muted); margin: 0 0 20px; }
.totp-code-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.totp-code-input:focus { border-color: var(--accent); }
.totp-error { margin-top: 10px; color: #dc2626; font-size: 0.87rem; }
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 4px 0;
  text-decoration: underline;
}

/* ── Payment gateway config ─────────────────────────────────────────────── */
.pay-status-badge {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.pay-status-badge--on  { background: #dcfce7; color: #166534; }
.pay-status-badge--off { background: #f1f5f9; color: var(--muted); }

.pay-config-form { display: flex; flex-direction: column; gap: 28px; }

/* Gateway selector cards */
.pay-gateway-select {}
.pay-gateway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}
.pay-gateway-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.pay-gateway-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pay-gateway-card strong { font-size: 0.9rem; color: var(--ink); }
.pay-gateway-card span  { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.pay-gateway-card:hover { border-color: var(--accent); }
.pay-gateway-card.active {
  border-color: var(--accent);
  background: #eef2ff;
}
.pay-gateway-logo {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.pay-gateway-logo--paystack { background: #e0f7fc; }
.pay-gateway-logo--hubtel   { background: #fff3e0; }
.pay-gateway-logo--none     { background: #f1f5f9; }

/* Mode toggle */
.pay-mode-row { padding: 14px 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.pay-toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.9rem; }
.pay-toggle-label em { color: var(--muted); font-style: normal; font-size: 0.83rem; }
.pay-toggle-check { display: none; }
.pay-toggle-ui {
  width: 40px; height: 22px; flex-shrink: 0;
  background: #cbd5e1; border-radius: 11px;
  position: relative; transition: background .2s;
}
.pay-toggle-ui::after {
  content: ""; position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.pay-toggle-check:checked + .pay-toggle-ui { background: var(--accent); }
.pay-toggle-check:checked + .pay-toggle-ui::after { transform: translateX(18px); }

/* Credential fields */
.pay-fields {
  display: flex; flex-direction: column; gap: 16px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.pay-section-title { font-weight: 700; font-size: 0.9rem; margin: 0; color: var(--ink); }
.pay-field-row { display: flex; flex-direction: column; gap: 6px; }
.pay-field-label { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.pay-field-hint  { font-weight: 400; color: var(--muted); }
.pay-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; font-family: monospace;
  box-sizing: border-box; outline: none;
  transition: border-color .15s;
}
.pay-input:focus { border-color: var(--accent); }
.pay-secret-wrap { display: flex; gap: 8px; align-items: center; }
.pay-secret-wrap .pay-input { flex: 1; }
.pay-help-box {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 12px 14px;
}
.pay-help-box p { margin: 0 0 4px; font-size: 0.82rem; color: #78350f; line-height: 1.5; }
.pay-help-box p:last-child { margin: 0; }
.pay-help-box code { background: #fef3c7; padding: 1px 4px; border-radius: 4px; font-size: 0.8rem; }

/* Actions */
.pay-actions { display: flex; align-items: center; gap: 14px; }
.pay-save-status { color: #059669; font-weight: 600; font-size: 0.88rem; }

.donation-settings-form {
  display: grid;
  gap: 22px;
  max-width: 900px;
}

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

.donation-wide {
  grid-column: 1 / -1;
}

.donation-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
  color: var(--ink);
}

.donation-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

@media (max-width: 620px) {
  .pay-gateway-grid { grid-template-columns: 1fr; }
  .donation-settings-grid { grid-template-columns: 1fr; }
}

/* ── Donate modal ────────────────────────────────────────────────────────── */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: translateY(0) } }

.donate-modal {
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: slideUp .22s ease;
}

.donate-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background .15s;
}
.donate-modal-close:hover { background: #e2e8f0; color: var(--ink); }

.donate-modal-hero {
  text-align: center;
  margin-bottom: 24px;
}
.donate-heart { font-size: 2.8rem; margin-bottom: 10px; }
.donate-modal-hero h2 { margin: 0 0 8px; font-size: 1.4rem; }
.donate-modal-hero p  { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.55; }

/* Amount chips */
.donate-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.donate-amt {
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  color: var(--ink);
}
.donate-amt:hover { border-color: var(--accent); background: #eef2ff; color: var(--accent); }
.donate-amt.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Custom amount */
.donate-custom-row { margin-bottom: 20px; }
.donate-custom-row label { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; display: block; }
.donate-custom-wrap { position: relative; display: flex; align-items: center; }
.donate-currency {
  position: absolute; left: 12px;
  font-weight: 700; color: var(--muted); pointer-events: none;
}
.donate-custom-input {
  width: 100%;
  padding: 10px 12px 10px 26px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.donate-custom-input:focus { border-color: var(--accent); }

/* Payment methods */
.donate-methods { margin-bottom: 16px; }
.donate-method-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.donate-method-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.donate-method {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer; color: var(--muted);
  transition: all .15s;
}
.donate-method:hover { border-color: var(--accent); color: var(--accent); }
.donate-method.active { border-color: var(--accent); background: #eef2ff; color: var(--accent); }

/* Method detail box */
.donate-method-detail {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.donate-method-detail p { margin: 0 0 4px; }
.donate-method-detail p:last-child { margin: 0; }
.donate-email-hint strong { color: var(--ink); }

/* Submit */
.donate-submit {
  width: 100%;
  font-size: 1.05rem;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
}
.donate-submit-amount { font-weight: 800; }
.donate-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.admin-page {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  max-width: none;
  min-height: calc(100vh - 70px);
  margin: 0;
  padding: 0;
}

.admin-sidebar {
  position: sticky;
  top: 65px;
  align-self: start;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 22px;
  min-height: calc(100vh - 70px);
  border-right: 1px solid var(--line);
  background: var(--white);
  padding: 22px;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar-head div {
  display: grid;
  gap: 2px;
}

.admin-sidebar-head strong {
  font-size: 1rem;
}

.admin-sidebar-head span:not(.brand-mark) {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
}

.admin-menu-icon {
  display: inline-grid;
  width: 22px;
  min-width: 22px;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.admin-menu-item:hover {
  background: #edf2f5;
  color: var(--ink);
}

.admin-menu-item.active {
  border-color: #bfe4df;
  background: #e7f7f5;
  color: var(--teal-dark);
}

.admin-sidebar-tools,
.admin-sidebar-account {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.admin-sidebar-tools p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-sidebar-tools a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 9px 12px;
}

.admin-sidebar-tools a:hover {
  background: #edf2f5;
  color: var(--ink);
}

.admin-sidebar-account {
  align-self: end;
}

.admin-sidebar-account span {
  display: block;
  border-radius: 8px;
  background: #d9eee8;
  color: #3d6f69;
  font-weight: 800;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-account .ghost-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.admin-main {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: clamp(22px, 4vw, 44px);
}

.admin-main .admin-header {
  margin-bottom: 0;
}

.admin-main .admin-header h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

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

.admin-overview-grid article,
.admin-settings-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
}

.admin-overview-grid span,
.admin-settings-list span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-overview-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.admin-settings-list {
  display: grid;
  gap: 12px;
}

.admin-settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-section {
  min-width: 0;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

/* ── Admin: page edit FAB ─────────────────────────────────── */

.page-edit-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  gap: 6px;
}

/* ── Admin: page editor modal ─────────────────────────────── */

.page-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(23, 32, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
}

.page-editor-modal {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.page-editor-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.page-editor-header span {
  color: var(--teal-dark);
  font-style: italic;
}

.page-editor-hint {
  padding: 10px 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.page-editor-textarea {
  flex: 1;
  margin: 12px 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  resize: none;
  background: var(--paper);
  color: var(--ink);
  min-height: 0;
}

.page-editor-textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}

.page-editor-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
