/* ----- Dark theme — Base, Surfaces, Text, Accent, Glow palette ----- */
:root,
[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-alt: #14161c;
  --bg-elevated: #1a1e28;
  --accent: #4f46e5;
  --accent-secondary: #6366f1;
  --accent-soft: rgba(79, 70, 229, 0.15);
  --text-main: #f5f5f7;
  --text-muted: #a8b2c1;
  --border-subtle: rgba(168, 178, 193, 0.2);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(79, 70, 229, 0.12);
  --nav-height: 72px;
  --transition-fast: 180ms ease-out;
  --transition-smooth: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --bg-body: radial-gradient(ellipse 120% 80% at 50% -20%, #1a1e28 0%, #0d0d0f 50%);
  --bg-mesh-color: rgba(79, 70, 229, 0.03);
  --bg-grid-color: rgba(168, 178, 193, 0.05);
  --blob-1: rgba(79, 70, 229, 0.08);
  --blob-2: rgba(99, 102, 241, 0.06);
  --blob-3: rgba(79, 70, 229, 0.04);
  --nav-bg: rgba(13, 13, 15, 0.92);
  --card-bg: radial-gradient(circle at top, #1a1e28 0%, #0d0d0f 65%);
  --stat-ring-color: #4f46e5;
}

/* ----- Light theme ----- */
[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-alt: #f0f2f5;
  --bg-elevated: #ffffff;
  --accent: #4f46e5;
  --accent-secondary: #6366f1;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --text-main: #1a1a1a;
  --text-muted: #64748b;
  --border-subtle: rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 50px rgba(79, 70, 229, 0.08);
  --bg-body: radial-gradient(ellipse 120% 80% at 50% -20%, #eef0f5 0%, #f8f9fa 45%);
  --bg-mesh-color: rgba(79, 70, 229, 0.02);
  --bg-grid-color: rgba(0, 0, 0, 0.04);
  --blob-1: rgba(79, 70, 229, 0.06);
  --blob-2: rgba(99, 102, 241, 0.05);
  --blob-3: rgba(79, 70, 229, 0.04);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --card-bg: linear-gradient(180deg, #ffffff 0%, #f5f6f9 100%);
  --stat-ring-color: #4f46e5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-body);
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-mesh {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, var(--bg-mesh-color) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 80% 20%, var(--bg-mesh-color) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 80%, var(--bg-mesh-color) 0%, transparent 50%);
  animation: meshFloat 20s ease-in-out infinite;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-color) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 70%);
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.7;
  animation: blobFloat 25s ease-in-out infinite;
}

.bg-blob-1 { width:  min(70vw, 500px); height: min(70vw, 500px); background: var(--blob-1); top: -15%; right: -10%; animation-delay: 0s; }
.bg-blob-2 { width:  min(50vw, 380px); height: min(50vw, 380px); background: var(--blob-2); bottom: -10%; left: -5%; animation-delay: -8s; }
.bg-blob-3 { width:  min(40vw, 280px); height: min(40vw, 280px); background: var(--blob-3); top: 40%; left: 50%; animation-delay: -16s; }

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -1%) scale(1.02); }
  66% { transform: translate(-1%, 2%) scale(0.98); }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(5%, -5%) scale(1.05); }
  50% { transform: translate(-3%, 3%) scale(0.95); }
  75% { transform: translate(2%, 4%) scale(1.02); }
}

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

img {
  max-width: 100%;
  display: block;
}

.nav-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.navbar {
  max-width: 1120px;
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.5rem;
  position: relative;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.nav-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.nav-toggle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 20px;
  height: 18px;
}
.nav-toggle-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}
.nav-header.menu-open .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-header.menu-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}
.nav-header.menu-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer {
  display: contents;
}

.nav-drawer-inner {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-width: 0;
  margin-left: auto;
}

.nav-close {
  display: none;
}

.nav-overlay {
  display: none;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}
.nav-logo:hover {
  opacity: 0.95;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-soft);
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  transition: transform var(--transition-fast);
  filter: brightness(1.05) contrast(1.08);
}
.nav-logo:hover .logo-img { transform: scale(1.05); }

.logo-text {
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text-main);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0;
  margin: 0 auto;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-main);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  color: var(--text-muted);
}
.theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(12deg);
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}
.theme-icon svg {
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: scale(1);
}
[data-theme="light"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.45);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  filter: blur(12px);
  opacity: 0.5;
  z-index: -1;
  transition: opacity var(--transition-smooth);
}
.btn-glow:hover::before {
  opacity: 0.8;
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  color: var(--text-main);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--accent);
  background: var(--accent-soft);
}

main {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-content {
  max-width: 560px;
}

.hero-badge-wrap {
  position: relative;
  display: inline-block;
}

.hero-tagline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--border-subtle);
  z-index: 1;
}

.hero-badge-glow {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  filter: blur(14px);
  opacity: 0.25;
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.05); }
}

.hero h1 {
  margin: 1.2rem 0 0.8rem;
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.hero-title-line {
  display: block;
  opacity: 0;
  animation: titleReveal 0.6s ease-out forwards;
}
.hero-title-line:nth-child(2) { animation-delay: 0.1s; }

.hero-title-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-subtitle {
  margin: 0 0 1.6rem;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 90px;
}

.stat-ring {
  width: 48px;
  height: 48px;
  position: relative;
}

.stat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.stat-ring-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 3;
}

.stat-ring-fill {
  fill: none;
  stroke: var(--stat-ring-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
}

.hero-stats.in-view .stat:nth-child(1) .stat-ring-fill {
  animation: ringFill85 0.9s ease-out forwards;
}
.hero-stats.in-view .stat:nth-child(2) .stat-ring-fill {
  animation: ringFill87 0.9s ease-out 0.15s forwards;
}
.hero-stats.in-view .stat:nth-child(3) .stat-ring-fill {
  animation: ringFill100 0.9s ease-out 0.3s forwards;
}

@keyframes ringFill85 {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: 85 100; }
}
@keyframes ringFill87 {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: 87 100; }
}
@keyframes ringFill100 {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: 100 100; }
}

.hero-stats .stat .stat-number,
.hero-stats .stat .stat-label {
  opacity: 0;
  transform: translateY(8px);
}
.hero-stats.in-view .stat:nth-child(1) .stat-number,
.hero-stats.in-view .stat:nth-child(1) .stat-label {
  animation: statReveal 0.5s ease-out 0.4s forwards;
}
.hero-stats.in-view .stat:nth-child(2) .stat-number,
.hero-stats.in-view .stat:nth-child(2) .stat-label {
  animation: statReveal 0.5s ease-out 0.55s forwards;
}
.hero-stats.in-view .stat:nth-child(3) .stat-number,
.hero-stats.in-view .stat:nth-child(3) .stat-label {
  animation: statReveal 0.5s ease-out 0.7s forwards;
}

@keyframes statReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number {
  font-weight: 700;
  font-size: 1.15rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-float {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.5;
}

.hero-float-1 {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  filter: blur(40px);
  top: -20px;
  right: -30px;
  animation: float1 8s ease-in-out infinite;
}

.hero-float-2 {
  width: 80px;
  height: 80px;
  background: var(--accent);
  filter: blur(30px);
  bottom: 10%;
  left: -20px;
  animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-15px, 15px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -10px); }
}

.hero-card {
  width: 100%;
  max-width: 320px;
  padding: 1.5rem 1.75rem 1.6rem;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero-card-shine {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  pointer-events: none;
}

[data-theme="light"] .hero-card-shine {
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
}

.hero-card-border {
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent));
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  animation: borderShift 4s ease infinite;
  pointer-events: none;
}

@keyframes borderShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-card-label {
  position: relative;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.hero-card h2 {
  position: relative;
  margin: 0.8rem 0 1rem;
  font-size: 1.3rem;
}

.hero-checklist {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.hero-checklist li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.hero-checklist li:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

.check-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.hero-card-progress {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.progress-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.6s ease-out;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----- Features section ----- */
.features {
  position: relative;
  z-index: 1;
  padding: 4.5rem 1.5rem 5rem;
}

.features-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3rem;
}

.features-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.features-title {
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-main);
  margin: 0 0 0.85rem;
}

.features-subtitle {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.features-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.feature-card {
  position: relative;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top, rgba(148, 163, 184, 0.18), transparent 65%),
    var(--bg-elevated);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.55);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth), background var(--transition-smooth);
}

.feature-card:hover {
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
  transform: translateY(-2px);
}

[data-theme="light"] .feature-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.15rem;
  flex-shrink: 0;
  transition: background var(--transition-smooth), color var(--transition-smooth), transform var(--transition-smooth);
}

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

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  transform: scale(1.05);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.feature-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ----- Pricing section ----- */
.pricing {
  position: relative;
  z-index: 1;
  padding: 4.5rem 1.5rem 5rem;
}

.pricing-inner {
  max-width: 900px;
  margin: 0 auto;
}

.pricing-header {
  text-align: center;
  margin-bottom: 2rem;
}

.pricing-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.pricing-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.pricing-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.pricing-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.pricing-toggle-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

.pricing-toggle-btn:hover {
  color: var(--text-main);
}

.pricing-toggle-btn--active {
  background: var(--accent);
  color: #fff;
}

.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.4);
}

.pricing-card--featured {
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-secondary) 100%);
  border: none;
  box-shadow: 0 16px 48px rgba(79, 70, 229, 0.25);
}

.pricing-card--featured:hover {
  box-shadow: 0 20px 56px rgba(79, 70, 229, 0.35);
}

[data-theme="light"] .pricing-card--featured {
  box-shadow: 0 16px 48px rgba(79, 70, 229, 0.2);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  right: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.pricing-card:not(.pricing-card--featured) {
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--bg-alt) 100%);
}

[data-theme="light"] .pricing-card:not(.pricing-card--featured) {
  background: linear-gradient(160deg, #1e293b 0%, #334155 100%);
}

.pricing-card-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem;
}

.pricing-card-price {
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  margin: 0 0 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.15em;
}

.pricing-currency {
  font-size: 0.6em;
  font-weight: 600;
  opacity: 0.95;
}

.pricing-card-cycle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.5rem;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.6rem;
}

.pricing-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent-secondary);
}
.pricing-card--featured .pricing-check {
  color: rgba(255, 255, 255, 0.95);
}

.pricing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
}

.pricing-btn--core {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.pricing-btn--core:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.pricing-btn--vision {
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pricing-btn--vision:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

.pricing-btn-arrow {
  width: 18px;
  height: 18px;
}

.pricing-card-cycle [data-yearly] {
  display: none;
}

.pricing-inner[data-cycle="yearly"] .pricing-card-cycle [data-monthly] {
  display: none;
}

.pricing-inner[data-cycle="yearly"] .pricing-card-cycle [data-yearly] {
  display: inline;
}

/* ----- User reviews section ----- */
.reviews {
  position: relative;
  z-index: 1;
  padding: 4.5rem 1.5rem 5rem;
}

.reviews-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.reviews-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  position: relative;
}

.reviews-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reviews-title-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 auto 1.25rem;
}

.reviews-subtitle {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.reviews-header {
  opacity: 0;
  transform: translateY(20px);
}
.reviews-inner.in-view .reviews-header {
  animation: reviewHeaderReveal 0.6s ease-out forwards;
}

@keyframes reviewHeaderReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.review-card {
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
}

.reviews-inner.in-view .review-card {
  animation: reviewCardReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.reviews-inner.in-view .review-card:nth-child(1) { animation-delay: 0.1s; }
.reviews-inner.in-view .review-card:nth-child(2) { animation-delay: 0.15s; }
.reviews-inner.in-view .review-card:nth-child(3) { animation-delay: 0.2s; }
.reviews-inner.in-view .review-card:nth-child(4) { animation-delay: 0.25s; }
.reviews-inner.in-view .review-card:nth-child(5) { animation-delay: 0.3s; }
.reviews-inner.in-view .review-card:nth-child(6) { animation-delay: 0.35s; }

@keyframes reviewCardReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.review-card--testimonial .review-stars .review-star {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.reviews-inner.in-view .review-card--testimonial .review-star:nth-child(1) { transition-delay: 0.35s; }
.reviews-inner.in-view .review-card--testimonial .review-star:nth-child(2) { transition-delay: 0.4s; }
.reviews-inner.in-view .review-card--testimonial .review-star:nth-child(3) { transition-delay: 0.45s; }
.reviews-inner.in-view .review-card--testimonial .review-star:nth-child(4) { transition-delay: 0.5s; }
.reviews-inner.in-view .review-card--testimonial .review-star:nth-child(5) { transition-delay: 0.55s; }
.reviews-inner.in-view .review-card--testimonial .review-star {
  opacity: 1;
  transform: scale(1);
}

.review-card--stat .review-stat-value {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
}
.reviews-inner.in-view .review-card--stat .review-stat-value {
  animation: reviewStatReveal 0.6s cubic-bezier(0.34, 1.2, 0.64, 1) 0.4s forwards;
}

@keyframes reviewStatReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.review-card--testimonial {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.review-card--testimonial:hover {
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.4);
  transform: translateY(-2px);
}

[data-theme="light"] .review-card--testimonial:hover {
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.1);
}

.review-stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.review-star {
  width: 18px;
  height: 18px;
}

.review-quote {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  margin: 0 0 1.25rem;
  flex: 1;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.review-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  font-style: normal;
  display: block;
}

.review-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.review-card--stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  color: #fff;
}

.review-card--stat-dark {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

[data-theme="light"] .review-card--stat-dark {
  background: linear-gradient(160deg, #1e293b 0%, #334155 100%);
}

.review-card--stat-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border: none;
  box-shadow: 0 12px 32px rgba(192, 192, 192, 0.15);
}

.review-stat-headline {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 0.75rem;
  opacity: 0.95;
}

.review-stat-value {
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 0.25rem;
}

.review-stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin: 0;
}

/* ----- Newsletter section ----- */
.newsletter {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem;
}

.newsletter-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  justify-content: space-between;
  padding: 2.25rem 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.newsletter-content {
  flex: 1;
  min-width: 220px;
}

.newsletter-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.4rem;
}

.newsletter-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1;
  min-width: 260px;
}

.newsletter-input {
  flex: 1;
  min-width: 180px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.newsletter-input::placeholder {
  color: var(--text-muted);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.newsletter-btn {
  flex-shrink: 0;
}

/* ----- Contact section ----- */
.contact {
  position: relative;
  z-index: 1;
  padding: 4.5rem 1.5rem 5rem;
}

.contact-inner {
  max-width: 800px;
  margin: 0 auto;
}

.contact-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.contact-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.contact-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.contact-card {
  padding: 1.75rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 36px rgba(79, 70, 229, 0.15);
  transform: translateY(-2px);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin: 0 auto 1rem;
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.contact-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.contact-link {
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: var(--accent-secondary);
}

/* ----- Footer ----- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.5rem 2rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-subtle);
}

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

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: inline-flex;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.footer-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
}

.footer-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-main);
}

.footer-theme-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.footer-theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

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

/* ----- Sign up page (split layout) ----- */
.signup-page .page-bg {
  display: none;
}

.signup-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.signup-brand {
  position: relative;
  background: linear-gradient(160deg, #1a1e2e 0%, #0d0d0f 40%, #1e1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.signup-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(79, 70, 229, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.signup-brand-inner {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 60vh;
}

.signup-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  margin-bottom: 2rem;
}

.signup-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
}

.signup-logo-text {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.signup-back {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.signup-back:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.signup-slogan-carousel {
  margin-top: auto;
  padding-bottom: 1.5rem;
  min-height: 5.5em;
  position: relative;
}

.signup-slogan-slides {
  position: relative;
}

.signup-slogan-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.signup-slogan-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.signup-slogan-line {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
  margin: 0;
}

.signup-dots {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.signup-dot {
  width: 8px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast);
}

.signup-dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.signup-dot[aria-selected="true"],
.signup-dot.active {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .signup-brand {
  background: linear-gradient(160deg, #eef0f8 0%, #f5f6fa 40%, #e8eaf2 100%);
}

[data-theme="light"] .signup-brand::before {
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

[data-theme="light"] .signup-logo,
[data-theme="light"] .signup-slogan-line {
  color: #1a1a1a;
}

[data-theme="light"] .signup-dot {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .signup-dot:hover {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .signup-dot[aria-selected="true"],
[data-theme="light"] .signup-dot.active {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .signup-back {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

[data-theme="light"] .signup-back:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}


.signup-form-panel {
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  overflow-y: auto;
}

.signup-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-message {
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.auth-message--error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-message--success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

[data-theme="light"] .auth-message--error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

[data-theme="light"] .auth-message--success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.signup-form-title {
  font-size: clamp(1.65rem, 2.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.signup-form-login {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.signup-form-login a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}

.signup-form-login a:hover {
  color: var(--accent-secondary);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.signup-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.signup-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.signup-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

.signup-form input[type="text"],
.signup-form input[type="email"],
.signup-form input[type="password"] {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.signup-form input::placeholder {
  color: var(--text-muted);
}

.signup-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-with-toggle {
  position: relative;
  display: flex;
}

.input-with-toggle input {
  padding-right: 2.75rem;
  flex: 1;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.password-toggle:hover {
  color: var(--text-main);
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.form-group-checkbox {
  flex-direction: row;
  align-items: flex-start;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-alt);
  display: grid;
  place-items: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.checkbox-label input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-box::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -3px;
  margin-left: 1px;
}

.checkbox-label a {
  color: var(--accent);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.signup-submit {
  padding: 0.85rem 1.5rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
}

.signup-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.signup-divider span {
  padding: 0 1rem;
}

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

.signup-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.signup-social-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.signup-form-actions {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.signup-theme-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.signup-theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

  .signup-brand {
    min-height: 30vh;
    padding: 2rem 1.5rem;
  }

  .signup-brand-inner {
    min-height: auto;
  }

  .signup-back {
    position: static;
    align-self: flex-end;
    margin-top: -0.5rem;
  }

  .signup-slogan-carousel {
    margin-top: 2rem;
  }
}

@media (max-width: 600px) {
  .signup-form-panel {
    padding: 2rem 1.5rem;
  }

  .signup-form-row {
    grid-template-columns: 1fr;
  }

  .signup-social {
    grid-template-columns: 1fr;
  }
}

/* ----- Tablet & mobile: responsive navbar ----- */
@media (max-width: 900px) {
  .navbar {
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .nav-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 50;
    width: min(320px, 88vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    overflow-y: auto;
  }

  .nav-header.menu-open .nav-drawer {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-close {
    display: flex;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
  }
  .nav-close:hover {
    background: var(--accent-soft);
    color: var(--text-main);
  }
  .nav-close svg {
    width: 24px;
    height: 24px;
  }

  .nav-drawer-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: calc(var(--nav-height) + 1rem) 1.5rem 1.5rem;
    gap: 2rem;
  }

  .nav-drawer .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }

  .nav-drawer .nav-links li {
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-drawer .nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.05rem;
    border-bottom: none;
  }

  .nav-drawer .nav-links a:hover {
    transform: none;
    padding-left: 0.5rem;
  }

  .nav-drawer .nav-cta {
    flex-direction: column;
    margin-top: auto;
    padding-top: 1rem;
    gap: 0.75rem;
  }

  .nav-drawer .nav-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
  }

  .nav-header.menu-open .nav-overlay {
    opacity: 1;
    visibility: visible;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 2.5rem 1.25rem 3.5rem;
    gap: 2rem;
  }

  .hero-content {
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
    gap: 1.5rem;
  }

  .hero-visual {
    order: -1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
  }

  .hero-card {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    flex-shrink: 0;
  }

  .hero-float-1,
  .hero-float-2 {
    display: none;
  }

  .features {
    padding: 3.5rem 1.25rem 4rem;
  }

  .features-header {
    margin-bottom: 2.5rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .pricing {
    padding: 3.5rem 1.25rem 4rem;
  }

  .newsletter-inner {
    flex-direction: column;
    text-align: center;
  }

  .newsletter-form {
    width: 100%;
  }

  .contact {
    padding: 3.5rem 1.25rem 4rem;
  }

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

  .footer-top {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .pricing-cards {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .pricing-card--featured {
    order: -1;
  }

  .reviews {
    padding: 3.5rem 1.25rem 4rem;
  }

  .reviews-header {
    margin-bottom: 2.5rem;
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

/* ----- Mobile ----- */
@media (max-width: 600px) {
  .navbar {
    padding-inline: 1rem;
  }

  .nav-drawer {
    width: min(300px, 92vw);
  }

  .nav-drawer-inner {
    padding: calc(var(--nav-height) + 0.75rem) 1.25rem 1.25rem;
  }

  .nav-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }

  .nav-drawer .nav-cta {
    gap: 0.65rem;
  }

  .hero {
    padding: 2rem 1rem 3rem;
  }

  .hero-visual {
    padding: 0 0.5rem;
  }

  .hero-card {
    max-width: 300px;
  }

  .features {
    padding: 3rem 1rem 3.5rem;
  }

  .features-header {
    margin-bottom: 2rem;
  }

  .features-title {
    font-size: clamp(1.6rem, 5vw, 1.9rem);
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .feature-card {
    padding: 1.5rem 1.25rem;
  }

  .feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
  }

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

  .feature-title {
    font-size: 1.05rem;
  }

  .feature-desc {
    font-size: 0.88rem;
  }

  .pricing {
    padding: 3rem 1rem 3.5rem;
  }

  .pricing-header {
    margin-bottom: 1.5rem;
  }

  .pricing-toggle-wrap {
    margin-bottom: 2rem;
  }

  .pricing-card {
    padding: 1.75rem 1.5rem;
  }

  .reviews {
    padding: 3rem 1rem 3.5rem;
  }

  .reviews-header {
    margin-bottom: 2rem;
  }

  .reviews-title {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
  }

  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .review-card {
    padding: 1.5rem 1.25rem;
  }

  .review-card--stat {
    padding: 1.75rem 1.25rem;
  }

  .newsletter {
    padding: 3rem 1rem;
  }

  .newsletter-inner {
    padding: 1.75rem 1.5rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-input {
    min-width: 100%;
  }

  .newsletter-btn {
    width: 100%;
  }

  .contact {
    padding: 3rem 1rem 4rem;
  }

  .contact-title {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
  }

  .site-footer {
    padding: 2rem 1rem 1.5rem;
  }

  .review-stat-value {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .hero-tagline {
    font-size: 0.8rem;
    padding: 0.3rem 0.85rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
  }

  .stat {
    min-width: 80px;
  }

  .stat-ring {
    width: 44px;
    height: 44px;
  }

  .stat-number {
    font-size: 1.05rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .hero-card {
    padding: 1.25rem 1.35rem;
    border-radius: 20px;
  }

  .hero-checklist li {
    padding: 0.45rem 0.7rem;
    font-size: 0.88rem;
  }

  .btn-primary {
    padding: 0.6rem 1rem;
  }
}

/* ----- Small mobile ----- */
@media (max-width: 380px) {
  .nav-drawer {
    width: 100%;
    max-width: 100%;
  }

  .hero-stats {
    gap: 1rem;
  }
}

/* ----- Members page ----- */
.members-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 1fr;
}

.members-page .page-bg {
  display: none;
}

.members-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.members-sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.members-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  pointer-events: none;
  cursor: default;
}

.members-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
}

.members-logo-text {
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.members-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.members-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid transparent;
}

.members-nav-link:hover {
  color: var(--text-main);
  background: var(--accent-soft);
}

.members-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.3);
}

.members-nav-link svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.members-sidebar-footer {
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.members-theme-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.members-back {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.members-back:hover {
  color: var(--text-main);
}

.members-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 50;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-main);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.members-menu-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.members-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.members-main {
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem 3rem;
  overflow-y: auto;
}

.members-section {
  display: none;
  animation: sectionFade 0.3s ease-out;
}

.members-section.is-active {
  display: block;
}

.members-section[hidden] {
  display: none !important;
}

@keyframes sectionFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.members-section-header {
  margin-bottom: 2rem;
}

.members-section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0 0 0.4rem;
}

.members-section-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.members-placeholder {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.members-placeholder p {
  margin: 0;
}

/* Home planner */
.home-planner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.home-header-left {
  flex: 1;
  min-width: 0;
}

.home-greeting {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.home-task-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.home-xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.15);
}

.home-xp-badge svg {
  color: var(--accent);
  flex-shrink: 0;
}

.home-calendar-card {
  padding: 1.35rem 1.5rem;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  min-width: 0;
}

.home-calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.home-calendar-month {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.home-this-week-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.home-this-week-btn:hover {
  background: var(--accent-secondary);
  transform: scale(1.02);
}

.home-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  min-width: 0;
}

.home-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.35rem;
  min-height: 52px;
  min-width: 32px;
  border: none;
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.home-day-btn:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.home-day-btn.is-selected {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.home-day-btn.is-today:not(.is-selected) {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.home-day-abbrev {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.home-day-num {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-time-slots {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-slot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-slot-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.home-slot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.home-slot-icon svg {
  width: 18px;
  height: 18px;
}

.home-slot-icon--morning {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

.home-slot-icon--afternoon {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.home-slot-icon--evening {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent);
}

.home-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  flex-shrink: 0;
}

.home-slot-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
  margin-left: 0.5rem;
}

.home-slot-tasks {
  min-height: 2.5rem;
  padding: 0 0.25rem;
}

.home-slot-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.5rem 0;
  padding: 1rem 0.75rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-subtle);
}

.home-slot-task {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-slot-task:hover {
  border-color: var(--border-subtle);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.home-slot-check {
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-alt);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-slot-check:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.home-slot-check:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.home-slot-label {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  word-break: break-word;
  line-height: 1.4;
  padding: 0.1rem 0;
}

.home-slot-label.is-done {
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
}

.home-slot-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.home-slot-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

/* Floating add button */
.home-add-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 35;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.home-add-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.5);
}

/* Add task modal */
.home-task-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.home-task-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.home-task-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  z-index: 50;
  width: calc(100% - 2rem);
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s, transform 0.2s ease;
}

@media (min-width: 520px) {
  .home-task-modal {
    max-width: 520px;
  }
}

.home-task-modal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.home-task-modal-inner {
  padding: 0;
}

.home-task-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  border-radius: 20px 20px 0 0;
}

.home-task-modal-header-text {
  flex: 1;
  min-width: 0;
}

.home-task-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.home-task-modal-title-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.home-task-modal-title-icon {
  width: 18px;
  height: 18px;
}

.home-task-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.home-task-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-task-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.home-task-modal-close svg {
  width: 20px;
  height: 20px;
}

.home-task-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 1.5rem 1.75rem;
}

/* Task view: time of day + suggested tasks */
@media (min-width: 520px) {
  .home-task-modal-body--task {
    display: grid;
    grid-template-columns: 130px 1fr;
    grid-template-rows: auto 1fr auto auto;
    gap: 1.25rem 1.5rem;
    align-items: start;
  }

  .home-task-modal-body--task .home-task-modal-section--time {
    grid-row: 1;
    grid-column: 1;
  }

  .home-task-modal-body--task .home-task-modal-section--suggested {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }

  .home-task-modal-body--task .home-task-modal-divider {
    grid-column: 1 / -1;
    margin: 0.15rem 0 0;
  }

  .home-task-modal-body--task .home-task-modal-actions {
    grid-column: 1 / -1;
  }
}

.home-task-modal-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.home-task-modal-time-group {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--bg-alt);
  border-radius: 12px;
}

.home-task-modal-time-btn {
  flex: 1;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-task-modal-time-btn:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

.home-task-modal-time-btn.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.home-task-modal-suggested {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-task-suggested-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-alt);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.home-task-suggested-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.08);
}

.home-task-suggested-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.home-task-suggested-icon svg {
  width: 20px;
  height: 20px;
  color: inherit;
}

.home-task-suggested-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.home-task-suggested-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.home-task-suggested-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.home-task-suggested-xp {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.home-task-modal-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.home-task-modal-divider::before,
.home-task-modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.home-task-modal-divider span {
  flex-shrink: 0;
  text-transform: lowercase;
}

.home-task-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.home-task-modal-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.home-task-modal-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-task-modal-action-icon svg {
  width: 18px;
  height: 18px;
}

.home-task-modal-action:hover {
  border-color: var(--accent);
  color: var(--text-main);
  background: var(--accent-soft);
}

.home-task-modal-action--habit {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.home-task-modal-action--habit:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #fff;
}

/* Habit form view */
.home-task-modal-body--habit {
  padding-top: 0;
}

@media (min-width: 520px) {
  .home-task-modal-body--habit {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 1rem 1.5rem;
    align-items: start;
  }

  .home-task-modal-body--habit .home-task-modal-section:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
  }

  .home-task-modal-body--habit .home-task-modal-section:nth-child(2) {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }

  .home-task-modal-body--habit .home-task-modal-section:nth-child(3) {
    grid-column: 1 / -1;
  }

  .home-task-modal-body--habit .home-task-modal-challenge {
    grid-column: 1 / -1;
  }

  .home-task-modal-body--habit .home-task-modal-footer {
    grid-column: 1 / -1;
  }
}

/* Custom task form view - time + input on one row */
@media (min-width: 520px) {
  .home-task-modal-body--custom {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem 1.5rem;
    align-items: start;
  }

  .home-task-modal-body--custom .home-task-modal-section:first-child {
    grid-row: 1;
    grid-column: 1;
  }

  .home-task-modal-body--custom .home-task-modal-section:nth-child(2) {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }

  .home-task-modal-body--custom .home-task-modal-footer {
    grid-column: 1 / -1;
  }
}

.home-task-modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.home-task-modal-input::placeholder {
  color: var(--text-muted);
}

.home-task-modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.home-task-modal-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b2c1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.home-task-modal-challenge {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}

.home-task-modal-challenge strong {
  color: var(--accent);
}

/* Shared footer for custom + habit views */
.home-task-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.home-task-modal-back {
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.home-task-modal-back:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--text-main);
}

.home-task-modal-primary {
  padding: 0.7rem 1.35rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.home-task-modal-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

/* Custom task form view */
.home-task-modal-body--custom {
  padding-top: 0;
}

.home-task-modal-body--custom .home-task-modal-footer,
.home-task-modal-body--habit .home-task-modal-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  justify-content: stretch;
}

.home-task-modal-body--custom .home-task-modal-back,
.home-task-modal-body--habit .home-task-modal-back {
  justify-self: start;
}

.home-task-modal-body--custom .home-task-modal-primary,
.home-task-modal-body--habit .home-task-modal-primary {
  justify-self: end;
}

/* Bottom nav - mobile only */
.members-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.members-bottom-nav .members-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 10px;
  transition: color var(--transition-fast), background var(--transition-fast);
  flex: 1;
  min-width: 0;
}

.members-bottom-nav .members-bottom-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.members-bottom-nav .members-bottom-link:hover {
  color: var(--text-main);
}

.members-bottom-nav .members-bottom-link.is-active {
  background: var(--accent);
  color: #fff;
}

.members-bottom-nav .members-bottom-link.is-active svg {
  color: inherit;
}

/* Coach section - AI Coach */
.coach-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.coach-header {
  margin-bottom: 0.25rem;
}

.coach-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.coach-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.coach-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

button.coach-card {
  appearance: none;
}

.coach-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.coach-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.coach-card-icon svg {
  width: 24px;
  height: 24px;
}

.coach-card-icon--purple {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent);
}

.coach-card-icon--green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.coach-card-icon--blue {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.coach-card-icon--pink {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.coach-card-icon--orange {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.coach-card-icon--teal {
  background: rgba(20, 184, 166, 0.2);
  color: #14b8a6;
}

.coach-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.coach-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.coach-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.coach-card-chevron {
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Coach modal */
.coach-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.coach-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.coach-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 50;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s, transform 0.25s ease;
}

.coach-modal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.coach-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.coach-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.coach-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.coach-modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.coach-modal-close:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.coach-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 200px;
}

.coach-need-key {
  text-align: center;
  padding: 1rem 0;
}

.coach-need-key p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.coach-goto-profile {
  color: var(--accent);
  font-weight: 500;
}

.coach-form-view--upload {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coach-upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 1.25rem;
  border: 2px dashed var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-alt);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.coach-upload-zone:hover,
.coach-upload-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.coach-upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.coach-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.coach-upload-icon svg {
  width: 28px;
  height: 28px;
}

.coach-upload-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.coach-upload-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
}

.coach-upload-preview.has-image img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
}

.coach-upload-clear {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.coach-upload-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.coach-upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.coach-form-label--or {
  margin-top: 0.25rem;
}

.coach-result--compact {
  margin-top: 0.5rem;
}

.coach-form-view .coach-form-label,
.coach-form-view .coach-form-input,
.coach-form-view .coach-form-textarea,
.coach-form-view .coach-form-btn {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.coach-form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.coach-form-input,
.coach-form-textarea {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
}

.coach-form-textarea {
  min-height: 100px;
  resize: vertical;
}

.coach-form-btn {
  margin-top: 0.5rem;
}

.coach-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
}

.coach-result-text,
.coach-result-error {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
}

.coach-result-error {
  color: #f87171;
}

.coach-result-error--friendly a {
  color: var(--accent);
  text-decoration: underline;
}

.coach-result-error--friendly a:hover {
  color: var(--accent-secondary);
}

.coach-result-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.coach-chat-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
}

.coach-chat-messages {
  flex: 1;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coach-chat-msg {
  max-width: 90%;
}

.coach-chat-msg--user {
  align-self: flex-end;
}

.coach-chat-msg--user .coach-chat-msg-content {
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 14px 14px 4px 14px;
}

.coach-chat-msg--assistant .coach-chat-msg-content {
  background: var(--bg-alt);
  padding: 0.6rem 1rem;
  border-radius: 14px 14px 14px 4px;
  color: var(--text-main);
}

.coach-chat-input-wrap {
  display: flex;
  gap: 0.5rem;
}

.coach-chat-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
}

.coach-chat-send {
  flex-shrink: 0;
}

.coach-breathing-view {
  text-align: center;
  padding: 1rem 0;
}

.coach-breathing-phase {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1.5rem;
}

.coach-breathing-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 3px solid var(--accent);
  transition: transform 4s ease-in-out;
}

.coach-breathing-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.coach-breathing-btn {
  margin: 0 0.25rem;
}

/* Profile: hero, rank, ladder, details, logout */
.profile-complete-prompt {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--text-main);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.profile-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-hero-avatar-wrap {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
  border: 3px solid var(--border-subtle);
  margin-bottom: 0.75rem;
}

.profile-hero .profile-avatar,
.profile-hero .profile-avatar-initials {
  width: 100%;
  height: 100%;
}

.profile-avatar-camera {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg-elevated);
  transition: background 0.15s ease, transform 0.15s ease;
}

.profile-avatar-camera:hover {
  background: var(--accent-secondary);
  transform: scale(1.05);
}

.profile-photo-file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.profile-hero-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.profile-hero-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.profile-rank-card {
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.profile-rank-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.profile-rank-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.profile-rank-icon--crown {
  color: var(--accent);
}

.profile-rank-icon svg {
  width: 18px;
  height: 18px;
}

.profile-rank-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.profile-rank-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-rank-level {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.profile-rank-progress-wrap {
  margin-top: 0.5rem;
}

.profile-rank-xp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.profile-rank-xp-current {
  font-weight: 600;
  color: var(--text-main);
}

.profile-rank-xp-icon {
  opacity: 0.7;
  margin-right: 0.2rem;
}

.profile-rank-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.profile-rank-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}

.profile-ladder-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-ladder-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.profile-ladder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.profile-ladder-icon svg {
  width: 22px;
  height: 22px;
}

.profile-ladder-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.profile-ladder-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.profile-ladder-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-ladder-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.profile-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.profile-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
}

.profile-detail-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.profile-detail-icon svg {
  width: 100%;
  height: 100%;
}

.profile-detail-field {
  flex: 1;
  min-width: 0;
}

.profile-detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.profile-detail-input {
  width: 100%;
  padding: 0.4rem 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.95rem;
}

.profile-detail-input::placeholder {
  color: var(--text-muted);
}

.profile-detail-value {
  font-size: 0.95rem;
  color: var(--text-main);
}

.profile-detail-value--active {
  color: var(--success, #22c55e);
  font-weight: 600;
}

.profile-detail-value--inactive {
  color: var(--text-muted);
}

.profile-setting-block--photo {
  margin-bottom: 1rem;
}

.profile-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  margin-top: 1.5rem;
  border-radius: 12px;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.profile-logout-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.profile-logout-btn svg {
  width: 20px;
  height: 20px;
}

.profile-save-msg--error {
  color: var(--error, #ef4444);
}

/* Rank Ladder modal */
.rank-ladder-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.rank-ladder-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.rank-ladder-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 60;
  width: calc(100% - 2rem);
  max-width: 400px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s, transform 0.2s ease;
}

.rank-ladder-modal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.rank-ladder-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.rank-ladder-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  flex-shrink: 0;
}

.rank-ladder-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-ladder-modal-star {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.rank-ladder-modal-star svg {
  width: 22px;
  height: 22px;
}

.rank-ladder-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.rank-ladder-modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.rank-ladder-modal-close:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.rank-ladder-list {
  overflow-y: auto;
  padding: 0.75rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-ladder-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rank-ladder-item.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.rank-ladder-item.is-current .rank-ladder-item-xp {
  color: rgba(255, 255, 255, 0.9);
}

.rank-ladder-item.is-completed {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.rank-ladder-item-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.rank-ladder-item.is-current .rank-ladder-item-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.rank-ladder-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rank-ladder-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.rank-ladder-item.is-current .rank-ladder-item-name {
  color: #fff;
}

.rank-ladder-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
}

.rank-ladder-item-xp {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rank-ladder-item-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success, #22c55e);
  color: #fff;
}

.rank-ladder-item-check svg {
  width: 14px;
  height: 14px;
}

/* CalPal */
#section-calpal .members-section-header {
  margin-bottom: 1.5rem;
}

.calpal-goals-card {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

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

.calpal-goals-title {
  font-size: 1.02rem;
  font-weight: 650;
  margin: 0 0 0.2rem;
}

.calpal-goals-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calpal-goals-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calpal-goals-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.calpal-goal-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calpal-goal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
}

.calpal-goal-field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
}

.calpal-goal-field input::placeholder {
  color: rgba(168, 178, 193, 0.5);
}

.calpal-goal-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.calpal-goals-save-btn {
  align-self: flex-start;
  margin-top: 0.1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.calpal-goals-save-btn:hover {
  background: rgba(79, 70, 229, 0.24);
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.calpal-goals-reset-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.calpal-goals-reset-btn:hover {
  color: var(--text-main);
  background: var(--accent-soft);
}

.calpal-goals-msg {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calpal-goals-msg--ok {
  color: #22c55e;
}

.calpal-today-card {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.calpal-today-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.calpal-today-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.calpal-stat {
  font-size: 0.95rem;
  color: var(--text-main);
}

.calpal-stat strong {
  color: var(--accent);
}

.calpal-today-progress {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.calpal-today-progress--empty {
  color: var(--text-muted);
}

.calpal-progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calpal-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.calpal-progress-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.calpal-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.calpal-progress-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: inherit;
  transition: width 0.35s var(--transition-smooth);
}

.calpal-log-card {
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.calpal-log-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.calpal-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.calpal-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.calpal-meal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.calpal-image-zone {
  position: relative;
  min-height: 80px;
  border: 2px dashed var(--border-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.calpal-image-zone:hover {
  border-color: var(--accent);
}

.calpal-photo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.calpal-image-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.calpal-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: contain;
}

.calpal-analyze-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.calpal-analyze-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
}

.calpal-analyze-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.calpal-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.calpal-result--loading {
  background: var(--bg-alt);
  color: var(--text-muted);
}

.calpal-result--ok {
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--text-main);
}

.calpal-result--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error, #ef4444);
}

.calpal-add-log-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.calpal-add-log-btn:hover {
  background: var(--accent-soft);
}

.calpal-entries-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.75rem;
}

.calpal-entries-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.calpal-entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.calpal-entry-line {
  font-size: 0.9rem;
  color: var(--text-main);
}

.calpal-entry-remove {
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.calpal-entry-remove:hover {
  color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

.calpal-entry-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 1rem;
  text-align: center;
}

/* Workout */
.workout-shell {
  max-width: 520px;
  width: 100%;
  padding: 1rem 1.1rem 1.5rem;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.workout-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.workout-tab {
  flex: 0 0 auto;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.workout-tab.is-active {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
}

.workout-tab--ghost {
  opacity: 0.75;
}

.workout-tab[disabled] {
  cursor: default;
  opacity: 0.45;
}

.workout-view {
  margin-top: 0.8rem;
}

.workout-view--placeholder {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

.workout-placeholder-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.workout-splits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.workout-splits-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.workout-splits-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.workout-new-split-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.workout-new-split-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.55);
}

.workout-new-split-plus {
  font-size: 1rem;
}

.workout-new-split-card {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.workout-new-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.workout-new-split-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.workout-new-split-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
}

.workout-new-split-cancel {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.workout-new-split-cancel:hover {
  background: rgba(15, 23, 42, 0.9);
}

.workout-new-split-save {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.workout-new-split-save:hover {
  background: rgba(79, 70, 229, 0.24);
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.workout-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.workout-select {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.85rem;
}

.workout-select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.workout-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
}

.workout-input--short {
  text-align: center;
}

.workout-error {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #f97373;
}

.workout-splits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workout-split-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  position: relative;
  overflow: hidden;
}

.workout-split-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--workout-split-color, var(--accent));
}

.workout-split-main {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.workout-split-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.workout-split-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.workout-split-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-split-chevron {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.workout-split-card:hover .workout-split-chevron {
  color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

.workout-splits-empty {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
}

.workout-detail {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.workout-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.workout-detail-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.workout-detail-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-detail-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.workout-detail-close:hover {
  background: rgba(15, 23, 42, 0.9);
}

.workout-detail-form {
  margin-bottom: 0.8rem;
}

.workout-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 0.8fr));
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.workout-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.workout-detail-field--wide {
  grid-column: span 1;
}

.workout-detail-add-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.workout-detail-add-btn:hover {
  background: rgba(79, 70, 229, 0.24);
  border-color: var(--accent-secondary);
  transform: translateY(-1px);
}

.workout-detail-list-wrap {
  margin-top: 0.5rem;
}

.workout-detail-list-title {
  margin: 0 0 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.workout-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.workout-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
}

.workout-detail-empty {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-progress-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.workout-progress-card {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.workout-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-progress-value {
  font-size: 1rem;
  font-weight: 650;
}

.workout-progress-list-wrap {
  margin-top: 0.25rem;
}

.workout-progress-title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.workout-progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workout-progress-item {
  padding: 0.4rem 0.1rem;
}

.workout-progress-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.workout-progress-name {
  font-size: 0.85rem;
}

.workout-progress-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.workout-progress-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: inherit;
  transition: width 0.35s var(--transition-smooth);
}

.workout-progress-empty {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-leaderboard-title {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.workout-leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workout-leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.1rem;
  font-size: 0.82rem;
}

.workout-leaderboard-rank {
  width: 32px;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}

.workout-leaderboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.workout-leaderboard-name {
  font-weight: 500;
}

.workout-leaderboard-day {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.workout-leaderboard-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workout-leaderboard-empty {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Progress */
#section-progress .members-section-header {
  margin-bottom: 1.5rem;
}

.progress-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.progress-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.progress-card-icon--xp {
  background: var(--accent-soft);
}

.progress-card-icon--tasks {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success, #22c55e);
}

.progress-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.progress-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.progress-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-week-chart {
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.progress-chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.progress-chart-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.progress-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  min-height: 120px;
}

.progress-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.progress-bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-bar-track {
  width: 100%;
  height: 80px;
  background: var(--bg-alt);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.progress-bar-fill {
  width: 100%;
  min-height: 4px;
  background: var(--accent);
  border-radius: 0 0 8px 8px;
  transition: height 0.3s ease;
}

.progress-bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Legacy profile card (kept for any refs) */
.profile-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.profile-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  border: 3px solid var(--border-subtle);
}

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

.profile-avatar[hidden] {
  display: none;
}

.profile-avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-alt);
}

.profile-avatar-initials[hidden] {
  display: none;
}

.profile-card-fields {
  flex: 1;
  min-width: 0;
  max-width: 420px;
}

.profile-section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.profile-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.profile-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.6rem 0;
}

.profile-xp-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-xp-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-save-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.profile-save-btn:hover {
  background: var(--accent-secondary);
  transform: scale(1.02);
}

.profile-save-msg {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  min-height: 1.4em;
}

.profile-save-msg--ok {
  color: var(--success, #22c55e);
}

.profile-settings {
  max-width: 480px;
}

.profile-setting-block {
  margin-bottom: 1.5rem;
}

.profile-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.profile-input,
.profile-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.95rem;
}

.profile-select {
  cursor: pointer;
  appearance: auto;
}

.profile-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

@media (min-width: 901px) {
  .coach-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .coach-card {
    padding: 1.25rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .coach-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .coach-card {
    padding: 1rem 1.25rem;
  }
}

/* Desktop: calendar + time slots side by side */
@media (min-width: 901px) {
  .home-planner-grid {
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 2rem;
    align-items: start;
  }

  .home-calendar-card {
    position: sticky;
    top: 1.5rem;
    min-width: 0;
    width: 100%;
  }

  .home-calendar-days {
    gap: 0.5rem;
  }

  .home-day-btn {
    min-height: 56px;
    padding: 0.6rem 0.4rem;
  }

  .home-day-abbrev {
    font-size: 0.7rem;
  }

  .home-day-num {
    font-size: 1.2rem;
  }

  .home-time-slots {
    gap: 1.25rem;
    min-width: 0;
  }

  .home-slot {
    min-height: 140px;
  }
}

/* Large desktop: time slots in 3 columns when space allows */
@media (min-width: 1200px) {
  .home-planner-grid {
    grid-template-columns: minmax(300px, 360px) 1fr;
  }

  .home-time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: start;
  }

  .home-slot {
    min-height: 180px;
  }
}

/* Mobile: bottom nav visible, FAB above nav */
@media (max-width: 900px) {
  .members-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
  }

  .home-add-fab {
    bottom: 5.5rem;
    right: 1.25rem;
  }
}

.members-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.members-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

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

  .members-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 85vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    visibility: hidden;
    border-right: 1px solid var(--border-subtle);
  }

  .members-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .members-menu-toggle {
    display: flex;
  }

  .members-overlay {
    display: block;
  }

  .members-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .members-main {
    padding: 2rem 1.5rem 3rem;
    padding-top: calc(1.5rem + 56px);
    padding-bottom: 5rem;
  }
}

@media (max-width: 600px) {
  .members-main {
    padding: 1.5rem 1.25rem 2.5rem;
    padding-top: calc(1.5rem + 56px);
    padding-bottom: 5rem;
  }

  .members-placeholder {
    padding: 1.5rem;
  }
}

/* UX polish: home task modal */
.home-task-modal-inner { border: 1px solid rgba(148, 163, 184, 0.2); }
.home-task-modal-action { min-height: 70px; border-radius: 14px; }
.home-task-modal-input, .home-task-modal-select { border-radius: 12px; }

/* Workout split and exercise upgrades */
.workout-split-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
}
.workout-detail-form {
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
}
.workout-set-checklist {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.workout-set-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--text-main);
  font-size: 12px;
}
.workout-detail-complete-wrap { margin-top: 12px; }
.workout-detail-complete-btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
}
.workout-detail-complete-hint { margin: 8px 0 0; color: var(--text-muted); font-size: 0.85rem; }

/* Programs section */
.programs-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.programs-admin-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-alt);
}
.programs-admin-grid { display: grid; gap: 10px; }
.programs-admin-title { margin: 0 0 10px; }

/* CalPal and StrivPal readability */
.calpal-result-text--structured { line-height: 1.6; font-size: 0.97rem; }
.coach-chat-msg-content { line-height: 1.55; letter-spacing: 0.01em; white-space: pre-wrap; }

[data-theme="light"] .workout-split-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
  border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .workout-detail-form {
  background: #eef2f7;
  border-color: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .workout-set-check {
  background: rgba(34, 197, 94, 0.2);
  color: #1f2937;
}
[data-theme="light"] .workout-detail-complete-btn {
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
}

/* Mobile polish: workout + programs */
@media (max-width: 600px) {
  .workout-shell {
    padding: 0.8rem;
    border-radius: 16px;
  }

  .workout-splits-header {
    align-items: flex-start;
    gap: 0.6rem;
  }

  .workout-splits-title {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .workout-splits-subtitle {
    font-size: 0.9rem;
  }

  .workout-new-split-btn {
    min-height: 42px;
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
  }

  .workout-detail-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .workout-detail-field--wide {
    grid-column: 1 / -1;
  }

  .workout-detail-item {
    align-items: flex-start;
    padding: 0.7rem 0.75rem;
  }

  .workout-ex-name {
    font-size: 1.02rem;
    line-height: 1.3;
  }

  .workout-ex-meta {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .workout-set-check {
    padding: 6px 10px;
    font-size: 0.83rem;
  }

  .workout-detail-complete-btn {
    width: 100%;
    min-height: 44px;
    font-size: 1.02rem;
  }

  .workout-progress-cards {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .workout-progress-card {
    padding: 0.75rem 0.8rem;
  }

  .programs-admin-card {
    padding: 12px;
  }

  .programs-admin-title {
    font-size: 1.05rem;
  }

  .programs-list .workout-detail-item {
    border-radius: 12px;
  }
}

