:root {
  /* Common tokens */
  --font-sans: -apple-system, BlinkMacSystemFont, system-ui, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height-top: 64px;
  --nav-height-bottom: calc(88px + var(--safe-area-inset-bottom));

  /* Borders */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Accent (overridden per preset) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.15);
  --progress-fill: linear-gradient(90deg, #2563eb, #4f82e3);
  --hero-card-bg: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(79, 130, 227, 0.06), transparent 55%);

  --danger: #ff3b30;
  --danger-dim: rgba(255, 59, 48, 0.15);
  --warning: #2563eb;
  --success: #1d4ed8;

  /* Default to dark theme values; light theme overrides on body.theme-light */
  --bg-dark: #050509;
  --bg-surface: #101018;
  --bg-surface-elevated: #171826;
  --bg-surface-hover: #23263a;

  --text-primary: #f9fafb;
  --text-secondary: #c7c9d9;
  --text-muted: #8b8ea3;

  --border: rgba(255, 255, 255, 0.08);

  /* Shadows tuned for dark */
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 28px rgba(37, 99, 235, 0.14);
}

/* Dark theme */
body.theme-dark {
  --bg-dark: #050509;
  --bg-surface: #101018;
  --bg-surface-elevated: #171826;
  --bg-surface-hover: #23263a;

  --text-primary: #f9fafb;
  --text-secondary: #c7c9d9;
  --text-muted: #8b8ea3;

  --border: rgba(255, 255, 255, 0.08);

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.15);
  --progress-fill: linear-gradient(90deg, #2563eb, #4f82e3);
  --hero-card-bg: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(79, 130, 227, 0.06), transparent 55%);

  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 28px rgba(37, 99, 235, 0.14);
}

body[data-accent="blue"] {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.15);
  --progress-fill: linear-gradient(90deg, #2563eb, #4f82e3);
  --hero-card-bg: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(79, 130, 227, 0.06), transparent 55%);
  --shadow-glow: 0 0 28px rgba(37, 99, 235, 0.14);
}

body[data-accent="green"] {
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-dim: rgba(22, 163, 74, 0.15);
  --progress-fill: linear-gradient(90deg, #16a34a, #3ba867);
  --hero-card-bg: radial-gradient(circle at top left, rgba(22, 163, 74, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(59, 168, 103, 0.06), transparent 55%);
  --shadow-glow: 0 0 28px rgba(22, 163, 74, 0.13);
}

body[data-accent="red"] {
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-dim: rgba(220, 38, 38, 0.15);
  --progress-fill: linear-gradient(90deg, #dc2626, #cf5b5b);
  --hero-card-bg: radial-gradient(circle at top left, rgba(220, 38, 38, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(207, 91, 91, 0.06), transparent 55%);
  --shadow-glow: 0 0 28px rgba(220, 38, 38, 0.13);
}

body[data-accent="yellow"] {
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-dim: rgba(217, 119, 6, 0.16);
  --progress-fill: linear-gradient(90deg, #d97706, #cb8a34);
  --hero-card-bg: radial-gradient(circle at top left, rgba(217, 119, 6, 0.12), transparent 60%), radial-gradient(circle at bottom right, rgba(203, 138, 52, 0.06), transparent 55%);
  --shadow-glow: 0 0 28px rgba(217, 119, 6, 0.14);
}

body[data-accent="slate"] {
  --accent: #94a3b8;
  --accent-hover: #64748b;
  --accent-dim: rgba(148, 163, 184, 0.14);
  --progress-fill: linear-gradient(90deg, #94a3b8, #aeb8c6);
  --hero-card-bg: radial-gradient(circle at top left, rgba(148, 163, 184, 0.08), transparent 60%), radial-gradient(circle at bottom right, rgba(174, 184, 198, 0.05), transparent 55%);
  --shadow-glow: 0 0 24px rgba(148, 163, 184, 0.11);
}

/* Light theme: elegant whites with soft greys */
body.theme-light {
  --bg-dark: #f5f5f7;              /* App background */
  --bg-surface: #ffffff;           /* Primary surface */
  --bg-surface-elevated: #f0f0f5;  /* Cards / inputs */
  --bg-surface-hover: #e4e4ec;

  --text-primary: #111827;         /* Almost black */
  --text-secondary: #4b5563;       /* Slate grey */
  --text-muted: #6b7280;

  --border: rgba(15, 23, 42, 0.08);

  /* Light theme: iOS-style blue accent (calorie box, bottom nav, progress) */
  --accent: #0b5fff;
  --accent-hover: #0842b8;
  --accent-dim: rgba(11, 95, 255, 0.16);
  --progress-fill: linear-gradient(90deg, #0b5fff, #60a5fa);
  --hero-card-bg: radial-gradient(circle at top left, rgba(96, 165, 250, 0.35), transparent 60%), radial-gradient(circle at bottom right, rgba(11, 95, 255, 0.2), transparent 55%);

  --shadow-sm: 0 0 0 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 14px 30px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 0% -10%, var(--accent-dim), transparent 55%);
  background-attachment: fixed;
}

.app-launch {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at bottom, rgba(148, 163, 184, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(5, 5, 9, 0.98), rgba(5, 5, 9, 1));
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease, transform 0.45s ease;
}

.app-launch.is-hiding {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  pointer-events: none;
}

.app-launch-backdrop,
.app-launch-shell {
  position: absolute;
  inset: 0;
}

.app-launch-shell {
  position: relative;
  inset: auto;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  z-index: 1;
  animation: app-launch-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-launch-glow {
  position: absolute;
  top: 18px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.3), rgba(148, 163, 184, 0));
  filter: blur(18px);
  opacity: 0.9;
  animation: app-launch-float 4.5s ease-in-out infinite;
}

.app-launch-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  padding: 12px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(16, 16, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.app-launch-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.app-launch-eyebrow {
  margin-top: 16px;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-launch-brand {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.app-launch-status {
  min-height: 1.5em;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-launch-progress {
  position: relative;
  width: min(220px, 58vw);
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-launch-progress-bar {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.08));
  animation: app-launch-shimmer 1.3s ease-in-out infinite;
}

.app-launch-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.7;
}

.app-launch-orb-one {
  top: 10%;
  left: -8%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.24), transparent 70%);
}

.app-launch-orb-two {
  right: -12%;
  bottom: 6%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
}

.app-launch-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 78%);
  opacity: 0.4;
}

body.theme-light {
  background-image: radial-gradient(circle at 0% -10%, rgba(15, 23, 42, 0.04), transparent 60%);
}

body.theme-light .app-launch {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at bottom, rgba(11, 95, 255, 0.12), transparent 42%),
    linear-gradient(180deg, #f7f8fb, #eef2f8);
}

body.theme-light .app-launch-glow {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.22), rgba(96, 165, 250, 0));
}

body.theme-light .app-launch-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 28px 60px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.theme-light .app-launch-progress {
  background: rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

body.theme-light .app-launch-progress-bar {
  background: linear-gradient(90deg, rgba(11, 95, 255, 0.06), rgba(11, 95, 255, 0.85), rgba(11, 95, 255, 0.06));
}

body.theme-light .app-launch-grid {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

@keyframes app-launch-enter {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes app-launch-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 12px, 0) scale(1.06);
  }
}

@keyframes app-launch-shimmer {
  0% {
    transform: translateX(-150%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-launch,
  .app-launch-shell,
  .app-launch-glow,
  .app-launch-progress-bar {
    animation: none !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    transform: none !important;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* UI Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  gap: 8px;
  border: 0;
}

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

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(15, 23, 42, 0.65));
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.5));
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.14);
}

.btn-danger {
  background-color: var(--danger-dim);
  color: var(--danger);
}

.card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

/* Dashboard discipline ring: rounded stroke, refined look */
.discipline-ring {
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.discipline-ring .discipline-ring-fill {
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-control {
  width: 100%;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Base Layout & App Shell */
.app-content {
  flex: 1;
  padding-top: var(--nav-height-top);
  padding-bottom: var(--nav-height-bottom);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Navigation - Top */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height-top);
  /* Fully integrated: let the page background show through */
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  transform: translateY(0);
  opacity: 1;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease;
  will-change: transform, opacity;
}

.top-nav.nav-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

@media (max-width: 680px) {
  .dash-day-grid {
    grid-template-columns: 1fr;
  }
}

.dash-metric-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.dash-metric-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.35);
}

.dash-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-metric-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-emoji {
  font-size: 1.05rem;
}

.dash-metric-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dash-metric-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dash-ring {
  width: 56px;
  height: 56px;
  position: relative;
  flex: 0 0 auto;
}

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

.dash-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.dash-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 113.097; /* 2πr where r=18 */
  transition: stroke-dashoffset 0.35s ease;
}

.dash-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dash-ring-emoji {
  font-size: 1.1rem;
  filter: saturate(1.1);
}

.dash-metric-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
}

.dash-metric-big {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.dash-metric-small {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-plan-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 16px;
  align-items: stretch;
}

.dash-plan-hero-copy {
  min-width: 0;
}

.dash-plan-hero-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dash-plan-hero-calories {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.dash-plan-hero-calories-value {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.dash-plan-hero-calories-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 6px;
}

.dash-plan-hero-macros {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.dash-plan-hero-macro {
  min-width: 72px;
}

.dash-plan-hero-macro-label {
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.dash-plan-hero-macro-value {
  font-weight: 700;
  color: var(--text-primary);
}

.dash-plan-hero-macro-value.accent {
  color: var(--accent);
}

.dash-plan-hero-meta {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-plan-hero-meta-icon {
  font-size: 1.1rem;
}

.dash-plan-hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  width: min(100%, 310px);
  aspect-ratio: 864 / 716;
  min-height: 150px;
  margin-top: 28px;
  align-self: end;
  justify-self: end;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-plan-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.dash-plan-hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.28) 0%, rgba(96, 165, 250, 0.08) 28%, rgba(15, 23, 42, 0.38) 58%, rgba(2, 6, 23, 0.88) 100%);
  pointer-events: none;
}

.dash-plan-hero-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(7, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.dash-plan-hero-badge-label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.dash-plan-hero-badge-value {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

/* Dashboard: macros card */
.dash-macros-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-macros-title {
  font-size: 1.1rem;
  margin: 0;
}

.dash-macros-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.dash-macros-body {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.dash-macros-total {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.dash-macros-total-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dash-macros-total-value {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.dash-macros-total-value span:first-child {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.dash-macros-total-unit {
  padding-bottom: 3px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dash-macros-total-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-macros-total-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

body.theme-light .dash-macros-total-chip {
  background: rgba(15, 23, 42, 0.05);
}

.dash-macros-total-chip.protein {
  color: var(--accent);
}

.dash-macros-total-chip.carbs {
  color: var(--success);
}

.dash-macros-total-chip.fat {
  color: var(--warning);
}

@media (max-width: 620px) {
  .dash-plan-hero-layout {
    grid-template-columns: minmax(0, 1fr) 156px;
    gap: 12px;
  }

  .dash-plan-hero-media {
    width: 100%;
    min-height: 152px;
    margin-top: 12px;
    border-radius: 18px;
  }

  .dash-plan-hero-calories-value {
    font-size: 2.4rem;
  }

  .dash-plan-hero-macros {
    gap: 12px;
  }

  .dash-plan-hero-badge {
    right: 10px;
    bottom: 10px;
    padding: 9px 10px;
    border-radius: 14px;
    gap: 4px;
  }

  .dash-plan-hero-badge-label {
    font-size: 0.58rem;
  }

  .dash-plan-hero-badge-value {
    font-size: 0.95rem;
  }

  .dash-macros-body {
    grid-template-columns: 1fr;
  }

  .dash-macros-total {
    padding: 12px;
  }
}

.dash-macros-legend {
  display: grid;
  gap: 8px;
}

.dash-legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.dash-legend-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.10);
}

.dash-legend-dot.protein { background: var(--accent); }
.dash-legend-dot.carbs { background: var(--success); }
.dash-legend-dot.fat { background: var(--warning); }

.dash-legend-label {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dash-legend-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.dash-legend-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-legend-val {
  font-weight: 900;
  color: var(--text-primary);
}

.dash-legend-kcal {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-legend-pct {
  font-weight: 900;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.dash-legend-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.dash-legend-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dash-legend-bar-fill.protein {
  background: var(--accent);
}

.dash-legend-bar-fill.carbs {
  background: var(--success);
}

.dash-legend-bar-fill.fat {
  background: var(--warning);
}

@media (max-width: 620px) {
  .dash-legend-row {
    grid-template-columns: 1fr;
  }

  .dash-legend-metrics {
    justify-content: space-between;
    gap: 8px;
  }
}

/* Plan */
.plan-hero {
  margin: -6px 0 16px;
  padding: 12px;
  border-radius: var(--radius-xl);
  background: var(--hero-card-bg), var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.plan-hero-top {
  display: grid;
  gap: 8px;
}

.plan-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-hero-title {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.plan-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.plan-hero-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.plan-summary-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.plan-summary-row::-webkit-scrollbar {
  display: none;
}

.plan-summary-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

body.theme-light .plan-summary-pill {
  background: rgba(15, 23, 42, 0.03);
}

.plan-summary-pill-calories {
  justify-content: flex-start;
  gap: 6px;
  padding-right: 11px;
}

.plan-summary-pill-icon {
  font-size: 0.96rem;
  line-height: 1;
}

.plan-summary-pill-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.plan-summary-pill-value {
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.plan-summary-pill-calories .plan-summary-pill-value {
  font-size: 1rem;
}

.plan-summary-pill-unit {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

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

@media (min-width: 900px) {
  .plan-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.plan-stat {
  padding: 14px 14px 12px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

body.theme-light .plan-stat {
  background: rgba(15, 23, 42, 0.03);
}

.plan-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.plan-stat-value {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.plan-stat-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.plan-intensity {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.plan-intensity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.plan-intensity-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plan-intensity-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
}

.plan-intensity-slider-wrap {
  margin-top: 6px;
}

.plan-intensity-hints {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  user-select: none;
}

.plan-intensity-hint-left,
.plan-intensity-hint-right {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.plan-intensity-track-wrap {
  position: relative;
  padding-bottom: 28px;
}

.plan-intensity-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(34, 197, 94, 0.25) 0%,
    rgba(234, 179, 8, 0.25) 50%,
    rgba(239, 68, 68, 0.25) 100%);
  overflow: hidden;
}

.plan-intensity-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg,
    rgba(34, 197, 94, 0.85) 0%,
    rgba(234, 179, 8, 0.85) 50%,
    rgba(239, 68, 68, 0.85) 100%);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plan-intensity-stops {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.plan-intensity-stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 44px;
  margin-top: -3px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
}

.plan-intensity-stop-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.plan-intensity-stop:first-child .plan-intensity-stop-dot {
  border-color: rgba(34, 197, 94, 0.55);
}

.plan-intensity-stop:nth-child(2) .plan-intensity-stop-dot {
  border-color: rgba(234, 179, 8, 0.55);
}

.plan-intensity-stop:last-child .plan-intensity-stop-dot {
  border-color: rgba(239, 68, 68, 0.55);
}

.plan-intensity-stop.active .plan-intensity-stop-dot {
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.plan-intensity-stop:first-child.active .plan-intensity-stop-dot {
  background: rgba(34, 197, 94, 0.9);
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.18);
}

.plan-intensity-stop:nth-child(2).active .plan-intensity-stop-dot {
  background: rgba(234, 179, 8, 0.9);
  border-color: rgba(234, 179, 8, 0.9);
  box-shadow: 0 0 0 5px rgba(234, 179, 8, 0.18);
}

.plan-intensity-stop:last-child.active .plan-intensity-stop-dot {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.18);
}

.plan-intensity-stop-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.plan-intensity-stop.active .plan-intensity-stop-label {
  color: var(--text-primary);
}


.plan-intensity-note {
  margin-top: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #f87171;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.18);
  display: none;
}

.plan-intensity-note.visible {
  display: block;
}


.plan-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.plan-timing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 900px) {
  .plan-timing {
    grid-template-columns: 1fr 1fr;
  }
}

.plan-timing-item {
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)),
    var(--bg-surface-elevated);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.plan-timing-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.plan-timing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.plan-timing-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Premium Menu (Plan) */
.menu-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.menu-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    var(--bg-surface);
  border-radius: var(--radius-xl);
}

body.theme-light .menu-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent 22%),
    var(--bg-surface);
}

.menu-card-title-group {
  display: grid;
  gap: 6px;
}

.menu-card-head h3 {
  font-size: 1.34rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.menu-card-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.menu-card-empty {
  min-height: 184px;
}

.menu-empty-state {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.menu-workout-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) - 2px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 90%),
    var(--bg-surface-elevated);
}

body.theme-light .menu-workout-controls {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.025), transparent 90%),
    var(--bg-surface-elevated);
}

.menu-workout-controls-copy {
  min-width: 0;
}

.menu-workout-controls-label {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-workout-controls-sub {
  margin-top: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.45;
}

.menu-workout-toggle {
  width: auto;
  min-width: 154px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.menu-workout-toggle.is-disabled {
  opacity: 0.68;
}

.menu-workout-toggle.is-disabled .settings-segment-btn.btn {
  pointer-events: none;
}

.menu-workout-toggle .settings-segment-btn.btn {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 14px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 0.84rem;
  font-weight: 800;
}

.menu-workout-toggle .settings-segment-btn.btn:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
  background: rgba(148, 163, 184, 0.08);
}

.menu-workout-toggle .settings-segment-btn.btn.active {
  background: var(--bg-surface-elevated);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.menu-meals {
  display: grid;
  gap: 18px;
}

.menu-workout-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2px 4px;
}

.menu-workout-marker::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
}

.menu-workout-marker-label {
  position: relative;
  z-index: 1;
  min-width: 96px;
  padding: 0 12px;
  background: var(--bg-dark);
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-workout-marker-btn {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.menu-workout-marker-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.menu-meal {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 28%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.menu-meal-head {
  padding: 18px 18px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
}

body.theme-light .menu-meal-head {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.03), transparent);
}

.menu-meal-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.menu-meal-badge {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  flex: 0 0 auto;
}

.menu-meal-copy {
  min-width: 0;
}

.menu-meal-title {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.menu-meal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.menu-meal-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.menu-role-chip.pre {
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.menu-role-chip.post {
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.menu-meal-totals {
  min-width: 160px;
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.menu-meal-totals-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-meal-kcal {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.menu-meal-kcal span {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-left: 6px;
}

.menu-macro-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.menu-macro-entry {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.menu-macro-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-macro-value {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.menu-meal-macros {
  justify-content: flex-end;
}

.menu-meal-macros .menu-macro-value,
.menu-current-macros .menu-macro-value {
  color: var(--text-primary);
}

.menu-meal-change {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.menu-meal-change:hover {
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.menu-items {
  display: grid;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.10s ease;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.18);
}

body.theme-light .menu-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.menu-item:active {
  transform: scale(0.99);
}

.menu-item-main {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.menu-item-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-item-name {
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.menu-item-portion {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.menu-item-sub {
  margin-top: 0;
}

.menu-item-side {
  min-width: 88px;
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
  flex: 0 0 auto;
}

.menu-item-kcal {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.menu-item-kcal span {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-left: 4px;
}

.menu-item-change {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Bottom sheet */
body.modal-open {
  overflow: hidden;
}

.menu-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 950;
}

.menu-sheet-backdrop[hidden],
.menu-sheet[hidden] {
  display: none !important;
}

.menu-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height-bottom) - var(--safe-area-inset-bottom));
  width: min(680px, calc(100vw - 24px));
  max-height: min(76vh, 680px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 960;
  overflow: hidden;
}

.menu-sheet-grab {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  margin: 12px auto 4px;
}

body.theme-light .menu-sheet-grab {
  background: rgba(15, 23, 42, 0.14);
}

.menu-sheet-head {
  padding: 10px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.menu-sheet-title {
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1.04rem;
  color: var(--text-primary);
}

.menu-sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.menu-sheet-close:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.menu-sheet-body {
  padding: 16px 18px 14px;
  overflow: auto;
}

.menu-sheet-current {
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--bg-surface-elevated);
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
}

.menu-current-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-current-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.menu-current-name {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.menu-current-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.menu-current-detail {
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.06);
}

.menu-current-detail-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-current-detail-value {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.menu-current-summary {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.menu-sheet-actions {
  margin-bottom: 12px;
}

.menu-reset {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.04);
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.menu-reset:hover {
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.menu-sheet-list {
  display: grid;
  gap: 12px;
}

.menu-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--bg-surface);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.menu-opt:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
  border-color: rgba(148, 163, 184, 0.35);
}

.menu-opt.disabled {
  opacity: 0.55;
}

.menu-opt.active {
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.menu-opt-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
}

.menu-opt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.menu-opt-name {
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-size: 0.96rem;
}

.menu-opt-kcal {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.menu-opt-kcal span {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-left: 4px;
}

.menu-opt-sub {
  margin-top: 0;
  font-size: 0.79rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.menu-opt-items {
  line-height: 1.5;
}

.menu-opt-check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.38);
  background: transparent;
  flex: 0 0 auto;
}

.menu-opt.active .menu-opt-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-dim);
}

.menu-sheet-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.08));
}

body.theme-light .menu-sheet-foot {
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.04));
}

.menu-sheet-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.menu-empty {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.04);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.menu-item:focus-visible,
.menu-meal-change:focus-visible,
.menu-workout-marker-btn:focus-visible,
.menu-sheet-close:focus-visible,
.menu-reset:focus-visible,
.menu-opt:focus-visible,
.menu-sheet-btn:focus-visible,
.menu-workout-toggle .settings-segment-btn.btn:focus-visible {
  outline: none;
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

@media (max-width: 640px) {
  .menu-card {
    padding: 20px;
  }

  .menu-workout-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-workout-toggle {
    width: 100%;
  }

  .menu-meal-head {
    flex-direction: column;
  }

  .menu-meal-totals {
    width: 100%;
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .menu-meal-macros {
    justify-content: flex-start;
  }

  .menu-item {
    flex-direction: column;
  }

  .menu-item-side {
    width: 100%;
    grid-auto-flow: column;
    justify-content: space-between;
    align-items: baseline;
  }

  .menu-sheet {
    width: calc(100vw - 16px);
    max-height: min(80vh, 720px);
  }

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

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

  .menu-current-top,
  .menu-opt-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.plan-tab-switcher {
  margin-top: 10px;
  width: 100%;
  max-width: 420px;
}

/* ── Cheat Meals: Hero Banner ──────────────────────────────── */
.cheat-meal-hero {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1a0a2e 100%);
  overflow: hidden;
  padding: 28px 24px 0;
}

body.theme-light .cheat-meal-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
}

.cheat-meal-hero-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.cheat-meal-hero-content {
  position: relative;
  z-index: 1;
}

.cheat-meal-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 12px;
}

.cheat-meal-hero-title {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #fff;
  line-height: 1.1;
}

.cheat-meal-hero-sub {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(196, 181, 253, 0.8);
}

.cheat-meal-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 22px;
}

.cheat-meal-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}

.cheat-meal-hero-stat:first-child {
  padding-left: 0;
}

.cheat-meal-hero-stat strong {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}

.cheat-meal-hero-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.65);
  margin-top: 3px;
}

.cheat-meal-hero-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(139, 92, 246, 0.3);
  flex-shrink: 0;
}

.cheat-meal-hero-cats {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 1;
}

.cheat-meal-hero-cats::-webkit-scrollbar { display: none; }

.cheat-meal-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

/* ── Category colour tokens ─────────────────────────────────── */
.cat-breakfast { --cat-from: #f59e0b; --cat-to: #ea580c; --cat-glow: rgba(245, 158, 11, 0.28); --cat-text: #fef3c7; }
.cat-lunch     { --cat-from: #22c55e; --cat-to: #16a34a; --cat-glow: rgba(34, 197, 94, 0.28);  --cat-text: #dcfce7; }
.cat-dinner    { --cat-from: #818cf8; --cat-to: #6d28d9; --cat-glow: rgba(129, 140, 248, 0.28); --cat-text: #e0e7ff; }
.cat-dessert   { --cat-from: #f472b6; --cat-to: #db2777; --cat-glow: rgba(244, 114, 182, 0.28); --cat-text: #fce7f3; }
.cat-snacks    { --cat-from: #fb923c; --cat-to: #dc2626; --cat-glow: rgba(251, 146, 60, 0.28);  --cat-text: #ffedd5; }

/* ── Dev card ───────────────────────────────────────────────── */
.cheat-meal-dev-card,
.cheat-meal-summary-card {
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    var(--bg-surface);
  border: 1px solid var(--border);
  padding: 20px;
}

body.theme-light .cheat-meal-dev-card,
body.theme-light .cheat-meal-summary-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent 22%),
    var(--bg-surface);
}

.cheat-meal-dev-head,
.cheat-meal-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cheat-meal-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.3;
}

.cheat-meal-card-sub {
  margin-top: 5px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cheat-meal-dev-current,
.cheat-meal-summary-copy {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.cheat-meal-dev-switcher {
  margin-top: 14px;
  width: 100%;
  max-width: 360px;
}

/* ── Summary card ───────────────────────────────────────────── */
.cheat-meal-summary-card--locked {
  border-style: dashed;
}

.cheat-meal-summary-card--pro-exhausted {
  border-color: rgba(96, 165, 250, 0.16);
}

.cheat-meal-summary-cta {
  margin-top: 10px;
}

.cheat-meal-summary-strip,
.cheat-meal-hero-strip {
  max-width: fit-content;
}

.cheat-meal-summary-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cheat-meal-summary-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.cheat-meal-summary-item:hover {
  border-color: rgba(148, 163, 184, 0.28);
}

.cheat-meal-summary-category {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 64px;
}

.cheat-meal-summary-name {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ── Filters ────────────────────────────────────────────────── */
.cheat-meal-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.cheat-meal-filters::-webkit-scrollbar { display: none; }

.cheat-meal-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.cheat-meal-filter-emoji {
  font-size: 0.95em;
}

.cheat-meal-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.cheat-meal-filter.cat-breakfast.active { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.25); }
.cheat-meal-filter.cat-lunch.active     { background: #16a34a; border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.25); }
.cheat-meal-filter.cat-dinner.active    { background: #6d28d9; border-color: #6d28d9; box-shadow: 0 0 0 3px rgba(109,40,217,0.25); }
.cheat-meal-filter.cat-dessert.active   { background: #db2777; border-color: #db2777; box-shadow: 0 0 0 3px rgba(219,39,119,0.25); }
.cheat-meal-filter.cat-snacks.active    { background: #ea580c; border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234,88,12,0.25); }

/* ── Card grid ──────────────────────────────────────────────── */
.cheat-meal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* ── Recipe card ────────────────────────────────────────────── */
.cheat-meal-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  text-align: left;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cheat-meal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.cheat-meal-card.is-selected {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.cheat-meal-card.is-locked {
  opacity: 0.82;
}

/* image area */
.cheat-meal-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cat-from, #6366f1), var(--cat-to, #4f46e5));
  flex-shrink: 0;
}

.cheat-meal-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cheat-meal-card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 40%, var(--cat-glow, rgba(99,102,241,0.3)) 0%, transparent 65%),
    linear-gradient(135deg, var(--cat-from, #6366f1), var(--cat-to, #4f46e5));
}

.cheat-meal-card-image-emoji {
  font-size: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  user-select: none;
}

.cheat-meal-card-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.38) 0%, transparent 60%);
}

.cheat-meal-card-selected-mark {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.cheat-meal-card-lock-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  font-size: 2rem;
  pointer-events: none;
}

/* body area */
.cheat-meal-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  flex: 1;
}

.cheat-meal-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.cheat-meal-card-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cheat-meal-card-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background: rgba(37, 99, 235, 0.12);
  color: #bfdbfe;
}

.cheat-meal-card-status-pill--remaining {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.14);
  color: #d1fae5;
}

.cheat-meal-card-status-row.is-exhausted .cheat-meal-card-status-pill--remaining {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

/* pills shared */
.cheat-meal-meta-pill,
.cheat-meal-card-category,
.cheat-meal-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cheat-meal-meta-pill {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
}

.cheat-meal-card-category {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cheat-meal-card-badge {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cheat-meal-card-badge.is-preview {
  background: rgba(245, 158, 11, 0.82);
  border-color: rgba(245, 158, 11, 0.9);
  color: #fff;
}

.cheat-meal-card-badge.is-locked {
  background: rgba(239, 68, 68, 0.75);
  border-color: rgba(239, 68, 68, 0.9);
  color: #fff;
}

.cheat-meal-card-badge.is-open {
  background: rgba(16, 185, 129, 0.82);
  border-color: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.cheat-meal-card-badge.is-pro-exhausted {
  background: rgba(51, 65, 85, 0.82);
  border-color: rgba(148, 163, 184, 0.36);
  color: #e2e8f0;
}

.cheat-meal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cheat-meal-card-author {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cheat-meal-card-cta {
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent);
  flex-shrink: 0;
}

.cheat-meal-card-cta.is-exhausted {
  font-size: 0.86rem;
  color: var(--text-secondary);
  flex-shrink: 1;
  text-align: right;
  line-height: 1.35;
}

/* ── Bottom sheet ────────────────────────────────────────────── */
.cheat-meal-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height-bottom) - var(--safe-area-inset-bottom));
  width: min(760px, calc(100vw - 24px));
  max-height: min(80vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 960;
  overflow: hidden;
}

.cheat-meal-sheet-backdrop[hidden],
.cheat-meal-sheet[hidden] {
  display: none !important;
}

.cheat-meal-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 950;
}

.cheat-meal-sheet-body {
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cheat-meal-sheet-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.08));
  flex-shrink: 0;
}

body.theme-light .cheat-meal-sheet-foot {
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.04));
}

/* ── Detail sheet: image hero ───────────────────────────────── */
.cheat-meal-detail-image {
  position: relative;
  width: min(440px, calc(100% - 40px));
  margin: 20px auto 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--cat-from, #6366f1), var(--cat-to, #4f46e5));
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.cheat-meal-detail-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cheat-meal-detail-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(ellipse at 30% 40%, var(--cat-glow, rgba(99,102,241,0.35)) 0%, transparent 65%),
    linear-gradient(135deg, var(--cat-from, #6366f1), var(--cat-to, #4f46e5));
}

.cheat-meal-detail-image-emoji {
  font-size: 4.5rem;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35));
  user-select: none;
}

.cheat-meal-detail-image-hint {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.cheat-meal-detail-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* ── Detail sheet: content ──────────────────────────────────── */
.cheat-meal-detail-hero {
  padding: 20px 20px 4px;
  background: transparent;
  border: none;
}

.cheat-meal-detail-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.cheat-meal-detail-overview {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.cheat-meal-lock-panel,
.cheat-meal-detail-section,
.cheat-meal-detail-callout {
  margin: 12px 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.cheat-meal-detail-callout {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cheat-meal-detail-callout.is-preview {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.cheat-meal-detail-callout.is-open {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.08);
}

.cheat-meal-detail-strip {
  margin: 0 20px 12px;
}

.cheat-meal-lock-panel--pro {
  border-color: rgba(96, 165, 250, 0.16);
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(15, 23, 42, 0.02)),
    var(--bg-surface-elevated);
}

.cheat-meal-detail-section-title,
.cheat-meal-lock-panel-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cheat-meal-lock-panel-copy {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cheat-meal-detail-nutrition {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cheat-meal-detail-nutrition-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.cheat-meal-detail-nutrition-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cheat-meal-detail-nutrition-value {
  margin-top: 5px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  font-weight: 600;
}

.cheat-meal-detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Focus styles ───────────────────────────────────────────── */
.plan-tab-switcher .settings-segment-btn.btn:focus-visible,
.cheat-meal-filter:focus-visible,
.cheat-meal-card:focus-visible,
.cheat-meal-summary-item:focus-visible,
.cheat-meal-sheet-btn:focus-visible {
  outline: none;
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cheat-meal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .plan-tab-switcher,
  .cheat-meal-dev-switcher {
    max-width: none;
  }

  .plan-hero {
    padding: 10px;
  }

  .plan-summary-row {
    gap: 5px;
  }

  .plan-summary-pill {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  .plan-summary-pill-label {
    font-size: 0.62rem;
  }

  .plan-summary-pill-value {
    font-size: 0.9rem;
  }

  .plan-summary-pill-calories .plan-summary-pill-value {
    font-size: 0.96rem;
  }

  .cheat-meal-dev-head,
  .cheat-meal-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .cheat-meal-hero-title {
    font-size: 1.5rem;
  }

  .cheat-meal-sheet {
    width: calc(100vw - 16px);
    max-height: min(86vh, 800px);
  }

  .cheat-meal-detail-image {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .cheat-meal-sheet-foot {
    grid-template-columns: 1fr;
  }

  .cheat-meal-sheet-pro-buttons {
    grid-template-columns: 1fr;
  }

  .cheat-meal-detail-nutrition {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .cheat-meal-grid {
    grid-template-columns: 1fr;
  }
}

.desktop-only {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 16px;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 24px rgba(0, 0, 0, 0.16);
  font-weight: 700;
  transform: translateY(-1px);
}

body.theme-light .nav-link.active {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.icon-btn {
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.icon-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.streak-btn {
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
  padding: 0 12px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, opacity 180ms ease, filter 180ms ease, background 220ms ease;
  position: relative;
  will-change: transform;
}

.streak-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.35);
}

.streak-btn:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-sm);
}

.streak-icon {
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-btn:hover .streak-icon {
  transform: translateY(-1px) scale(1.04);
}

.streak-btn:active .streak-icon {
  transform: scale(0.97);
}

.streak-count {
  font-size: 0.92rem;
  line-height: 1;
}

.streak-btn.is-broken {
  opacity: 0.62;
  filter: grayscale(1);
}

.streak-restore-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

/* Streak / Giveaway modal */
.streak-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}

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

.streak-modal-overlay.streak-modal--hiding {
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.streak-modal-card {
  width: min(560px, 92vw);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  transform: translateY(28px) scale(0.97);
  opacity: 0;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease;
  will-change: transform, opacity;
}

.streak-modal--visible .streak-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.streak-modal--hiding .streak-modal-card {
  transform: translateY(16px) scale(0.985);
  opacity: 0;
  transition: transform 220ms ease, opacity 180ms ease;
}

.streak-modal-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 20% 0%, rgba(148, 163, 184, 0.20), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(11, 95, 255, 0.18), transparent 60%),
    radial-gradient(circle at 40% 90%, rgba(148, 163, 184, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.streak-modal-inner {
  position: relative;
  z-index: 1;
}

#streakModal.streak-modal-overlay {
  align-items: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));
}

#streakModal .streak-modal-card {
  margin: auto;
}

.streak-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.streak-modal-heading {
  min-width: 0;
}

.streak-modal-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.streak-close-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 15px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background:
    radial-gradient(circle at 30% 25%, rgba(251, 191, 36, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(127, 29, 29, 0.96), rgba(69, 10, 10, 0.98));
  color: #fff7ed;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(127, 29, 29, 0.28);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.streak-close-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.48);
  background:
    radial-gradient(circle at 30% 25%, rgba(251, 191, 36, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(153, 27, 27, 0.98), rgba(127, 29, 29, 1));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 30px rgba(127, 29, 29, 0.34);
}

.streak-recovery-chip {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(244, 114, 182, 0.2);
  background:
    radial-gradient(circle at 25% 20%, rgba(244, 114, 182, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.streak-recovery-hearts {
  display: flex;
  align-items: center;
  gap: 3px;
}

.streak-recovery-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
}

.streak-recovery-heart--available {
  color: #fb7185;
  text-shadow: 0 0 10px rgba(244, 114, 182, 0.2);
}

.streak-recovery-heart--spent {
  color: rgba(148, 163, 184, 0.56);
  opacity: 0.9;
}

.streak-recovery-chip-count {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.74);
}

.streak-modal-kicker {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 900;
}

.streak-modal-title {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.streak-info-toggle {
  margin-top: 10px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.94));
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(2, 6, 23, 0.22);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.streak-info-toggle::before {
  content: '?';
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 900;
}

.streak-info-toggle:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(30, 64, 175, 0.36));
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 28px rgba(2, 6, 23, 0.28);
}

.streak-info-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.32), rgba(15, 23, 42, 0.96));
  border-color: rgba(147, 197, 253, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 30px rgba(2, 6, 23, 0.3);
}

.streak-info-dialog-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  border-radius: inherit;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.streak-info-dialog-overlay[hidden] {
  display: none;
}

.streak-info-dialog {
  position: relative;
  width: min(460px, calc(100% - 4px));
  max-height: min(76vh, 540px);
  overflow-y: auto;
  margin: 0 auto;
  padding: 18px;
  border: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 0%, rgba(96, 165, 250, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.985), rgba(8, 12, 24, 0.99));
  box-shadow:
    0 24px 64px rgba(2, 6, 23, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.streak-info-dialog::before {
  display: none;
}

.streak-info-dialog-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.streak-info-dialog-copy {
  min-width: 0;
}

.streak-info-kicker {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93c5fd;
}

.streak-info-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

.streak-info-close:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.32);
  color: #f8fafc;
}

.streak-info-title {
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f8fafc;
}

.streak-info-subtitle {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.82);
}

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

.streak-info-card {
  min-width: 0;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.96));
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.16);
}

.streak-info-card-accent {
  border-color: rgba(96, 165, 250, 0.28);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(30, 58, 138, 0.32), rgba(15, 23, 42, 0.96));
}

.streak-info-card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.22);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.streak-info-card-title {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #f8fafc;
}

.streak-info-card-copy {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.52;
  color: rgba(226, 232, 240, 0.88);
}

.streak-info-card-copy strong {
  color: #f8fafc;
}

.streak-info-note {
  margin-top: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 15, 30, 0.92);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.88);
  box-shadow: none;
}

.streak-info-note strong {
  color: #f8fafc;
}

body.theme-light .streak-info-toggle {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.98));
  border-color: rgba(59, 130, 246, 0.24);
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(148, 163, 184, 0.16);
}

body.theme-light .streak-info-toggle::before {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

body.theme-light .streak-info-dialog-overlay {
  background: rgba(226, 232, 240, 0.78);
}

body.theme-light .streak-info-dialog {
  background:
    radial-gradient(circle at 14% 0%, rgba(96, 165, 250, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(248, 250, 252, 0.99));
  box-shadow:
    0 24px 56px rgba(148, 163, 184, 0.22),
    0 0 0 1px rgba(148, 163, 184, 0.14);
}

body.theme-light .streak-info-close {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.2);
  color: #475569;
}

body.theme-light .streak-close-btn {
  border-color: rgba(248, 113, 113, 0.22);
  background:
    radial-gradient(circle at 30% 25%, rgba(251, 191, 36, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 241, 242, 0.98), rgba(254, 226, 226, 0.98));
  color: #991b1b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 12px 24px rgba(248, 113, 113, 0.16);
}

body.theme-light .streak-close-btn:hover {
  border-color: rgba(248, 113, 113, 0.34);
  background:
    radial-gradient(circle at 30% 25%, rgba(251, 191, 36, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(254, 226, 226, 1), rgba(254, 205, 211, 1));
  color: #7f1d1d;
}

body.theme-light .streak-recovery-chip {
  border-color: rgba(244, 114, 182, 0.16);
  background:
    radial-gradient(circle at 25% 20%, rgba(244, 114, 182, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

body.theme-light .streak-recovery-heart--available {
  color: #e11d48;
}

body.theme-light .streak-recovery-heart--spent {
  color: rgba(148, 163, 184, 0.72);
}

body.theme-light .streak-recovery-chip-count {
  color: #64748b;
}

body.theme-light .streak-info-title {
  color: #0f172a;
}

body.theme-light .streak-info-subtitle {
  color: #475569;
}

body.theme-light .streak-info-card {
  border-color: rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98));
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.12);
}

body.theme-light .streak-info-card-accent {
  border-color: rgba(96, 165, 250, 0.24);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(241, 245, 249, 0.98));
}

body.theme-light .streak-info-card-title {
  color: #0f172a;
}

body.theme-light .streak-info-card-copy,
body.theme-light .streak-info-note {
  color: #334155;
}

body.theme-light .streak-info-card-copy strong,
body.theme-light .streak-info-note strong {
  color: #0f172a;
}

body.theme-light .streak-info-note {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.94);
}

.streak-info-list {
  margin: 0;
  padding: 0;
  display: grid;
}

@media (max-width: 520px) {
  #streakModal.streak-modal-overlay {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  #streakModal .streak-modal-card {
    width: min(560px, 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .streak-info-dialog-overlay {
    padding: 10px;
  }

  .streak-info-dialog {
    width: min(460px, 100%);
    max-height: calc(100% - 4px);
    padding: 15px;
    border-radius: 18px;
  }

  .streak-info-title {
    font-size: 1.14rem;
  }

  .streak-info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .streak-info-card {
    padding: 12px;
    border-radius: 16px;
  }
}

.streak-gift-badge {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 8px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(148, 163, 184, 0.05));
  box-shadow: var(--shadow-md);
}

body.theme-light .streak-gift-badge {
  background: radial-gradient(circle at 30% 0%, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.02)),
    linear-gradient(135deg, rgba(11, 95, 255, 0.18), rgba(11, 95, 255, 0.04));
}

.streak-gift-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.streak-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
}

.streak-panel.elevated {
  background: var(--bg-surface-elevated);
}

.streak-comparison-panel {
  margin-top: 12px;
  padding: 12px;
  border-color: rgba(251, 191, 36, 0.24);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.18), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(249, 115, 22, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(41, 24, 10, 0.94), rgba(15, 23, 42, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(15, 23, 42, 0.24);
}

.streak-comparison-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.streak-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.streak-comparison-card {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(2, 6, 23, 0.16);
}

.streak-comparison-card--accent {
  border-color: rgba(251, 191, 36, 0.34);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(120, 53, 15, 0.34), rgba(15, 23, 42, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 34px rgba(120, 53, 15, 0.18);
}

.streak-comparison-card--current {
  border-color: rgba(255, 255, 255, 0.22);
}

.streak-comparison-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.streak-comparison-label {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.82);
}

.streak-comparison-badge,
.streak-comparison-current {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.streak-comparison-badge {
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.streak-comparison-current {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.streak-comparison-stat {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.streak-comparison-gift {
  font-size: 0.95rem;
  line-height: 1;
}

.streak-comparison-value {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #f8fafc;
}

.streak-comparison-unit {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.72);
}

.streak-comparison-meta {
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(241, 245, 249, 0.84);
}

.streak-comparison-note {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.16);
  background: rgba(15, 23, 42, 0.46);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(241, 245, 249, 0.88);
}

.streak-comparison-note strong {
  color: #fff7ed;
}

.streak-upsell-cta-wrap {
  margin-top: 10px;
}

.streak-upsell-cta {
  width: 100%;
  min-height: 44px;
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.22);
}

.streak-upsell-meta {
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(241, 245, 249, 0.76);
  text-align: center;
}

body.theme-light .streak-comparison-panel {
  border-color: rgba(245, 158, 11, 0.22);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(249, 115, 22, 0.10), transparent 40%),
    linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 18px 36px rgba(148, 163, 184, 0.16);
}

body.theme-light .streak-comparison-pill {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

body.theme-light .streak-comparison-card {
  border-color: rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 26px rgba(148, 163, 184, 0.14);
}

body.theme-light .streak-comparison-card--accent {
  border-color: rgba(245, 158, 11, 0.24);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.98));
}

body.theme-light .streak-comparison-label,
body.theme-light .streak-comparison-unit,
body.theme-light .streak-comparison-meta,
body.theme-light .streak-upsell-meta {
  color: #475569;
}

body.theme-light .streak-comparison-value,
body.theme-light .streak-comparison-current,
body.theme-light .streak-comparison-note strong {
  color: #0f172a;
}

body.theme-light .streak-comparison-current {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(148, 163, 184, 0.18);
}

body.theme-light .streak-comparison-note {
  border-color: rgba(245, 158, 11, 0.18);
  background: rgba(255, 255, 255, 0.68);
  color: #334155;
}

/* ── Brand logo carousel (streak giveaway) ─────────────── */
.streak-brands-wrapper {
  overflow: hidden;
  width: 100%;
  margin-top: 12px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.streak-brands-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: streak-brands-scroll 10s linear infinite;
}

.streak-brand-logo {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.streak-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.streak-brands-wrapper--locked .streak-brand-logo {
  opacity: 0.45;
  filter: grayscale(0.4);
}

@keyframes streak-brands-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.streak-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.streak-big {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.streak-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 800;
}

.streak-sub {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1.45;
}

.streak-sub strong {
  color: var(--text-primary);
  font-weight: 900;
}

.streak-progress {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
}

body.theme-light .streak-progress {
  background: rgba(15, 23, 42, 0.04);
}

.streak-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--progress-fill);
  border-radius: 999px;
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .streak-comparison-panel {
    padding: 10px;
  }

  .streak-comparison-value {
    font-size: 1.34rem;
  }

  .streak-comparison-unit,
  .streak-comparison-meta,
  .streak-comparison-note,
  .streak-upsell-meta {
    font-size: 0.72rem;
  }

  .streak-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .streak-recovery-chip {
    padding: 7px 9px;
    border-radius: 14px;
  }

  .streak-recovery-heart {
    font-size: 0.86rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Gift / Giveaway button + modal
══════════════════════════════════════════════════════════════════ */

/* ── Gift button (next to streak button) ─────────────────────── */
.gift-btn {
  height: 38px;
  width: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  position: relative;
  will-change: transform;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms ease;
}

.gift-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(251, 191, 36, 0.42);
}

.gift-btn:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-sm);
}

.gift-icon {
  font-size: 1.08rem;
  line-height: 1;
  display: inline-flex;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gift-btn:hover .gift-icon {
  transform: translateY(-1px) scale(1.1) rotate(-6deg);
}

.gift-btn:active .gift-icon {
  transform: scale(0.95);
}

.gift-ticket-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent, #0b5fff);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg-surface-elevated);
  pointer-events: none;
}

/* ── Giveaway modal shell (reuses streak-modal-overlay/card) ─── */
#giveawayModal.streak-modal-overlay {
  align-items: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));
}

#giveawayModal .streak-modal-card {
  margin: auto;
}

/* Amber/gold accent gradient on the giveaway card border */
.giveaway-modal-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 20% 0%,  rgba(251, 191, 36, 0.22), transparent 52%),
    radial-gradient(circle at 80% 30%, rgba(245, 158, 11, 0.18), transparent 58%),
    radial-gradient(circle at 40% 90%, rgba(148, 163, 184, 0.08), transparent 55%);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* Kicker label with amber tint */
.giveaway-kicker {
  color: #f59e0b !important;
}

body.theme-light .giveaway-kicker {
  color: #b45309 !important;
}

/* Green close button for giveaway modal */
.giveaway-close-btn {
  border-color: rgba(74, 222, 128, 0.28) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(134, 239, 172, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(6, 78, 59, 0.96), rgba(4, 47, 46, 0.98)) !important;
  color: #d1fae5 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(6, 78, 59, 0.26) !important;
}

.giveaway-close-btn:hover {
  border-color: rgba(134, 239, 172, 0.42) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(134, 239, 172, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(6, 95, 70, 0.98), rgba(6, 78, 59, 1)) !important;
  color: #fff !important;
}

body.theme-light .giveaway-close-btn {
  border-color: rgba(16, 185, 129, 0.24) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(167, 243, 208, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(209, 250, 229, 0.98)) !important;
  color: #065f46 !important;
}

/* Ticket count chip in header */
.giveaway-ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background:
    radial-gradient(circle at 25% 20%, rgba(251, 191, 36, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fcd34d;
}

body.theme-light .giveaway-ticket-chip {
  background:
    radial-gradient(circle at 25% 20%, rgba(251, 191, 36, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(254, 252, 232, 0.98));
  color: #92400e;
  border-color: rgba(251, 191, 36, 0.22);
}

/* ── Progress panel ──────────────────────────────────────────── */
.giveaway-progress-panel {
  margin-top: 12px;
  padding: 16px;
}

.giveaway-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.giveaway-progress-label {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.giveaway-progress-count {
  font-size: 0.88rem;
  font-weight: 900;
  color: #fcd34d;
  letter-spacing: -0.01em;
}

body.theme-light .giveaway-progress-count {
  color: #92400e;
}

.giveaway-progress-bar-wrap {
  margin: 10px 0 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  overflow: hidden;
}

body.theme-light .giveaway-progress-bar-wrap {
  background: rgba(15, 23, 42, 0.05);
}

.giveaway-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24 60%, #fde68a);
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Status messages */
.giveaway-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 10px;
  margin-top: 8px;
}

.giveaway-status--ready {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

body.theme-light .giveaway-status--ready {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #065f46;
}

.giveaway-status--broken {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

body.theme-light .giveaway-status--broken {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.16);
  color: #991b1b;
}

.giveaway-status--building {
  color: var(--text-secondary);
  padding: 6px 0;
  margin-top: 4px;
}

.giveaway-status--building strong {
  color: var(--text-primary);
}

/* Convert button */
.giveaway-convert-btn {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
  color: #1c1917 !important;
  font-weight: 900 !important;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.giveaway-convert-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.36) !important;
}

/* Elite badge */
.giveaway-elite-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.giveaway-elite-crown {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.giveaway-elite-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.giveaway-elite-sub {
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ── Tickets summary ─────────────────────────────────────────── */
.giveaway-tickets-panel {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.08), transparent 50%),
    var(--bg-surface-elevated);
}

body.theme-light .giveaway-tickets-panel {
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.06), transparent 50%),
    rgba(255, 255, 255, 0.96);
}

.giveaway-tickets-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.giveaway-tickets-label {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-primary);
}

.giveaway-tickets-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.giveaway-ticket-free-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

body.theme-light .giveaway-ticket-free-badge {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

.giveaway-ticket-used-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 900;
}

body.theme-light .giveaway-ticket-used-badge {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.18);
  color: #065f46;
}

/* ── Giveaway months section ─────────────────────────────────── */
.giveaway-months-section {
  margin-top: 14px;
}

.giveaway-section-title {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.giveaway-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.giveaway-month-card {
  padding: 13px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.96));
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.theme-light .giveaway-month-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
  border-color: rgba(148, 163, 184, 0.14);
}

.giveaway-month-card--registered {
  border-color: rgba(74, 222, 128, 0.32);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(6, 78, 59, 0.24), rgba(15, 23, 42, 0.96));
}

body.theme-light .giveaway-month-card--registered {
  border-color: rgba(16, 185, 129, 0.24);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(241, 245, 249, 0.98));
}

.giveaway-month-card--locked {
  opacity: 0.72;
}

.giveaway-month-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}

.giveaway-month-name {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.giveaway-month-year {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.giveaway-month-date-line {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.giveaway-prize-secret {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.giveaway-prize-revealed {
  font-size: 0.7rem;
  font-weight: 900;
  color: #fcd34d;
}

body.theme-light .giveaway-prize-revealed {
  color: #92400e;
}

.giveaway-month-action {
  margin-top: 4px;
}

/* Register button */
.giveaway-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  cursor: pointer;
}

.giveaway-register-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.44);
  transform: translateY(-1px);
}

body.theme-light .giveaway-register-btn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

/* Registered row */
.giveaway-month-registered-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.giveaway-registered-label {
  font-size: 0.72rem;
  font-weight: 900;
  color: #6ee7b7;
}

body.theme-light .giveaway-registered-label {
  color: #065f46;
}

/* Unregister button */
.giveaway-unregister-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.66rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.giveaway-unregister-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.34);
}

body.theme-light .giveaway-unregister-btn {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.16);
  color: #991b1b;
}

.giveaway-lock-pill {
  font-size: 0.72rem;
  opacity: 0.7;
}

.giveaway-month-locked-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  padding: 4px 0;
}

.giveaway-month-no-ticket {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  padding: 4px 0;
  opacity: 0.75;
}

/* Prizes panel */
.giveaway-prizes-panel {
  margin-top: 12px;
}

.giveaway-prize-note {
  margin-top: 10px;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.streak-prizes-panel {
  border-color: rgba(251, 191, 36, 0.2);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 38px rgba(15, 23, 42, 0.2);
}

.streak-prizes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.streak-prizes-badge {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.26);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.streak-prizes-marquee {
  margin-top: 14px;
}

.streak-prizes-panel .streak-brands-track {
  animation-duration: 12s;
}

.streak-prizes-panel:hover .streak-brands-track {
  animation-play-state: paused;
}

.streak-prizes-panel .streak-brand-logo {
  width: 58px;
  height: 58px;
  border-color: rgba(251, 191, 36, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 10px 22px rgba(2, 6, 23, 0.28);
}

.streak-prizes-panel .streak-brand-logo img {
  padding: 8px;
}

.streak-prize-note {
  margin-top: 12px;
}

.streak-prize-sub {
  margin-top: 6px;
  color: rgba(241, 245, 249, 0.78);
}

/* streak-status broken state */
.streak-status--broken {
  color: #f87171;
}

body.theme-light .streak-status--broken {
  color: #b91c1c;
}

body.theme-light .streak-prizes-panel {
  border-color: rgba(245, 158, 11, 0.2);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.12), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 18px 34px rgba(148, 163, 184, 0.14);
}

body.theme-light .streak-prizes-badge {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

body.theme-light .streak-prizes-panel .streak-brand-logo {
  border-color: rgba(245, 158, 11, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 20px rgba(148, 163, 184, 0.16);
}

body.theme-light .streak-prize-sub {
  color: #475569;
}

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 520px) {
  #giveawayModal.streak-modal-overlay {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  #giveawayModal .streak-modal-card {
    width: min(560px, 100%);
  }

  .giveaway-months-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .giveaway-month-card {
    padding: 10px 8px;
  }

  .giveaway-month-name {
    font-size: 0.78rem;
  }

  .giveaway-month-year,
  .giveaway-month-date-line,
  .giveaway-prize-secret,
  .giveaway-prize-revealed {
    font-size: 0.62rem;
  }

  .giveaway-register-btn {
    font-size: 0.64rem;
    padding: 6px 4px;
  }

  .giveaway-registered-label {
    font-size: 0.64rem;
  }

  .giveaway-unregister-btn {
    font-size: 0.6rem;
    padding: 3px 6px;
  }
}

/* reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .gift-btn,
  .gift-btn:hover,
  .gift-btn:active,
  .gift-btn:hover .gift-icon,
  .gift-btn:active .gift-icon,
  .giveaway-progress-bar-fill,
  .giveaway-register-btn,
  .giveaway-convert-btn {
    transition: none !important;
    animation: none !important;
  }
}

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.profile-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.35);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-initials {
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 0%, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05));
}

.profile-btn.has-photo .profile-avatar { display: block; }
.profile-btn.has-photo .profile-initials { display: none; }

.settings-page {
  position: relative;
}

.settings-page-shell {
  display: grid;
  gap: 16px;
}

.settings-top-actions {
  display: flex;
  justify-content: flex-end;
}

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

.settings-hero,
.settings-panel {
  animation: settings-panel-rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.settings-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.22), transparent 38%),
    radial-gradient(circle at bottom right, rgba(11, 95, 255, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.settings-hero::after {
  content: '';
  position: absolute;
  inset: auto -12% -28% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.14), transparent 68%);
  pointer-events: none;
}

.settings-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-hero-copy {
  max-width: 560px;
}

.settings-hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-hero-title {
  margin-top: 6px;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.settings-hero-text {
  margin-top: 10px;
  max-width: 36ch;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.settings-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.settings-hero-calorie {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(16, 16, 24, 0.52), rgba(16, 16, 24, 0.28));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

.settings-hero-calorie-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-hero-calorie-value {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.settings-hero-calorie-value span:first-child {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.settings-hero-calorie-unit {
  padding-bottom: 6px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.settings-hero-calorie-meta {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.settings-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.settings-hero-chip-icon,
.settings-panel-icon,
.settings-choice-figure,
.settings-bodyfat-figure,
.settings-collapsible-arrow,
.settings-icon,
.settings-hero-chip svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-hero-chip svg,
.settings-panel-icon svg,
.settings-choice-figure svg,
.settings-bodyfat-figure svg,
.settings-collapsible-arrow svg,
.settings-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.settings-panel-secondary {
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.07), rgba(148, 163, 184, 0.02)),
    var(--bg-surface);
}

.settings-panel-priority {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--bg-surface);
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.settings-panel-header-compact {
  margin-bottom: 0;
}

.settings-panel-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.06));
  color: var(--text-primary);
}

.settings-panel-copy {
  min-width: 0;
}

.settings-panel-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-panel-title {
  margin-top: 5px;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
}

.settings-panel-subtitle {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.settings-stack {
  display: grid;
  gap: 14px;
}

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

.settings-panel .input-group {
  margin-bottom: 0;
}

.settings-panel .input-control {
  min-height: 48px;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.settings-panel .input-control:focus {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

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

.settings-accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.settings-icon-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.settings-accent-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.settings-icon-btn:hover,
.settings-accent-btn:hover,
.settings-choice:hover,
.settings-bodyfat-btn:hover,
.settings-segment-btn.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.28);
}

.settings-icon-btn.active,
.settings-accent-btn.active,
.settings-choice.active,
.settings-bodyfat-btn.active,
.settings-segment-btn.btn.active {
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.04));
}

.settings-page .settings-icon-btn.active,
.settings-page .settings-choice.active,
.settings-page .settings-bodyfat-btn.active,
.settings-page .settings-segment-btn.btn.active,
.settings-page .settings-binary-btn.is-selected {
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 14px 28px rgba(10, 56, 30, 0.14);
}

.settings-page .settings-icon-btn.active .settings-icon,
.settings-page .settings-choice.active .settings-choice-figure,
.settings-page .settings-bodyfat-btn.active .settings-bodyfat-figure {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.22), rgba(21, 128, 61, 0.12));
  color: #dcfce7;
}

.settings-binary-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-binary-btn {
  flex: 1;
}

.settings-select-choice:not(.is-selected) {
  color: var(--text-secondary);
}

.settings-page .settings-select-choice.is-selected {
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.settings-page .settings-select-choice.is-selected:focus {
  border-color: rgba(74, 222, 128, 0.62);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.settings-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.settings-accent-swatch {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 14px rgba(0, 0, 0, 0.22);
}

.settings-accent-swatch-blue {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.settings-accent-swatch-green {
  background: linear-gradient(135deg, #16a34a, #4ade80);
}

.settings-accent-swatch-red {
  background: linear-gradient(135deg, #dc2626, #f87171);
}

.settings-accent-swatch-yellow {
  background: linear-gradient(135deg, #d97706, #fbbf24);
}

.settings-accent-swatch-slate {
  background: linear-gradient(135deg, #64748b, #cbd5e1);
}

.settings-accent-label {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-icon-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.settings-icon-text {
  font-weight: 900;
  letter-spacing: -0.02em;
}

.settings-icon-subtext {
  margin-top: 1px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.settings-icon-male {
  color: #60a5fa;
}

.settings-icon-female {
  color: #f472b6;
}

.settings-icon-sun {
  color: #f59e0b;
}

.settings-icon-moon {
  color: #93c5fd;
}

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

.settings-workout-time {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-segment-btn.btn {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.settings-workout-time.is-disabled {
  opacity: 0.58;
}

.settings-workout-time.is-disabled .settings-segment-btn.btn {
  cursor: not-allowed;
}

.settings-inline-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.settings-age-stepper,
.settings-workouts {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.settings-step {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.settings-age-display,
.settings-workouts-main {
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.settings-age-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.settings-age-value {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.settings-age-label {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.settings-input-shell {
  position: relative;
}

.settings-metric-input.input-control {
  padding-right: 72px;
}

.settings-input-suffix {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.metric-slider-card {
  position: relative;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at top right, rgba(11, 95, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 32px rgba(2, 6, 23, 0.16);
}

.metric-slider-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-slider-label {
  margin: 0;
}

.metric-slider-value-pill {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.metric-slider-value {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  font-weight: 900;
  color: var(--text-primary);
}

.metric-slider-unit {
  padding-bottom: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-slider-track-wrap {
  margin-top: 18px;
}

.metric-slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
  --metric-slider-progress: 50%;
}

.metric-slider-input:focus {
  outline: none;
}

.metric-slider-input::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent) 94%, white) 0%,
      color-mix(in srgb, var(--accent) 74%, white) var(--metric-slider-progress),
      rgba(255, 255, 255, 0.12) var(--metric-slider-progress),
      rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.18),
    inset 0 10px 22px rgba(2, 6, 23, 0.2);
}

.metric-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -8px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 90%, white), color-mix(in srgb, var(--accent) 68%, black));
  box-shadow:
    0 12px 24px rgba(2, 6, 23, 0.28),
    0 0 0 7px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-slider-input:active::-webkit-slider-thumb,
.metric-slider-input:focus-visible::-webkit-slider-thumb {
  transform: scale(1.04);
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.34),
    0 0 0 10px color-mix(in srgb, var(--accent) 24%, transparent);
}

.metric-slider-input::-moz-range-track {
  height: 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.18),
    inset 0 10px 22px rgba(2, 6, 23, 0.2);
}

.metric-slider-input::-moz-range-progress {
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent) 94%, white) 0%,
      color-mix(in srgb, var(--accent) 74%, white) 100%);
}

.metric-slider-input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 90%, white), color-mix(in srgb, var(--accent) 68%, black));
  box-shadow:
    0 12px 24px rgba(2, 6, 23, 0.28),
    0 0 0 7px color-mix(in srgb, var(--accent) 18%, transparent);
}

.metric-slider-input:focus-visible::-moz-range-thumb {
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.34),
    0 0 0 10px color-mix(in srgb, var(--accent) 24%, transparent);
}

.metric-slider-ticks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  margin-top: 2px;
  pointer-events: none;
}

.metric-slider-ticks span {
  justify-self: center;
  width: 2px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
}

.metric-slider-ticks span:first-child,
.metric-slider-ticks span:last-child {
  height: 14px;
  background: rgba(148, 163, 184, 0.42);
}

.metric-slider-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.settings-workouts-value {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--text-primary);
}

.settings-workouts-unit {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-bottom: 3px;
}

.settings-workouts-dots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.settings-dot {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.settings-dot.on {
  background: linear-gradient(90deg, var(--accent), rgba(148, 163, 184, 0.95));
  border-color: rgba(148, 163, 184, 0.4);
}

.settings-choice-grid,
.settings-bodyfat {
  display: grid;
  gap: 10px;
}

.settings-choice-grid-goal,
.settings-bodyfat {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-choice-grid-meals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-choice,
.settings-bodyfat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 102px;
  padding: 12px 10px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.settings-choice-compact {
  min-height: 88px;
  gap: 8px;
}

.settings-choice-figure,
.settings-bodyfat-figure {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.05));
  color: var(--text-primary);
}

.settings-choice-figure-compact {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.settings-choice-text {
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
}

.settings-collapsible {
  padding: 0;
}

.settings-collapsible summary {
  list-style: none;
  cursor: pointer;
}

.settings-collapsible summary::-webkit-details-marker {
  display: none;
}

.settings-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.settings-collapsible-copy {
  flex: 1;
  min-width: 0;
}

.settings-collapsible-status {
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  word-break: break-word;
}

.settings-collapsible-arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transition: transform 0.18s ease;
}

.settings-collapsible[open] .settings-collapsible-arrow {
  transform: rotate(180deg);
}

.settings-collapsible-body {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.settings-collapsible-body-spaced {
  padding-top: 18px;
}

.settings-notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.settings-inline-help {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.settings-inline-help-title {
  font-weight: 700;
  color: var(--text-primary);
}

.settings-inline-help-copy {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.settings-inline-help-copy ol {
  margin: 8px 0 0 18px;
}

.settings-restart-panel {
  display: grid;
  gap: 14px;
}

.settings-restart-row {
  display: grid;
  gap: 12px;
}

.settings-restart-note {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.settings-restart-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
}

.settings-save-wrap {
  position: relative;
}

.settings-save-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.icon-btn-danger {
  position: relative;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 59, 48, 0.25);
  background: rgba(255, 59, 48, 0.08);
}

.icon-btn-danger:hover {
  background: rgba(255, 59, 48, 0.14);
  color: var(--text-primary);
  border-color: rgba(255, 59, 48, 0.35);
}

.icon-btn-danger .danger-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.22);
}

.settings-sticky-save {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height-bottom) + 14px);
  width: min(720px, calc(100vw - 28px));
  z-index: 900;
  pointer-events: none;
}

.settings-sticky-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  background: rgba(16, 16, 24, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.settings-sticky-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.settings-sticky-btn {
  padding: 10px 14px;
  font-size: 0.9rem;
}

@keyframes settings-panel-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 700px) {
  .settings-hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: end;
  }

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

  .settings-restart-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .settings-restart-btn {
    width: auto;
    min-width: 150px;
  }
}

@media (min-width: 960px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-sticky-save {
    bottom: 18px;
  }
}

@media (max-width: 540px) {
  .settings-hero {
    padding: 18px;
  }

  .settings-choice-grid-goal,
  .settings-bodyfat {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-choice,
  .settings-bodyfat-btn {
    min-height: 96px;
    padding: 12px 8px;
  }

  .settings-icon-btn {
    min-height: 58px;
    padding: 10px;
  }

  .settings-accent-btn {
    min-height: 54px;
    padding: 10px;
  }

  .settings-icon-subtext {
    display: none;
  }

  .settings-sticky-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-sticky-btn {
    width: 100%;
  }

  .metric-slider-card {
    padding: 14px;
    border-radius: 20px;
  }

  .metric-slider-head {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-slider-value-pill {
    align-self: flex-start;
  }
}

/* Navigation - Bottom (Mobile) */
.mobile-only {
  display: none;
}

/* Media Queries */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: flex;
  }

  .app-content {
    /* Only account for top nav if present, else just bottom */
    padding-top: max(var(--nav-height-top), 24px);
    padding-bottom: calc(var(--nav-height-bottom) + 24px);
  }

  .top-nav {
    justify-content: space-between;
    padding: 0 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bottom-nav {
    position: fixed;
    bottom: calc(var(--safe-area-inset-bottom) + 16px);
    left: 16px;
    right: 16px;
    height: 64px;
    background-color: rgba(16, 16, 24, 0.82);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    z-index: 100;
  }

  body.theme-light .bottom-nav {
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15);
  }

  .bnav-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 100%;
    color: var(--text-secondary);
    gap: 4px;
    border-radius: 22px;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .bnav-link .icon,
  .bnav-link svg {
    font-size: 1.25rem;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .bnav-link .label {
    font-size: 0.6rem;
    font-weight: 500;
    transition: letter-spacing 0.2s ease, font-weight 0.2s ease;
  }

  .bnav-link:hover,
  .bnav-link.active {
    color: var(--accent);
  }

  .bnav-link.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24), inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
    transform: translateY(-2px);
  }

  body.theme-light .bnav-link.active {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14), inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  }

  .bnav-link.active svg {
    transform: translateY(-2px) scale(1.08);
  }

  .bnav-link.active .label {
    font-weight: 700;
    letter-spacing: 0.02em;
  }
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 12px 12px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  animation: slideFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
}

.toast-message {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.toast-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Toast semantic styling: subtle icon-like badge instead of big color stripe */
.toast::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.22);
}

.toast-error::before,
.toast-warning::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25);
}

.toast-success::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
}

.toast-warning,
.toast-error {
  /* Opaque + readable */
  background-color: var(--bg-surface-elevated);
  border-color: rgba(255, 59, 48, 0.55);
}

.toast-warning .toast-message,
.toast-error .toast-message {
  color: var(--text-primary);
}

.toast-warning .toast-icon,
.toast-error .toast-icon {
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.35);
}


@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Add to Home Screen (A2HS) overlay */
.a2hs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1200;
}

.a2hs-card {
  width: min(560px, 92vw);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  padding: 18px 16px 16px;
}

.a2hs-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 15% 0%, rgba(148, 163, 184, 0.22), transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(11, 95, 255, 0.14), transparent 60%),
    radial-gradient(circle at 45% 95%, rgba(148, 163, 184, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.a2hs-card > * {
  position: relative;
  z-index: 1;
}

.a2hs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.a2hs-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.a2hs-close {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.a2hs-close:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.a2hs-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.a2hs-sub {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 14px;
}

.a2hs-steps {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.a2hs-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.a2hs-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--text-primary);
}

.a2hs-step-text {
  color: var(--text-secondary);
  font-weight: 750;
  line-height: 1.45;
}

.a2hs-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 900;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

body.theme-light .a2hs-pill {
  background: rgba(15, 23, 42, 0.04);
}

.a2hs-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.a2hs-primary[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.a2hs-dont {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}

.a2hs-dont input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.a2hs-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.a2hs-foot-muted {
  color: var(--text-muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

/* iOS hint bar (subtle) */
.a2hs-hintbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(560px, calc(100vw - 28px));
  z-index: 1201;
  pointer-events: none;
}

.a2hs-hintbar[aria-hidden="true"] {
  display: none !important;
}

.a2hs-hintbar-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  background: rgba(16, 16, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-md);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

body.theme-light .a2hs-hintbar-inner {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.10);
  color: #111827;
}

.a2hs-hintbar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-dim);
}

.a2hs-reduced-motion *,
.a2hs-reduced-motion {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 420px) {
  .a2hs-actions {
    grid-template-columns: 1fr;
  }
}

/* View Container */
.view-container {
  width: 100%;
  height: 100%;
  padding: 24px;
  display: block;
}

@media (max-width: 768px) {
  .view-container {
    padding: 16px;
  }
}

/* Journal (Log) page */
.log-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.log-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

/* ── Week strip ── */
.log-week-strip-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-week-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-week-days {
  display: flex;
  gap: 4px;
  flex: 1;
}

.log-week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  min-width: 0;
}

.log-week-day:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.log-week-day:disabled {
  opacity: 0.25;
  cursor: default;
}

.log-week-day.is-today {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.log-week-day.is-selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.log-week-day.is-selected .log-week-day-dot {
  background: rgba(255, 255, 255, 0.9);
}

.log-week-day-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.log-week-day-num {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}

.log-week-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease;
}

.log-week-day.has-workout .log-week-day-dot {
  background: currentColor;
  opacity: 0.8;
}

.log-week-day.is-selected .log-week-day-dot {
  opacity: 1;
}

.log-week-nav {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.log-week-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.log-week-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.log-week-month-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.log-week-month-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.log-week-month-btn.is-open {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  color: #fff;
}

.log-calendar-card--inline {
  border-radius: 16px;
}

.log-calendar-shell {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  position: relative;
}

.log-calendar-shell.is-open {
  width: min(100%, 380px);
}

.log-calendar-trigger {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top left, var(--accent-dim), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.log-calendar-trigger:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.log-calendar-trigger.is-open {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.log-calendar-trigger-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.log-calendar-card {
  width: min(100%, 380px);
  background:
    radial-gradient(circle at top left, var(--accent-dim), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-top: 12px;
}

.log-calendar-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.log-calendar-heading {
  text-align: center;
}

.log-calendar-month {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: capitalize;
}

.log-calendar-selected {
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.log-calendar-nav {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.log-calendar-nav:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.log-calendar-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.log-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.log-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.log-calendar-day {
  aspect-ratio: 1 / 1;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.log-calendar-day:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.log-calendar-day.is-outside {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
}

.log-calendar-day.is-today {
  border-color: rgba(255, 255, 255, 0.18);
}

.log-calendar-day.is-selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.log-calendar-day:disabled {
  opacity: 0.22;
  cursor: default;
}

.log-calendar-day-num {
  font-size: 0.92rem;
  font-weight: 700;
}

.log-calendar-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.log-calendar-day.has-workout .log-calendar-day-dot {
  background: currentColor;
  opacity: 0.9;
}

.log-calendar-day.is-selected .log-calendar-day-dot {
  background: rgba(255, 255, 255, 0.95);
}

.log-calendar-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.log-calendar-today {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.log-calendar-today:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.log-calendar-today.is-current {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}
.log-section {
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .log-calendar-card {
    width: 100%;
  }
}
.log-calorie-hero {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.log-calorie-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}
.log-calorie-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.log-calorie-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.log-calorie-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-dark);
  overflow: hidden;
  margin-bottom: 10px;
}
.log-calorie-bar {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.log-macros-row {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.log-search-wrap {
  margin-bottom: 8px;
}
.log-search {
  border-radius: var(--radius-md);
}
.log-search-results {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 6px;
}
.log-search-results:empty {
  display: none;
}
.log-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
}
.log-manual-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.log-manual-section .input-control {
  margin-bottom: 8px;
}
.log-manual-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.log-manual-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.log-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  padding: 12px 0;
}
.log-food-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.log-food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.log-food-item:last-child {
  border-bottom: none;
}
.log-food-info {
  min-width: 0;
}
.log-food-name {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary);
}
.log-food-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.log-food-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.log-food-remove:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.log-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}
.log-habits {
  margin-bottom: 24px;
}
.log-habits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (min-width: 500px) {
  .log-habits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.log-habit {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.log-habit-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.log-habit-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.log-habit-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.log-habit-btn:hover {
  background: var(--bg-surface-hover);
}
.log-habit-value {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: center;
}
.log-habit-bar-wrap {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-dark);
  overflow: hidden;
}
.log-habit-bar {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.log-habit-input {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px;
}
.log-habit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
}
.log-habit-toggle .log-habit-label {
  margin-bottom: 0;
}
.log-toggle {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg-surface-hover);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.log-toggle.on {
  background: var(--accent);
}
.log-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.log-toggle.on .log-toggle-thumb {
  transform: translateX(20px);
}

.log-supp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.log-supp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.log-supp-item:hover {
  background: var(--bg-surface-hover);
}
.log-supp-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
}
.log-supp-dose {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.log-supp-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.log-supp-check.on {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.log-search-supp {
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.log-subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.log-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.log-tab {
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.log-tab.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)),
    rgba(96, 165, 250, 0.14);
}

.log-tab-panel {
  min-height: 220px;
}

.log-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.log-section-btn {
  white-space: nowrap;
}

.workout-active-hero {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 42%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.16), transparent 40%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.92)),
    var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

.workout-active-kicker,
.workout-template-kicker,
.workout-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.workout-active-title,
.workout-modal-head h3 {
  margin: 6px 0 8px;
  font-size: 1.55rem;
  color: var(--text-primary);
}

.workout-modal-head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.workout-active-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.workout-active-stat {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.workout-active-stat-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.workout-active-stat strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.workout-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workout-active-top {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 12px;
}

.workout-active-copy {
  max-width: 560px;
}

.workout-active-caption {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.workout-active-timer {
  min-width: 132px;
  text-align: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  align-self: flex-start;
}

.workout-active-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.workout-active-actions {
  margin-top: 18px;
}

.workout-exercise-card,
.workout-template-card,
.workout-history-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 18px;
}

.workout-exercise-card {
  margin-bottom: 16px;
}

.workout-exercise-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.workout-exercise-copy {
  flex: 1;
}

.workout-exercise-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.workout-exercise-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.workout-exercise-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.workout-exercise-summary span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.workout-set-table {
  display: grid;
  gap: 10px;
}

.workout-set-row {
  display: grid;
  grid-template-columns: minmax(42px, 56px) minmax(0, 1fr) minmax(0, 1fr) 54px 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.36);
}

.workout-set-head {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  padding: 0 4px;
}

.workout-set-num {
  font-weight: 700;
  color: var(--text-primary);
}

.workout-set-input {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
}

.workout-set-check,
.workout-set-remove {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  cursor: pointer;
}

.workout-set-check.done {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.55);
  color: #86efac;
}

.workout-exercise-actions {
  margin-top: 14px;
}

.workout-inline-empty {
  margin-top: 14px;
}

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

.workout-template-head,
.workout-history-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.workout-template-title,
.workout-history-title {
  margin: 6px 0 4px;
  font-size: 1.08rem;
  color: var(--text-primary);
}

.workout-template-meta,
.workout-history-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.workout-template-exercises,
.workout-history-exercises {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.workout-template-chip,
.workout-history-chip {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.65);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.workout-template-btn {
  width: 100%;
}

.workout-template-card-suggested {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 16px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(7, 10, 16, 0.96) 0%, rgba(11, 17, 27, 0.9) 54%, rgba(7, 10, 16, 0.28) 100%),
    var(--bg-surface-elevated);
}

.workout-template-card-suggested::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 16, 0.02) 0%, rgba(7, 10, 16, 0.16) 48%, rgba(7, 10, 16, 0.72) 74%, rgba(7, 10, 16, 0.9) 100%);
  pointer-events: none;
}

.workout-template-suggested-copy,
.workout-template-suggested-media {
  position: relative;
  z-index: 1;
}

.workout-template-suggested-copy {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.workout-template-suggested-day-title {
  margin-bottom: 0;
}

.workout-template-suggested-day-meta {
  margin-top: -2px;
}

.workout-template-day-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workout-template-day-tab {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.workout-template-day-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.26);
  color: var(--text-primary);
}

.workout-template-day-tab.active {
  border-color: rgba(148, 163, 184, 0.36);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.08));
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.workout-split-recommendation {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(74, 222, 128, 0.22);
  background:
    radial-gradient(circle at top right, rgba(74, 222, 128, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(8, 13, 21, 0.02)),
    var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workout-split-recommendation-rest {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(148, 163, 184, 0.06), rgba(8, 13, 21, 0.02)),
    var(--bg-surface);
}

.workout-split-recommendation-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.workout-split-recommendation-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.workout-split-recommendation-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.88rem;
}

.workout-split-recommendation-actions {
  flex: 0 0 auto;
}

.workout-template-suggested-media {
  align-self: stretch;
  min-height: 168px;
  margin: -18px -18px -18px 0;
  border-radius: 18px 22px 22px 18px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.88));
}

.workout-template-suggested-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 16, 0.88) 0%, rgba(7, 10, 16, 0.66) 32%, rgba(7, 10, 16, 0.18) 68%, rgba(7, 10, 16, 0) 100%),
    linear-gradient(0deg, rgba(7, 10, 16, 0.72) 0%, rgba(7, 10, 16, 0.26) 34%, rgba(7, 10, 16, 0.04) 62%, rgba(7, 10, 16, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

.workout-template-suggested-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.workout-template-suggested-overlay {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  gap: 6px;
  width: min(72%, 230px);
  padding: 4px 0;
}

.workout-template-suggested-overlay-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
}

.workout-template-suggested-overlay-time {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.82);
}

.workout-template-suggested-overlay-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workout-template-suggested-overlay-stats span {
  padding: 4px 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.76);
}

.workout-template-empty {
  grid-column: 1 / -1;
}

.workout-history-list {
  display: grid;
  gap: 12px;
}

.workout-history-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workout-history-kpis span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.workout-history-actions {
  margin-top: 4px;
}

.workout-history-card.legacy {
  padding: 18px;
}

.workout-history-copy {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.food-search-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.food-search-main {
  min-width: 0;
}

.food-search-name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.food-search-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.food-search-kpis {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.workout-day-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.workout-day-summary strong {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.workout-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.workout-modal-card {
  width: min(100%, 760px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.workout-picker-card {
  width: min(100%, 560px);
}

.workout-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.workout-modal-body {
  display: grid;
  gap: 14px;
}

.workout-modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
}

.workout-modal-stats span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.workout-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

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

.workout-picker-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.workout-picker-item[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.workout-picker-name {
  font-weight: 600;
}

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

.workout-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
}

.workout-builder-title {
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.workout-builder-selected {
  display: grid;
  gap: 10px;
}

.workout-builder-selected-row {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.workout-builder-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.workout-builder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.workout-builder-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .log-tabs {
    gap: 8px;
  }

  .workout-active-hero {
    padding: 20px;
  }

  .workout-set-row {
    grid-template-columns: 42px 1fr 1fr 44px 30px;
  }

  .workout-active-top {
    flex-direction: column;
  }

  .workout-active-timer {
    min-width: 0;
    width: 100%;
  }

  .workout-builder-layout {
    grid-template-columns: 1fr;
  }

  .workout-builder-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .log-tabs {
    grid-template-columns: 1fr;
  }

  .workout-active-stats {
    grid-template-columns: 1fr;
  }

  .workout-set-row,
  .workout-set-head {
    grid-template-columns: 38px 1fr 1fr 40px 28px;
    gap: 6px;
  }

  .workout-set-check,
  .workout-set-remove {
    width: 28px;
    height: 28px;
  }

  .workout-modal-card {
    padding: 16px;
  }

  .workout-template-card-suggested {
    grid-template-columns: 1fr;
  }

  .workout-template-card-suggested::after {
    background:
      linear-gradient(180deg, rgba(7, 10, 16, 0.04) 0%, rgba(7, 10, 16, 0.18) 58%, rgba(7, 10, 16, 0.78) 100%);
  }

  .workout-template-suggested-media {
    order: -1;
    min-height: 140px;
    margin: -18px -18px 0;
    border-radius: 22px 22px 16px 16px;
  }

  .workout-template-suggested-overlay {
    left: 12px;
    bottom: 12px;
    width: min(78%, 220px);
  }

  .workout-template-suggested-overlay-time {
    font-size: 1.2rem;
  }

  .workout-template-suggested-overlay-stats span {
    font-size: 0.68rem;
  }

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

  .workout-split-recommendation {
    flex-direction: column;
    align-items: flex-start;
  }

  .workout-modal-actions,
  .workout-active-actions {
    flex-direction: column;
  }

  .workout-modal-actions .btn,
  .workout-active-actions .btn {
    width: 100%;
  }
}

/* Settings / profile layout */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: flex-start;
}

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

.settings-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0%, var(--bg-surface-elevated), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050509;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.settings-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.settings-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(19, 20, 35, 0.95);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Settings section titles with SF-like icons */
.settings-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-section-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.settings-section-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Onboarding Specific Styles */
.onboarding-progress {
  width: 100%;
  height: 4px;
  background-color: var(--bg-surface-elevated);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.onboarding-step {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
  /* minus nav spacing */
}

@media (max-width: 768px) {
  .onboarding-step {
    padding-top: 20px;
    min-height: 100vh;
  }
}

.onboarding-step h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.toggle-group {
  display: flex;
  gap: 12px;
}

.toggle-group.row {
  flex-direction: row;
}

.toggle-group.col {
  flex-direction: column;
}

.toggle-group .btn {
  flex: 1;
  border: 1px solid var(--border);
  background-color: var(--bg-surface-elevated);
  transition: all 0.2s ease;
  justify-content: flex-start;
  text-align: left;
}

.toggle-group.row .btn {
  justify-content: center;
  text-align: center;
}

.toggle-group .btn.active {
  background-color: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 40px;
  gap: 16px;
}

.nav-buttons .btn {
  flex: 1;
}

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

/* Range Slider Styling */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface-elevated);
  outline: none;
  margin: 16px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.onboarding-page {
  position: relative;
}

.onboarding-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding-bottom: 116px;
}

.onboarding-shell-finishing {
  min-height: calc(100vh - 96px);
  place-items: center;
}

.onboarding-progress-card,
.onboarding-question-card {
  width: min(100%, 680px);
  margin: 0 auto;
}

.onboarding-question-card-wide {
  width: min(100%, 980px);
}

.onboarding-progress-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.16), transparent 40%),
    radial-gradient(circle at bottom right, rgba(11, 95, 255, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.onboarding-progress-card::after {
  content: '';
  position: absolute;
  inset: auto -80px -110px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.14), transparent 72%);
  pointer-events: none;
}

.onboarding-progress-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.onboarding-progress-copy {
  min-width: 0;
  max-width: 40rem;
}

.onboarding-progress-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.onboarding-progress-meta {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 68px;
  text-align: right;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.onboarding-question-title {
  margin-top: 6px;
  font-size: clamp(1.95rem, 5vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.onboarding-question-hint {
  margin-top: 8px;
  max-width: 36ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.onboarding-progress-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 8px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.onboarding-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill);
  transition: width 0.35s ease;
}

.onboarding-question-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.onboarding-question-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.onboarding-question-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.onboarding-question-body-food {
  gap: 14px;
}

.onboarding-question-group {
  margin-bottom: 0;
}

.onboarding-question-input,
.onboarding-question-select {
  min-height: 56px;
  font-size: 1.04rem;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.onboarding-question-input:focus,
.onboarding-question-select:focus {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.onboarding-question-toggle,
.onboarding-peds-toggle {
  width: 100%;
}

.onboarding-question-card .settings-icon-btn,
.onboarding-question-card .settings-choice,
.onboarding-question-card .settings-bodyfat-btn {
  background: rgba(255, 255, 255, 0.04);
}

.onboarding-question-card .settings-icon-btn.active,
.onboarding-question-card .settings-choice.active,
.onboarding-question-card .settings-bodyfat-btn.active,
.onboarding-question-card .settings-segment-btn.btn.active {
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 14px 28px rgba(10, 56, 30, 0.14);
}

.onboarding-question-card .settings-icon-btn.active .settings-icon,
.onboarding-question-card .settings-choice.active .settings-choice-figure,
.onboarding-question-card .settings-bodyfat-btn.active .settings-bodyfat-figure {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.22), rgba(21, 128, 61, 0.12));
  color: #dcfce7;
}

.onboarding-question-select:not(.is-selected) {
  color: var(--text-secondary);
}

.onboarding-question-select.is-selected {
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.onboarding-question-select.is-selected:focus {
  border-color: rgba(74, 222, 128, 0.62);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

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

.onboarding-split-preset {
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  display: grid;
  gap: 6px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.onboarding-split-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28);
}

.onboarding-split-preset.active {
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.onboarding-split-preset-name {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.onboarding-split-preset-copy {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.onboarding-split-overview {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.onboarding-split-overview-copy {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

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

.onboarding-split-day-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 14px;
}

.onboarding-split-day-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.onboarding-split-day-name {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.onboarding-split-day-summary {
  margin-top: 4px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.onboarding-split-day-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.onboarding-split-day-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-split-option {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.46);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.onboarding-split-option:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-primary);
}

.onboarding-split-option.active {
  border-color: rgba(74, 222, 128, 0.46);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(21, 128, 61, 0.08));
  color: #dcfce7;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.settings-split-presets {
  margin-bottom: 12px;
}

.settings-split-overview {
  margin-top: 12px;
}

.settings-weekly-split {
  margin-top: 12px;
}

.onboarding-food-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.onboarding-food-toolbar-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.onboarding-food-toolbar-subtitle {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.onboarding-food-actions,
.onboarding-food-group-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.onboarding-food-action-btn,
.onboarding-food-mini-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.onboarding-food-groups {
  display: grid;
  gap: 12px;
}

.onboarding-food-group {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.onboarding-food-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.onboarding-food-group-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.onboarding-food-group-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.onboarding-food-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-food-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.onboarding-food-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-primary);
}

.onboarding-food-chip.active {
  color: var(--text-primary);
  border-color: rgba(74, 222, 128, 0.52);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(21, 128, 61, 0.08));
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.onboarding-food-chip-check {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 2px rgba(5, 5, 9, 0.9);
}

.onboarding-food-chip.active .onboarding-food-chip-check {
  background: #22c55e;
  border-color: rgba(74, 222, 128, 0.56);
}

.onboarding-ped-warning {
  display: none;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 59, 48, 0.32);
  background: rgba(255, 59, 48, 0.08);
}

.onboarding-ped-warning.visible {
  display: block;
}

.onboarding-ped-warning-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffd3cf;
}

.onboarding-ped-warning-copy {
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.onboarding-nav-sticky {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  width: min(760px, calc(100vw - 28px));
  z-index: 850;
}

.onboarding-nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(16, 16, 24, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.onboarding-nav-btn {
  min-height: 52px;
  flex: 1;
}

.onboarding-nav-btn-primary {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.onboarding-nav-spacer {
  flex: 1;
}

.onboarding-tailoring-card {
  width: min(100%, 560px);
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(148, 163, 184, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.onboarding-tailoring-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.onboarding-tailoring-title {
  margin-top: 10px;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.onboarding-tailoring-text {
  margin-top: 12px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.onboarding-tailoring-loader {
  width: 56px;
  height: 56px;
  margin: 22px auto 0;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.16);
  border-top-color: var(--accent);
  animation: onboarding-loader-spin 0.9s linear infinite;
}

.onboarding-tailoring-points {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.onboarding-tailoring-point {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@keyframes onboarding-loader-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .settings-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .onboarding-progress-card,
  .onboarding-question-card,
  .onboarding-tailoring-card {
    padding: 18px;
  }

  .onboarding-progress-head {
    flex-direction: column;
  }

  .onboarding-nav-inner {
    padding: 10px;
    border-radius: 24px;
  }

  .onboarding-nav-btn {
    min-height: 48px;
  }

  .onboarding-food-group-head {
    flex-direction: column;
  }

  .onboarding-question-group .metric-slider-card {
    padding: 14px;
  }

  .onboarding-split-presets,
  .onboarding-weekly-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .onboarding-shell {
    padding-bottom: 126px;
  }

  .onboarding-question-title {
    font-size: 1.95rem;
  }

  .onboarding-food-actions,
  .onboarding-food-group-actions {
    width: 100%;
  }

  .onboarding-food-action-btn,
  .onboarding-food-mini-btn {
    flex: 1;
  }

  .onboarding-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .onboarding-nav-spacer {
    display: none;
  }

  .onboarding-nav-btn {
    width: 100%;
  }

  .onboarding-tailoring-card {
    padding: 22px 18px;
  }
}

/* Supplements page: category filter chips */
.supplement-chip {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.supplement-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.supplement-chip-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* Supplements page: dosing mode pill switch */
.dose-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.dose-mode-toggle::before {
  content: '';
  position: absolute;
  inset: 4px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transform: translateX(0);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.dose-mode-toggle[data-mode="max"]::before {
  transform: translateX(calc(100% + 4px));
}

/* Burst when enabling LIMIT */
.dose-mode-toggle-burst::after {
  content: '';
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.35), transparent 45%),
    radial-gradient(circle at 65% 60%, rgba(255, 255, 255, 0.22), transparent 50%),
    conic-gradient(from 180deg, transparent 0 70%, rgba(255, 255, 255, 0.22) 72% 78%, transparent 80% 100%);
  opacity: 0;
  transform: scale(0.9);
  animation: doseBurst 520ms cubic-bezier(0.16, 1, 0.3, 1) 1;
  pointer-events: none;
  z-index: 0;
}

.dose-mode-option {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  position: relative;
  z-index: 1;
}

.dose-mode-option-active {
  background: transparent;
  color: #0b1220;
  transform: translateY(-1px);
}

.dose-mode-option:not(.dose-mode-option-active):hover {
  color: var(--text-primary);
}

body.theme-dark .dose-mode-option-active {
  color: #07090f;
}

@keyframes doseBurst {
  0% { opacity: 0; transform: scale(0.88); filter: blur(0px); }
  30% { opacity: 0.9; transform: scale(1); filter: blur(0px); }
  100% { opacity: 0; transform: scale(1.08); filter: blur(0.6px); }
}

/* Supplements page: max-dose alert theme */
.view-container.supplements-max-mode {
  /* locally override accent colors to red only inside supplements view */
  --accent: var(--danger);
  --accent-hover: #b91c1c;
  --accent-dim: var(--danger-dim);
}

/* Supplements: new layout */
.supp-hero {
  margin: -4px 0 14px;
  padding: 12px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.12), transparent 34%),
    radial-gradient(circle at left top, rgba(59, 130, 246, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-sm);
}

.supp-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.supp-hero-copy {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.supp-hero-title {
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.supp-hero-subtitle {
  max-width: 48ch;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.supp-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supp-hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.26);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.supp-hero-chip-emphasis {
  background: var(--accent-dim);
  border-color: transparent;
  color: var(--accent);
}

.supp-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.95fr);
  align-items: center;
  gap: 10px;
}

.supp-search-panel,
.supp-mode-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--bg-surface-elevated);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.supp-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.supp-control-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.supp-control-meta {
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.supp-control-meta-query {
  color: var(--text-primary);
  font-weight: 700;
}

.supp-control-meta-separator {
  margin: 0 4px;
}

.supp-search-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 6px 0 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.supp-search-shell:focus-within {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.supp-search-icon {
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
}

.supp-search {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.supp-search:focus {
  box-shadow: none;
}

.supp-search::placeholder {
  color: var(--text-muted);
}

.supp-search-clear {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.supp-search-clear:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
}

.supp-search-clear[hidden] {
  display: none;
}

.supp-mode-stack {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.supp-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.supp-warning-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.supp-warning-copy {
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

body.theme-light .supp-hero-chip {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-light .supp-search-shell {
  background: rgba(255, 255, 255, 0.84);
}

body.theme-light .supp-warning {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.64);
}

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

@media (max-width: 640px) {
  .supp-hero {
    padding: 10px;
  }

  .supp-search-panel,
  .supp-mode-panel {
    padding: 8px;
    border-radius: 16px;
  }

  .dose-mode-toggle {
    width: 100%;
  }

  .dose-mode-option {
    flex: 1 1 0;
  }

  .supp-search-shell {
    min-height: 44px;
    padding-left: 8px;
  }

  .supp-mode-stack {
    grid-template-columns: 1fr;
  }

  .supp-warning {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .supp-control-head {
    align-items: flex-start;
  }
}

.supp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 12px;
}

.supp-section-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.supp-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.supp-mini {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.supp-mini:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.35);
}

.supp-mini-rank {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.supp-mini-name {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.supp-mini-dose {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
}

.supp-list {
  display: grid;
  gap: 14px;
}

.supp-card {
  padding: 16px;
  position: relative;
}

.supp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.supp-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.supp-evidence-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(148, 163, 184, 0.35);
  box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.08);
  cursor: pointer;
  flex: 0 0 auto;
  margin-top: 0;
  opacity: 0.85;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.supp-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.supp-info-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.35);
}

.supp-info-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 8px rgba(148, 163, 184, 0.14);
}
.supp-evidence-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 10px rgba(148, 163, 184, 0.14);
}

.supp-evidence-dot:hover {
  transform: scale(1.05);
  opacity: 1;
  box-shadow: 0 0 0 8px rgba(148, 163, 184, 0.12);
}

/* Evidence colors (subtle) */
.supp-evidence-dot[data-evidence-level="Strong"] {
  background: rgba(34, 197, 94, 0.55);
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.supp-evidence-dot[data-evidence-level="Moderate"] {
  background: rgba(245, 158, 11, 0.55);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.12);
}

.supp-evidence-dot[data-evidence-level="Weak"] {
  background: rgba(239, 68, 68, 0.55);
  border-color: rgba(239, 68, 68, 0.72);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
}

.supp-waste {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 0.85rem;
}

body.theme-light .supp-evidence-dot {
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 0 0 6px rgba(15, 23, 42, 0.06);
}

.supp-card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.supp-rank {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--accent);
}

.supp-name {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.supp-name-en {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.supp-badge {
  display: none;
}

.supp-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

@media (min-width: 900px) {
  .supp-meta {
    grid-template-columns: 1fr 1fr;
  }
}

.supp-meta-k {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.supp-meta-v {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.supp-details,
.supp-purpose {
  display: none;
}

/* ═══════════════════════════════════════════
   PRs View
   ═══════════════════════════════════════════ */

:root {
  --pr-bench:    #f59e0b;
  --pr-squat:    #10b981;
  --pr-deadlift: #ef4444;

  /* Tier color palette */
  --tier-iron:     #94a3b8;
  --tier-bronze:   #b87333;
  --tier-silver:   #c0c0c0;
  --tier-gold:     #f59e0b;
  --tier-platinum: #4dd0e1;
  --tier-diamond:  #818cf8;
  --tier-elite:    #d946ef;
  --tier-titan:    #ef4444;
}

.pr-comp-shell {
  display: grid;
  gap: 10px;
  margin: -2px 0 18px;
}

.prs-page-loading {
  min-height: min(62vh, 520px);
  display: grid;
  place-items: center;
}

.prs-page-loading-card {
  width: min(100%, 420px);
  padding: 24px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(9, 10, 18, 0.96), rgba(18, 24, 38, 0.98));
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.prs-page-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #f8d27a;
  animation: prs-page-loader-spin 0.9s linear infinite;
}

.prs-page-loading-title {
  margin: 0;
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.prs-page-loading-copy {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

@keyframes prs-page-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.pr-comp-hero {
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 38%),
    linear-gradient(145deg, rgba(9, 10, 18, 0.96), rgba(18, 24, 38, 0.98));
  box-shadow: var(--shadow-lg);
}

.pr-comp-hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -28% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.16), transparent 64%);
  pointer-events: none;
}

.pr-comp-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 9px;
}

.pr-comp-title-block {
  flex: 1;
  min-width: 0;
}

.pr-comp-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f8d27a;
  margin-bottom: 4px;
}

.pr-comp-title {
  font-size: clamp(1.26rem, 2.8vw, 1.72rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0;
}

.pr-comp-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.pr-comp-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pr-comp-status.live {
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.18);
}

.pr-comp-status.soft {
  color: #e5e7eb;
  background: rgba(148, 163, 184, 0.16);
}

.pr-comp-division {
  min-width: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pr-comp-score-pill {
  min-width: 84px;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  text-align: right;
}

.pr-comp-score-pill strong {
  display: block;
  font-size: 1.32rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.pr-comp-score-label {
  display: block;
  margin-bottom: 3px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.pr-comp-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.9fr);
  gap: 10px;
  align-items: stretch;
}

.pr-comp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pr-comp-stat {
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.pr-comp-stat.accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.08));
}

.pr-comp-stat-label {
  display: block;
  margin-bottom: 0;
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.15;
}

.pr-comp-stat strong {
  display: block;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.pr-comp-rival {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pr-comp-rival.empty {
  justify-content: flex-start;
}

.pr-comp-rival-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2px;
  line-height: 1.1;
}

.pr-comp-rival-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.22;
}

.pr-comp-rival-points {
  font-size: 0.9rem;
  font-weight: 900;
  color: #f8d27a;
  white-space: nowrap;
}

.pr-comp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  width: fit-content;
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
}

.pr-comp-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.pr-comp-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.pr-comp-panel {
  display: grid;
  gap: 12px;
}

.pr-comp-loading,
.pr-comp-banner,
.pr-comp-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.pr-comp-loading {
  color: var(--text-secondary);
}

.pr-comp-banner.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.32);
  border-color: rgba(239, 68, 68, 0.28);
}

.pr-comp-banner.muted {
  color: var(--text-secondary);
}

.pr-comp-card-title {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.pr-comp-copy {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.pr-comp-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pr-comp-form-help {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pr-comp-inline-btn {
  margin-top: 12px;
  width: fit-content;
}

.pr-comp-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
}

.pr-comp-stack {
  display: grid;
  gap: 12px;
}

.pr-comp-summary-grid,
.pr-comp-forms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pr-comp-summary {
  padding: 14px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pr-comp-summary span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pr-comp-summary strong {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.pr-comp-lift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pr-comp-lift-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.pr-comp-lift-card.ready {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.18);
}

.pr-comp-lift-card.local {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

.pr-comp-lift-card.missing {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.pr-comp-lift-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.pr-comp-lift-emoji {
  font-size: 1.4rem;
}

.pr-comp-lift-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pr-comp-lift-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pr-comp-lift-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pr-comp-note {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pr-comp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pr-comp-row-list {
  display: grid;
  gap: 8px;
}

.pr-comp-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pr-comp-row.self {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(255, 255, 255, 0.02));
}

.pr-comp-row-rank {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-primary);
}

.pr-comp-row-name {
  font-size: 0.94rem;
  font-weight: 800;
}

.pr-comp-row-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pr-comp-row-score {
  font-size: 1rem;
  font-weight: 900;
  color: #f8d27a;
}

.pr-comp-self-row,
.pr-comp-empty {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}

.pr-comp-self-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pr-comp-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin: 8px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.pr-comp-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.pr-comp-toggle-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.pr-comp-invite-card {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 32%),
    var(--bg-surface-elevated);
}

.pr-comp-invite-block {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.pr-comp-invite-label {
  margin-bottom: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pr-comp-invite-value {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.pr-comp-invite-link {
  word-break: break-all;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

@media (max-width: 860px) {
  .pr-comp-summary-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .pr-comp-hero {
    padding: 11px 12px;
  }

  .pr-comp-title {
    font-size: clamp(1.18rem, 6vw, 1.48rem);
  }

  .pr-comp-score-pill {
    padding: 7px 9px;
  }

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

  .pr-comp-summary-grid,
  .pr-comp-forms-grid {
    grid-template-columns: 1fr;
  }

  .pr-comp-tab {
    padding: 6px 9px;
  }

  .pr-comp-rival {
    padding: 8px 10px;
  }

  .pr-comp-rival-points {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .pr-comp-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Avatar Circle ── */
.pr-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* ── Hero rank block (right side of hero top) ── */
.pr-comp-hero-rank-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.pr-comp-hero-rank-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  line-height: 1;
}

.pr-comp-hero-rank-num {
  font-size: clamp(2.2rem, 7vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

/* ── Rival VS card ── */
.pr-rival-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 10px;
}

.pr-rival-vs-self {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pr-rival-vs-them {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
}

.pr-rival-vs-name {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-rival-vs-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  line-height: 1;
}

.pr-rival-vs-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.pr-rival-vs-sword {
  font-size: 1.25rem;
  line-height: 1;
}

.pr-rival-vs-gap {
  font-size: 0.68rem;
  font-weight: 900;
  color: #f8d27a;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Rank / lift sync progress bar ── */
.pr-rank-progress {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pr-rank-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.pr-rank-progress-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pr-rank-progress-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pr-rank-progress-bar-wrap {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.pr-rank-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: currentColor;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Squad CTA cards (no squad state) ── */
.pr-squad-cta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pr-squad-cta-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.pr-squad-cta-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.pr-squad-cta-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pr-squad-cta-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 4px;
}

.pr-squad-cta-form {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: auto;
}

@media (max-width: 560px) {
  .pr-squad-cta-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Scrollable leaderboard container ── */
.pr-comp-row-list-scroll {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  margin-top: 10px;
}

/* ── Tier dot (strength label indicator) ── */
.pr-card-tier-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Hero ── */
.pr-hero {
  margin: -6px 0 24px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: var(--hero-card-bg), var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pr-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pr-hero-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.pr-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pr-hero-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--pr-bench);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

/* ── Big 3 Total ── */
.pr-big3 {
  text-align: center;
  padding: 12px 0 4px;
}

.pr-big3-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pr-big3-value {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 12px;
}

.pr-big3-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 6px;
}

.pr-big3-lifts {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pr-big3-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── PR Cards Grid ── */
.pr-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 700px) {
  .pr-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pr-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pr-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pr-card-emoji {
  font-size: 1.6rem;
  flex: 0 0 auto;
}

.pr-card-info {
  flex: 1;
  min-width: 0;
}

.pr-card-name {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pr-card-name-en {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Sparkline */
.pr-sparkline {
  width: 80px;
  height: 32px;
  flex: 0 0 auto;
}

/* Value Row */
.pr-card-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pr-card-max {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pr-card-max-num {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.pr-card-max-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pr-card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Milestone Progress */
.pr-milestone {
  margin-bottom: 12px;
}

.pr-milestone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pr-milestone-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.pr-milestone-pct {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pr-milestone-bar-wrap {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.pr-milestone-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Actions */
.pr-card-actions {
  display: flex;
  gap: 8px;
}

.pr-log-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.pr-log-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pr-log-btn:active {
  transform: scale(0.97);
}

/* History Details */
.pr-history-details {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pr-history-details summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
}

.pr-history-details summary::-webkit-details-marker {
  display: none;
}

.pr-history-details[open] summary {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pr-history-list {
  display: grid;
  gap: 6px;
}

.pr-history-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.pr-history-row:last-child {
  border-bottom: none;
}

.pr-history-val {
  font-weight: 900;
  color: var(--text-primary);
}

.pr-history-meta {
  color: var(--text-secondary);
}

.pr-history-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Calculator Card ── */
.pr-calc-card {
  margin-bottom: 24px;
}

.pr-calc-head h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.pr-calc-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.pr-calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.pr-calc-field-full {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.calc-lift-toggle {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 4px;
}

.btn-lift-toggle {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-lift-toggle.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 480px) {
  .pr-calc-inputs {
    grid-template-columns: 1fr 1fr;
  }
  .pr-calc-field-btn {
    grid-column: span 2;
  }
}

.pr-calc-btn {
  padding: 12px 20px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Calculator Result */
.calc-result {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--hero-card-bg), var(--bg-surface);
  border: 1px solid var(--border);
  text-align: center;
  animation: pr-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pr-pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.calc-result-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.calc-result-value {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.calc-result-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 6px;
}

.calc-strength-rating {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.calc-strength-stars {
  display: flex;
  gap: 4px;
  font-size: 1.4rem;
}

.calc-star.filled {
  color: #fca5a5; /* Reddish for deadlift, gold for others? Standard gold below */
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.calc-star.empty {
  color: var(--border);
}

.calc-strength-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-strength-percentile {
  max-width: 32ch;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.calc-strength-meta {
  max-width: 34ch;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.pr-card-strength-note {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pr-card-strength-label {
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pr-card-strength-percentile {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Rep Table */
.pr-rep-table {
  margin-top: 20px;
}

.pr-rep-table-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.pr-rep-table-grid {
  display: grid;
  gap: 4px;
}

.pr-rep-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.pr-rep-row:first-child {
  background: var(--accent-dim);
}

.pr-rep-reps {
  font-weight: 800;
  color: var(--text-primary);
}

.pr-rep-pct {
  color: var(--text-secondary);
  text-align: center;
}

.pr-rep-weight {
  font-weight: 900;
  color: var(--text-primary);
  text-align: right;
}

/* ── PR Log Bottom Sheet ── */
.pr-log-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pr-log-sheet-backdrop[hidden] {
  display: none !important;
}

.pr-log-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pr-sheet-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pr-log-sheet[hidden] {
  display: none !important;
}

@keyframes pr-sheet-up {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

.pr-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 0;
}

.pr-sheet-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pr-sheet-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.pr-sheet-preview {
  margin-top: 8px;
}

.pr-sheet-est {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  animation: pr-pop 0.25s ease;
}

.pr-sheet-foot {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.pr-sheet-foot .btn {
  flex: 1;
}

/* Shared unlock capacity strip */
.unlock-capacity-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(52, 211, 153, 0.08)),
    rgba(15, 23, 42, 0.38);
}

.unlock-capacity-strip--compact {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 16px;
}

.unlock-capacity-strip--exhausted {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.42), rgba(71, 85, 105, 0.2)),
    rgba(15, 23, 42, 0.3);
}

.unlock-capacity-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.42);
  color: #eff6ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.unlock-capacity-pill--plan {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.42);
  color: #dbeafe;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.unlock-capacity-pill--remaining {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.3);
  color: #d1fae5;
}

.unlock-capacity-note {
  flex-basis: 100%;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 700;
}

.unlock-capacity-strip--exhausted .unlock-capacity-pill--remaining {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

body.theme-light .unlock-capacity-strip {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(209, 250, 229, 0.8)),
    rgba(255, 255, 255, 0.92);
}

body.theme-light .unlock-capacity-strip--exhausted {
  background:
    linear-gradient(135deg, rgba(226, 232, 240, 0.96), rgba(241, 245, 249, 0.88)),
    rgba(255, 255, 255, 0.94);
}

body.theme-light .unlock-capacity-pill {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
}

body.theme-light .unlock-capacity-pill--plan {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(96, 165, 250, 0.34);
  color: #1d4ed8;
}

body.theme-light .unlock-capacity-pill--remaining {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.24);
  color: #047857;
}

body.theme-light .unlock-capacity-note {
  color: #334155;
}

body.theme-light .unlock-capacity-strip--exhausted .unlock-capacity-pill--remaining {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
  color: #334155;
}

/* Bodybuilder routine library */
.learn-library {
  display: grid;
  gap: 22px;
}

.learn-library-hero {
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top left, var(--accent-dim), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow-md);
}

.learn-library-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.learn-library-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
  margin-bottom: 10px;
}

.learn-library-copy {
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

.learn-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.learn-library-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.learn-routine-stack {
  display: grid;
  gap: 18px;
}

.learn-routine-card {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(180px, 52%) minmax(0, 1fr);
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at right top, rgba(59, 130, 246, 0.18), transparent 36%),
    linear-gradient(135deg, #06070c 0%, #0d1018 58%, #111827 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  text-align: left;
  padding: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.learn-routine-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  border-color: rgba(255, 255, 255, 0.14);
}

.learn-routine-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2), 0 28px 70px rgba(0, 0, 0, 0.48);
}

.learn-routine-card-media {
  position: absolute;
  inset: 0 auto 0 0;
  width: 56%;
  overflow: hidden;
}

.learn-routine-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.learn-routine-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0) 8%, rgba(5, 7, 12, 0.14) 38%, rgba(5, 7, 12, 0.82) 62%, rgba(5, 7, 12, 0.98) 100%);
  pointer-events: none;
}

.learn-routine-state-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.68);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.learn-routine-state-pill--pro {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.42);
  color: #dbeafe;
}

.learn-routine-state-pill--pro-exhausted {
  background: rgba(51, 65, 85, 0.78);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

.learn-routine-card-copy {
  position: relative;
  z-index: 1;
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  padding: 28px 30px 28px 0;
}

.learn-routine-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learn-routine-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.78rem;
  font-weight: 700;
}

.learn-routine-chip.muted {
  color: rgba(255, 255, 255, 0.72);
}

.learn-routine-name {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.learn-routine-desc {
  display: block;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.76);
}

.learn-routine-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #60a5fa);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(96, 165, 250, 0.32);
}

/* ── Locked card state ── */
.learn-routine-card--locked {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.04);
}

/* Pre-selection browse lock — softer, still shows lock but card is fully clickable */
.learn-routine-card--browse-locked {
  cursor: pointer;
  border-color: rgba(255, 255, 255, 0.06);
}

.learn-routine-card--browse-locked .learn-routine-card-overlay {
  background: linear-gradient(90deg, rgba(5, 7, 12, 0) 8%, rgba(5, 7, 12, 0.18) 38%, rgba(5, 7, 12, 0.85) 62%, rgba(5, 7, 12, 0.97) 100%);
}

/* Selected card glow border */
.learn-routine-card--selected {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.learn-routine-card--selected:hover {
  border-color: rgba(96, 165, 250, 0.65);
}

.learn-routine-card--pro-unlockable {
  border-color: rgba(52, 211, 153, 0.22);
  background:
    radial-gradient(circle at right top, rgba(52, 211, 153, 0.18), transparent 36%),
    radial-gradient(circle at left center, rgba(59, 130, 246, 0.18), transparent 44%),
    linear-gradient(135deg, #06070c 0%, #0d1018 58%, #111827 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(52, 211, 153, 0.08);
}

.learn-routine-card--pro-unlockable:hover {
  border-color: rgba(52, 211, 153, 0.34);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(52, 211, 153, 0.14);
}

.learn-routine-card--pro-exhausted {
  border-color: rgba(96, 165, 250, 0.18);
  background:
    radial-gradient(circle at right top, rgba(96, 165, 250, 0.12), transparent 36%),
    linear-gradient(135deg, #06070c 0%, #0d1018 58%, #111827 100%);
}

.learn-routine-card--pro-exhausted:hover {
  border-color: rgba(96, 165, 250, 0.26);
}

.learn-routine-card--pro-exhausted .learn-routine-card-media {
  filter: saturate(0.88) brightness(0.78);
}

.learn-routine-card--pro-exhausted .learn-routine-card-overlay {
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0.08) 8%, rgba(5, 7, 12, 0.22) 36%, rgba(5, 7, 12, 0.84) 62%, rgba(5, 7, 12, 0.98) 100%);
}


.learn-routine-card--locked:hover {
  transform: none;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.04);
}

/* Darken and blur the content reasonably while keeping names clear (no filter on copy) */
.learn-routine-card--locked .learn-routine-card-media,
.learn-routine-card--browse-locked .learn-routine-card-media,
.learn-routine-card--locked .workout-template-suggested-media,
.learn-routine-card--browse-locked .workout-template-suggested-media {
  filter: blur(2.2px) brightness(0.8);
  pointer-events: none;
  user-select: none;
}

.learn-routine-card--locked .learn-routine-card-copy,
.learn-routine-card--browse-locked .learn-routine-card-copy,
.learn-routine-card--locked .workout-template-suggested-copy,
.learn-routine-card--browse-locked .workout-template-suggested-copy {
  filter: none;
  pointer-events: none;
  user-select: none;
}

.learn-routine-card--locked, .learn-routine-card--browse-locked {
  overflow: hidden; /* Ensure blur doesn't bleed out */
}

/* Lock badge centred on the card */
.learn-routine-lock-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6));
}

/* Unlocked badge — selected card gets a small checkmark in the top-right */
.learn-routine-lock-badge--unlocked {
  align-items: flex-start;
  justify-content: flex-end;
  font-size: 1.6rem;
  padding: 16px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Locked chip variant (post-selection) */
.learn-routine-chip--locked {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
}

/* Free CTA pill — browse mode */
.learn-routine-cta--free {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(59, 130, 246, 0.15));
  color: #93c5fd;
  box-shadow: none;
  border: 1px solid rgba(96, 165, 250, 0.3);
}


/* Locked CTA pill */
.learn-routine-cta--locked {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

/* Selected chip variant */
.learn-routine-chip--selected {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(59, 130, 246, 0.18));
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

.learn-routine-status-copy {
  display: block;
  max-width: 34ch;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.74);
}

/* Change-selection link in hero meta */
.learn-library-change-wrap {
  display: inline-flex;
  align-items: center;
}

.learn-library-change-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.learn-library-change-btn:hover {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.55);
}

/* ── Confirmation Banner ── */
.learn-confirm-banner {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background:
    radial-gradient(circle at left, rgba(59, 130, 246, 0.16), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.18);
  animation: confirm-banner-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes confirm-banner-in {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.learn-confirm-banner-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.learn-confirm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.learn-confirm-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 4px;
}

.learn-confirm-name {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 6px;
}

.learn-confirm-sub {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  max-width: 50ch;
}

.learn-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.learn-confirm-btn-confirm {
  min-width: 160px;
}

.bodybuilder-modal-backdrop {
  z-index: 1200;
  background: rgba(3, 6, 12, 0.8);
}

.bodybuilder-modal-card {
  width: min(100%, 1040px);
  padding: 24px;
  background:
    radial-gradient(circle at top left, var(--accent-dim), transparent 34%),
    var(--bg-surface);
  border-radius: 28px;
}

.bodybuilder-modal-hero {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 18px;
}

.bodybuilder-modal-media {
  overflow: hidden;
  border-radius: 24px;
  min-height: 250px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.8));
}

.bodybuilder-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bodybuilder-modal-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.bodybuilder-modal-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bodybuilder-modal-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.bodybuilder-modal-headline h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.95;
  margin-bottom: 10px;
}

.bodybuilder-modal-headline p {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 54ch;
}

.bodybuilder-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.bodybuilder-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bodybuilder-modal-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.bodybuilder-day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-radius: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
}

.bodybuilder-day-tab {
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.18s ease;
}

.bodybuilder-day-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.bodybuilder-day-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: var(--shadow-glow);
}

.bodybuilder-day-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.bodybuilder-day-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.bodybuilder-day-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.bodybuilder-day-summary {
  max-width: 68ch;
  color: var(--text-secondary);
  line-height: 1.75;
}

.bodybuilder-day-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.bodybuilder-day-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(11, 95, 255, 0.1), rgba(15, 23, 42, 0.02));
  color: var(--text-secondary);
  line-height: 1.7;
}

.bodybuilder-exercise-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bodybuilder-exercise-item {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.bodybuilder-exercise-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.bodybuilder-exercise-main h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.bodybuilder-exercise-prescription {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
}

.bodybuilder-exercise-prescription span {
  color: var(--text-muted);
}

.bodybuilder-exercise-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.bodybuilder-sources {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.bodybuilder-sources-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bodybuilder-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bodybuilder-source-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
}

.bodybuilder-source-chip:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.dash-library-card {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.16), transparent 48%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.92));
  border-color: rgba(255, 255, 255, 0.08);
}

.dash-library-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.dash-library-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
  margin-bottom: 6px;
}

.dash-library-title {
  color: #fff;
}

.dash-library-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.dash-library-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dash-library-avatars {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dash-library-avatar {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28);
}

.dash-library-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.dash-library-stats span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 700;
}

.dash-library-copy {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 14px;
  line-height: 1.7;
}

body.theme-light .dash-library-card {
  background:
    radial-gradient(circle at top left, rgba(11, 95, 255, 0.12), transparent 44%),
    linear-gradient(135deg, #14213d, #1d3557);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .bodybuilder-modal-hero {
    grid-template-columns: minmax(130px, 40%) minmax(0, 1fr);
  }

  .bodybuilder-exercise-list {
    grid-template-columns: 1fr;
  }

  .dash-library-card-top {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .learn-library-hero {
    padding: 22px;
    border-radius: 24px;
  }

  .learn-routine-card {
    min-height: 280px;
    grid-template-columns: minmax(126px, 48%) minmax(0, 1fr);
    border-radius: 24px;
  }

  .learn-routine-card-media {
    width: 58%;
  }

  .learn-routine-card-copy {
    gap: 10px;
    padding: 22px 18px 22px 0;
  }

  .learn-routine-desc {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .bodybuilder-modal-card {
    padding: 18px;
    border-radius: 24px;
  }

  .bodybuilder-day-panel-top,
  .bodybuilder-modal-headline {
    flex-direction: column;
  }

  .bodybuilder-day-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .bodybuilder-day-actions .btn {
    width: 100%;
  }
}

/* Gym Bro Additions */
.rest-timer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.rest-timer-card {
  width: min(100%, 380px);
  text-align: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent);
  border-radius: 32px;
  padding: 32px;
  box-shadow: 0 0 50px var(--accent-dim);
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rest-timer-circle {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
}

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

.rest-timer-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.rest-timer-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

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

.rest-timer-time {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.rest-timer-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Plate Calculator */
.plate-calc-modal {
  width: min(100%, 480px) !important;
}

.plate-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.plate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: var(--bg-dark);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.plate-count {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.plate-weight {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gym-bro-motivation {
  font-size: 1.1rem;
  font-weight: 700;
  font-style: italic;
  margin: 16px 0;
  color: var(--text-primary);
}

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

@keyframes scaleUp {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.workout-plate-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.workout-plate-calc-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  transform: scale(1.05);
}

.gym-bro-shout {
  font-weight: 800;
  text-transform: uppercase;
  font-style: italic;
  color: var(--accent);
}

/* ── Routine change section ── */
.routine-change-section {
  margin-top: 10px;
  text-align: center;
}

.routine-change-trigger {
  font-size: 0.78rem;
  padding: 5px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Change picker panel */
.routine-change-picker {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.routine-change-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.routine-change-picker-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}

.routine-change-picker-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.routine-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.routine-picker-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.routine-picker-card:hover:not(.routine-picker-card--locked) {
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.routine-picker-card--locked {
  cursor: default;
}

.routine-picker-card--locked img {
  filter: blur(2px) grayscale(0.5);
  opacity: 0.45;
}

.routine-picker-card-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  pointer-events: none;
}

.routine-picker-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  object-position: top;
  display: block;
}

.routine-picker-card-body {
  padding: 8px 10px 10px;
}

.routine-picker-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.routine-picker-card--locked .routine-picker-card-name {
  color: var(--text-muted);
}

.routine-picker-card-locked-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
}

.routine-picker-card-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  width: 100%;
}

.routine-change-picker-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  text-align: center;
}

/* ============================================================
   Supplement Notification System
   ============================================================ */

/* Bell button */
.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, background 220ms ease;
  flex-shrink: 0;
  will-change: transform;
}

.notif-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.35);
}

.notif-btn:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-sm);
}

.notif-btn-icon {
  display: block;
  flex-shrink: 0;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-btn:hover .notif-btn-icon {
  transform: translateY(-1px) scale(1.04);
}

.notif-btn:active .notif-btn-icon {
  transform: scale(0.97);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-surface-elevated);
}

/* Permission bar */
.supp-perm-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
  user-select: none;
}

.supp-perm-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.supp-perm-bar--ok {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  cursor: default;
}

.supp-perm-bar--prompt {
  background: var(--accent-dim);
  color: var(--accent);
}

.supp-perm-bar--denied {
  background: var(--danger-dim);
  color: var(--danger);
  cursor: default;
}

/* Streak chip */
.supp-streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

/* Empty state */
.supp-empty-state {
  text-align: center;
  padding: 28px 16px 20px;
}

.supp-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.supp-empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.supp-empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Schedule list */
.supp-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.supp-schedule-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.supp-schedule-info {
  grid-column: 1;
  grid-row: 1;
}

.supp-schedule-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.supp-schedule-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.supp-adherence-dots {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  gap: 5px;
  padding-top: 6px;
  align-items: center;
}

.supp-toggle-wrap {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.supp-edit-btn {
  grid-column: 3;
  grid-row: 1 / 3;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  line-height: 1;
}

.supp-edit-btn:hover {
  background: var(--bg-surface-hover);
}

/* CSS-only toggle switch */
.supp-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.supp-toggle-track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--bg-surface-hover);
  position: relative;
  transition: background 0.2s;
  display: block;
  flex-shrink: 0;
}

.supp-toggle-input:checked + .supp-toggle-track {
  background: var(--accent);
}

.supp-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.supp-toggle-input:checked + .supp-toggle-track .supp-toggle-thumb {
  transform: translateX(18px);
}

/* Adherence dots */
.supp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.supp-dot[data-status="taken"]   { background: #16a34a; }
.supp-dot[data-status="skipped"] { background: #d97706; }
.supp-dot[data-status="missed"]  { background: var(--text-muted); opacity: 0.4; }
.supp-dot[data-status="none"]    { background: transparent; border: 1.5px solid var(--border); }

/* Timing pill grid */
.supp-timing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.supp-timing-btn {
  padding: 10px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1.3;
}

.supp-timing-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* Dosage row */
.supp-dosage-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.supp-dosage-row select.input-control {
  min-width: 110px;
  width: auto;
}

/* Edit actions */
.supp-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* Check-in backdrop */
.supp-checkin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 980;
}

/* Check-in bottom sheet */
.supp-checkin-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: min(560px, 100vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 990;
  padding: 0 20px calc(32px + var(--safe-area-inset-bottom));
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.supp-checkin-sheet.is-open {
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  .supp-checkin-sheet {
    bottom: 50%;
    transform: translateX(-50%) translateY(50%) scale(0.96);
    border-radius: var(--radius-xl);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s;
    padding-bottom: 32px;
  }

  .supp-checkin-sheet.is-open {
    transform: translateX(-50%) translateY(50%) scale(1);
    opacity: 1;
  }
}

.supp-checkin-grab {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  margin: 14px auto 18px;
}

.supp-checkin-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.supp-checkin-head h3 {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}

.supp-checkin-head span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.supp-checkin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.supp-checkin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.12s;
}

.supp-checkin-item:hover {
  border-color: rgba(148, 163, 184, 0.3);
}

.supp-checkin-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.supp-checkin-info {
  flex: 1;
  min-width: 0;
}

.supp-checkin-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supp-checkin-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.supp-checkin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* =========================================================
   Subscription Modal
   z-index: 1300 — above bodybuilder modal (1200),
   below rest-timer (2000)
   ========================================================= */

/* --- Backdrop --- */
.sub-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sub-modal-backdrop.sub-modal--visible {
  opacity: 1;
  visibility: visible;
}

.sub-modal-backdrop.sub-modal--hiding {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

/* --- Modal Card --- */
.sub-modal-card {
  position: relative;
  width: min(100%, 980px);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 26px 22px;
  box-shadow: var(--shadow-lg);
  transform: translateY(28px) scale(0.97);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease;
}

.sub-modal--visible .sub-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sub-modal--hiding .sub-modal-card {
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .streak-btn,
  .streak-icon,
  .notif-btn,
  .notif-btn-icon,
  .streak-modal-overlay,
  .streak-modal-card {
    transition: none !important;
    animation: none !important;
  }

  .streak-btn:hover,
  .streak-btn:active,
  .notif-btn:hover,
  .notif-btn:active,
  .streak-btn:hover .streak-icon,
  .streak-btn:active .streak-icon,
  .notif-btn:hover .notif-btn-icon,
  .notif-btn:active .notif-btn-icon,
  .streak-modal-card,
  .streak-modal--visible .streak-modal-card,
  .streak-modal--hiding .streak-modal-card {
    transform: none !important;
  }
}

/* --- Header --- */
.sub-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.sub-modal-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  opacity: 0.85;
}

.sub-modal-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.sub-modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  max-width: 44ch;
}

.sub-modal-close-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-family: inherit;
}

.sub-modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* --- Billing Toggle --- */
.sub-billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 20px;
}

.sub-billing-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}

.sub-billing-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.sub-billing-save-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.16);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- Plan Grid --- */
.sub-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

/* --- Plan Card Base --- */
.sub-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sub-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Pro: blue tint */
.sub-plan-card--pro {
  border-color: rgba(37, 99, 235, 0.38);
  background:
    radial-gradient(ellipse at top left, rgba(37, 99, 235, 0.09) 0%, transparent 60%),
    var(--bg-surface-elevated);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.14), 0 8px 28px rgba(0, 0, 0, 0.3);
}

/* Elite: amber/gold */
.sub-plan-card--elite {
  border-color: rgba(217, 119, 6, 0.42);
  background:
    radial-gradient(ellipse at top right, rgba(217, 119, 6, 0.11) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(180, 83, 9, 0.07) 0%, transparent 60%),
    var(--bg-surface-elevated);
  box-shadow:
    0 0 0 1px rgba(217, 119, 6, 0.22),
    0 0 50px rgba(217, 119, 6, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.32);
}

/* Elite decorative ambient glow */
.sub-plan-elite-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(24px);
}

/* Current plan card: muted */
.sub-plan-card--current {
  opacity: 0.65;
}

.sub-plan-card--current:hover {
  transform: none;
  box-shadow: none;
}

/* --- Popular badge (pill at top of Pro) --- */
.sub-plan-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- Plan header (name + price) --- */
.sub-plan-header-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-plan-card--pro .sub-plan-header-inner {
  margin-top: 12px; /* space below badge */
}

.sub-plan-name {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sub-plan-card--elite .sub-plan-name {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub-plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.sub-plan-price-amount {
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  line-height: 1;
}

.sub-plan-card--elite .sub-plan-price-amount {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub-plan-price-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Feature list --- */
.sub-plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  margin: 0;
  padding: 0;
}

.sub-plan-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* CSS-only check dot — no icon font needed */
.sub-plan-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
  margin-top: 2px;
  position: relative;
}

.sub-plan-check::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.sub-plan-card--elite .sub-plan-check {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
}

.sub-plan-card--elite .sub-plan-check::after {
  background: #d97706;
}

/* --- CTA Buttons --- */
.sub-plan-cta {
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  font-family: inherit;
  margin-top: auto;
}

/* Primary (Pro) */
.sub-plan-cta--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: 0 0 22px rgba(37, 99, 235, 0.28);
}

.sub-plan-cta--primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 32px rgba(37, 99, 235, 0.4);
}

/* Elite */
.sub-plan-cta--elite {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 0 24px rgba(217, 119, 6, 0.26);
}

.sub-plan-cta--elite:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 36px rgba(217, 119, 6, 0.38);
}

/* Current plan (disabled) */
.sub-plan-cta--current {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: default;
  font-weight: 600;
}

.sub-plan-cta--current:disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* --- Footer note --- */
.sub-modal-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* =========================================================
   Subscription Modal — Responsive
   ========================================================= */

/* Tablet: Free card full-width strip, Pro + Elite side by side */
@media (max-width: 860px) {
  .sub-plan-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sub-plan-card:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 18px;
  }

  .sub-plan-card:first-child .sub-plan-features {
    display: none;
  }

  .sub-plan-card:first-child .sub-plan-cta {
    width: auto;
    min-width: 130px;
    flex-shrink: 0;
    margin-top: 0;
  }

  .sub-plan-card:first-child .sub-plan-header-inner {
    flex: 1;
  }
}

/* Mobile: single column */
@media (max-width: 560px) {
  .sub-modal-card {
    padding: 20px 16px 18px;
    border-radius: var(--radius-lg);
  }

  .sub-plan-grid {
    grid-template-columns: 1fr;
  }

  .sub-plan-card:first-child {
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  .sub-plan-card:first-child .sub-plan-features {
    display: flex;
  }

  .sub-plan-card:first-child .sub-plan-cta {
    width: 100%;
    margin-top: auto;
  }

  .sub-billing-toggle {
    width: 100%;
  }

  .sub-billing-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 10px;
    font-size: 0.82rem;
  }
}


/* =========================================================
   PayPal Payment Modal
   ========================================================= */

/* Backdrop */
.pp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 5, 12, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.pp-modal-backdrop.pp-modal--visible {
  opacity: 1;
  visibility: visible;
}

.pp-modal-backdrop.pp-modal--hiding {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

/* Card */
.pp-modal-card {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.5);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease;
}

.pp-modal--visible .pp-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pp-modal--hiding .pp-modal-card {
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.18s ease;
}

/* Header row */
.pp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.pp-modal-plan-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
}

.pp-modal-plan-pill--pro {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.35);
}

.pp-modal-plan-pill--elite {
  background: rgba(217, 119, 6, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.pp-modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.pp-modal-close-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Price row */
.pp-modal-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 6px;
}

.pp-modal-price {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.pp-modal-price-currency {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

.pp-modal-price-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-basis: 100%;
}

.pp-modal-price-usd {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Features */
.pp-modal-features {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pp-modal-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pp-modal-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(34, 197, 94, 0.16);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

.pp-modal-check::before {
  content: '✓';
  font-size: 9px;
  color: #4ade80;
  font-weight: 700;
}

/* Divider */
.pp-modal-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Security badge */
.pp-modal-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* PayPal button area */
.pp-modal-btn-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-modal-btn-wrap {
  min-height: 48px;
  transition: opacity 0.2s;
}

/* Processing loader */
.pp-modal-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
}

.pp-modal-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pp-spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

.pp-modal-loader-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Status message */
.pp-modal-status {
  font-size: 0.82rem;
  text-align: center;
  min-height: 1em;
  color: var(--text-muted);
}

.pp-modal-status--error {
  color: #f87171;
}

.pp-modal-status--info {
  color: var(--text-secondary);
}

/* Footer */
.pp-modal-footer-note {
  margin-top: 14px;
  font-size: 0.73rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Success screen ─────────────────────────────────── */
.pp-modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
  text-align: center;
  gap: 12px;
}

.pp-success-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 1.5px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  animation: pp-pop 0.4s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

@keyframes pp-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.pp-success-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.pp-success-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.pp-success-cta {
  margin-top: 4px;
  padding: 11px 28px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.pp-success-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 480px) {
  .pp-modal-card {
    padding: 20px 16px 18px;
    border-radius: var(--radius-lg);
  }

  .pp-modal-price {
    font-size: 2rem;
  }
}

/* =========================================================
   Settings — Subscription Upgrade Banner
   ========================================================= */

/* ── Active subscription management strip ─────────────────────────────── */
.settings-sub-manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.settings-sub-manage-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-sub-manage-pill {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
}

.settings-sub-manage-pill--pro {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.settings-sub-manage-pill--elite {
  background: rgba(217, 119, 6, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.settings-sub-manage-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-sub-manage-date {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.settings-sub-manage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-sub-manage-change {
  font-size: 0.82rem;
  padding: 6px 14px;
}

.settings-sub-manage-cancel {
  font-size: 0.8rem;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.settings-sub-manage-cancel:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.6);
}

.settings-sub-manage-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Upgrade banner (free users) ──────────────────────────────────────── */
.settings-upgrade-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 119, 6, 0.25);
  background:
    radial-gradient(ellipse at top left, rgba(37, 99, 235, 0.13) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(217, 119, 6, 0.1) 0%, transparent 55%),
    var(--bg-surface-elevated);
  box-shadow:
    0 0 0 1px rgba(217, 119, 6, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 22px;
  animation: settings-panel-rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Ambient blue glow top-left */
.settings-upgrade-glow {
  position: absolute;
  top: -60px;
  left: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(32px);
}

.settings-upgrade-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  position: relative; /* above the glow layer */
}

.settings-upgrade-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "FREE PLAN" pill badge */
.settings-upgrade-current-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-upgrade-headline {
  font-size: clamp(1.18rem, 2.4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0;
}

/* Feature perks */
.settings-upgrade-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-upgrade-perk {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* CTA button */
.settings-upgrade-cta {
  align-self: flex-start;
  margin-top: 2px;
}

/* Right column: tier preview cards */
.settings-upgrade-tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 138px;
}

.settings-upgrade-tier {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-surface);
}

.settings-upgrade-tier--pro {
  border-color: rgba(37, 99, 235, 0.3);
  background:
    radial-gradient(ellipse at top, rgba(37, 99, 235, 0.09) 0%, transparent 70%),
    var(--bg-surface);
}

.settings-upgrade-tier--elite {
  border-color: rgba(217, 119, 6, 0.35);
  background:
    radial-gradient(ellipse at top, rgba(217, 119, 6, 0.11) 0%, transparent 70%),
    var(--bg-surface);
}

.settings-upgrade-tier-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-upgrade-tier--elite .settings-upgrade-tier-label {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-upgrade-tier-price {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-primary);
}

.settings-upgrade-tier-price span {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.settings-upgrade-tier--elite .settings-upgrade-tier-price {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-upgrade-tier-tag {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Mobile: tiers go below copy, side by side */
@media (max-width: 540px) {
  .settings-upgrade-body {
    flex-direction: column;
  }

  .settings-upgrade-tiers {
    flex-direction: row;
    width: 100%;
  }

  .settings-upgrade-tier {
    flex: 1;
  }

  .settings-upgrade-cta {
    width: 100%;
    align-self: stretch;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════════════
   Hold-to-Unlock Modal
   ══════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────── */
.unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.unlock-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Card ────────────────────────────────────────────────── */
.unlock-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 36px 28px 40px;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  transform: scale(0.9) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.3s, box-shadow 0.3s;
}
.unlock-overlay.is-visible .unlock-card {
  transform: scale(1) translateY(0);
}
.unlock-card.is-shaking {
  animation: unlock-shake 0.08s linear infinite;
}
.unlock-card.is-unlocked {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(52, 211, 153, 0.35),
    0 0 48px rgba(52, 211, 153, 0.18);
}

/* ── Close button ────────────────────────────────────────── */
.unlock-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.1);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.unlock-close:hover { background: rgba(148, 163, 184, 0.22); }

/* ── Hero icon ───────────────────────────────────────────── */
.unlock-hero-icon {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
  user-select: none;
}

/* ── Text ────────────────────────────────────────────────── */
.unlock-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.25;
}
.unlock-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
  max-width: 240px;
}

/* ── Slot counter ────────────────────────────────────────── */
.unlock-slots {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 4px;
  gap: 2px;
}
.unlock-slots-val  { color: var(--accent); font-size: 0.95rem; font-weight: 900; }
.unlock-slots-sep  { opacity: 0.5; }
.unlock-slots-max  { opacity: 0.7; }
.unlock-slots-label { opacity: 0.6; }

/* ── Hold area ───────────────────────────────────────────── */
.unlock-hold-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* ── Progress ring ───────────────────────────────────────── */
.unlock-ring-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unlock-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.unlock-ring-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 5;
}
.unlock-ring-fill {
  fill: none;
  stroke: var(--accent, #2563eb);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.04s linear, stroke 0.3s;
}
.unlock-card.is-unlocked .unlock-ring-fill { stroke: #34d399; }

/* ── Hold button ─────────────────────────────────────────── */
.unlock-hold-btn {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.07);
  border: 2px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.unlock-hold-btn.is-holding {
  transform: scale(0.9);
  background: rgba(37, 99, 235, 0.14);
  border-color: var(--accent);
}
.unlock-hold-btn.is-complete {
  background: rgba(52, 211, 153, 0.22);
  border-color: #34d399;
  transform: scale(1.12);
  animation: unlock-success-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.unlock-hold-icon {
  font-size: 2.2rem;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  transition: transform 0.2s;
}
.unlock-hold-btn.is-holding .unlock-hold-icon {
  animation: unlock-icon-pulse 0.28s ease infinite alternate;
}

/* ── Label below button ──────────────────────────────────── */
.unlock-hold-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.25s;
}
.unlock-card.is-unlocked .unlock-hold-label { color: #34d399; }

/* ── Particles ───────────────────────────────────────────── */
.unlock-particles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: visible;
}
.unlock-particle {
  position: absolute;
  border-radius: 50%;
  animation: unlock-particle-fly 0.72s ease-out forwards;
}

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes unlock-shake {
  0%   { transform: translate(0,0)      rotate(0deg);    }
  12%  { transform: translate(-4px,-2px) rotate(-1.8deg); }
  24%  { transform: translate(4px,-1px)  rotate(1.8deg);  }
  37%  { transform: translate(-3px, 3px) rotate(-0.6deg); }
  50%  { transform: translate(3px, 1px)  rotate(1.2deg);  }
  63%  { transform: translate(-4px,-2px) rotate(-1.2deg); }
  76%  { transform: translate(4px, 2px)  rotate(0.6deg);  }
  88%  { transform: translate(-2px,-1px) rotate(-0.6deg); }
  100% { transform: translate(0,0)      rotate(0deg);    }
}

@keyframes unlock-icon-pulse {
  from { transform: scale(1);    }
  to   { transform: scale(1.18); }
}

@keyframes unlock-success-pop {
  0%   { transform: scale(0.82); }
  55%  { transform: scale(1.2);  }
  100% { transform: scale(1.12); }
}

@keyframes unlock-particle-fly {
  0%   { transform: translate(0, 0)                       scale(1);   opacity: 1;   }
  100% { transform: translate(var(--tx), var(--ty))        scale(0);   opacity: 0;   }
}

/* ── Cheat meal card: unlockable state (Pro users) ───────── */
.cheat-meal-card.is-unlockable {
  opacity: 1;
  cursor: pointer;
  border-color: rgba(52, 211, 153, 0.24);
  background:
    linear-gradient(180deg, rgba(52, 211, 153, 0.05), transparent 26%),
    var(--bg-surface);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.12);
}
.cheat-meal-card.is-pro-exhausted {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.18);
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.05), transparent 28%),
    var(--bg-surface);
}
.cheat-meal-card-badge.is-unlockable {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.cheat-meal-card-badge.is-unlocked-personal {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ── Routine card: unlockable (Pro, within quota) ────────── */
.learn-routine-chip--unlockable {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.learn-routine-chip--pro {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(52, 211, 153, 0.18));
  color: #e0f2fe;
  border: 1px solid rgba(96, 165, 250, 0.38);
}

.learn-routine-chip--pro-exhausted {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.learn-routine-cta--unlock {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(52, 211, 153, 0.2));
  color: #d1fae5;
  font-weight: 800;
  border: 1px solid rgba(52, 211, 153, 0.24);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

.learn-routine-cta--pro-exhausted {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

/* ── Cheat meal sheet: unlock footer button ──────────────── */
.cheat-meal-unlock-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 0 4px;
}
.cheat-meal-unlock-slots {
  padding: 3px 10px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 99px;
  color: var(--accent);
  font-weight: 900;
  font-size: 0.8rem;
}
.cheat-meal-preview-tease {
  margin: 12px 20px;
  padding: 14px 16px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-lg);
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}

.cheat-meal-preview-tease strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.cheat-meal-preview-tease-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  display: block;
}

.cheat-meal-sheet-pro-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cheat-meal-sheet-pro-copy {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: center;
}

.cheat-meal-sheet-pro-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ============================================================
   SUPPLEMENT PAGE ENHANCEMENTS
   ============================================================ */

/* Category chip */
.supp-category-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.supp-category-chip[data-category="Essentials"] {
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.3);
}
.supp-category-chip[data-category="Performance"] {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.supp-category-chip[data-category="Recovery"] {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}
.supp-category-chip[data-category="Health"] {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}
.supp-category-chip[data-category="Fat loss"] {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.supp-category-chip[data-category="Optional"] {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
}
body.theme-light .supp-category-chip[data-category="Essentials"] { color: #2563eb; }
body.theme-light .supp-category-chip[data-category="Performance"] { color: #059669; }
body.theme-light .supp-category-chip[data-category="Recovery"] { color: #7c3aed; }
body.theme-light .supp-category-chip[data-category="Health"] { color: #d97706; }
body.theme-light .supp-category-chip[data-category="Fat loss"] { color: #dc2626; }
body.theme-light .supp-category-chip[data-category="Optional"] { color: #64748b; }

/* Purpose line */
.supp-purpose {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 6px 0 10px;
}

/* Card footer row */
.supp-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Add to reminders button */
.supp-add-reminder-btn {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.supp-add-reminder-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Load more button */
.supp-load-more-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 0.88rem;
}

/* Buy links section */
.supp-buy-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.supp-buy-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.supp-buy-row {
  display: flex;
  gap: 8px;
}

.supp-buy-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  cursor: pointer;
  min-width: 0;
}
.supp-buy-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
body.theme-light .supp-buy-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.18);
}

.supp-buy-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.supp-buy-cheap .supp-buy-label { color: #34d399; }
.supp-buy-quality .supp-buy-label { color: #fbbf24; }
body.theme-light .supp-buy-cheap .supp-buy-label { color: #059669; }
body.theme-light .supp-buy-quality .supp-buy-label { color: #d97706; }

.supp-buy-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supp-buy-price {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 800;
}

/* ============================================================
   SETTINGS — ADMIN ENTRY POINT
   ============================================================ */

.settings-admin-entry {
  text-align: center;
  padding: 16px 0 4px;
}

.settings-admin-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.4;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}

.settings-admin-link:hover {
  opacity: 0.9;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

.admin-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ── Admin: top header (logo bar) ── */
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.admin-panel-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-panel-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.admin-panel-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.admin-panel-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Admin: login page ── */
.admin-login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 0;
}
.admin-login-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  line-height: 1;
}
.admin-login-title {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.admin-login-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.admin-login-card {
  width: 100%;
  max-width: 400px;
}

/* ── Admin: loading state ── */
.admin-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.admin-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.admin-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Admin: dashboard header row ── */
.admin-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 6px;
}
.admin-user-avatar {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}
.admin-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.admin-signout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.admin-signout-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.admin-tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}
.admin-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 4px);
  transition: color 0.15s, background 0.15s;
}
.admin-tab-icon { font-size: 1.05rem; line-height: 1; }
.admin-tab-label { letter-spacing: 0.01em; }
.admin-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.admin-tab.active {
  color: var(--accent);
  background: rgba(37,99,235,0.1);
}

.admin-link-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.admin-link-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-link-group-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-link-group.cheap .admin-link-group-title .dot { background: #34d399; }
.admin-link-group.quality .admin-link-group-title .dot { background: #fbbf24; }

.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-form-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
}
.admin-status.success {
  display: block;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.admin-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
body.theme-light .admin-status.success { color: #059669; }
body.theme-light .admin-status.error { color: #dc2626; }


/* ── Admin: supplement list (links tab) ──────────────────────── */

.admin-supp-search-wrap {
  margin-bottom: 12px;
}

.admin-supp-search {
  font-size: 0.875rem;
}

.admin-supp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-supp-row {
  border-bottom: 1px solid var(--border);
}

.admin-supp-row:last-child {
  border-bottom: none;
}

.admin-supp-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.admin-supp-row-header:hover {
  background: rgba(255,255,255,0.03);
}

.admin-supp-row.open .admin-supp-row-header {
  background: rgba(37,99,235,0.08);
  border-bottom: 1px solid var(--border);
}

.admin-supp-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-supp-geo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-supp-en {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-supp-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-supp-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.admin-supp-badge.has-links {
  background: rgba(16,185,129,0.15);
  color: #10b981;
}

.admin-supp-badge.no-links {
  background: rgba(148,163,184,0.1);
  color: var(--text-muted);
}

.admin-supp-chevron {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  line-height: 1;
}

.admin-supp-row.open .admin-supp-chevron {
  transform: rotate(90deg);
}

.admin-supp-form {
  padding: 14px;
  background: rgba(0,0,0,0.15);
}

.admin-supp-form-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.admin-supp-form-footer .btn {
  flex: 1;
}

.admin-supp-form-status {
  margin-top: 8px;
}

/* dot colours in link groups */
.dot-cheap   { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; margin-right: 6px; }
.dot-quality { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-right: 6px; }

/* ── Admin: stats tab ───────────────────────────────────────────── */

.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.admin-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
}

.admin-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}

.admin-stat-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-stats-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
}

.admin-loading-dots::after {
  content: '';
  animation: admin-dots 1.2s infinite;
}

@keyframes admin-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── Admin: banner tab toggle ───────────────────────────────────── */

.admin-banner-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(148,163,184,0.3);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.admin-switch input:checked + .admin-switch-slider {
  background: var(--accent);
}

.admin-switch input:checked + .admin-switch-slider::before {
  transform: translateX(20px);
}

/* ── Admin: Analytics Dashboard ─────────────────────────────────── */

.admin-analytics-card {
  padding: 0;
  overflow: hidden;
}

.admin-anl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.admin-analytics {
  display: flex;
  flex-direction: column;
}

.admin-anl-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.admin-anl-section:last-child { border-bottom: none; }

.admin-anl-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* KPI cards */
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-kpi-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
}

.admin-kpi-card.accent {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.07);
}

.admin-kpi-val {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
}

.admin-kpi-card.accent .admin-kpi-val { color: var(--accent); }

.admin-kpi-lbl {
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Bar chart rows */
.admin-bar-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-bar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-bar-name {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-bar-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-bar-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.admin-bar-fill.email     { background: #60a5fa; }
.admin-bar-fill.google    { background: #f87171; }
.admin-bar-fill.free-tier { background: var(--text-muted); }
.admin-bar-fill.pro-tier  { background: var(--accent); }
.admin-bar-fill.elite-tier{ background: #f59e0b; }
.admin-bar-fill.page      { background: linear-gradient(90deg, var(--accent), #818cf8); }

/* Tier badges */
.admin-tier-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-tier-badge.free  { background: rgba(148,163,184,0.15); color: #94a3b8; }
.admin-tier-badge.pro   { background: rgba(37,99,235,0.15);   color: #60a5fa; }
.admin-tier-badge.elite { background: rgba(245,158,11,0.15);  color: #f59e0b; }

/* MRR box */
.admin-mrr-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
}
.admin-mrr-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }
.admin-mrr-sub   { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.admin-mrr-val   { font-size: 1.3rem; font-weight: 900; color: var(--accent); }

/* Streak chips */
.admin-streak-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.admin-streak-chip {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
}
.admin-streak-chip.active { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.admin-streak-chip.broken { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.admin-streak-chip.none   { background: rgba(148,163,184,0.08); color: var(--text-muted); border: 1px solid var(--border); }

/* Leaderboard */
.admin-lb-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.admin-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.admin-lb-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.admin-lb-table th {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.admin-lb-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.admin-lb-table tr:last-child td { border-bottom: none; }
.admin-lb-table tr:hover td { background: rgba(255,255,255,0.02); }

.admin-lb-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.admin-lb-rank.gold   { background: rgba(245,158,11,0.18); color: #f59e0b; }
.admin-lb-rank.silver { background: rgba(148,163,184,0.18); color: #94a3b8; }
.admin-lb-rank.bronze { background: rgba(180,83,9,0.18);   color: #d97706; }
.admin-lb-rank.other  { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.admin-lb-name { font-weight: 600; font-size: 0.82rem; }

.admin-anl-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.admin-anl-badge.active { background: rgba(16,185,129,0.12); color: #10b981; }
.admin-anl-badge.broken { background: rgba(239,68,68,0.1);   color: #f87171; }
.admin-anl-badge.none   { color: var(--text-muted); }

/* Page analytics */
.admin-page-legend {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.68rem;
  font-weight: 700;
}

.admin-page-list {
  display: flex;
  flex-direction: column;
}

.admin-page-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.admin-page-row:last-child { border-bottom: none; }

.admin-page-icon {
  font-size: 1.1rem;
  text-align: center;
  line-height: 1;
}
.admin-page-name {
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.admin-page-tier-row {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}
.admin-page-tier {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.admin-page-tier.free  { background: rgba(148,163,184,0.12); color: #94a3b8; }
.admin-page-tier.pro   { background: rgba(37,99,235,0.12);   color: #60a5fa; }
.admin-page-tier.elite { background: rgba(245,158,11,0.12);  color: #f59e0b; }

.admin-page-stats { text-align: right; }
.admin-page-time  { font-size: 0.84rem; font-weight: 700; }
.admin-page-users { font-size: 0.68rem; color: var(--text-muted); }
.admin-page-avg   { font-size: 0.66rem; color: var(--text-muted); }

/* Refresh button */
.admin-refresh-btn {
  font-size: 1rem;
  color: var(--accent);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.admin-refresh-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(37, 99, 235, 0.3);
}

/* Loading / empty state */
.admin-anl-loading {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.admin-no-data {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.admin-anl-footer {
  padding: 10px 18px 14px;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
}

/* Light theme adjustments */
body.theme-light .admin-kpi-card { background: rgba(0,0,0,0.03); }
body.theme-light .admin-bar-track { background: rgba(0,0,0,0.07); }
body.theme-light .admin-lb-table thead tr { background: rgba(0,0,0,0.03); }

/* ── App Banner (top bar shown to all users) ───────────────────── */

.app-banner {
  position: relative;
  z-index: 200;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 0;
}

.app-banner.app-banner-visible {
  transform: translateY(0);
  opacity: 1;
  max-height: 80px;
}

.app-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(37,99,235,0.18) 0%, rgba(16,185,129,0.12) 100%);
  border-bottom: 1px solid rgba(37,99,235,0.25);
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.app-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.app-banner-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  flex: 1;
}

.app-banner-inner > span:not(.app-banner-icon) {
  flex: 1;
}

.app-banner-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}

.app-banner-dismiss:hover {
  color: var(--text-primary);
}
