﻿/* ===== Scripture's Purpose — Stylesheet ===== */

/* ---------- Theme variables ---------- */
:root {
  /* Light theme */
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --card-elevated: #fafafa;
  --primary: #1a1a1a;
  --primary-foreground: #ffffff;
  --primary-hover: #333333;
  --secondary: #f5f5f5;
  --secondary-foreground: #1a1a1a;
  --muted: #f5f5f5;
  --muted-foreground: #888888;
  --accent: #f0f0f0;
  --accent-foreground: #1a1a1a;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #e8e8e8;
  --border-subtle: #f0f0f0;
  --input: #e8e8e8;
  --ring: #1a1a1a;
  --sidebar: #fafafa;
  --sidebar-foreground: #1a1a1a;
  --sidebar-accent: #f0f0f0;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --glow: 0 0 0 1px rgba(0,0,0,0.02);
}

html.dark {
  /* True black dark mode with subtle depth */
  --background: #000000;
  --foreground: #f5f5f5;
  --card: #0a0a0a;
  --card-foreground: #f5f5f5;
  --card-elevated: #111111;
  --primary: #f5f5f5;
  --primary-foreground: #000000;
  --primary-hover: #ffffff;
  --secondary: #141414;
  --secondary-foreground: #f5f5f5;
  --muted: #141414;
  --muted-foreground: #707070;
  --accent: #1a1a1a;
  --accent-foreground: #f5f5f5;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #1f1f1f;
  --border-subtle: #161616;
  --input: #1f1f1f;
  --ring: #f5f5f5;
  --sidebar: #000000;
  --sidebar-foreground: #f5f5f5;
  --sidebar-accent: #141414;
  --shadow: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.6);
  --glow: 0 0 0 1px rgba(255,255,255,0.04);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

/* Subtle radial gradient — adds depth without distracting */
html.dark body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,255,255,0.025), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255,255,255,0.015), transparent 60%),
    var(--background);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
code { font-family: "SF Mono", Monaco, Menlo, Consolas, monospace; font-size: 0.9em; }

/* Ensure [hidden] attribute always wins */
[hidden] { display: none !important; }

/* Custom scrollbars everywhere — hide default browser scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* ---------- Landing page ---------- */
.landing-page {
  position: fixed; inset: 0; z-index: 9999;
  overflow-y: auto;
  background: var(--background);
  transition: opacity 0.45s ease, visibility 0.45s ease;
  -webkit-overflow-scrolling: touch;
}
html.dark .landing-page {
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(255,255,255,0.05), transparent 55%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(255,255,255,0.025), transparent 60%),
    var(--background);
}
.landing-page.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.landing-shell {
  max-width: 760px; margin: 0 auto;
  padding: 64px 24px 40px;
  display: flex; flex-direction: column; align-items: stretch;
}

/* Hero */
.landing-hero {
  text-align: center;
  padding: 32px 0 56px;
  animation: landFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.landing-logo {
  width: 72px; height: 72px; margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-elevated); border: 1px solid var(--border);
  border-radius: 18px; color: var(--foreground);
}
html.dark .landing-logo {
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.06),
    0 8px 32px rgba(0,0,0,0.55);
}
.landing-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted-foreground);
  margin-bottom: 14px;
}
.landing-title {
  font-size: clamp(40px, 8vw, 56px); font-weight: 700;
  color: var(--foreground); letter-spacing: -0.035em;
  line-height: 1.05; margin-bottom: 14px;
}
.landing-tagline {
  font-size: clamp(17px, 3vw, 21px); color: var(--foreground);
  font-weight: 500; letter-spacing: -0.01em; margin-bottom: 14px;
}
.landing-desc {
  font-size: 15px; color: var(--muted-foreground);
  line-height: 1.65; margin: 0 auto 32px;
  max-width: 520px;
}
.landing-cta {
  min-width: 220px;
  position: relative;
  animation: landPulse 3.6s ease-in-out 1.5s infinite;
}
.landing-cta svg { transition: transform 0.2s ease; }
.landing-cta:hover svg { transform: translateX(3px); }
.landing-meta {
  margin-top: 18px; font-size: 13px; color: var(--muted-foreground);
  display: flex; gap: 8px; align-items: center;
  justify-content: center; flex-wrap: wrap;
}
.landing-meta .dot { opacity: 0.5; }

/* Section headers */
.landing-section-title {
  font-size: clamp(22px, 4vw, 28px); font-weight: 600;
  color: var(--foreground); letter-spacing: -0.02em;
  text-align: center; margin-bottom: 8px;
}
.landing-section-sub {
  text-align: center; font-size: 14px;
  color: var(--muted-foreground); margin-bottom: 32px;
}

/* How it works */
.landing-how {
  padding: 40px 0;
  animation: landFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.how-step {
  position: relative;
  padding: 28px 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
html.dark .how-step {
  background: var(--card-elevated);
}
.how-step:hover { transform: translateY(-2px); border-color: var(--muted-foreground); }
.how-num {
  position: absolute; top: 14px; right: 16px;
  font-size: 11px; font-weight: 700; color: var(--muted-foreground);
  letter-spacing: 0.05em;
}
.how-icon {
  width: 44px; height: 44px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border-radius: 12px;
  color: var(--foreground);
}
.how-step h3 {
  font-size: 15px; font-weight: 600; color: var(--foreground);
  margin-bottom: 8px; letter-spacing: -0.01em;
}
.how-step p {
  font-size: 13px; color: var(--muted-foreground);
  line-height: 1.55;
}

/* Preview */
.landing-preview {
  padding: 48px 0 32px;
  display: flex; justify-content: center;
  animation: landFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
.landing-preview-stage {
  display: flex; gap: 16px; flex-wrap: wrap;
  justify-content: center; align-items: stretch;
}
.preview-card {
  width: 240px; min-height: 200px;
  padding: 28px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  position: relative;
}
html.dark .preview-card {
  background: var(--card-elevated);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.preview-card-front {
  animation: landFloat 5s ease-in-out infinite;
}
.preview-card-back {
  animation: landFloat 5s ease-in-out 0.6s infinite;
}
.preview-card-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted-foreground);
  margin-bottom: 12px;
}
.preview-card-ref {
  font-size: 28px; font-weight: 700; color: var(--foreground);
  letter-spacing: -0.02em; margin-bottom: 18px;
}
.preview-card-hint {
  font-size: 12px; color: var(--muted-foreground);
}
.preview-card-verse {
  font-size: 14px; line-height: 1.55; color: var(--foreground);
  font-style: italic;
}

/* Features */
.landing-features {
  padding: 32px 0 48px;
  animation: landFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
html.dark .feature-item { background: var(--card-elevated); }
.feature-item:hover { border-color: var(--muted-foreground); transform: translateY(-1px); }
.feature-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border-radius: 10px;
  color: var(--foreground);
}
.feature-text h4 {
  font-size: 14px; font-weight: 600; color: var(--foreground);
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.feature-text p {
  font-size: 13px; color: var(--muted-foreground);
  line-height: 1.5;
}

/* Final CTA */
.landing-final {
  text-align: center;
  padding: 56px 0 40px;
  border-top: 1px solid var(--border-subtle);
  animation: landFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
.landing-final h2 {
  font-size: clamp(24px, 5vw, 32px); font-weight: 700;
  color: var(--foreground); letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.landing-final p {
  font-size: 15px; color: var(--muted-foreground);
  margin-bottom: 28px;
}

/* Footer */
.landing-footer {
  text-align: center; padding: 24px 0 8px;
  font-size: 12px; color: var(--muted-foreground);
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap; opacity: 0.7;
}
.landing-footer .dot { opacity: 0.5; }

/* Subtle brand logo in footer */
.landing-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.landing-footer-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.7;
  filter: grayscale(1) brightness(1.5);
  transition: opacity 0.15s ease;
}
.landing-footer-logo:hover { opacity: 1; }
html.dark .landing-footer-logo {
  filter: grayscale(1) brightness(2);
}

/* "Beta" badge — small pill next to title and footer link */
.beta-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-size: 0.32em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  margin-left: 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--foreground);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  position: relative;
  top: -0.18em;
  white-space: nowrap;
}
.beta-badge:hover {
  background: var(--secondary);
  border-color: var(--muted-foreground);
}
.beta-badge:active {
  transform: scale(0.96);
}
html.dark .beta-badge {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
html.dark .beta-badge:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* Subtle text link for "Report a Bug" */
.landing-footer-link {
  display: inline;
  font: inherit;
  color: var(--muted-foreground);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.landing-footer-link:hover {
  color: var(--foreground);
  text-decoration-color: var(--muted-foreground);
}

/* Entrance + ambient animations */
@keyframes landFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes landPulse {
  0%, 100% { box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.12), 0 1px 2px rgba(0,0,0,0.4); }
  50%      { box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.18), 0 0 0 4px rgba(245,245,245,0.08), 0 1px 2px rgba(0,0,0,0.4); }
}
@keyframes landFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 640px) {
  .landing-shell { padding: 32px 18px 28px; }
  .landing-hero { padding: 8px 0 28px; }
  .landing-logo { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px; }
  .landing-logo svg { width: 32px; height: 32px; }
  .landing-eyebrow { font-size: 10px; letter-spacing: 0.16em; margin-bottom: 10px; }
  .landing-tagline { font-size: 15px; margin-bottom: 10px; }
  .landing-desc { font-size: 14px; line-height: 1.55; margin-bottom: 24px; }
  .landing-cta { min-width: 180px; height: 44px; padding: 0 24px; font-size: 14px; }
  .landing-meta { font-size: 12px; margin-top: 14px; }
  .how-grid { grid-template-columns: 1fr; gap: 10px; }
  .how-step { padding: 18px 16px 16px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; }
  .how-icon { width: 36px; height: 36px; margin: 0 0 10px; border-radius: 10px; }
  .how-icon svg { width: 18px; height: 18px; }
  .how-step h3 { font-size: 14px; margin-bottom: 4px; }
  .how-step p { font-size: 12px; line-height: 1.5; }
  .landing-how { padding: 28px 0; }
  .landing-section-title { font-size: 20px; margin-bottom: 6px; }
  .landing-section-sub { font-size: 13px; margin-bottom: 22px; }
  .features-grid { grid-template-columns: 1fr; gap: 8px; }
  .feature-item { padding: 14px 16px; gap: 12px; }
  .feature-icon { width: 32px; height: 32px; border-radius: 9px; }
  .feature-icon svg { width: 16px; height: 16px; }
  .feature-text h4 { font-size: 13px; margin-bottom: 2px; }
  .feature-text p { font-size: 12px; line-height: 1.45; }
  .landing-features { padding: 24px 0 32px; }
  .preview-card { width: 100%; max-width: 320px; min-height: 170px; padding: 22px 20px; }
  .preview-card-ref { font-size: 24px; margin-bottom: 14px; }
  .preview-card-verse { font-size: 13px; }
  .landing-preview { padding: 32px 0 24px; }
  .landing-preview-stage { gap: 12px; }
  .landing-final { padding: 40px 0 28px; }
  .landing-final h2 { font-size: 22px; margin-bottom: 6px; }
  .landing-final p { font-size: 14px; margin-bottom: 22px; }
  .landing-footer { padding: 18px 0 4px; font-size: 11px; }
}

/* Landscape phones and small tablets — wider viewport, short height.
   Use horizontal space, compress vertical rhythm. */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 500px) {
  .landing-shell { padding: 24px 24px 24px; max-width: 880px; }
  .landing-hero { padding: 4px 0 20px; }
  .landing-logo { width: 56px; height: 56px; margin: 0 auto 14px; }
  .landing-logo svg { width: 28px; height: 28px; }
  .landing-eyebrow { margin-bottom: 8px; }
  .landing-title { font-size: 36px; margin-bottom: 8px; }
  .landing-tagline { font-size: 15px; margin-bottom: 8px; max-width: 720px; margin-left: auto; margin-right: auto; }
  .landing-desc { font-size: 14px; margin-bottom: 18px; max-width: 720px; }
  .landing-cta { min-width: 220px; height: 44px; }
  .landing-meta { margin-top: 10px; }
  .landing-how { padding: 20px 0; }
  .how-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .how-step { padding: 18px 14px 16px; }
  .how-icon { width: 36px; height: 36px; margin: 0 auto 10px; }
  .how-step h3 { font-size: 13px; margin-bottom: 4px; }
  .how-step p { font-size: 11px; line-height: 1.45; }
  .landing-section-title { font-size: 20px; margin-bottom: 4px; }
  .landing-section-sub { font-size: 12px; margin-bottom: 16px; }
  .features-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .feature-item { padding: 14px 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .feature-icon { width: 30px; height: 30px; }
  .feature-text h4 { font-size: 12px; margin-bottom: 2px; }
  .feature-text p { font-size: 11px; line-height: 1.4; }
  .landing-features { padding: 20px 0 24px; }
  .preview-card { width: 100%; min-height: 150px; padding: 18px 16px; }
  .preview-card-ref { font-size: 20px; margin-bottom: 10px; }
  .preview-card-verse { font-size: 12px; }
  .landing-preview { padding: 20px 0 20px; }
  .landing-final { padding: 24px 0 20px; }
  .landing-final h2 { font-size: 22px; margin-bottom: 4px; }
  .landing-final p { font-size: 13px; margin-bottom: 16px; }
  .landing-footer { padding: 12px 0 4px; }
}

/* Slightly wider phones in landscape (e.g. 568x320 iPhone SE) — keep 1-col features
   but compress vertical rhythm. */
@media (max-width: 600px) and (orientation: landscape) and (max-height: 500px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: 1fr 1fr; }
  .landing-desc { max-width: 100%; }
}

/* Very short viewports (e.g. iPhone SE landscape 568x320) — aggressive compression
   so the page doesn't feel oppressively cramped. */
@media (max-height: 400px) and (orientation: landscape) {
  .landing-shell { padding: 16px 18px 16px; max-width: 100%; }
  .landing-hero { padding: 0 0 14px; }
  .landing-logo { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; }
  .landing-logo svg { width: 22px; height: 22px; }
  .landing-eyebrow { font-size: 9px; letter-spacing: 0.14em; margin-bottom: 6px; }
  .landing-title { font-size: 26px; margin-bottom: 6px; }
  .landing-tagline { font-size: 13px; margin-bottom: 6px; }
  .landing-desc { font-size: 12px; line-height: 1.5; margin-bottom: 12px; max-width: 100%; }
  .landing-cta { min-width: 180px; height: 38px; padding: 0 20px; font-size: 13px; }
  .landing-meta { font-size: 10px; margin-top: 8px; }
  .landing-how { padding: 14px 0; }
  .how-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .how-step { padding: 12px 10px 10px; }
  .how-num { top: 8px; right: 10px; font-size: 9px; }
  .how-icon { width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 8px; }
  .how-icon svg { width: 14px; height: 14px; }
  .how-step h3 { font-size: 11px; margin-bottom: 2px; }
  .how-step p { font-size: 10px; line-height: 1.35; }
  .landing-section-title { font-size: 16px; margin-bottom: 2px; }
  .landing-section-sub { font-size: 11px; margin-bottom: 10px; }
  .features-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .feature-item { padding: 10px 10px; gap: 6px; flex-direction: column; align-items: flex-start; }
  .feature-icon { width: 24px; height: 24px; border-radius: 7px; }
  .feature-icon svg { width: 13px; height: 13px; }
  .feature-text h4 { font-size: 11px; margin-bottom: 1px; }
  .feature-text p { font-size: 10px; line-height: 1.35; }
  .landing-features { padding: 14px 0 16px; }
  .preview-card { width: 100%; min-height: 110px; padding: 14px 12px; }
  .preview-card-label { font-size: 9px; margin-bottom: 6px; }
  .preview-card-ref { font-size: 16px; margin-bottom: 6px; }
  .preview-card-hint { font-size: 10px; }
  .preview-card-verse { font-size: 10px; line-height: 1.4; }
  .landing-preview { padding: 14px 0 12px; }
  .landing-preview-stage { gap: 8px; }
  .landing-final { padding: 16px 0 12px; }
  .landing-final h2 { font-size: 18px; margin-bottom: 2px; }
  .landing-final p { font-size: 12px; margin-bottom: 10px; }
  .landing-footer { padding: 8px 0 2px; font-size: 10px; }
}

/* Wider phones in portrait (390px+) — use 2-col features grid to reduce page length */
@media (min-width: 380px) and (max-width: 640px) and (orientation: portrait) {
  .features-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .feature-item { flex-direction: column; align-items: flex-start; padding: 14px 14px; }
  .feature-icon { width: 30px; height: 30px; }
  .feature-text h4 { font-size: 12px; }
  .feature-text p { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero, .landing-how, .landing-preview, .landing-features, .landing-final,
  .preview-card-front, .preview-card-back, .landing-cta {
    animation: none !important;
  }
}

/* ---------- App layout ---------- */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Main cycle view (always visible) ---------- */
#cycle-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

/* ---------- Empty hero (no verses yet) ---------- */
#empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  text-align: center;
  padding: 24px;
  position: relative;
}
.empty-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 480px;
}
.empty-hero-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--foreground);
  margin-bottom: 8px;
  position: relative;
}
html.dark .empty-hero-icon {
  background: var(--card-elevated);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.05),
    0 4px 16px rgba(0,0,0,0.4);
}
html.dark .empty-hero-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.empty-hero h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
.empty-hero p {
  font-size: 15px;
  color: var(--muted-foreground);
  line-height: 1.6;
  max-width: 360px;
}
.empty-corners {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}

/* ---------- Corner buttons ---------- */
.corner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted-foreground);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
html.dark .corner-btn {
  background: var(--card-elevated);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.04);
}
.corner-btn:hover {
  background: var(--accent);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}
.corner-btn-lg {
  width: auto;
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
}
.corner-btn-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Cycle top bar ---------- */
.cycle-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 769px) {
  .cycle-top-bar { padding: 20px 32px; }
}
.cycle-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.cycle-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cycle-table-info { min-width: 0; }
.cycle-table-info .small { font-size: 12px; }
.cycle-table-info .medium {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.translation-badge {
  padding: 6px 12px;
  background: var(--secondary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--foreground);
}

/* ---------- Drawer (slide-out panel) ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--background);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
html.dark .drawer {
  background: var(--background);
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}
html.dark .drawer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
  pointer-events: none;
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.drawer-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.drawer-section:last-of-type {
  border-bottom: none;
}
.drawer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.drawer-section-header span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}
.drawer-ad {
  padding: 20px 24px;
}

/* ---------- Sidebar ---------- */
#sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--foreground);
  color: var(--background);
  border-radius: 8px;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sidebar-foreground);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 8px;
}

.sidebar-section-header span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted-foreground);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}

/* ---------- New table form ---------- */
.new-table-form {
  padding: 0 12px 8px;
  display: flex;
  gap: 8px;
}
.new-table-form input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
}
.new-table-form input:focus {
  outline: none;
  border-color: var(--ring);
}

.tables-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}
.tables-list::-webkit-scrollbar { width: 4px; }
.tables-list::-webkit-scrollbar-track { background: transparent; }
.tables-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.table-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  color: var(--sidebar-foreground);
  border-radius: 8px;
  text-align: left;
  transition: background 0.15s;
  margin-bottom: 1px;
  font-size: 14px;
}
.table-item:hover { background: var(--sidebar-accent); }
.table-item.active { background: var(--sidebar-accent); }

.table-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.table-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.table-item-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.table-item-menu {
  display: none;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--muted-foreground);
}
.table-item:hover .table-item-menu { display: flex; }
.table-item-menu:hover { background: var(--card); color: var(--foreground); }

.table-item-rename-input {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--ring);
  border-radius: 6px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
}

/* Dropdown menu */
.dropdown {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 160px;
  z-index: 100;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  color: var(--foreground);
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--accent); }
.dropdown-item.danger { color: var(--destructive); }
.dropdown-item.danger:hover { background: color-mix(in srgb, var(--destructive) 12%, transparent); }
.dropdown-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.sidebar-footer p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.sidebar-ad {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* Ad placeholder */
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ad-sidebar { min-height: 200px; }
.ad-inline { min-height: 90px; width: 100%; }

/* ---------- Main ---------- */
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-header, .desktop-header {
  display: none;
}

@media (max-width: 768px) {
  #sidebar { display: none; }
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-title { flex: 1; min-width: 0; }
  .mobile-table-name {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }
  .mobile-table-meta { font-size: 12px; color: var(--muted-foreground); }
}
@media (min-width: 769px) {
  .desktop-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
  }
}

.hide-mobile { }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}

/* ---------- Cycle top bar — mobile fixes ----------
   On phones the top bar collapses to one row so the flip card remains visible
   above the fold. Help and Support stay out of the compact header; Packs is
   restored as an icon-only control in portrait mode. */
@media (max-width: 640px) {
  .cycle-top-bar {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    flex-shrink: 0;
  }
  /* LEFT column — only show drawer + table info inline */
  .cycle-left {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
  }
  /* Keep Support out of the compact mobile header. Packs is restored below
     for portrait phones as a small icon-only control. */
  #open-marketplace-btn,
  #open-support-btn {
    display: none !important;
  }
  /* Keep the table-info inline, but make it compact */
  .cycle-table-info {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
  }
  .cycle-table-info .small { font-size: 10px; }
  .cycle-table-info .medium { font-size: 13px; }

  /* RIGHT column — keep translation badge + 3 essential buttons in one row */
  .cycle-right {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
  }
  /* Translation badge — small inline pill */
  #translation-badge {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 10px;
    letter-spacing: 0.04em;
    border-radius: 6px;
  }
  /* Hide the Help/Tutorial button on mobile (it's in Settings → Help & Feedback) */
  #open-tutorial-btn-cycle {
    display: none !important;
  }
  .cycle-right .corner-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
  }
  .cycle-right .corner-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Portrait phones still need direct access to Verse Packs. Show the Packs
   control as a compact icon so the entire top bar remains on one row. */
@media (max-width: 640px) and (orientation: portrait) {
  #open-marketplace-btn {
    display: inline-flex !important;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    flex: 0 0 34px;
    flex-direction: row;
    gap: 0;
  }
  #open-marketplace-btn svg {
    width: 16px;
    height: 16px;
  }
  #open-marketplace-btn .corner-btn-label {
    display: none;
  }
}

/* Even smaller phones — keep the layout identical, just shrink everything a hair */
@media (max-width: 380px) {
  .cycle-top-bar { padding: 8px 12px; gap: 6px; }
  .cycle-left { gap: 6px; }
  .cycle-right { gap: 2px; }
  .cycle-right .corner-btn { width: 30px; height: 30px; }
  .cycle-right .corner-btn svg { width: 14px; height: 14px; }
  #translation-badge { padding: 3px 6px; font-size: 9px; }
  .cycle-table-info .small { font-size: 9px; }
  .cycle-table-info .medium { font-size: 12px; }
}

/* ---------- Mobile sidebar overlay ---------- */
.mobile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
}
.mobile-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
}
.mobile-sidebar .sidebar-brand { padding: 24px 20px 20px; }
.mobile-sidebar .sidebar-section-header { padding: 4px 20px 8px; }
.mobile-sidebar .tables-list { padding: 0 8px 16px; }
.mobile-sidebar .sidebar-footer { border-top: 1px solid var(--border); padding: 12px 20px; }

/* ---------- Browse mode ---------- */
.browse-mode {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.browse-mode::-webkit-scrollbar { width: 4px; }
.browse-mode::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.browse-left {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 1024px) {
  .browse-mode { flex-direction: column; padding: 20px; }
  .browse-left { width: 100%; }
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  position: relative;
}

/* Subtle top-edge highlight on dark cards for depth */
html.dark .card {
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.03),
    0 1px 2px rgba(0,0,0,0.4);
}
html.dark .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 30%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card-header p {
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ---------- Form ---------- */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.form-row .form-group { margin-bottom: 0; }

input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 15%, transparent);
}
input[type="text"]::placeholder, input[type="email"]::placeholder, input[type="password"]::placeholder {
  color: var(--muted-foreground);
}
input.invalid { border-color: var(--destructive); }

/* ---------- Combobox ---------- */
.combobox { position: relative; }
.combobox-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.15s;
}
.combobox-btn:hover { border-color: var(--muted-foreground); }
.combobox-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}
.combobox-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}
.combobox-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  height: 24px;
}
.combobox-search input:focus { outline: none; box-shadow: none; }
.combobox-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}
.combobox-list::-webkit-scrollbar { width: 4px; }
.combobox-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.combobox-group-label {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}
.combobox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--foreground);
  text-align: left;
  font-size: 14px;
  width: 100%;
  border-radius: 6px;
  transition: background 0.1s;
}
.combobox-item:hover { background: var(--accent); }
.combobox-item .check {
  width: 16px;
  height: 16px;
  opacity: 0;
  color: var(--foreground);
}
.combobox-item.selected .check { opacity: 1; }
.combobox-item .chapters {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-foreground);
}
.combobox-empty {
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted-foreground);
}

/* ---------- Preview row ---------- */
.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.preview-badge {
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Divider ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}

/* ---------- Quick add ---------- */
.quick-add-row {
  display: flex;
  gap: 8px;
}
.input-with-icon {
  position: relative;
  flex: 1;
}
.input-with-icon svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}
.input-with-icon input {
  padding-left: 36px;
}

/* ---------- Tip box ---------- */
.tip-box {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--secondary);
  margin-top: 20px;
}
.tip-box svg { flex-shrink: 0; color: var(--muted-foreground); margin-top: 2px; }
.tip-box div { font-size: 12px; line-height: 1.5; color: var(--muted-foreground); }
.tip-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card);
  color: var(--foreground);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: var(--primary);
  color: var(--primary-foreground);
  transition: background 0.15s, opacity 0.15s, transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
  position: relative;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Primary button gets a subtle inner highlight in dark mode */
html.dark .btn:not(.btn-secondary):not(.btn-ghost):not(.btn-danger):not(.btn-outline) {
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.12),
    0 1px 2px rgba(0,0,0,0.4);
}
html.dark .btn:not(.btn-secondary):not(.btn-ghost):not(.btn-danger):not(.btn-outline):active {
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.06),
    0 0 0 rgba(0,0,0,0);
}
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 32px; font-size: 15px; min-width: 180px; }
.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover { background: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover { background: var(--accent); color: var(--foreground); }
.btn-danger {
  background: var(--destructive);
  color: var(--destructive-foreground);
}
.btn-danger:hover { background: color-mix(in srgb, var(--destructive) 90%, black); }
.danger-hover:hover { color: var(--destructive); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--accent); }

/* ---------- Help card ---------- */
.help-card {
  border-color: var(--border);
  background: var(--secondary);
}
.help-card h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}
.help-card ol { padding-left: 0; }
.help-card li {
  font-size: 14px;
  color: var(--foreground);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ---------- Verses list ---------- */
.verses-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.verses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.verses-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.verses-header p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.verses-actions {
  display: flex;
  gap: 8px;
}
.filter-row {
  padding: 16px 24px 0;
}
.filter-row input { height: 38px; }
.verses-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 0;
}
.verses-list-body::-webkit-scrollbar { width: 4px; }
.verses-list-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.verse-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.1s;
}
.verse-item:hover { background: var(--accent); }
.verse-item-num {
  width: 24px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.verse-item-info { flex: 1; min-width: 0; }
.verse-item-ref {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.verse-item-meta {
  font-size: 12px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.verse-item-remove {
  display: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.1s, background 0.1s;
}
.verse-item:hover .verse-item-remove { display: flex; }
.verse-item-remove:hover { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 12%, transparent); }

.verse-item-edit {
  display: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.1s, background 0.1s;
}
.verse-item:hover .verse-item-edit { display: flex; }
.verse-item-edit:hover { color: var(--foreground); background: var(--accent); }

.verse-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--foreground);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--muted-foreground);
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  max-width: 300px;
  line-height: 1.6;
}

/* ---------- Cycle mode ---------- */
.cycle-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.cycle-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
@media (min-width: 769px) {
  .cycle-top-bar { padding: 16px 32px; }
}
.cycle-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.cycle-table-info { min-width: 0; }
.cycle-table-info .small { font-size: 12px; }
.cycle-table-info .medium {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.translation-badge {
  padding: 5px 12px;
  background: var(--secondary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--foreground);
}

/* Scrollable card area */
.cycle-content {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px 20px;
  overflow: hidden;
  min-height: 0;
}
@media (min-width: 769px) {
  .cycle-content { padding: 24px 32px; }
}
.cycle-inner {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.cycle-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.medium { font-size: 15px; }
.primary-text { color: var(--foreground); font-weight: 500; }

/* ---------- Flip card ---------- */
.flip-card-container {
  perspective: 1400px;
  flex: 1;
  min-height: 0;
  display: flex;
}
.flip-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-height: 0;
}
.flip-card.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px 24px;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  height: 100%;
}
.card-front:hover { border-color: var(--muted-foreground); }

/* Elevated card face with depth */
html.dark .card-face {
  background: var(--card-elevated);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.04),
    0 4px 24px rgba(0,0,0,0.5);
}
.card-back {
  transform: rotateY(180deg);
  border-color: var(--border);
}
.card-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.card-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
}
.card-reference {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-wrap: balance;
  line-height: 1.1;
}
@media (min-width: 769px) {
  .card-reference { font-size: 56px; }
}
.card-hint { font-size: 13px; }

.card-blockquote {
  font-size: 22px;
  line-height: 1.5;
  color: var(--foreground);
  text-wrap: balance;
  letter-spacing: -0.005em;
}
@media (min-width: 769px) {
  .card-blockquote { font-size: 26px; line-height: 1.5; }
}
.card-reference-small {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}
.card-letters {
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
  font-size: 26px;
  letter-spacing: 0.3em;
  color: var(--foreground);
  font-weight: 500;
}
@media (min-width: 769px) {
  .card-letters { font-size: 32px; }
}
.card-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted-foreground);
  padding: 24px 0;
}
.card-loading p { font-size: 13px; }
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--destructive);
  padding: 24px 0;
  max-width: 440px;
}
.card-error p { font-size: 13px; }

/* "Show original" link — appears on card back when verse has custom (modified) text */
.card-show-original {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.card-show-original:hover {
  color: var(--foreground);
  border-color: var(--muted-foreground);
  background: var(--accent);
}
html.dark .card-show-original {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
html.dark .card-show-original:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.card-show-original svg { opacity: 0.7; }

/* "Modified" pill — shown next to reference on front of card when verse has custom text */
.card-modified-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
}
html.dark .card-modified-pill {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* ---------- Compare dialog ---------- */
.dialog-compare { max-width: 580px; }
.compare-section { margin-bottom: 4px; }
.compare-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.compare-label-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted-foreground);
}
.compare-label-current {
  color: var(--foreground);
  border-color: var(--muted-foreground);
}
html.dark .compare-label-current {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}
.compare-label-original {
  color: var(--foreground);
  border-color: var(--border);
}
.compare-label-meta {
  font-size: 11px;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}
.compare-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--foreground);
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--secondary);
  border: 1px solid var(--border);
  text-wrap: balance;
  letter-spacing: -0.005em;
  word-break: break-word;
}
html.dark .compare-text {
  background: var(--card-elevated);
}
.compare-text-original {
  color: var(--muted-foreground);
  font-style: italic;
}
.compare-text ins {
  background: rgba(34, 197, 94, 0.16);
  color: var(--foreground);
  text-decoration: none;
  padding: 1px 2px;
  border-radius: 3px;
}
.compare-text del {
  background: rgba(239, 68, 68, 0.16);
  color: var(--muted-foreground);
  text-decoration: line-through;
  padding: 1px 2px;
  border-radius: 3px;
}
.compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  color: var(--muted-foreground);
  opacity: 0.6;
}
.compare-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}
html.dark .compare-summary {
  background: var(--card-elevated);
}
.compare-summary.match {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
  color: var(--foreground);
}
.compare-summary.diff {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.06);
  color: var(--foreground);
}

/* ---------- Bug report dialog ---------- */
.dialog-bug-report { max-width: 520px; }
.bug-type-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bug-type-option {
  position: relative;
  flex: 1;
  min-width: 90px;
}
.bug-type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bug-type-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  user-select: none;
}
html.dark .bug-type-label {
  background: var(--card-elevated);
}
.bug-type-label:hover {
  border-color: var(--muted-foreground);
  color: var(--foreground);
}
.bug-type-option input[type="radio"]:checked + .bug-type-label {
  border-color: var(--foreground);
  color: var(--foreground);
  background: var(--accent);
}
.bug-report-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.bug-report-status.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--foreground);
}
.bug-report-status.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--destructive);
}
.bug-report-status.sending {
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}
html.dark .bug-report-status.sending {
  background: var(--card-elevated);
}

/* ---------- Admin bug report list ---------- */
.admin-bug-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.admin-bug-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--secondary);
}
html.dark .admin-bug-item {
  background: var(--card-elevated);
}
.admin-bug-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.admin-bug-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
}
.admin-bug-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  flex: 1;
  min-width: 0;
}
.admin-bug-date {
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.admin-bug-desc {
  font-size: 13px;
  color: var(--foreground);
  line-height: 1.5;
  margin: 6px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-bug-meta {
  font-size: 11px;
  color: var(--muted-foreground);
  margin: 2px 0;
}
.admin-bug-meta a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-bug-delete {
  margin-top: 8px;
  font-size: 11px;
  height: 28px;
  padding: 0 10px;
}

/* ---------- Dialog ---------- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
  animation: fadeIn 0.15s;
  backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dialog-sm { max-width: 400px; }

.dialog-header {
  padding: 24px 24px 16px;
}
.dialog-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.dialog-header h2 svg { color: var(--foreground); }
.dialog-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}
.dialog-body {
  padding: 0 24px 24px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 24px;
}
.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
}
.dialog-close:hover { background: var(--accent); color: var(--foreground); }

.settings-section {
  margin-bottom: 24px;
}
.settings-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 10px;
}
.settings-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 10px;
  line-height: 1.5;
}

.translation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.translation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.translation-item:hover { background: var(--accent); }
.translation-item.active {
  border-color: var(--foreground);
  background: var(--accent);
}
.translation-item-name { font-size: 15px; font-weight: 600; }
.translation-item-desc { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.translation-item-check {
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--background);
}
.translation-item.active .translation-item-check { display: flex; }

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-btn:hover { background: var(--accent); color: var(--foreground); }
.theme-btn.active {
  border-color: var(--foreground);
  background: var(--accent);
  color: var(--foreground);
}

.settings-danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 8px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  font-size: 14px;
  max-width: 360px;
  z-index: 200;
  animation: slideInRight 0.2s;
}
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-color: var(--foreground); }
.toast.error { border-color: var(--destructive); }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-desc { color: var(--muted-foreground); font-size: 13px; }

/* ---------- Tutorial ---------- */
.dialog-tutorial {
  max-width: 480px;
}

.tutorial-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.tutorial-step:last-child {
  border-bottom: none;
}

.tutorial-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--foreground);
  color: var(--background);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tutorial-step-content {
  flex: 1;
  min-width: 0;
}

.tutorial-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}

.tutorial-step-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.tutorial-step-desc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--secondary);
  color: var(--foreground);
  font-size: 12px;
}

.tutorial-step-desc strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ---------- Guided Tour ---------- */
/* The highlight element creates the spotlight effect via a huge box-shadow.
   No separate overlay needed — this keeps the rest of the UI visible enough. */

.tour-highlight {
  position: fixed;
  border: 2px solid var(--foreground);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  z-index: 9000;
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

/* When there's no highlight (centered welcome/finish), use a subtle overlay */
.tour-overlay-only {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 8999;
}

.tour-tooltip {
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  z-index: 9001;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: tourSlideIn 0.2s ease-out;
}
@keyframes tourSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tour-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tour-step-num {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.tour-skip {
  font-size: 12px;
  color: var(--muted-foreground);
  padding: 2px 8px;
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
}
.tour-skip:hover {
  background: var(--accent);
  color: var(--foreground);
}

.tour-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.tour-body {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Confirm dialog should appear above other dialogs */
#confirm-dialog { z-index: 200 !important; }

/* ---------- Verse Editor ---------- */
.dialog-verse-editor {
  max-width: 520px;
}

.verse-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}
.verse-editor-select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 14px;
}
.verse-editor-select:focus {
  outline: none;
  border-color: var(--ring);
}
@media (max-width: 520px) {
  .verse-editor-fields { grid-template-columns: 1fr; gap: 0; }
}

.verse-editor-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--secondary);
}
.verse-editor-status.custom {
  color: var(--foreground);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.verse-editor-textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}
.verse-editor-textarea:focus {
  outline: none;
  border-color: var(--ring);
}

.verse-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.verse-editor-footer-right {
  display: flex;
  gap: 8px;
}

/* ---------- Empty state stats ---------- */
.empty-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.empty-stat {
  text-align: center;
}
.empty-stat-num {
  font-size: 28px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.empty-stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* ---------- Cycle control panel ---------- */
.cycle-controls {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
html.dark .cycle-controls {
  background: var(--card-elevated);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.3);
}

.cycle-section + .cycle-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle, var(--border));
}

.cycle-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 12px;
  text-align: center;
}

/* ---------- View buttons (segmented control) ---------- */
.view-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--secondary);
  padding: 4px;
  border-radius: 10px;
  flex-shrink: 0;
}
.view-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: transparent;
  color: var(--foreground);
  opacity: 0.5;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.view-btn:hover {
  opacity: 0.85;
}
.view-btn.active {
  background: var(--card);
  color: var(--foreground);
  opacity: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
html.dark .view-btn.active {
  background: var(--background);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.view-btn span { font-size: 12px; }

/* ---------- Cycle action row ---------- */
.cycle-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}
.cycle-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  transition: all 0.15s;
}
.cycle-mode-btn:hover {
  border-color: var(--muted-foreground);
  color: var(--foreground);
}

/* ---------- Sync ---------- */
.corner-btn.synced { color: var(--foreground); border-color: var(--foreground); }
.corner-btn.synced::after {
  content: ""; position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; border: 2px solid var(--background);
}
.sync-setup { text-align: left; }
.sync-steps { margin-bottom: 16px; }
.sync-step { font-size: 13px; color: var(--muted-foreground); line-height: 1.6; margin-bottom: 8px; }
.sync-step strong { color: var(--foreground); }
.sync-step a { color: var(--foreground); text-decoration: underline; }
.sync-config-input {
  width: 100%; min-height: 100px; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--foreground);
  font-size: 12px; font-family: monospace; line-height: 1.5; resize: vertical;
}
.sync-config-input:focus { outline: none; border-color: var(--ring); }
.sync-error {
  font-size: 12px; color: var(--destructive); padding: 8px 10px;
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  border-radius: 6px; margin-top: 8px;
}
.sync-account {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--secondary); border-radius: 12px;
}
.sync-account-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--foreground);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sync-account-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.sync-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 44px; padding: 0 16px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 8px;
  font-size: 14px; font-weight: 500; font-family: 'Google Sans', 'Roboto', sans-serif;
  transition: background 0.15s, box-shadow 0.15s;
}
.sync-google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.sync-google-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.sync-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.sync-divider::before, .sync-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.sync-divider span {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted-foreground);
}
.sync-account-info { flex: 1; min-width: 0; }
.sync-account-email {
  font-size: 14px; font-weight: 600; color: var(--foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sync-account-status { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.sync-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--secondary); padding: 4px; border-radius: 8px; margin-bottom: 16px;
}
.sync-tab {
  padding: 8px; border: none; background: transparent;
  color: var(--muted-foreground); font-size: 13px; font-weight: 500;
  border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.sync-tab.active { background: var(--card); color: var(--foreground); }
html.dark .sync-tab.active { background: var(--background); }

/* ---------- Section header actions ---------- */
.section-header-actions {
  display: flex;
  gap: 2px;
}

/* ---------- Marketplace ---------- */
.dialog-marketplace { max-width: 560px; max-height: 85vh; }
.marketplace-body { padding: 0; }
.mp-tabs {
  display: flex; gap: 0; padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.mp-tab {
  padding: 12px 16px; border: none; background: transparent;
  color: var(--muted-foreground); font-size: 14px; font-weight: 600;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.mp-tab:hover { color: var(--foreground); }
.mp-tab.active { color: var(--foreground); border-bottom-color: var(--foreground); }
.mp-bar {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.mp-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.mp-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.mp-filter {
  padding: 5px 10px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--muted-foreground); transition: all 0.15s;
}
.mp-filter:hover { color: var(--foreground); }
.mp-filter.active { background: var(--accent); color: var(--foreground); border-color: var(--foreground); }
.mp-bar-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
#mp-results { max-height: 420px; overflow-y: auto; padding: 12px 20px; }
#mp-results::-webkit-scrollbar { width: 4px; }
#mp-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.mp-card {
  padding: 0; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; background: var(--card); overflow: hidden;
  transition: border-color 0.15s;
}
.mp-card:hover { border-color: var(--muted-foreground); }
.mp-card-clickable {
  padding: 14px; cursor: pointer;
}
.mp-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 6px;
}
.mp-card-info { min-width: 0; flex: 1; }
.mp-card-title { font-size: 15px; font-weight: 600; color: var(--foreground); margin-bottom: 4px; }
.mp-card-author {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted-foreground);
}
.mp-mini-avatar {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.mp-mini-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--foreground);
  font-size: 9px; font-weight: 600;
}
.mp-card-stats { display: flex; gap: 8px; flex-shrink: 0; }
.mp-stat {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted-foreground);
}
.mp-card-desc { font-size: 13px; color: var(--muted-foreground); line-height: 1.5; margin-bottom: 6px; }
.mp-card-meta {
  font-size: 11px; color: var(--muted-foreground);
  display: flex; gap: 6px;
}
.mp-card-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border-subtle, var(--border));
}
.mp-delete-btn { color: var(--destructive); }
.mp-installed-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: #22c55e;
  padding: 6px 12px;
}

.marketplace-add-btn {
  background: #22c55e; color: #fff; border: none;
  height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600;
  border-radius: 8px; display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.marketplace-add-btn:hover { background: #16a34a; }

/* Pack detail view */
.mp-detail { padding: 20px; }
.mp-back-btn {
  display: flex; align-items: center; gap: 6px;
  border: none; background: transparent; color: var(--muted-foreground);
  font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 16px;
  cursor: pointer; transition: color 0.15s;
}
.mp-back-btn:hover { color: var(--foreground); }
.mp-detail-header {
  padding: 20px; background: var(--secondary); border-radius: 14px;
  margin-bottom: 16px;
}
html.dark .mp-detail-header {
  background: var(--card-elevated);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.04);
}
.mp-detail-title { font-size: 22px; font-weight: 700; color: var(--foreground); margin-bottom: 6px; letter-spacing: -0.02em; }
.mp-detail-desc { font-size: 14px; color: var(--muted-foreground); line-height: 1.6; margin-bottom: 14px; }
.mp-detail-stats {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.mp-stat-pill {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--muted-foreground);
  padding: 5px 10px; border-radius: 9999px;
  background: var(--card); border: 1px solid var(--border);
}
html.dark .mp-stat-pill { background: var(--background); }
.mp-detail-actions {
  display: flex; align-items: center; gap: 8px; margin-bottom: 24px;
}
.mp-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: 10px; background: transparent; color: var(--muted-foreground);
  transition: all 0.15s;
}
.mp-icon-btn:hover { color: var(--foreground); border-color: var(--muted-foreground); }
.mp-icon-btn.liked { color: #ef4444; border-color: #ef4444; }
.mp-icon-btn.liked svg { fill: #ef4444; }
.mp-detail-section { margin-bottom: 24px; }
.mp-detail-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted-foreground); margin-bottom: 10px;
}
.mp-section-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); cursor: pointer;
  transition: border-color 0.15s; margin-bottom: 0;
}
.mp-section-toggle:hover { border-color: var(--muted-foreground); }
.mp-toggle-icon { color: var(--muted-foreground); transition: transform 0.2s; flex-shrink: 0; }
.mp-collapsed { display: none; }

.mp-verse-list {
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; overflow: hidden;
}
.mp-verse-item {
  background: var(--card);
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.mp-verse-item:last-child { border-bottom: none; }
.mp-verse-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border: none; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background 0.15s;
}
.mp-verse-row:hover { background: var(--secondary); }
.mp-verse-item.open .mp-verse-row { background: var(--secondary); }
.mp-verse-num { font-size: 12px; font-weight: 600; color: var(--muted-foreground); min-width: 20px; }
.mp-verse-ref { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--foreground); }
.mp-verse-expand-icon {
  flex-shrink: 0; color: var(--muted-foreground); transition: transform 0.18s ease;
}
.mp-verse-item.open .mp-verse-expand-icon { transform: rotate(90deg); }
.mp-verse-preview {
  padding: 2px 14px 14px 44px;
  background: var(--card);
}
.mp-verse-text {
  margin: 0; padding: 12px 14px; border-left: 2px solid var(--border);
  border-radius: 0 8px 8px 0; background: var(--secondary);
  color: var(--foreground); font-size: 14px; line-height: 1.65;
}
.mp-verse-preview-meta {
  margin-top: 8px; color: var(--muted-foreground); font-size: 11px; font-weight: 500;
}
.mp-verse-loading, .mp-verse-error {
  display: flex; align-items: center; gap: 8px; min-height: 42px;
  color: var(--muted-foreground); font-size: 12px;
}
.mp-verse-loading .spinner { width: 14px; height: 14px; border-width: 2px; }
.mp-verse-error { color: var(--destructive); }

/* Comments */
.comment-loading { padding: 12px; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.comment-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.comment-form {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.comment-form input {
  flex: 1; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--foreground); font-size: 13px;
}
.comment-form input:focus { outline: none; border-color: var(--ring); }
.comment-item {
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle, var(--border));
}
.comment-item:last-child { border-bottom: none; }
.comment-body { display: flex; gap: 10px; }
.comment-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
}
.comment-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--foreground);
  font-size: 12px; font-weight: 600;
}
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.comment-author { font-size: 12px; font-weight: 600; color: var(--foreground); }
.comment-date { font-size: 10px; color: var(--muted-foreground); }
.comment-delete {
  margin-left: auto; border: none; background: transparent;
  color: var(--muted-foreground); cursor: pointer;
  padding: 4px; border-radius: 4px; display: flex; align-items: center;
}
.comment-delete:hover { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.comment-text { font-size: 13px; color: var(--foreground); line-height: 1.5; }
/* Profile view */
.profile-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; background: var(--secondary); border-radius: 14px;
  margin-bottom: 16px;
}
html.dark .profile-header { background: var(--card-elevated); box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.04); }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
}
.profile-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--foreground);
  font-size: 24px; font-weight: 600;
}
.profile-info { min-width: 0; }
.profile-name { font-size: 20px; font-weight: 700; color: var(--foreground); }
.profile-email { margin-top: 2px; }
.profile-stats {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.mp-author-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  cursor: pointer; transition: opacity 0.15s;
}
.mp-author-row:hover { opacity: 0.8; }
.mp-author-name { font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.post-pack-form { padding: 20px; }

/* ---------- Floating support ad ---------- */
.floating-support {
  position: fixed; bottom: 16px; left: 16px; z-index: 80;
  max-width: 340px;
  animation: slideUpFade 0.3s ease-out;
}
@keyframes slideUpFade {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* On mobile, collapse the floating support banner to a small heart icon.
   Tapping the icon still opens the full Support dialog. */
@media (max-width: 640px) {
  .floating-support {
    bottom: 12px;
    left: 12px;
    max-width: none;
    width: 44px;
    height: 44px;
  }
  .floating-support-inner {
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .floating-support-inner:active {
    transform: scale(0.92);
  }
  .floating-support-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* let the parent .floating-support-inner handle clicks */
  }
  .floating-support-icon svg {
    width: 20px;
    height: 20px;
  }
  /* Hide the title text, description, and Donate button — they're for desktop only */
  .floating-support-text,
  .floating-support-btn {
    display: none !important;
  }
  /* Small dismiss X in the corner */
  .floating-support-close {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
  }
  .floating-support-close svg {
    width: 10px;
    height: 10px;
  }
}
.floating-support-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--card-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  position: relative;
}
html.dark .floating-support-inner {
  background: var(--card);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 0 rgba(255,255,255,0.04);
}
.floating-support-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--accent); color: var(--foreground);
}
.floating-support-text { flex: 1; min-width: 0; }
.floating-support-title { font-size: 13px; font-weight: 600; color: var(--foreground); }
.floating-support-desc { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }
.floating-support-close {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card);
  border: 1px solid var(--border); color: var(--muted-foreground);
  cursor: pointer; transition: color 0.15s, background 0.15s;
}
.floating-support-close:hover { color: var(--foreground); background: var(--accent); }
@media (max-width: 600px) {
  .floating-support { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}

/* ---------- Support banner ---------- */
.support-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin: 0 12px 16px;
  background: linear-gradient(135deg, var(--secondary), var(--card-elevated));
  border: 1px solid var(--border); border-radius: 12px;
  cursor: default;
}
.support-banner-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--accent); color: var(--foreground);
}
.support-banner-text { flex: 1; min-width: 0; }
.support-banner-title { font-size: 13px; font-weight: 600; color: var(--foreground); }
.support-banner-desc { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }

/* ---------- Support dialog ---------- */
.dialog-support { max-width: 460px; max-height: 85vh; }
.support-body { padding: 0; }
.donorbox-wrapper {
  width: 100%; max-width: 425px; margin: 0 auto;
  border-radius: 0; overflow: hidden;
}
.donorbox-wrapper dbox-widget {
  width: 100% !important; max-width: 100% !important;
  min-height: 640px; display: block; margin: 0 auto;
}

/* Mobile — make Donorbox usable in portrait mode.
   The widget defaults to min-height: 640px which is too tall for small screens
   and causes the dialog to overflow. Let the widget size to its natural height,
   and make the dialog body scroll if needed. */
@media (max-width: 640px) {
  .dialog-support {
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
  }
  .support-body {
    padding: 0;
    max-height: calc(90vh - 80px);  /* leave room for dialog header */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .donorbox-wrapper {
    max-width: 100%;
    margin: 0;
  }
  .donorbox-wrapper dbox-widget {
    min-height: 540px;  /* shorter on mobile */
  }
}

/* ---------- Privacy policy ---------- */
.privacy-body {
  max-height: 60vh; overflow-y: auto;
}
.privacy-section { margin-bottom: 16px; }
.privacy-section h3 {
  font-size: 14px; font-weight: 600; color: var(--foreground);
  margin-bottom: 6px;
}
.privacy-section p {
  font-size: 13px; color: var(--muted-foreground); line-height: 1.6;
}
.privacy-section ul {
  list-style: disc; padding-left: 20px;
}
.privacy-section ul li {
  font-size: 13px; color: var(--muted-foreground); line-height: 1.6;
}

/* ---------- Admin dashboard ---------- */
.admin-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 20px;
}
@media (max-width: 480px) {
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.admin-stat-card {
  padding: 16px; background: var(--secondary); border-radius: 12px;
  text-align: center;
}
html.dark .admin-stat-card { background: var(--card-elevated); }
.admin-stat-icon { color: var(--muted-foreground); margin-bottom: 6px; }
.admin-stat-value { font-size: 24px; font-weight: 700; color: var(--foreground); }
.admin-stat-label { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-section { margin-bottom: 20px; }
.admin-chart {
  display: flex; align-items: flex-end; gap: 4px; height: 140px;
  padding: 16px 12px 8px; background: var(--secondary); border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html.dark .admin-chart { background: var(--card-elevated); }

/* SVG line chart — the actual chart */
.admin-line-chart {
  display: block;
  width: 100%;
  height: 220px;
  background: var(--secondary);
  border-radius: 10px;
  padding: 8px;
}
html.dark .admin-line-chart {
  background: var(--card-elevated);
}
.admin-line-chart .grid-line {
  stroke: var(--border);
  stroke-width: 1;
}
.admin-line-chart .axis-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}
.admin-line-chart .data-point {
  fill: var(--background);
  stroke: var(--foreground);
  stroke-width: 1.5;
  transition: r 0.15s;
}
.admin-line-chart .data-point:hover {
  r: 5;
}

/* Keep bar chart CSS for backward compat (no longer used but in case) */
.admin-bar-col {
  flex: 1 0 auto; min-width: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  height: 100%; justify-content: flex-end;
}
.admin-bar {
  width: 100%; max-width: 28px; background: var(--foreground);
  border-radius: 4px 4px 0 0; min-height: 3px; position: relative;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s;
  opacity: 0.85;
}
html.dark .admin-bar {
  background: linear-gradient(180deg, var(--foreground) 0%, color-mix(in srgb, var(--foreground) 70%, var(--card-elevated)) 100%);
}
.admin-bar:hover { opacity: 1; }
.admin-bar-num {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 600; color: var(--foreground);
  white-space: nowrap;
}
.admin-bar-label {
  font-size: 10px; color: var(--muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}

/* Chart header with range tabs */
.admin-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.admin-chart-header .mp-detail-section-label {
  margin-bottom: 0;
}
.admin-range-tabs {
  display: inline-flex;
  background: var(--secondary);
  border-radius: 8px;
  padding: 2px;
  gap: 1px;
}
html.dark .admin-range-tabs {
  background: var(--card-elevated);
}
.admin-range-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.admin-range-tab:hover {
  color: var(--foreground);
}
.admin-range-tab.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
html.dark .admin-range-tab.active {
  background: var(--background);
}

/* Chart summary — total views / sessions / avg per period */
.admin-chart-summary {
  display: flex;
  gap: 24px;
  padding: 0 4px 12px;
  flex-wrap: wrap;
}
.admin-chart-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-chart-summary-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

/* Empty state for ranges with no data */
.admin-chart-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
  background: var(--secondary);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
html.dark .admin-chart-empty {
  background: var(--card-elevated);
}

/* Mobile — admin chart range tabs should wrap nicely */
@media (max-width: 640px) {
  .admin-chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .admin-range-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .admin-range-tab {
    flex-shrink: 0;
  }
  .admin-chart {
    height: 110px;
    padding: 12px 8px 6px;
  }
  .admin-bar-col {
    min-width: 14px;
  }
  .admin-bar {
    max-width: 20px;
  }
  .admin-chart-summary {
    gap: 16px;
  }
  .admin-chart-summary-num {
    font-size: 16px;
  }
}

/* ---------- Toggle switch ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}
.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}
.toggle-desc {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.toggle {
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: var(--secondary);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.toggle[aria-checked="true"] {
  background: var(--foreground);
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--background);
  transition: transform 0.2s;
}
.toggle[aria-checked="true"] .toggle-thumb {
  transform: translateX(16px);
}

/* ---------- Search results ---------- */
.search-results {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  cursor: pointer;
  transition: background 0.1s;
  width: 100%;
  text-align: left;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent); }
.search-result-ref {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  flex-shrink: 0;
  min-width: 100px;
}
.search-result-text {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-text mark {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--foreground);
  border-radius: 2px;
  padding: 0 1px;
}
.search-loading {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}
.search-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ---------- Drag and drop ---------- */
.verse-item {
  cursor: grab;
}
.verse-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.verse-item.drag-over {
  border-top: 2px solid var(--foreground);
}

/* ---------- Animated counter ---------- */
.animated-count {
  display: inline-block;
  transition: transform 0.2s;
}
.animated-count.bump {
  animation: countBump 0.4s ease;
}
@keyframes countBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--foreground); }
  100% { transform: scale(1); }
}

/* Extra-narrow portrait phones */
@media (max-width: 380px) and (orientation: portrait) {
  #open-marketplace-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  #open-marketplace-btn svg { width: 14px; height: 14px; }
}

/* Keep all empty-state controls accessible on narrow portrait phones. */
@media (max-width: 640px) and (orientation: portrait) {
  .empty-corners {
    top: 14px;
    right: 14px;
    gap: 5px;
  }
  .empty-corners .corner-btn {
    width: 34px;
    height: 34px;
  }
  .empty-corners .corner-btn svg {
    width: 16px;
    height: 16px;
  }
}
@media (max-width: 360px) and (orientation: portrait) {
  .empty-corners { right: 10px; gap: 4px; }
  .empty-corners .corner-btn { width: 30px; height: 30px; border-radius: 8px; }
  .empty-corners .corner-btn svg { width: 14px; height: 14px; }
}

/* ---------- Analytics dashboard refinements ---------- */
.dialog-admin { max-width: 780px; }
.admin-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.admin-stat-card {
  text-align: left;
  border: 1px solid var(--border);
  padding: 15px;
}
.admin-stat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}
.admin-stat-icon { margin-bottom: 0; flex: 0 0 auto; }
.admin-stat-label { margin-top: 0; }
.admin-stat-value { font-size: 26px; line-height: 1.1; }
.admin-stat-detail {
  min-height: 16px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted-foreground);
}
.admin-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 22px;
}
.admin-insight-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--secondary) 72%, transparent);
}
.admin-insight-label {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-bottom: 5px;
}
.admin-insight-card strong {
  display: block;
  font-size: 20px;
  color: var(--foreground);
  letter-spacing: -0.02em;
}
.admin-insight-card p {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.admin-chart-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--secondary);
}
html.dark .admin-chart-container { background: var(--card-elevated); }
.admin-chart-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 16px 0;
}
.admin-chart-summary { padding: 0 0 12px; gap: 22px; }
.admin-chart-peak { font-size: 15px; }
.admin-chart-peak small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.admin-chart-legend {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted-foreground);
}
.admin-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.admin-chart-legend i { width: 16px; height: 2px; border-radius: 2px; background: var(--foreground); }
.admin-chart-legend i.sessions {
  height: 0;
  border-top: 2px dashed var(--muted-foreground);
  background: none;
}
.admin-line-chart {
  border-radius: 0;
  background: transparent;
  padding: 0 8px 8px;
}
html.dark .admin-line-chart { background: transparent; }
.admin-chart-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-chart-line.views { stroke: var(--foreground); }
.admin-chart-line.sessions { stroke: var(--muted-foreground); stroke-width: 1.8; stroke-dasharray: 5 5; }
.admin-chart-dot.views { fill: var(--background); stroke: var(--foreground); stroke-width: 1.5; }
.admin-chart-dot.sessions { fill: var(--background); stroke: var(--muted-foreground); stroke-width: 1.3; }
.admin-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-info-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
}
html.dark .admin-info-card { background: var(--card-elevated); }
.admin-last-activity { display: flex; align-items: flex-start; gap: 10px; }
.admin-last-activity strong { display: block; font-size: 13px; color: var(--foreground); }
.admin-last-activity span:not(.admin-live-dot) { display: block; margin-top: 4px; font-size: 11px; color: var(--muted-foreground); }
.admin-live-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 15%, transparent);
}
.admin-info-copy { font-size: 12px; line-height: 1.55; color: var(--muted-foreground); margin-bottom: 12px; }
.admin-external-btn { gap: 7px; }
@media (max-width: 680px) {
  .dialog-admin { max-width: 100%; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-insight-grid, .admin-info-grid { grid-template-columns: 1fr; }
  .admin-chart-topline { flex-direction: column; }
  .admin-chart-legend { padding-bottom: 4px; }
}
@media (max-width: 390px) {
  .admin-stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-stat-card { padding: 12px; }
  .admin-stat-value { font-size: 22px; }
  .admin-chart-summary { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

/* Keep fixed dialogs above the 3D flip-card compositing layer on all browsers. */
.dialog-overlay {
  isolation: isolate;
  transform: translateZ(1000px);
}
body:has(.dialog-overlay:not([hidden])) .flip-card {
  visibility: hidden;
}


/* ---------- Analytics dashboard v2 ---------- */
.admin-dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 18px;
}
.admin-dashboard-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}
.admin-dashboard-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.admin-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.admin-live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--foreground);
}
.admin-insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-chart-hint {
  margin-top: 3px;
  max-width: 430px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.admin-metric-tabs {
  display: inline-flex;
  gap: 3px;
  margin: 0 16px 12px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--secondary) 78%, transparent);
}
.admin-metric-tab {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-metric-tab:hover { color: var(--foreground); }
.admin-metric-tab.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.admin-chart-plot {
  position: relative;
  outline: none;
  touch-action: pan-y;
}
.admin-chart-plot:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ring);
}
.admin-chart-line.series-0 { stroke: var(--foreground); }
.admin-chart-line.series-1 {
  stroke: var(--muted-foreground);
  stroke-width: 1.9;
  stroke-dasharray: 6 5;
}
.admin-chart-line.series-2 {
  stroke: color-mix(in srgb, var(--foreground) 52%, var(--background));
  stroke-width: 1.8;
  stroke-dasharray: 2 5;
}
.admin-chart-dot.series-0 {
  fill: var(--background);
  stroke: var(--foreground);
  stroke-width: 1.5;
}
.admin-chart-dot.series-1 {
  fill: var(--background);
  stroke: var(--muted-foreground);
  stroke-width: 1.3;
}
.admin-chart-dot.series-2 {
  fill: var(--background);
  stroke: color-mix(in srgb, var(--foreground) 52%, var(--background));
  stroke-width: 1.3;
}
.admin-chart-legend i.series-0,
.admin-tooltip-row i.series-0 {
  background: var(--foreground);
}
.admin-chart-legend i.series-1,
.admin-tooltip-row i.series-1 {
  height: 0;
  border-top: 2px dashed var(--muted-foreground);
  background: transparent;
}
.admin-chart-legend i.series-2,
.admin-tooltip-row i.series-2 {
  height: 0;
  border-top: 2px dotted color-mix(in srgb, var(--foreground) 52%, var(--background));
  background: transparent;
}
.admin-chart-hover-line {
  stroke: var(--foreground);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s;
}
.admin-chart-hover-line.visible { opacity: 0.42; }
.admin-chart-tooltip {
  position: absolute;
  top: 12px;
  z-index: 4;
  min-width: 170px;
  transform: translateX(-18%);
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--background) 94%, transparent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.admin-chart-tooltip.align-right { transform: translateX(-88%); }
.admin-tooltip-time {
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted-foreground);
}
.admin-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 3px 0;
  font-size: 11px;
  color: var(--foreground);
}
.admin-tooltip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-tooltip-row i {
  width: 12px;
  height: 2px;
  border-radius: 2px;
}
.admin-tooltip-row strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.admin-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.admin-breakdown-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
}
html.dark .admin-breakdown-card { background: var(--card-elevated); }
.admin-breakdown-row + .admin-breakdown-row { margin-top: 11px; }
.admin-breakdown-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted-foreground);
}
.admin-breakdown-meta strong {
  color: var(--foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.admin-breakdown-meta small {
  margin-left: 3px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.admin-breakdown-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}
.admin-breakdown-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--foreground);
}
.admin-breakdown-empty {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.admin-mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-mini-metrics span {
  font-size: 11px;
  color: var(--muted-foreground);
}
.admin-mini-metrics strong {
  color: var(--foreground);
  font-size: 13px;
}
@media (max-width: 760px) {
  .admin-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-breakdown-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .admin-dashboard-heading { flex-direction: column; gap: 9px; }
  .admin-metric-tabs { display: flex; overflow-x: auto; margin-left: 0; margin-right: 0; }
  .admin-metric-tab { flex: 1 0 auto; }
  .admin-chart-tooltip { min-width: 150px; max-width: 78%; }
}
@media (max-width: 390px) {
  .admin-insight-grid { grid-template-columns: 1fr; }
}


/* ---------- Recent analytics sessions ---------- */
.admin-visitor-section { overflow: hidden; }
.admin-visitor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.admin-visitor-limit {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.admin-session-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.admin-session-summary > div {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
}
.admin-session-summary span {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
}
.admin-session-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.admin-session-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: var(--background);
}
.admin-session-row + .admin-session-row { border-top: 1px solid var(--border); }
.admin-session-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.admin-session-person > div { min-width: 0; }
.admin-session-person strong,
.admin-session-person span {
  display: block;
}
.admin-session-person strong {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--foreground);
}
.admin-session-person > div > span {
  margin-top: 1px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted-foreground);
}
.admin-session-avatar {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--background);
  font-size: 11px;
  font-weight: 700;
}
.admin-session-avatar.anonymous {
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
}
.admin-session-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted-foreground);
}
.admin-session-meta > span:not(.admin-session-time) {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--secondary);
}
.admin-session-time {
  margin-right: 3px;
  font-variant-numeric: tabular-nums;
}
.admin-session-new {
  color: var(--foreground) !important;
  font-weight: 600;
}
.admin-session-empty {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-foreground);
}
@media (max-width: 680px) {
  .admin-session-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .admin-session-meta { justify-content: flex-start; padding-left: 39px; }
  .admin-session-person strong,
  .admin-session-person > div > span { max-width: 250px; }
}
@media (max-width: 420px) {
  .admin-session-summary { grid-template-columns: 1fr; }
  .admin-session-meta { padding-left: 0; }
}
