/* LINGO — signed-in surfaces: dashboard, courses, lessons, missions,
   practice, marketplace, community, profile. */

/* Section headings inside cards and panels sit a step down from page titles. */
.section-head h2.h-sm { font-size: var(--step-2); letter-spacing: -0.022em; }
/* Inside a card the surrounding stack already supplies the gap. */
.card > .section-head, .stack > .section-head { margin-bottom: 0; }

/* ======================================================================
   Dashboard
   ====================================================================== */

.dash-greeting { font-size: var(--step-4); }
.wave-hand { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out 1s 2; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) { .wave-hand { animation: none; } }

.dash-hero { overflow: hidden; padding: clamp(20px, 3vw, 32px); }
.dash-hero-glow {
  position: absolute;
  inset: -40% 40% 30% -20%;
  background: radial-gradient(50% 50% at 30% 50%, rgba(200, 255, 77, 0.14), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.dash-hero-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}

.dash-level-name {
  font-size: var(--step-5);
  line-height: 0.9;
}

.dash-stat {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.dash-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  flex: none;
}
.dash-goal-value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.goal-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-3);
}

.goal-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.goal-chip.is-done { border-color: var(--accent-line); background: var(--accent-soft); }
.goal-chip-icon {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
  flex: none;
}
.goal-chip.is-done .goal-chip-icon { background: var(--accent); color: var(--text-on-accent); }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.session-when {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  border: 1px solid var(--line);
}

.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
}
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week-bar {
  width: 100%;
  height: var(--h);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--surface-3), #262c37);
  transform-origin: bottom;
  animation: growBar 700ms var(--ease-out) both;
}
.week-bar.is-today { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); }
.week-day { font-size: var(--step--2); color: var(--text-3); font-family: var(--font-mono); }

.practice-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--sp-3); }
.practice-card-glow {
  position: absolute;
  inset: auto -30% -60% 30%;
  height: 160px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(91, 60, 240, 0.35), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

/* ======================================================================
   Cards used across the app
   ====================================================================== */

.continue-card { display: block; }
.continue-emoji { font-size: 30px; line-height: 1; flex: none; }
.continue-go {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  flex: none;
}

.mission-hero { position: relative; overflow: hidden; display: block; }
.mission-hero-glow {
  position: absolute;
  inset: -60% -20% auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(200, 255, 77, 0.18), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.mission-hero-body { margin-block: var(--sp-4); align-items: flex-start; }
.mission-hero-emoji { font-size: 40px; line-height: 1; flex: none; }
.mission-hero-foot { align-items: center; }
.mission-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 700;
  font-size: var(--step--1);
}
.card-link:hover .mission-hero-cta .icon { transform: translateX(3px); transition: transform var(--t) var(--ease); }

.mission-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.mission-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.mission-emoji { font-size: 30px; line-height: 1; }
.mission-card-foot { margin-top: auto; padding-top: var(--sp-2); }
.mission-card.is-locked { opacity: 0.66; }
.mission-card.is-locked:hover { opacity: 1; }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  transition: all var(--t) var(--ease);
}
.lesson-row:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateX(2px); }
.lesson-row-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-2);
  flex: none;
}
.lesson-row.is-done .lesson-row-icon { background: var(--accent-soft); color: var(--accent); }
.lesson-row-title { font-size: var(--step--1); font-weight: 600; }
.lesson-check {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  flex: none;
}

.ach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-inset);
}
.ach-badge {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  flex: none;
  color: var(--text-on-accent);
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
}
.ach-silver .ach-badge { background: linear-gradient(140deg, #e7ecf3, #95a1b3); }
.ach-bronze .ach-badge { background: linear-gradient(140deg, #f0b98a, #b4703c); }
.ach.is-locked { opacity: 0.72; }
.ach.is-locked .ach-badge { background: var(--surface-3); color: var(--text-3); }
.ach-pct { font-size: var(--step--2); color: var(--text-3); }

.word-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.word-example {
  padding-left: 12px;
  border-left: 2px solid var(--accent-line);
  color: var(--text-2);
  font-style: italic;
  font-size: var(--step--1);
  line-height: 1.6;
}

.word-translation {
  color: var(--accent);
  font-size: var(--step-0);
  font-weight: 600;
}

/* ---- translation reveal inside a vocabulary step ---- */

.translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--sp-2);
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: var(--step--1);
  font-weight: 600;
  transition: all var(--t) var(--ease);
}
.translate-btn:hover { border-color: var(--accent-line); color: var(--accent); }
.translate-btn.is-open { border-style: solid; border-color: var(--accent-line); color: var(--accent); }

.translation {
  width: 100%;
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  text-align: center;
  animation: rise var(--t) var(--ease-out) both;
}
.translation-text {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.teacher-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.teacher-headline { font-size: var(--step--1); color: var(--text-2); line-height: 1.5; }
.teacher-foot { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--line); }

.club-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); overflow: hidden; }
.club-stripe {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: hsl(var(--hue) 80% 58%);
}
.club-foot { margin-top: auto; padding-top: var(--sp-2); }
.club-joined {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--step--2);
  color: var(--accent);
  font-weight: 600;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.event-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.event-foot { margin-top: auto; padding-top: var(--sp-2); }

.partner-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.partner-avatar { position: relative; display: inline-flex; flex: none; }
.online-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--surface);
}

.notif {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  transition: all var(--t) var(--ease);
}
.notif:hover { border-color: var(--line-2); background: var(--surface); }
.notif.is-unread { background: var(--surface); border-color: var(--line-2); }
.notif-icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text-2);
  flex: none;
}
.notif-accent { background: var(--accent-soft); color: var(--accent); }
.notif-ok { background: rgba(62, 224, 160, 0.12); color: var(--ok); }
.notif-streak { background: rgba(255, 138, 61, 0.12); color: var(--streak); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.challenge-card { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ======================================================================
   Level map
   ====================================================================== */

.level-map {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  overflow-x: auto;
  scrollbar-width: none;
}
.level-map::-webkit-scrollbar { display: none; }
.level-map-line {
  position: absolute;
  left: 6%; right: 6%;
  top: 62px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--surface-3) 60%);
}
.level-map-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 108px;
}

.level-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform var(--t) var(--ease);
}
.level-node:hover { transform: translateY(-3px); }
.level-node-ring { position: relative; }
.level-node-code {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.level-node.is-locked { opacity: 0.5; }
.level-node.is-locked .ring-fill { stroke: var(--text-3); }
.level-lock {
  position: absolute;
  right: -2px; bottom: 2px;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text-3);
}
.level-here { white-space: nowrap; }

.level-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.level-panel.is-locked { opacity: 0.72; }

.level-header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}
.can-do ul li { line-height: 1.45; }

.module-card { display: flex; flex-direction: column; gap: var(--sp-4); }
.module-head { display: flex; align-items: flex-start; gap: var(--sp-4); }
.module-emoji { font-size: 32px; line-height: 1; flex: none; }
.module-ring { flex: none; }
.module-lessons { }

/* ======================================================================
   Lesson player
   ====================================================================== */

.lesson-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.lesson-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--gutter);
  background: rgba(8, 9, 12, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.lesson-bar-progress { flex: 1; }
.lesson-count { font-size: var(--step--2); flex: none; }

.lesson-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px) var(--gutter) 140px;
}

.step-wrap { width: 100%; }
.step { display: flex; flex-direction: column; gap: var(--sp-4); }
.step-prompt { font-size: var(--step-2); }

.lesson-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  padding: var(--sp-4) var(--gutter) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 9, 12, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.lesson-foot-inner { margin-inline: auto; display: flex; }
.lesson-foot-inner > * { flex: 1; }

.vocab-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 100% at 50% 0%, rgba(200, 255, 77, 0.09), transparent 70%),
    var(--surface);
}
.vocab-term {
  font-size: var(--step-5);
  letter-spacing: -0.045em;
  text-align: center;
}

.feedback {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  animation: rise var(--t) var(--ease-out) both;
  font-size: var(--step--1);
}
.feedback.is-right { border-color: rgba(62, 224, 160, 0.4); background: rgba(62, 224, 160, 0.07); }
.feedback.is-right strong { color: var(--ok); }
.feedback.is-wrong { border-color: rgba(255, 95, 87, 0.4); background: rgba(255, 95, 87, 0.07); }
.feedback.is-wrong strong { color: var(--danger); }
.feedback p { color: var(--text-2); line-height: 1.55; }

.order-slot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 62px;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
  background: var(--surface-inset);
  align-content: flex-start;
}
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }

.token {
  padding: 9px 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.token:hover { border-color: var(--accent-line); background: var(--surface-3); }
.token.is-placed { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.player {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.player-btn {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 0;
  flex: none;
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-accent);
}
.player-btn.is-playing { animation: pulseBtn 1.4s ease-in-out infinite; }
@keyframes pulseBtn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.player-wave { display: flex; align-items: center; gap: 3px; height: 32px; }
.player-wave span {
  width: 3px;
  height: var(--h);
  border-radius: 99px;
  background: var(--surface-3);
}
.player-btn.is-playing ~ .stack .player-wave span { background: var(--accent-deep); }

.passage {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  line-height: 1.75;
  font-size: var(--step-0);
  max-width: 62ch;
}

.mic-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4);
}
.mic-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px; height: 86px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform var(--t) var(--ease-spring), background var(--t) var(--ease);
  touch-action: none;
  user-select: none;
}
.mic-btn:hover { background: rgba(200, 255, 77, 0.18); }
.mic-btn.is-recording {
  background: var(--accent);
  color: var(--text-on-accent);
  transform: scale(1.06);
}
.mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
}
.mic-btn.is-recording .mic-ring { animation: pulse-ring 1.4s var(--ease-out) infinite; }
.mic-hint { font-size: var(--step--1); color: var(--text-3); }
.mic-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  font-size: var(--step--1);
}
.mic-transcript { font-size: var(--step-0); line-height: 1.5; }

.complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-4);
}
.complete-mark {
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  color: var(--text-on-accent);
  box-shadow: var(--shadow-accent);
  animation: pop 600ms var(--ease-spring) both;
}
.streak-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: rgba(255, 138, 61, 0.1);
  border: 1px solid rgba(255, 138, 61, 0.3);
  font-size: var(--step--1);
}

/* ======================================================================
   Responsive adjustments for app surfaces
   ====================================================================== */

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .level-header { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dash-hero { padding: var(--sp-4); }
  .dash-hero-main { flex-direction: column; align-items: stretch; gap: var(--sp-4); }

  /* The goal becomes a strip under the card's own content, so the ring and its
     label read as one object instead of two things sharing a row. */
  .dash-goal {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    background: var(--surface-inset);
    border: 1px solid var(--line);
  }
  .dash-goal .pill { margin-left: auto; }

  .dash-greeting { font-size: var(--step-3); }
  .dash-level-name { font-size: var(--step-4); }
  .module-head { flex-wrap: wrap; }
  .module-ring { order: -1; }
  .lesson-main { padding-bottom: 160px; }
  .vocab-term { font-size: var(--step-4); }
  .lesson-foot-inner .row { flex-direction: column; }
}

/* ======================================================================
   Missions: runner and debrief
   ====================================================================== */

.mission-view { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.mission-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px) var(--gutter) 220px;
}

.mission-brief-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(70% 140% at 20% 0%, rgba(200, 255, 77, 0.12), transparent 70%),
    var(--surface);
}
.mission-brief-emoji { font-size: 48px; line-height: 1; flex: none; }

.mission-chat { display: flex; flex-direction: column; gap: var(--sp-4); width: 100%; }

.chat-turn { display: flex; align-items: flex-start; gap: 11px; max-width: 86%; }
.chat-turn.is-me { margin-left: auto; justify-content: flex-end; }

.chat-avatar {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  font-size: 19px;
  flex: none;
}
.chat-speaker { font-size: var(--step--2); color: var(--text-3); font-weight: 600; }

.chat-bubble {
  padding: 13px 17px;
  border-radius: 20px 20px 20px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  line-height: 1.55;
  animation: rise 260ms var(--ease-out) both;
}
.chat-turn.is-me .chat-bubble {
  border-radius: 20px 20px 6px 20px;
  background: var(--accent);
  border-color: transparent;
  color: var(--text-on-accent);
  font-weight: 500;
}

.chat-typing { display: flex; gap: 5px; align-items: center; }
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.16s; }
.chat-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.mission-choice { text-align: left; }

.debrief-head {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  flex-wrap: wrap;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  border-left-width: 3px;
}
.review-item.is-good { border-left-color: var(--ok); }
.review-item.is-bad { border-left-color: var(--warn); }
.review-item p { font-size: var(--step--1); color: var(--text-2); line-height: 1.55; }
.review-quote {
  font-size: var(--step--1);
  color: var(--text-3);
  font-style: italic;
}

/* ======================================================================
   AI practice
   ====================================================================== */

.scenario-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: all var(--t) var(--ease);
}
.scenario-card:hover { border-color: var(--line-lit); transform: translateY(-2px); background: var(--surface-2); }
.scenario-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.scenario-emoji { font-size: 26px; line-height: 1; flex: none; }

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  height: calc(100vh - var(--topbar-h) - 120px);
  min-height: 460px;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-right: 4px;
}

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.chat-input {
  min-height: 44px;
  max-height: 140px;
  border: 0;
  background: transparent;
  resize: none;
  padding: 10px 6px;
}
.chat-input:focus { box-shadow: none; background: transparent; }
.chat-compose .btn-square { width: 44px; height: 44px; border-radius: 12px; }
.chat-compose .is-recording { background: var(--accent); color: var(--text-on-accent); }
.chat-note { font-size: var(--step--2); text-align: center; }

.chat-note-line {
  align-self: center;
  max-width: 34ch;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-size: var(--step--2);
  text-align: center;
}

.is-pulsing { animation: pulseBtn 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .is-pulsing { animation: none; } }

.chat-compose .is-recording {
  background: var(--accent);
  color: var(--text-on-accent);
  animation: pulseBtn 1.3s ease-in-out infinite;
}

.alt-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  border: 1px solid var(--line);
}
.alt-said { color: var(--text-3); font-size: var(--step--1); line-height: 1.5; }
.alt-better { color: var(--accent); font-size: var(--step--1); font-weight: 500; line-height: 1.5; }
.alt-arrow { color: var(--text-3); }
.alt-why { grid-column: 1 / -1; font-size: var(--step--2); padding-top: 6px; border-top: 1px solid var(--line); }

/* ======================================================================
   Marketplace
   ====================================================================== */

.speakers-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.filters {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.range {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  outline: none;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ground);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ground);
  cursor: pointer;
}

.teacher-hero { position: relative; overflow: hidden; }
.teacher-hero-glow {
  position: absolute;
  inset: -60% 40% 20% -10%;
  background: radial-gradient(50% 50% at 40% 50%, hsl(var(--hue) 80% 55% / 0.22), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.teacher-hero-main {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
}
.teacher-book {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-inset);
  min-width: 190px;
}

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  transition: all var(--t) var(--ease);
  min-width: 62px;
}
.day-chip:hover { border-color: var(--line-lit); transform: translateY(-2px); }
.day-chip.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.day-chip.is-empty { opacity: 0.45; }
.day-chip-name { font-size: var(--step--2); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.day-chip-num { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1; }
.day-chip-open { font-size: var(--step--2); color: var(--accent); }

/* ======================================================================
   Booking
   ====================================================================== */

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-5);
  align-items: start;
}

.booking-summary {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
}

.summary-rows { font-size: var(--step--1); }
.summary-total {
  margin-block: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.slot {
  padding: 11px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-inset);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--step--1);
  transition: all var(--t-fast) var(--ease);
}
.slot:hover { border-color: var(--accent-line); background: var(--surface-2); }
.slot.is-selected { border-color: var(--accent); background: var(--accent); color: var(--text-on-accent); }

.code-block {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
}

@media (max-width: 1080px) {
  .speakers-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .booking-layout { grid-template-columns: 1fr; }
  .booking-summary { position: static; }
}

@media (max-width: 640px) {
  .chat-turn { max-width: 94%; }
  .chat-shell { height: auto; min-height: 0; }
  .chat-log { max-height: 56vh; }
  .alt-row { grid-template-columns: 1fr; }
  .alt-arrow { transform: rotate(90deg); justify-self: start; }
  .mission-main { padding-bottom: 260px; }
  .debrief-head { justify-content: center; text-align: center; }
}

/* ======================================================================
   Community
   ====================================================================== */

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--surface-inset);
}
.rank-row.is-me {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.rank-num {
  width: 26px;
  text-align: right;
  color: var(--text-3);
  font-size: var(--step--1);
  flex: none;
}
.rank-row:nth-child(1) .rank-num,
.rank-row:nth-child(2) .rank-num,
.rank-row:nth-child(3) .rank-num { color: var(--accent); font-weight: 700; }

.thread { display: flex; flex-direction: column; gap: var(--sp-3); }
.thread h4 { font-size: var(--step-1); }

.club-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(20px, 4vw, 40px);
  position: relative;
  overflow: hidden;
}
.club-hero-glow {
  position: absolute;
  inset: -50% 30% 20% -20%;
  background: radial-gradient(50% 50% at 40% 50%, hsl(var(--hue) 80% 55% / 0.2), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.club-hero-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-inset);
}

/* ======================================================================
   Profile
   ====================================================================== */

.profile-hero { position: relative; overflow: hidden; }
.profile-hero-glow {
  position: absolute;
  inset: -60% 40% 20% -10%;
  background: radial-gradient(50% 50% at 40% 50%, rgba(200, 255, 77, 0.18), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.profile-hero-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
}

/* ======================================================================
   Settings
   ====================================================================== */

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--step--1);
  font-weight: 500;
  transition: all var(--t) var(--ease);
}
.settings-nav-link:hover { background: var(--surface); color: var(--text); }
.settings-nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.toggle-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: 0; }

.invoice-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.invoice-row:last-child { border-bottom: 0; }

/* ======================================================================
   Teaching side
   ====================================================================== */

.teach-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--depth-soft);
  border: 1px solid rgba(91, 60, 240, 0.4);
  color: #b9a8ff;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The teaching shell keeps the same bones but a different accent temperature,
   so you always know which side of the product you are on. */
.app-shell.is-teaching .sidebar { background: #0c0a14; }
.app-shell.is-teaching .sidebar-link.is-active {
  background: var(--depth-soft);
  color: #c3b5ff;
}

.teach-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.teach-hero-card {
  display: flex;
  flex-direction: column;
}

.mine-flag {
  position: absolute;
  top: -10px;
  left: var(--sp-5);
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--depth);
  color: #fff;
  font-size: var(--step--2);
  font-weight: 700;
  z-index: 1;
}
.teacher-card.is-mine { border-color: rgba(91, 60, 240, 0.5); }

/* ---- requests ---- */

.request-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface-inset);
}
.request-card.is-declined { opacity: 0.5; }

.example-tag {
  position: absolute;
  top: 12px; right: 12px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-message {
  padding-left: 12px;
  border-left: 2px solid var(--line-2);
  color: var(--text-2);
  font-size: var(--step--1);
  line-height: 1.6;
}

/* ---- checklist ---- */

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--text-3);
}
.check-row:last-of-type { border-bottom: 0; }
.check-row.is-done { color: var(--text); }
.check-mark {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  flex: none;
  background: var(--surface-3);
  color: var(--text-3);
}
.check-row.is-done .check-mark { background: var(--accent); color: var(--text-on-accent); }

/* ---- rate picker ---- */

.rate-card { display: flex; flex-direction: column; gap: var(--sp-4); }
.rate-value { display: flex; align-items: baseline; gap: 8px; }

/* ---- listing editor ---- */

.listing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-5);
  align-items: start;
}

.listing-preview {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.review-preview { max-width: 380px; }

/* ---- weekly availability grid ---- */

.week-grid-scroll {
  overflow-x: auto;
  margin-inline: calc(var(--sp-4) * -1);
  padding-inline: var(--sp-4);
  scrollbar-width: thin;
}

.week-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(52px, 1fr));
  gap: 4px;
  min-width: 460px;
}

.week-grid-corner { display: block; }

.week-grid-head {
  padding: 7px 4px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all var(--t-fast) var(--ease);
}
.week-grid-head:hover { background: var(--surface-3); color: var(--danger); }

.week-grid-hour {
  display: flex;
  align-items: center;
  font-size: var(--step--2);
  color: var(--text-3);
}

.week-cell {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-inset);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.week-cell:hover { border-color: var(--accent-line); background: var(--surface-2); }
.week-cell.is-on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px -4px var(--accent-glow);
}
.week-cell.is-on:hover { background: var(--accent-hot); }

@media (max-width: 1080px) {
  .teach-hero-grid { grid-template-columns: 1fr; }
  .listing-layout { grid-template-columns: 1fr; }
  .listing-preview { position: static; max-width: 420px; }
}

@media (max-width: 900px) {
  .club-hero { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-link { white-space: nowrap; border: 1px solid var(--line-2); }
}

/* ======================================================================
   Rewards: sparks, shop, league
   ====================================================================== */

.sparks-hero { position: relative; overflow: hidden; }
.sparks-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  flex-wrap: wrap;
}
.sparks-value {
  font-family: var(--font-display);
  font-size: var(--step-6);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
  color: var(--accent);
  text-shadow: 0 0 50px var(--accent-glow);
}
.sparks-unit { font-size: var(--step-1); color: var(--text-2); }
.sparks-tiles { min-width: min(320px, 100%); }

.shop-item { display: flex; flex-direction: column; gap: var(--sp-3); }
.shop-item.is-soon { opacity: 0.72; }
.shop-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.shop-foot { margin-top: auto; padding-top: var(--sp-2); }
.shop-note { font-size: var(--step--2); }

.spark-cost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--accent);
}
.spark-cost.is-plus { color: var(--ok); }
.spark-cost.is-minus { color: var(--text-3); }

.earn-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
}
.earn-row:last-child { border-bottom: 0; }

/* ---- league ---- */

.league-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--sp-5); }
.league-hero-glow {
  position: absolute;
  inset: -60% 30% 20% -20%;
  background: radial-gradient(50% 50% at 40% 50%, hsl(var(--hue) 85% 55% / 0.22), transparent 70%);
  filter: blur(42px);
  pointer-events: none;
}

.league-ladder { position: relative; display: flex; gap: 8px; }
.ladder-step {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.ladder-step.is-reached { background: hsl(var(--hue) 80% 55%); }
.ladder-step.is-current { box-shadow: 0 0 0 3px hsl(var(--hue) 80% 55% / 0.25); }

/* The promotion and relegation bands are drawn on the rows themselves, so the
   table shows the stakes without a legend. */
.league-row { border-left: 3px solid transparent; }
.league-row.is-up { border-left-color: var(--ok); }
.league-row.is-down { border-left-color: var(--danger); }

@media (max-width: 640px) {
  .sparks-value { font-size: var(--step-5); }
  .sparks-main { gap: var(--sp-4); }
}

/* ---- rewards on the dashboard ---- */

.rewards-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.rewards-card-glow {
  position: absolute;
  inset: auto -20% -60% 40%;
  height: 150px;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-glow), transparent 70%);
  filter: blur(34px);
  pointer-events: none;
}
.rewards-card-value {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}
.rewards-card-league {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  font-size: var(--step--1);
}
.league-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
  background: hsl(var(--hue) 80% 58%);
  box-shadow: 0 0 0 4px hsl(var(--hue) 80% 58% / 0.18);
}

/* ---- rewards pitch on the landing page ---- */

.reward-pitch { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 48px); }
.reward-pitch-glow {
  position: absolute;
  inset: -50% 50% 20% -20%;
  background: radial-gradient(50% 50% at 40% 50%, rgba(200, 255, 77, 0.16), transparent 70%);
  filter: blur(46px);
  pointer-events: none;
}
.reward-pitch-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.reward-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface-inset);
  border: 1px solid var(--line);
}
.reward-row-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  flex: none;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

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