/* ==========================================================================
   THE SOVEREIGNTY PLATFORM
   Modern, bold, confident — Inter at heavy weights, two-tone red/white emphasis,
   pill buttons, dark atmospheric cards. Built for Mar Morabito.
   ========================================================================== */

/* ---------- TOKENS ---------- */
:root {
  /* Surface */
  --bg: #0A0A0B;
  --bg-soft: #111114;
  --bg-elevated: #18181B;
  --card: #18181B;
  --card-hover: #1F1F23;
  --card-strong: #232328;

  --border: rgba(255, 255, 255, 0.06);
  --border-mid: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-red: rgba(232, 56, 71, 0.30);

  /* Brand - book cover red as primary, brighter red for emphasis */
  --red: #C8202C;
  --red-bright: #E83847;
  --red-deep: #9B131D;
  --red-soft: rgba(232, 56, 71, 0.12);
  --red-glow: rgba(232, 56, 71, 0.20);

  /* Text */
  --text: #FAFAFA;
  --text-soft: rgba(250, 250, 250, 0.82);
  --text-muted: rgba(250, 250, 250, 0.58);
  --text-dim: rgba(250, 250, 250, 0.40);

  /* Cream — for buttons-on-dark contexts */
  --cream: #F5EFE0;
  --ink: #0A0A0B;

  /* Font - Inter at every weight */
  --font: 'Inter', 'Inter Tight', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Radii — modern rounded */
  --r-sm: 8px;
  --r: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --max-w: 1280px;
  --max-w-md: 960px;
  --max-w-sm: 720px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'kern', 'liga', 'calt', 'ss01';
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}
::selection { background: var(--red); color: white; }

/* ---------- TYPOGRAPHY ---------- */
h1, .h1 {
  font-family: var(--font);
  font-weight: 800;
  font-size: clamp(2.8rem, 7.5vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: var(--text);
}
h2, .h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
}
h3, .h3 {
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}
h4 {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Red emphasis — replaces italic-serif pattern */
.text-red {
  color: var(--red-bright);
}
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }

p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 62ch;
}
.lede {
  font-size: clamp(1.15rem, 1.4vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-soft);
  font-weight: 400;
  max-width: 56ch;
}
.lede strong { color: var(--text); font-weight: 600; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-bright);
  display: inline-block;
}
.eyebrow-mute { color: var(--text-muted); }

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 4vw, 3rem);
}
.container-md {
  width: 100%;
  max-width: var(--max-w-md);
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 4vw, 3rem);
}
.container-sm {
  width: 100%;
  max-width: var(--max-w-sm);
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 4vw, 3rem);
}
section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section-divider { height: 1px; background: var(--border); margin: 0; }
.centered { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* ---------- BRAND PILL ---------- */
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem 0.4rem 0.45rem;
  background: var(--red-soft);
  border: 1px solid var(--border-red);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--red-bright);
  letter-spacing: -0.005em;
}
.brand-pill .mark {
  width: 22px;
  height: 22px;
  background: var(--red);
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(232, 56, 71, 0.5);
}
.brand-pill .mark img, .brand-pill .mark svg {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  background: var(--red);
  color: white;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(200, 32, 44, 0.25);
}
.btn:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232, 56, 71, 0.35);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: none;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: none;
}
.btn-cream {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(245, 239, 224, 0.12);
}
.btn-cream:hover {
  background: white;
  box-shadow: 0 8px 24px rgba(245, 239, 224, 0.2);
}
.btn-large {
  padding: 1.1rem 2rem;
  font-size: 1rem;
}
.btn-arrow::after {
  content: '→';
  font-weight: 500;
}

/* ---------- TAG / DOT ---------- */
.tags {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}
.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  display: inline-block;
}

/* ---------- ICON SQUARE ---------- */
.icon-sq {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--red);
  box-shadow: 0 0 24px rgba(232, 56, 71, 0.35);
}
.icon-sq svg { width: 22px; height: 22px; color: white; }
.icon-sq.blue {
  background: linear-gradient(135deg, #3B82F6, #6366F1);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
}
.icon-sq.lg {
  width: 56px;
  height: 56px;
}
.icon-sq.lg svg { width: 26px; height: 26px; }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.nav-brand .mark {
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(232, 56, 71, 0.4);
}
.nav-brand .mark img, .nav-brand .mark svg {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.4rem;
}
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-cta {
  padding: 0.7rem 1.4rem;
  background: var(--red);
  color: white;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 0 18px rgba(232, 56, 71, 0.35);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.nav-cta:hover {
  background: var(--red-bright);
  box-shadow: 0 0 28px rgba(232, 56, 71, 0.55);
}
.nav-cta::after { content: '→'; }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(4rem, 8vw, 7rem) clamp(4rem, 7vw, 6rem);
  overflow: hidden;
  background: var(--bg);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(232, 56, 71, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(232, 56, 71, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-grid > * { min-width: 0; }

.hero-title {
  font-weight: 800;
  font-size: clamp(2.4rem, 5.2vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin-block: 1.6rem 1.6rem;
}
.hero-title .text-red { color: var(--red-bright); }

.hero-lede {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 50ch;
  margin-bottom: 2.4rem;
  font-weight: 400;
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-ctas {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.hero-foot {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 44ch;
  line-height: 1.5;
}
.hero-foot a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: border-color 0.2s var(--ease);
}
.hero-foot a:hover { border-bottom-color: var(--red-bright); }

.hero-book {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.hero-book::before {
  content: '';
  position: absolute;
  width: 90%;
  height: 90%;
  background: radial-gradient(circle, rgba(232, 56, 71, 0.4), transparent 70%);
  filter: blur(60px);
  z-index: 0;
}
.hero-book img {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 60px 120px rgba(200, 32, 44, 0.2);
  transform: rotate(-3deg);
  transition: transform 0.6s var(--ease);
}
.hero-book img:hover { transform: rotate(0deg) translateY(-6px); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-book img { max-height: 460px; transform: rotate(-2deg); }
}

/* ==========================================================================
   THREE PILLARS (modern pillars section — replacing old 7 Rhythms intro)
   ========================================================================== */
.pillars {
  position: relative;
  border-top: 1px solid var(--border);
}
.pillars-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
}
.pillars-header h2 { max-width: 18ch; margin: 1.2rem auto 0; }
.pillars-header .eyebrow { margin-bottom: 0.4rem; }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.pillar {
  position: relative;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.pillar:hover {
  border-color: var(--border-mid);
  background: var(--card-hover);
  transform: translateY(-3px);
}
.pillar-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.pillar-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.pillar h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}
.pillar p {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: none;
}

@media (max-width: 820px) {
  .pillars-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   THE 7 RHYTHMS — grid of cards with roman numerals
   ========================================================================== */
.rhythms {
  border-top: 1px solid var(--border);
}
.rhythms-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
  align-items: end;
}
.rhythms-header h2 { margin-bottom: 0; max-width: 14ch; }
.rhythms-header h2 .text-red { color: var(--red-bright); }
.rhythms-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 48ch;
}

.rhythms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.rhythm-card {
  position: relative;
  padding: 1.8rem 1.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.rhythm-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(232, 56, 71, 0.3), transparent 50%) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.rhythm-card:hover {
  background: var(--card-hover);
  transform: translateY(-3px);
}
.rhythm-card:hover::after { opacity: 1; }
.rhythm-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.4rem;
}
.rhythm-roman {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  box-shadow: 0 0 14px rgba(232, 56, 71, 0.35);
}
.rhythm-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.1rem;
}
.rhythm-card p {
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: none;
  flex: 1;
}
.rhythm-card-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.4rem;
}

@media (max-width: 820px) {
  .rhythms-header { grid-template-columns: 1fr; gap: 1.2rem; }
  .rhythms-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   INSIDE / FEATURES — icon cards
   ========================================================================== */
.inside {
  border-top: 1px solid var(--border);
}
.inside-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
}
.inside-header h2 { max-width: 16ch; margin: 1.2rem auto 1.4rem; }
.inside-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto;
  line-height: 1.55;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.feature-card {
  padding: 1.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feature-card:hover {
  background: var(--card-hover);
  border-color: var(--border-mid);
  transform: translateY(-3px);
}
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.feature-card p {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: none;
}

@media (max-width: 820px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   WALL OF QUOTES
   ========================================================================== */
.wall {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.wall-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
}
.wall-header h2 { max-width: 18ch; margin: 1.2rem auto 0; }
.wall-header h2 .text-red { color: var(--red-bright); }

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.quote {
  padding: 2rem 1.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.quote:hover {
  border-color: var(--border-red);
  background: var(--card-hover);
  transform: translateY(-3px);
}
.quote-mark {
  font-size: 2.6rem;
  line-height: 0.5;
  color: var(--red-bright);
  margin-bottom: 1rem;
  font-weight: 700;
  display: block;
  height: 1.5rem;
}
.quote-text {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin-bottom: 1.4rem;
  flex: 1;
  font-weight: 400;
}
.quote-attr {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

@media (max-width: 820px) {
  .quotes-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ACTIVATE BAND
   ========================================================================== */
.activate {
  position: relative;
  text-align: center;
  padding-block: clamp(5rem, 10vw, 8rem);
  border-top: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.activate::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(232, 56, 71, 0.18), transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(232, 56, 71, 0.12), transparent 60%);
  pointer-events: none;
}
.activate-inner { position: relative; z-index: 2; max-width: 780px; margin: 0 auto; }
.activate h2 { margin-block: 1.2rem 1.4rem; }
.activate h2 .text-red { color: var(--red-bright); }
.activate-lede {
  margin: 0 auto 2.4rem;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.55;
  max-width: 52ch;
}
.activate-lede strong { color: var(--text); font-weight: 600; }
.activate-ctas {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}
.activate-foot {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 44ch;
  margin: 0 auto;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-block: 4rem 2rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.footer-brand .mark {
  width: 30px;
  height: 30px;
  background: var(--red);
  border-radius: 7px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 16px rgba(232, 56, 71, 0.4);
}
.footer-brand .mark img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}
.footer-brand span {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.footer-tagline {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 32ch;
  font-style: italic;
}
.footer-col h5 {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1.1rem;
}
.footer-col a {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-side {
  position: relative;
  background: var(--bg);
  color: var(--text);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 100vh;
  border-right: 1px solid var(--border);
}
.login-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(232, 56, 71, 0.25), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(232, 56, 71, 0.15), transparent 60%);
  pointer-events: none;
}
.login-side > * { position: relative; z-index: 2; }
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.login-brand .mark {
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(232, 56, 71, 0.4);
}
.login-brand .mark img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}
.login-quote {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 18ch;
  margin-bottom: 1.6rem;
  color: var(--text);
}
.login-quote .text-red { color: var(--red-bright); }
.login-attr {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.login-foot-text {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.login-form-side {
  background: var(--bg-soft);
  color: var(--text);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  min-height: 100vh;
}
.login-form-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.login-form-wrap h1 {
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 0.7rem;
  color: var(--text);
}
.login-form-wrap h1 .text-red { color: var(--red-bright); }
.login-form-wrap > p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 2.4rem;
  max-width: 38ch;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-mid);
  margin-bottom: 2.2rem;
}
.tab {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 0;
  margin-right: 2rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab.active { color: var(--text); border-color: var(--red-bright); }
.tab:hover { color: var(--text); }

.field { margin-bottom: 1.3rem; }
.field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}
.field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  margin-left: 0.4rem;
}
.field input, .field textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field input:focus, .field textarea:focus {
  border-color: var(--red-bright);
  outline: none;
  background: var(--card);
}
.field input::placeholder { color: var(--text-dim); }
.field input.invalid {
  border-color: var(--red-bright);
  background: rgba(232, 56, 71, 0.08);
}

.field-code input {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 1.02rem;
  padding: 1rem 1.1rem;
}
.field-error {
  font-size: 0.85rem;
  color: var(--red-bright);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.form-submit {
  width: 100%;
  background: var(--red);
  color: white;
  padding: 1.05rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  margin-top: 0.4rem;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 4px 18px rgba(200, 32, 44, 0.3);
}
.form-submit:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(232, 56, 71, 0.4);
}

.login-divider {
  height: 1px;
  background: var(--border-mid);
  margin: 2rem 0 1.4rem;
}
.login-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}
.login-note a {
  color: var(--red-bright);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}

/* No-book callout */
.no-book {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--red-bright);
  border-radius: var(--r-sm);
  margin-bottom: 1.4rem;
  align-items: start;
}
.no-book-icon {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(232, 56, 71, 0.35);
}
.no-book strong {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.no-book p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  max-width: none;
}
.no-book-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red-bright);
  letter-spacing: -0.005em;
  transition: color 0.2s var(--ease);
}
.no-book-link::after { content: '→'; }
.no-book-link:hover { color: var(--text); }

@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-side { min-height: 260px; padding-block: 2rem; }
  .login-form-side { min-height: 0; padding-block: 3rem; }
}

/* ==========================================================================
   PORTAL
   ========================================================================== */
body.portal {
  background: var(--bg);
  color: var(--text);
}
.portal-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.portal-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.portal-brand .mark {
  width: 30px;
  height: 30px;
  background: var(--red);
  border-radius: 7px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 16px rgba(232, 56, 71, 0.4);
}
.portal-brand .mark img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}
.portal-brand span {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--text);
}

.portal-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.portal-nav-group {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 1.3rem 0.75rem 0.4rem;
}
.portal-nav button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--r-sm);
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  width: 100%;
}
.portal-nav button:hover {
  background: var(--card);
  color: var(--text);
}
.portal-nav button.active {
  background: var(--red-soft);
  color: var(--red-bright);
}
.portal-nav-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.portal-nav-icon svg {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.portal-user {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.portal-user-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.portal-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.portal-user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  word-break: break-all;
}
.portal-signout {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s var(--ease);
}
.portal-signout:hover { color: var(--red-bright); }

.portal-main {
  padding: 2.5rem clamp(2rem, 4vw, 3.5rem);
  min-height: 100vh;
}
.portal-mobile-nav { display: none; }

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 2rem;
  gap: 1.5rem;
}
.portal-greeting h1 {
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
.portal-greeting h1 .text-red { color: var(--red-bright); }
.portal-date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.streak-card {
  padding: 1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: center;
  min-width: 140px;
}
.streak-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.streak-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.streak-foot {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.view-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0 2.5rem;
}

.view { display: none; }
.view.active { display: block; }

.view-eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 0.7rem;
}
.view-title {
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
}
.view-title .text-red { color: var(--red-bright); }
.view-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2.4rem;
  line-height: 1.55;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.8rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.4rem;
}
.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Dashboard grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
}
.dash-anchor {
  padding: 1.6rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  border-radius: var(--r-md);
  color: white;
  box-shadow: 0 8px 28px rgba(200, 32, 44, 0.3);
}
.dash-anchor-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.7rem;
}
.dash-anchor-quote {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: 0.7rem;
}
.dash-anchor-ref {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dash-win {
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.dash-win label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.dash-win textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.dash-win textarea::placeholder { color: var(--text-dim); }

/* Rhythm checklist */
.rhy-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rhy-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.rhy-item:hover { border-color: var(--border-mid); background: var(--bg-soft); }
.rhy-item.complete { border-color: var(--border-red); background: var(--red-soft); }
.rhy-item input[type='checkbox'] {
  width: 18px; height: 18px;
  accent-color: var(--red-bright);
  cursor: pointer;
}
.rhy-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.rhy-label {
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}
.rhy-principle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  justify-self: end;
  max-width: 30ch;
}

@media (max-width: 1020px) {
  .dash-grid { grid-template-columns: 1fr; }
  .rhy-item { grid-template-columns: auto auto 1fr; }
  .rhy-principle { display: none; }
}

/* Tracker form fields */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.tracker-field {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.tracker-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.tracker-field input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

@media (max-width: 820px) {
  .tracker-grid { grid-template-columns: 1fr 1fr; }
}

/* Workbook picker */
.wb-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.wb-pick {
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.wb-pick:hover { border-color: var(--border-mid); background: var(--card-hover); }
.wb-pick.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
  box-shadow: 0 4px 18px rgba(200, 32, 44, 0.25);
}
.wb-num {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.wb-pick.active .wb-num { color: rgba(255,255,255,0.85); }
.wb-name {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

@media (max-width: 820px) {
  .wb-picker { grid-template-columns: 1fr 1fr; }
}

/* Workbook content */
.wb-content {
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.wb-chapter {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 0.5rem;
}
.wb-content h3 {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.wb-content h3 .wb-roman {
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 0 14px rgba(232, 56, 71, 0.35);
}
.wb-principle {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--red);
  margin-bottom: 1.4rem;
}
.wb-summary {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}
.wb-section {
  margin-top: 1.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.wb-section-head {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 1rem;
}
.wb-prompt { margin-bottom: 1.2rem; }
.wb-prompt-q {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.wb-prompt textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.8rem;
  outline: none;
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease);
}
.wb-prompt textarea:focus { border-color: var(--red-bright); }

.wb-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wb-action {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.wb-action:hover { border-color: var(--border-mid); }
.wb-action input[type='checkbox'] {
  width: 18px; height: 18px;
  accent-color: var(--red-bright);
}
.wb-action label {
  font-size: 0.95rem;
  cursor: pointer;
  flex: 1;
  color: var(--text-soft);
}
.wb-takeaway {
  margin-top: 2rem;
  padding: 1.4rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-bright);
}
.wb-takeaway .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 0.5rem;
}
.wb-takeaway p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 0;
  max-width: none;
}

/* 30-day challenge grid */
.challenge-progress {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.4rem;
}
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.4rem;
}
.day-cell {
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.day-cell:hover { border-color: var(--border-mid); color: var(--text); }
.day-cell.complete {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(232, 56, 71, 0.35);
}

@media (max-width: 820px) {
  .challenge-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Journal */
.journal-prompt-card {
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-bright);
  border-radius: var(--r-sm);
  margin-bottom: 1.4rem;
}
.journal-prompt-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 0.4rem;
}
.journal-prompt {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}
.journal-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.4rem;
  outline: none;
  resize: vertical;
  min-height: 280px;
  line-height: 1.6;
  transition: border-color 0.2s var(--ease);
}
.journal-textarea:focus { border-color: var(--red-bright); }

/* Declaration form */
.declaration {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  background: var(--card);
  border: 1px solid var(--border-red);
  border-radius: var(--r-md);
}
.decl-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}
.decl-row .preface { color: var(--text-muted); }
.decl-row input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--red);
  outline: none;
  padding: 0.4rem 0.2rem;
  transition: border-color 0.2s var(--ease);
}
.decl-row input:focus { border-color: var(--red-bright); }
.decl-row input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.decl-actions {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.8rem;
}

/* Assessment */
.assess-q {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.assess-q:last-child { border-bottom: none; }
.q-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.8rem;
  max-width: none;
}
.assess-scale {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.assess-scale button {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s var(--ease);
}
.assess-scale button:hover { border-color: var(--border-mid); color: var(--text); }
.assess-scale button.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(232, 56, 71, 0.3);
}

.score-card {
  margin-top: 2rem;
  padding: 1.8rem;
  background: var(--card);
  border: 1px solid var(--border-red);
  border-radius: var(--r-md);
  text-align: center;
}
.score-big {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--red-bright);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.score-tier {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.score-desc {
  font-size: 0.96rem;
  color: var(--text-muted);
  max-width: 50ch;
  margin: 0 auto;
  line-height: 1.55;
}

/* Cheat sheet table */
.cheat-table {
  width: 100%;
  border-collapse: collapse;
}
.cheat-table th, .cheat-table td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  vertical-align: top;
}
.cheat-table th {
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
  background: var(--bg-soft);
}
.cheat-table td.cheat-rhythm {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.cheat-table tr:hover td { background: var(--card); }

/* Mobile nav toggle */
@media (max-width: 1020px) {
  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    z-index: 200;
  }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .portal-main { padding: 1.5rem; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.8rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Print */
@media print {
  body { background: white; color: black; }
  .portal-sidebar, .portal-mobile-nav, .decl-actions { display: none !important; }
  .portal-main { padding: 0; }
  .declaration { border: 2px solid var(--red); background: white; color: black; }
  .decl-row, .decl-row input { color: black; }
  .decl-row .preface { color: #444; }
}

/* ==========================================================================
   INNER CIRCLE — landing page enhancements
   Colorful rhythm icons (Figma style), network diagram, dashboard preview
   ========================================================================== */

/* ---------- Hero badge / inner circle pill ---------- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem 0.5rem 0.55rem;
  background: rgba(232, 56, 71, 0.10);
  border: 1px solid var(--border-red);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--red-bright);
  margin-bottom: 2rem;
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
}
.hero-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(232,56,71,0.15), transparent);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-bright);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 12px var(--red-bright);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hero-badge span { position: relative; z-index: 1; }

/* ---------- Rhythm icons — Figma-style colorful rounded squares ---------- */
.rhythm-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.rhythm-icon svg {
  width: 26px;
  height: 26px;
  color: white;
  position: relative;
  z-index: 2;
}
.rhythm-icon::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  background: inherit;
  filter: blur(14px);
  opacity: 0.6;
  z-index: 0;
}
.rhythm-card:hover .rhythm-icon { transform: scale(1.05); }

/* The 7 colors — fresh, distinct, energetic */
.rhythm-icon.c-fasting    { background: linear-gradient(135deg, #FF8C42, #FF6B1A); }
.rhythm-icon.c-prayer     { background: linear-gradient(135deg, #2DD4BF, #14B8A6); }
.rhythm-icon.c-sleep      { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.rhythm-icon.c-nutrition  { background: linear-gradient(135deg, #A3E635, #65A30D); }
.rhythm-icon.c-exercise   { background: linear-gradient(135deg, #22C55E, #16A34A); }
.rhythm-icon.c-comms      { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.rhythm-icon.c-goals      { background: linear-gradient(135deg, #F59E0B, #D97706); }
.rhythm-icon.c-mind       { background: linear-gradient(135deg, #E83847, #C8202C); }

/* Refined rhythm card — more breathing room, side-by-side icon */
.rhythms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.rhythm-card-v2 {
  position: relative;
  padding: 1.8rem 1.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 240px;
}
.rhythm-card-v2:hover {
  background: var(--card-hover);
  border-color: var(--border-mid);
  transform: translateY(-4px);
}
.rhythm-card-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rhythm-card-v2 .rhythm-num-soft {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: -0.02em;
}
.rhythm-card-v2 h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.rhythm-card-v2 p {
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: none;
  flex: 1;
}
.rhythm-card-v2-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  margin-top: 0.4rem;
}

@media (max-width: 980px) {
  .rhythms-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .rhythms-grid { grid-template-columns: 1fr; }
}

/* ---------- INNER CIRCLE — what you get ---------- */
.inner-circle {
  border-top: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.inner-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(232, 56, 71, 0.10), transparent 60%);
  pointer-events: none;
}
.inner-circle-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
  position: relative;
  z-index: 2;
}
.inner-circle-header h2 { max-width: 18ch; margin: 1.2rem auto 1.2rem; }
.inner-circle-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto;
  line-height: 1.55;
}

.ic-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  position: relative;
  z-index: 2;
}
.ic-pillar {
  position: relative;
  padding: 2rem 1.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow: hidden;
}
.ic-pillar::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-bright), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.ic-pillar:hover {
  background: var(--card-hover);
  border-color: var(--border-mid);
  transform: translateY(-4px);
}
.ic-pillar:hover::after { opacity: 1; }
.ic-pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ic-pillar-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px rgba(232, 56, 71, 0.4);
  position: relative;
}
.ic-pillar-icon svg { width: 24px; height: 24px; color: white; }
.ic-pillar-num {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: -0.02em;
}
.ic-pillar h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.ic-pillar p {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: none;
}

@media (max-width: 820px) {
  .ic-pillars { grid-template-columns: 1fr; }
}

/* ---------- THE TRANSFORMATION NETWORK ---------- */
.network {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.network::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(232, 56, 71, 0.10), transparent 60%);
  pointer-events: none;
}
.network-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
  position: relative;
  z-index: 2;
}
.network-text h2 { margin-bottom: 1.4rem; max-width: 14ch; }
.network-text .lede { max-width: 50ch; }
.network-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.network-stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--red-bright);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.network-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.network-viz {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  margin: 0 auto;
  min-height: 460px;
}
.network-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.network-svg line {
  stroke: rgba(232, 56, 71, 0.22);
  stroke-width: 1;
}
.network-node {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.network-node:hover {
  transform: translate(-50%, -50%) scale(1.12);
}
.network-node svg { width: 28px; height: 28px; }
.network-node-num {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.network-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--red-bright) 0%, var(--red) 100%);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow:
    0 0 0 1px rgba(232, 56, 71, 0.4),
    0 0 40px rgba(232, 56, 71, 0.6),
    0 0 80px rgba(232, 56, 71, 0.4);
  animation: pulse-center 3s ease-in-out infinite;
}
@keyframes pulse-center {
  0%, 100% { box-shadow: 0 0 0 1px rgba(232, 56, 71, 0.4), 0 0 40px rgba(232, 56, 71, 0.6), 0 0 80px rgba(232, 56, 71, 0.4); }
  50% { box-shadow: 0 0 0 1px rgba(232, 56, 71, 0.6), 0 0 60px rgba(232, 56, 71, 0.7), 0 0 120px rgba(232, 56, 71, 0.5); }
}
.network-center-label {
  color: white;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.015em;
  text-align: center;
}

@media (max-width: 820px) {
  .network-inner { grid-template-columns: 1fr; }
  .network-viz { max-width: 340px; }
  .network-node { width: 52px; height: 52px; }
  .network-node svg { width: 22px; height: 22px; }
  .network-center { width: 80px; height: 80px; }
}

/* ---------- DASHBOARD PREVIEW ---------- */
.preview {
  border-top: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.preview-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 4vw, 4rem);
}
.preview-header h2 { max-width: 20ch; margin: 1.2rem auto 1.2rem; }
.preview-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 auto;
  line-height: 1.55;
}

.preview-frame {
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--card) 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: 1rem;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 60px 120px rgba(232, 56, 71, 0.12);
  position: relative;
}
.preview-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(232, 56, 71, 0.4), transparent 50%, rgba(232, 56, 71, 0.2));
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.preview-window {
  background: var(--bg);
  border-radius: var(--r-md);
  overflow: hidden;
}
.preview-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}
.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card-strong);
}
.preview-dot.red { background: #FF5F57; }
.preview-dot.amber { background: #FEBC2E; }
.preview-dot.green { background: #28C840; }
.preview-titlebar-spacer { flex: 1; }
.preview-titlebar-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.preview-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 460px;
}
.preview-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.preview-side-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.8rem;
}
.preview-side-brand .mark {
  width: 22px;
  height: 22px;
  background: var(--red);
  border-radius: 5px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(232, 56, 71, 0.35);
}
.preview-side-brand .mark svg {
  width: 12px;
  height: 12px;
  color: white;
}
.preview-side-brand span {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}
.preview-side-group {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.8rem 0.5rem 0.3rem;
}
.preview-side-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.preview-side-item.active {
  background: rgba(232, 56, 71, 0.12);
  color: var(--red-bright);
}
.preview-side-item svg { width: 12px; height: 12px; }

.preview-main {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.preview-greeting {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.preview-greeting h4 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.preview-greeting h4 .text-red { color: var(--red-bright); }
.preview-greeting-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.preview-streak {
  text-align: right;
}
.preview-streak-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.preview-streak-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.preview-cards {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.7rem;
  flex: 1;
}
.preview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.preview-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.preview-card-meta {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.preview-rhythms-list {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.preview-rhythm-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.7rem;
}
.preview-rhythm-line.done {
  background: rgba(232, 56, 71, 0.08);
  border-color: rgba(232, 56, 71, 0.25);
}
.preview-rhythm-check {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  flex-shrink: 0;
}
.preview-rhythm-line.done .preview-rhythm-check {
  background: var(--red-bright);
  border-color: var(--red-bright);
  position: relative;
}
.preview-rhythm-line.done .preview-rhythm-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
}
.preview-rhythm-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}
.preview-rhythm-line:not(.done) .preview-rhythm-name { color: var(--text-soft); }

.preview-anchor {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: white;
  padding: 1rem;
  border-radius: 10px;
}
.preview-anchor-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.4rem;
}
.preview-anchor-quote {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.preview-anchor-ref {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.95;
  text-transform: uppercase;
}

.preview-win {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  flex: 1;
}
.preview-win-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.preview-win-text {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.4;
  font-style: italic;
}

.preview-floating {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 0.8rem 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}
.preview-floating-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--red);
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(232, 56, 71, 0.4);
}
.preview-floating-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.84rem;
  margin-bottom: 0.05rem;
}
.preview-floating-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.preview-floating.top-right {
  top: -20px;
  right: -20px;
  z-index: 5;
}
.preview-floating.bottom-left {
  bottom: 30px;
  left: -30px;
  z-index: 5;
}

@media (max-width: 980px) {
  .preview-floating { display: none; }
  .preview-body { grid-template-columns: 1fr; }
  .preview-sidebar { display: none; }
  .preview-cards { grid-template-columns: 1fr; }
}

/* ---------- THE PROMISE / WHY PRIVATE ---------- */
.promise {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.promise-inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.promise-inner h2 {
  margin-block: 1.2rem 1.6rem;
}
.promise-inner h2 .text-red { color: var(--red-bright); }
.promise-inner p {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 auto 1.2rem;
}
.promise-inner p strong { color: var(--text); font-weight: 600; }


/* ==========================================================================
   QR SCAN BUTTON + MODAL
   ========================================================================== */
.qr-scan-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.qr-scan-btn:hover {
  background: var(--card-hover);
  border-color: var(--red-bright);
}
.qr-scan-btn svg {
  width: 20px;
  height: 20px;
  color: var(--red-bright);
  flex-shrink: 0;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.qr-modal.open { display: flex; }
.qr-modal-inner {
  background: var(--bg-soft);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(232, 56, 71, 0.15);
}
.qr-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1rem;
}
.qr-modal-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.qr-modal-head p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: none;
}
.qr-modal-head p em { font-style: italic; color: var(--text-soft); }
.qr-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border-mid);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.qr-close:hover { color: var(--text); border-color: var(--border-strong); }
.qr-close svg { width: 16px; height: 16px; }

.qr-camera-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  overflow: hidden;
}
.qr-camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qr-reticle {
  position: absolute;
  inset: 18%;
  border: 2px solid var(--red-bright);
  border-radius: var(--r-md);
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.4),
    inset 0 0 30px rgba(232, 56, 71, 0.3);
  animation: qr-pulse 2s ease-in-out infinite;
}
@keyframes qr-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), inset 0 0 30px rgba(232, 56, 71, 0.3); }
  50%      { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), inset 0 0 50px rgba(232, 56, 71, 0.55); }
}
.qr-status {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--r-pill);
  padding: 0.55rem 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.qr-status.error { background: rgba(155, 19, 29, 0.85); }
.qr-status.success { background: rgba(34, 197, 94, 0.85); }

.qr-modal-foot {
  padding: 1rem 1.4rem 1.4rem;
  text-align: center;
}
.qr-manual {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.qr-manual:hover { color: var(--text); }

/* ==========================================================================
   PORTAL — FRESH AF REDESIGN
   ========================================================================== */

/* New top bar with hamburger / search / streak / brand */
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.portal-hamburger {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border-mid);
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.portal-hamburger:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}
.portal-hamburger svg { width: 18px; height: 18px; }

.portal-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.portal-search input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all 0.2s var(--ease);
}
.portal-search input:focus {
  border-color: var(--red-bright);
  outline: none;
  background: var(--card-hover);
}
.portal-search input::placeholder { color: var(--text-dim); }
.portal-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  background: rgba(232, 56, 71, 0.12);
  border: 1px solid var(--border-red);
  border-radius: var(--r-pill);
  color: var(--red-bright);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.streak-pill svg { width: 14px; height: 14px; }
.streak-pill-num { font-weight: 700; color: var(--red-bright); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-mid); background: var(--card-hover); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-bright);
  border: 2px solid var(--bg);
}

.portal-topbar .nav-brand {
  margin-left: 0.2rem;
}

/* Hero greeting (Figma-style centered with bigger streak) */
.portal-hero {
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3rem) 1rem;
  max-width: 940px;
  margin: 0 auto;
}
.portal-hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.4rem;
}
.portal-hero h1 .text-red { color: var(--red-bright); }
.portal-hero-date {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Dashboard rhythm checklist — colorful icons inline */
.dash-rhythm-list {
  max-width: 940px;
  margin: 0 auto;
  padding: 1rem clamp(1.5rem, 4vw, 3rem) 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dash-rhythm-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.dash-rhythm-row:hover {
  background: var(--card-hover);
  border-color: var(--border-mid);
}
.dash-rhythm-row.checked {
  background: rgba(232, 56, 71, 0.05);
  border-color: var(--border-red);
}
.dash-rhythm-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  display: grid;
  place-items: center;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.dash-rhythm-row.checked .dash-rhythm-check {
  background: var(--red-bright);
  border-color: var(--red-bright);
}
.dash-rhythm-row.checked .dash-rhythm-check::after {
  content: '✓';
  color: white;
  font-size: 0.84rem;
  font-weight: 800;
}
.dash-rhythm-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.dash-rhythm-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: inherit;
  filter: blur(10px);
  opacity: 0.55;
  z-index: 0;
}
.dash-rhythm-icon svg {
  width: 18px;
  height: 18px;
  color: white;
  position: relative;
  z-index: 1;
}
.dash-rhythm-body { min-width: 0; }
.dash-rhythm-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.dash-rhythm-principle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.dash-rhythm-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Track Today's Rhythms big CTA */
.dash-track-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding: 1.15rem;
  background: var(--red);
  color: white;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 8px 24px rgba(200, 32, 44, 0.3);
}
.dash-track-cta:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(232, 56, 71, 0.4);
}
.dash-track-cta svg { width: 18px; height: 18px; }

/* Collapsible sections */
.dash-sections {
  max-width: 940px;
  margin: 0 auto;
  padding: 1.4rem clamp(1.5rem, 4vw, 3rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.dash-collapsible {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.dash-collapsible:hover { border-color: var(--border-mid); }
.dash-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  user-select: none;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font);
  text-align: left;
}
.dash-collapsible-head:hover { background: rgba(255, 255, 255, 0.02); }
.dash-collapsible-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dash-collapsible-title .icon-mini {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--red);
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 0 12px rgba(232, 56, 71, 0.3);
}
.dash-collapsible-title .icon-mini svg { width: 14px; height: 14px; }
.dash-collapsible-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-collapsible-chevron {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease);
}
.dash-collapsible.open .dash-collapsible-chevron { transform: rotate(180deg); }
.dash-collapsible-chevron svg { width: 14px; height: 14px; }
.dash-collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
  border-top: 1px solid transparent;
}
.dash-collapsible.open .dash-collapsible-body {
  max-height: 2000px;
  border-top-color: var(--border);
}
.dash-collapsible-content {
  padding: 1.4rem;
}

/* Anchor card inside collapsible */
.dash-anchor-inner {
  padding: 1.4rem;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  border-radius: var(--r-sm);
  color: white;
  box-shadow: 0 8px 24px rgba(200, 32, 44, 0.25);
}
.dash-anchor-inner .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-bottom: 0.6rem;
}
.dash-anchor-inner .quote {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.7rem;
}
.dash-anchor-inner .ref {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Win textarea inside collapsible */
.win-input-bare {
  width: 100%;
  font-family: var(--font);
  font-size: 0.98rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1rem;
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease);
}
.win-input-bare:focus { border-color: var(--red-bright); outline: none; }
.win-input-bare::placeholder { color: var(--text-dim); font-style: italic; }

/* ==========================================================================
   VIDEOS FROM MAR — Loom embeds
   ========================================================================== */
.videos-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.videos-empty p {
  font-size: 0.95rem;
  max-width: 40ch;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.video-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all 0.2s var(--ease);
  display: flex;
  flex-direction: column;
}
.video-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
}
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: var(--bg-soft);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-meta {
  padding: 1rem 1.1rem;
}
.video-title {
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}
.video-date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.video-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.video-card-foot button {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s var(--ease);
}
.video-card-foot button:hover { color: var(--red-bright); background: rgba(232, 56, 71, 0.08); }

.video-add {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.video-add input {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color 0.2s var(--ease);
}
.video-add input:focus { border-color: var(--red-bright); outline: none; }
.video-add input::placeholder { color: var(--text-dim); }
.video-add button {
  padding: 0.85rem 1.4rem;
  background: var(--red);
  color: white;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s var(--ease);
  white-space: nowrap;
}
.video-add button:hover { background: var(--red-bright); }
.video-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.video-add-row .video-add-row-fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.video-add-row .video-add-row-fields input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color 0.2s var(--ease);
}
.video-add-row .video-add-row-fields input:focus {
  border-color: var(--red-bright);
  outline: none;
}
.video-add-row .video-add-row-fields input::placeholder {
  color: var(--text-dim);
}
.video-add-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--card);
  border: 1px dashed var(--border-mid);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.2s var(--ease);
}
.admin-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.admin-toggle.active {
  background: rgba(232, 56, 71, 0.12);
  border: 1px solid var(--border-red);
  border-style: solid;
  color: var(--red-bright);
}

/* Hide old portal-shell desktop sidebar by default — we use top bar now */
.portal-shell-modern {
  min-height: 100vh;
  background: var(--bg);
}
.portal-main-modern {
  max-width: none;
  padding: 0;
  min-height: calc(100vh - 65px);
}

/* Mobile-friendly */
@media (max-width: 640px) {
  .portal-search { display: none; }
  .streak-pill .streak-pill-label { display: none; }
  .portal-hero h1 { font-size: 1.8rem; }
  .dash-rhythm-row { grid-template-columns: auto auto 1fr; }
  .dash-rhythm-num { display: none; }
}


/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.portal-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  z-index: 200;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
}
.portal-sidebar.open { transform: translateX(0); }
.portal-shell-modern { display: block; }

/* Save toast match the global toast */
.save-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.8rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   LIGHTNING BOLT LOGO — replaces square white-on-red mark globally
   ========================================================================== */

/* All .mark elements: just contain the bolt, no red square */
.nav-brand .mark,
.footer-brand .mark,
.portal-brand .mark,
.login-brand .mark,
.brand-pill .mark,
.hero-badge .mark,
.preview-side-brand .mark {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 8px rgba(232, 56, 71, 0.55));
}

/* Override the white-invert filter — show the bolt in its native red */
.nav-brand .mark img,
.footer-brand .mark img,
.portal-brand .mark img,
.login-brand .mark img,
.brand-pill .mark img,
.hero-badge .mark img,
.preview-side-brand .mark img,
.nav-brand .mark svg,
.footer-brand .mark svg,
.portal-brand .mark svg {
  filter: none !important;
  width: 100% !important;
  height: 100% !important;
}

/* Specific sizes per context */
.nav-brand .mark { width: 28px; height: 36px; }
.footer-brand .mark { width: 26px; height: 34px; }
.portal-brand .mark { width: 24px; height: 32px; }
.login-brand .mark { width: 26px; height: 34px; }
.brand-pill .mark { width: 18px; height: 24px; }
.hero-badge .mark { width: 16px; height: 22px; }
.preview-side-brand .mark { width: 18px; height: 24px; }

/* Brand pill — remove background, keep glowing dot */
.brand-pill {
  padding: 0.5rem 1rem 0.5rem 0.6rem;
}


/* ==========================================================================
   LANDING PREVIEW — modern dashboard mockup (matches new portal layout)
   ========================================================================== */
.preview-topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.preview-tb-hamburger {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--border-mid);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.preview-tb-hamburger svg { width: 14px; height: 14px; }
.preview-tb-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-size: 0.74rem;
}
.preview-tb-search svg { width: 12px; height: 12px; }
.preview-tb-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  background: rgba(232, 56, 71, 0.12);
  border: 1px solid var(--border-red);
  border-radius: var(--r-pill);
  color: var(--red-bright);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.preview-tb-streak svg { width: 11px; height: 11px; }
.preview-tb-bell {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  position: relative;
}
.preview-tb-bell::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  border: 1.5px solid var(--bg-soft);
}
.preview-tb-bell svg { width: 13px; height: 13px; }
.preview-tb-mark {
  width: 22px;
  height: 30px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 6px rgba(232, 56, 71, 0.5));
}
.preview-tb-mark img { width: 100%; height: 100%; }

.preview-main-modern {
  padding: 1.2rem 1.4rem 1.4rem;
}
.preview-greeting-modern {
  margin-bottom: 1rem;
}
.preview-greeting-modern h4 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.preview-greeting-modern h4 .text-red { color: var(--red-bright); }
.preview-greeting-date {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.preview-rhythm-list-modern {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.preview-rhythm-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.preview-rhythm-row.done {
  background: rgba(232, 56, 71, 0.05);
  border-color: var(--border-red);
}
.preview-check-modern {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
}
.preview-rhythm-row.done .preview-check-modern {
  background: var(--red-bright);
  border-color: var(--red-bright);
  position: relative;
}
.preview-rhythm-row.done .preview-check-modern::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
}
.preview-rh-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.preview-rh-icon::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 7px;
  background: inherit;
  filter: blur(6px);
  opacity: 0.55;
  z-index: 0;
}
.preview-rh-icon svg {
  width: 14px;
  height: 14px;
  position: relative;
  z-index: 1;
}
.preview-rh-name {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.preview-rh-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  line-height: 1.2;
}
.preview-rh-num {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-dim);
}

.preview-track-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem;
  background: var(--red);
  color: white;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: 0 4px 14px rgba(200, 32, 44, 0.3);
}
.preview-track-cta svg { width: 14px; height: 14px; }

@media (max-width: 820px) {
  .preview-tb-search span { display: none; }
  .preview-tb-streak { padding: 0.35rem 0.55rem; }
  .preview-tb-streak::after { content: ''; }
}
@media (max-width: 600px) {
  .preview-rhythm-row { grid-template-columns: auto auto 1fr; }
  .preview-rh-num { display: none; }
}


/* ==========================================================================
   LOCKED PAGE — shown when activate.html accessed without a valid code
   ========================================================================== */
.locked-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.locked-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(232, 56, 71, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 90%, rgba(232, 56, 71, 0.10), transparent 60%);
  pointer-events: none;
}
.locked-card {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: clamp(2rem, 4vw, 3rem);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(232, 56, 71, 0.12);
}
.locked-bolt {
  width: 56px;
  height: 72px;
  margin: 0 auto 1.6rem;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 16px rgba(232, 56, 71, 0.6));
}
.locked-bolt img {
  width: 100%;
  height: 100%;
}
.locked-card h1 {
  font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  color: var(--text);
}
.locked-card h1 .text-red { color: var(--red-bright); }
.locked-card p {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 auto 1rem;
  max-width: 42ch;
}
.locked-card p em { color: var(--text); font-style: italic; }
.locked-card .locked-sub {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 2rem;
}
.locked-card .btn {
  margin-bottom: 1.4rem;
}
.locked-back {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.locked-back:hover { color: var(--text); }

/* ==========================================================================
   CODE BANNER — shown at top of activation form when code is verified
   ========================================================================== */
.code-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: var(--r-sm);
  margin-bottom: 1.8rem;
  color: #4ADE80;
}
.code-banner svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #4ADE80;
}
.code-banner-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4ADE80;
  margin-bottom: 0.15rem;
}
.code-banner-code {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
}


/* ==========================================================================
   SAVE INDICATORS — visible confirmation that data persisted
   ========================================================================== */

/* In-line save indicator inside collapsible meta */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: none;
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}
.save-indicator.saved {
  color: #4ADE80;
}
.save-indicator.saved::before {
  content: '✓';
  font-weight: 700;
  font-family: var(--font);
  font-size: 0.78rem;
}

/* Per-field save badge on tracker inputs */
.tracker-field {
  position: relative;
}
.tracker-field .field-saved {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #4ADE80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.tracker-field .field-saved.show {
  opacity: 1;
  transform: translateY(0);
}
.tracker-field .field-saved::before {
  content: '✓ ';
  font-family: var(--font);
}

/* Big "all saved" pulse on tracker header */
.panel-saved-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #4ADE80;
  margin-left: 0.7rem;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.panel-saved-pulse.show { opacity: 1; }
.panel-saved-pulse::before {
  content: '✓';
  font-family: var(--font);
  font-weight: 800;
}


/* ==========================================================================
   AUTH TABS + BANNER (activate page)
   ========================================================================== */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-mid);
  margin-bottom: 2rem;
}
.auth-tabs .tab {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.9rem 0;
  margin-right: 1.8rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.auth-tabs .tab.active {
  color: var(--text);
  border-color: var(--red-bright);
}
.auth-tabs .tab:hover { color: var(--text); }

.auth-banner {
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1.4rem;
}
.auth-banner.error {
  background: rgba(232, 56, 71, 0.12);
  border: 1px solid var(--border-red);
  color: #FCA5A5;
}
.auth-banner.success {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ADE80;
}

.field-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.field-link:hover { color: var(--red-bright); }

.login-note a {
  color: var(--red-bright);
  font-weight: 600;
  transition: opacity 0.2s var(--ease);
}
.login-note a:hover { opacity: 0.85; }

