#home-page .main-content > :not(.kouli-home-shell) {
  display: none !important;
}

html:has(body.kouli-home-active),
html:has(body.kouli-progress-active),
html:has(body.kouli-profile-active) {
  background-color: #07070d;
}

body.kouli-home-active {
  /* === TEAL BACKGROUND GLOW (original) — to revert, delete the grey/blue
     block below and uncomment this one. ===
  background:
    radial-gradient(circle at 50% 8%, rgba(0, 196, 160, 0.18), transparent 44%),
    radial-gradient(circle at 82% 36%, rgba(14, 165, 233, 0.10), transparent 34%),
    linear-gradient(180deg, #07070d 0%, #070d0c 44%, #040407 100%);
  */
  /* === GREY/BLUE BACKGROUND GLOW (trial) === */
  background:
    radial-gradient(circle at 50% 6%, rgba(122, 153, 171, 0.22), transparent 46%),
    radial-gradient(circle at 82% 34%, rgba(74, 93, 110, 0.16), transparent 36%),
    radial-gradient(circle at 14% 74%, rgba(74, 93, 110, 0.12), transparent 44%),
    linear-gradient(180deg, #07070d 0%, #08070f 50%, #040407 100%);
  background-color: #07070d;
  color: #fff;
}

body.kouli-home-active #app-header {
  display: none;
}

body.kouli-home-active #home-page {
  padding: 0;
  min-height: calc(100vh - 78px);
  /* === TEAL CONTENT GLOW (original) — to revert, delete the grey/blue
     block below and uncomment this one. ===
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 14%),
    radial-gradient(circle at 50% 16%, rgba(0, 196, 160, 0.13), transparent 34%);
  */
  /* === GREY/BLUE CONTENT GLOW (trial) === */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 14%),
    radial-gradient(circle at 50% 16%, rgba(122, 153, 171, 0.16), transparent 34%);
}

body.kouli-home-active #home-page .main-content {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 18px 28px;
}

.kouli-home-shell {
  position: relative;
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #fff;
}

.kouli-home-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 72%);
}

.kouli-home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.kouli-home-wordmark {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 0 22px rgba(0, 196, 160, 0.20);
}

.kouli-home-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}

.kouli-home-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: none;
}

.kouli-home-avatar-img.is-visible {
  display: block;
}

.kouli-home-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.kouli-home-avatar.is-image {
  border-color: rgba(255, 255, 255, 0.32);
}

.kouli-home-avatar.is-image .kouli-home-avatar-initials {
  display: none;
}

.kouli-home-mist-button {
  position: relative;
  width: min(100%, 440px);
  height: clamp(260px, 44vh, 400px);
  margin: 0 auto -2px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.kouli-home-mist-button:focus-visible {
  outline: 3px solid rgba(0, 196, 160, 0.85);
  outline-offset: 6px;
  border-radius: 28px;
}

.kouli-home-mist {
  position: absolute;
  inset: 18px 0 4px;
  overflow: hidden;
  filter: saturate(1.32);
  animation: kouliHomeMistBreathe 5.2s ease-in-out infinite;
}

.kouli-home-mist::before,
.kouli-home-mist::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  height: 44%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.26), rgba(0, 196, 160, 0.40), rgba(0, 229, 192, 0.22), transparent);
  filter: blur(22px);
  opacity: 0.78;
  animation: kouliHomeMistDrift 8s ease-in-out infinite alternate;
}

.kouli-home-mist::after {
  width: 78%;
  height: 64%;
  background:
    linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.20), rgba(0, 122, 100, 0.46), rgba(0, 196, 160, 0.24), transparent);
  filter: blur(34px);
  opacity: 0.5;
  animation-duration: 11s;
  animation-direction: alternate-reverse;
}

.kouli-home-mist-col {
  position: absolute;
  left: var(--mist-left);
  bottom: 12%;
  width: clamp(10px, 3.8vw, 18px);
  height: calc(62px + (var(--mist-i) * 4px));
  transform: translateX(-50%) scaleY(var(--mist-scale, 1));
  transform-origin: 50% 70%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    var(--mist-color),
    rgba(255, 255, 255, 0)
  );
  filter: blur(8px);
  opacity: 0.42;
  mix-blend-mode: screen;
  animation: kouliHomeMistColumn 4.6s ease-in-out infinite;
  animation-delay: var(--mist-delay);
}

.kouli-home-mist-label {
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(8, 8, 18, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.45),
    0 0 42px rgba(0, 196, 160, 0.70);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 6px 24px rgba(8, 8, 18, 0.32);
  pointer-events: none;
}

.kouli-home-mist-button:hover .kouli-home-mist {
  filter: saturate(1.55) brightness(1.08);
}

.kouli-home-mist-button:active .kouli-home-mist {
  transform: scale(0.985);
}

.kouli-home-copy {
  text-align: left;
  margin-top: -4px;
}

.kouli-home-title {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.06em;
  font-weight: 850;
  color: rgba(255, 255, 255, 0.96);
}

.kouli-home-subtitle {
  margin: 10px 0 0;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}

.kouli-home-primary {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #00C4A0;
  box-shadow:
    0 10px 28px rgba(0, 122, 100, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.kouli-home-primary:hover {
  transform: translateY(-1px);
  background: #00D4AD;
  box-shadow:
    0 12px 32px rgba(0, 122, 100, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.kouli-home-primary:active {
  transform: scale(0.985);
}

.kouli-home-primary svg,
.kouli-home-card svg,
.kouli-home-focus-edit svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.kouli-home-primary svg {
  color: #fff;
}

.kouli-home-focus {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.kouli-home-focus-row {
  min-height: 44px;
  padding: 0 12px 0 14px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.kouli-home-focus-label {
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.47);
}

.kouli-home-focus-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.18);
}

.kouli-home-focus-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.kouli-home-focus-text.is-empty {
  color: rgba(255, 255, 255, 0.46);
}

.kouli-home-focus-edit {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kouli-home-focus-edit:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.kouli-home-focus-form {
  display: none;
  gap: 10px;
  padding: 0 12px 12px;
}

.kouli-home-focus.is-editing .kouli-home-focus-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.kouli-home-focus-form input {
  min-height: 44px;
  border: 1px solid rgba(0, 196, 160, 0.34);
  border-radius: 14px;
  background: rgba(4, 4, 10, 0.7);
  color: #fff;
  padding: 0 13px;
  font: inherit;
  outline: none;
}

.kouli-home-focus-form input:focus {
  border-color: rgba(128, 245, 226, 0.82);
  box-shadow: 0 0 0 4px rgba(0, 122, 100, 0.18);
}

.kouli-home-focus-save {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 15px;
  background: rgba(0, 122, 100, 0.95);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.kouli-home-section-label {
  margin: 3px 0 -4px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

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

.kouli-home-card {
  position: relative;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(8, 8, 18, 0.76);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.kouli-home-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 196, 160, 0.36);
  background:
    linear-gradient(180deg, rgba(0, 122, 100, 0.12), rgba(255, 255, 255, 0.025)),
    rgba(8, 8, 18, 0.82);
}

.kouli-home-card:active {
  transform: scale(0.98);
}

.kouli-home-card svg {
  color: rgba(255, 255, 255, 0.72);
}

.kouli-home-card span {
  font-size: 0.93rem;
  font-weight: 760;
  letter-spacing: -0.01em;
}

/* Sprint Pass marker. Designed to whisper, not shout — sits as a
   sibling of the FOCUS / PRACTICE labels on the home screen.
   No fill, no glow, no chroma; just a hairline border + soft slate. */
.kouli-home-pass-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: transparent;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Dark mode-card surface: hairline white at low opacity. */
.kouli-home-card .kouli-home-pass-badge {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.52);
}

/* Legacy marker on the Pitch card. Same whisper register as the
   Sprint Pass badge (top-right, hairline border, no fill).
   Selector is scoped `.kouli-home-card .kouli-home-legacy-badge`
   so it beats `.kouli-home-card span` (which would otherwise drag
   the title's 0.93rem/760 weight onto this <span>). */
.kouli-home-card .kouli-home-legacy-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-block;
  padding: 1px 4px;
  border-radius: 999px;
  background: transparent;
  font-size: 8px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.42);
}

/* If the card is pass-locked AND the user has no active pass, the
   Sprint Pass badge is occupying the top-right slot — hide Legacy
   to avoid a stacked pill. When the user has an active pass, the
   Sprint Pass badge is suppressed (see rule above), so Legacy
   re-emerges in the slot it would have always owned. */
.kouli-home-card.is-pass-locked .kouli-home-legacy-badge {
  display: none;
}
.kouli-home-shell.has-active-pass .kouli-home-card.is-pass-locked .kouli-home-legacy-badge {
  display: inline-block;
}

/* Primary Interview CTA — flat teal; pass badge stays quiet. */
.kouli-home-primary {
  position: relative;
}
.kouli-home-primary .kouli-home-pass-badge {
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.7);
}

.kouli-home-shell.has-active-pass .kouli-home-pass-badge {
  display: none;
}

/* 2026-06-02: Hide Sprint Pass badges until /api/check-pass has
   resolved (or its localStorage cache was read at page load). The
   shell receives .has-checked-pass via main.js syncHomePassVisuals()
   the moment we know the answer. Without this, paid users saw badges
   flash for ~1-2s on every load because the .has-active-pass class
   was only flipped on a later /api/coach/memory response. */
.kouli-home-shell:not(.has-checked-pass) .kouli-home-pass-badge {
  display: none;
}

@keyframes kouliHomeMistBreathe {
  0%, 100% {
    transform: scaleX(0.96) scaleY(0.88);
    opacity: 0.76;
  }
  50% {
    transform: scaleX(1.05) scaleY(1.04);
    opacity: 1;
  }
}

@keyframes kouliHomeMistDrift {
  0% { transform: translate(-53%, -50%) skewX(-8deg); }
  100% { transform: translate(-47%, -48%) skewX(8deg); }
}

@keyframes kouliHomeMistColumn {
  0%, 100% {
    transform: translateX(-50%) scaleY(0.52) translateY(8px);
    opacity: 0.24;
  }
  50% {
    transform: translateX(-50%) scaleY(1.2) translateY(-4px);
    opacity: 0.62;
  }
}

@media (min-width: 760px) {
  body.kouli-home-active #home-page .main-content {
    padding-top: 24px;
  }

  .kouli-home-shell {
    justify-content: flex-start;
  }

  .kouli-home-mist-button {
    height: 380px;
  }
}

@media (max-width: 380px) {
  .kouli-home-shell {
    gap: 14px;
  }

  .kouli-home-mist-button {
    height: 230px;
  }

  .kouli-home-title {
    font-size: 1.8rem;
  }

  .kouli-home-grid {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kouli-home-mist,
  .kouli-home-mist::before,
  .kouli-home-mist::after,
  .kouli-home-mist-col {
    animation: none !important;
  }

  .kouli-home-primary,
  .kouli-home-card {
    transition: none !important;
  }
}
