/* ==========================================================================
   Hey Hoolo — student experience
   A calm, warm learning space. Design tokens live in tokens.css.
   Every id/class that app.js depends on is preserved.
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--hh-font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--hh-ink);
  background-color: var(--hh-canvas);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Ambient colour fields anchored to the page edges, not random blobs. */
  background-image:
    radial-gradient(1100px 620px at 82% -12%, rgba(108, 75, 244, 0.13), transparent 62%),
    radial-gradient(820px 520px at 6% 8%, rgba(15, 157, 118, 0.09), transparent 60%),
    radial-gradient(900px 600px at 50% 112%, rgba(59, 130, 246, 0.09), transparent 62%);
  background-attachment: fixed;
}

body[data-theme='dark'] {
  background-image:
    radial-gradient(1100px 620px at 82% -12%, rgba(108, 75, 244, 0.28), transparent 62%),
    radial-gradient(820px 520px at 6% 8%, rgba(15, 157, 118, 0.16), transparent 60%),
    radial-gradient(900px 600px at 50% 112%, rgba(59, 130, 246, 0.16), transparent 62%);
}

::placeholder {
  color: var(--hh-ink-muted);
  opacity: 0.72;
}

a {
  color: var(--hh-purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.w-full {
  width: 100%;
}

.muted {
  color: var(--hh-ink-muted);
  font-size: 0.82rem;
}

kbd {
  font-family: var(--hh-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--hh-ink-soft);
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.08rem 0.36rem;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   The small owl glyph, tinted by currentColor
   -------------------------------------------------------------------------- */
.hh-owl-glyph {
  width: 100%;
  height: 100%;
  display: block;
  color: inherit;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.hh-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--hh-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hh-line);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hh-header {
    background: var(--hh-surface);
  }
}

.hh-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem var(--hh-space-5);
  display: flex;
  align-items: center;
  gap: var(--hh-space-4);
}

.hh-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  min-height: var(--hh-tap);
  padding: 0.15rem 0.2rem;
  border-radius: var(--hh-radius);
}

.hh-brand__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 6px;
  color: #fff;
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-deep) 100%);
  border-radius: 12px;
  box-shadow: var(--hh-shadow-sm);
}

.hh-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hh-brand__name {
  font-family: var(--hh-font-display);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.015em;
  color: var(--hh-ink);
}

.hh-brand__tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--hh-ink-muted);
}

.hh-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  padding: 0.2rem;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-pill);
}

.hh-nav__link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--hh-radius-pill);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--hh-ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--hh-t) var(--hh-ease), color var(--hh-t) var(--hh-ease);
}

.hh-nav__link:hover {
  color: var(--hh-purple);
  background: var(--hh-purple-soft);
}

.hh-nav__link.is-active {
  background: var(--hh-surface);
  color: var(--hh-purple);
  box-shadow: var(--hh-shadow-xs);
}

.hh-header__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.hh-icon-btn {
  min-width: var(--hh-tap);
  height: var(--hh-tap);
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  color: var(--hh-ink-soft);
  font-family: var(--hh-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--hh-t-fast) var(--hh-ease), border-color var(--hh-t) var(--hh-ease),
    color var(--hh-t) var(--hh-ease), background var(--hh-t) var(--hh-ease),
    box-shadow var(--hh-t) var(--hh-ease);
}

.hh-icon-btn svg {
  width: 20px;
  height: 20px;
}

.hh-icon-btn:hover {
  transform: translateY(-1px);
  color: var(--hh-purple);
  border-color: var(--hh-line-strong);
  background: var(--hh-purple-soft);
  box-shadow: var(--hh-shadow-sm);
}

.hh-icon-btn--wide {
  min-width: auto;
  padding: 0 0.75rem;
}

.hh-icon-btn--menu {
  display: none;
}

.hh-mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem var(--hh-space-5) 0.8rem;
  border-top: 1px solid var(--hh-line);
  background: var(--hh-surface);
}

.hh-mobile-nav[hidden] {
  display: none;
}

.hh-mobile-nav__link {
  min-height: var(--hh-tap);
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  border-radius: var(--hh-radius);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--hh-ink-soft);
  text-decoration: none;
}

.hh-mobile-nav__link.is-active {
  color: var(--hh-purple);
  background: var(--hh-purple-soft);
}

/* ==========================================================================
   PAGE FRAME
   ========================================================================== */
.hh-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--hh-space-6) var(--hh-space-5) var(--hh-space-12);
  display: flex;
  flex-direction: column;
  gap: var(--hh-space-8);
}

.hh-rise {
  animation: hh-rise var(--hh-t-slow) var(--hh-ease-out) both;
  animation-delay: var(--hh-rise-delay, 0ms);
}

@keyframes hh-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   HERO — asymmetric on desktop, owl-first on mobile
   ========================================================================== */
.hh-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: var(--hh-space-8);
  padding: var(--hh-space-6) 0 var(--hh-space-2);
}

.hh-eyebrow {
  display: inline-block;
  margin-bottom: var(--hh-space-3);
  padding: 0.28rem 0.7rem;
  background: var(--hh-purple-soft);
  border: 1px solid color-mix(in srgb, var(--hh-purple) 22%, transparent);
  border-radius: var(--hh-radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hh-purple);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hh-eyebrow {
    border-color: var(--hh-line-strong);
  }
}

.hh-hero__title {
  font-family: var(--hh-font-display);
  font-weight: 900;
  font-size: clamp(2.3rem, 5.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
  color: var(--hh-ink);
  margin-bottom: var(--hh-space-4);
}

.hh-underline {
  position: relative;
  display: inline-block;
  color: var(--hh-purple);
  white-space: nowrap;
}

.hh-underline__stroke {
  position: absolute;
  left: -0.02em;
  right: -0.02em;
  bottom: -0.02em;
  width: calc(100% + 0.04em);
  height: 0.3em;
  color: var(--hh-purple);
  opacity: 0.42;
  pointer-events: none;
}

.hh-hero__lede {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.65;
  color: var(--hh-ink-soft);
  max-width: 46ch;
  margin-bottom: var(--hh-space-6);
}

.hh-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: var(--hh-space-6);
}

.hh-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.15rem;
}

.hh-trust__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hh-ink-soft);
}

.hh-trust__item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--hh-mint);
}

/* ---------- Owl companion ---------- */
.hh-hero__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hh-owl-stage {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hh-owl-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(108, 75, 244, 0.24), rgba(108, 75, 244, 0) 68%);
  animation: hh-breathe 7s var(--hh-ease) infinite;
}

.hh-owl-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed rgba(108, 75, 244, 0.3);
}

.hh-owl-orbit--one {
  inset: 4%;
}

.hh-owl-orbit--two {
  inset: 17%;
  border-style: solid;
  border-color: rgba(15, 157, 118, 0.24);
}

/*
  The approved Hey Hoolo owl (owl.png) is an opaque illustration with a warm
  cream background. It is masked into a cream medallion and multiplied, so the
  square source edges are never visible against the page.

  The medallion stays warm cream in the dark theme too: owl.png is opaque, so
  the image's own background always covers the medallion. Keeping the disc warm
  makes the companion read as one deliberate, bright focal point on the dark
  canvas rather than an accidental light patch.
*/
.hh-owl-medallion {
  position: relative;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #fdf3e3 0%, #f6e3cd 62%, #efd8bd 100%);
  box-shadow: var(--hh-shadow-md);
  animation: hh-float 6.5s var(--hh-ease) infinite;
}

.hh-owl-figure {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  user-select: none;
  -webkit-user-drag: none;
}

body[data-theme='dark'] .hh-owl-medallion {
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}

.hh-owl-spark {
  position: absolute;
  color: var(--hh-purple);
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.7;
}

.hh-owl-spark--one {
  top: 12%;
  right: 8%;
}

.hh-owl-spark--two {
  bottom: 16%;
  left: 6%;
  color: var(--hh-mint);
  font-size: 0.9rem;
}

.hh-note {
  position: absolute;
  padding: 0.5rem 0.85rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-md);
  box-shadow: var(--hh-shadow-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hh-ink-soft);
  white-space: nowrap;
}

.hh-note--left {
  left: 0;
  bottom: 16%;
  border-bottom-left-radius: 6px;
  transform: rotate(-2deg);
}

.hh-note--right {
  right: 0;
  top: 14%;
  border-bottom-right-radius: 6px;
  transform: rotate(2deg);
  color: var(--hh-mint-strong);
}

/* ==========================================================================
   CHAT CARD
   ========================================================================== */
.hh-chat-card {
  position: relative;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  box-shadow: var(--hh-shadow-md);
  overflow: hidden;
}

body[data-theme='dark'] .hh-chat-card {
  background: var(--hh-surface-raised);
}

/* ---------- 1. Top bar ---------- */
.hh-chat-top {
  display: flex;
  align-items: center;
  gap: var(--hh-space-4);
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  background: var(--hh-surface-sunk);
  border-bottom: 1px solid var(--hh-line);
  font-size: 0.82rem;
}

.hh-chat-top__left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hh-chat-top__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--hh-ink);
}

/*
  app.js only ever adds `.disconnected`, so the resting state must read as
  "connected and healthy" (green). This is the chat's live status dot.
*/
.status-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--hh-mint);
  box-shadow: 0 0 0 4px var(--hh-mint-soft);
}

.status-dot.active,
.active .status-dot {
  background: var(--hh-mint);
  box-shadow: 0 0 0 4px var(--hh-mint-soft);
}

/* Dropped socket. */
.disconnected .status-dot,
.status-dot.disconnected {
  background: var(--hh-red);
  box-shadow: 0 0 0 4px var(--hh-red-soft);
  animation: hh-pulse 1.6s var(--hh-ease) infinite;
}

.hh-shield {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.62rem;
  background: var(--hh-mint-soft);
  border-radius: var(--hh-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hh-mint-strong);
  white-space: nowrap;
}

.hh-shield svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.compliance-bar {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.compliance-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.compliance-label {
  color: var(--hh-ink-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

/* Status pills — app.js swaps status-success / status-pending /
   status-warning on these, so all four states are defined. */
.status-pill {
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: var(--hh-radius-pill);
  white-space: nowrap;
}

.status-success {
  background: var(--hh-mint-soft);
  color: var(--hh-mint-strong);
}

.status-pending {
  background: var(--hh-amber-soft);
  color: var(--hh-amber);
}

.status-warning {
  background: var(--hh-amber-soft);
  color: var(--hh-amber);
}

.status-error {
  background: var(--hh-red-soft);
  color: var(--hh-red);
}

.training-progress {
  flex: 1 0 100%;
  min-width: 12rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--hh-ink-muted);
  margin-bottom: 0.3rem;
}

.progress-bar {
  height: 7px;
  background: var(--hh-line);
  border-radius: var(--hh-radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--hh-radius-pill);
  background: linear-gradient(90deg, var(--hh-purple), var(--hh-blue-bright));
  transition: width 300ms var(--hh-ease);
}

/* ---------- Overflow menu ---------- */
.hh-overflow {
  position: relative;
}

.hh-overflow__trigger {
  width: var(--hh-tap);
  height: var(--hh-tap);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hh-radius);
  border: 1px solid var(--hh-line);
  background: var(--hh-surface);
  color: var(--hh-ink-soft);
  cursor: pointer;
  list-style: none;
  transition: transform var(--hh-t-fast) var(--hh-ease), color var(--hh-t) var(--hh-ease),
    border-color var(--hh-t) var(--hh-ease);
}

.hh-overflow__trigger::-webkit-details-marker {
  display: none;
}

.hh-overflow__trigger:hover {
  color: var(--hh-purple);
  border-color: var(--hh-line-strong);
  transform: translateY(-1px);
}

.hh-overflow__trigger svg {
  width: 18px;
  height: 18px;
}

.hh-overflow__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  min-width: 208px;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  box-shadow: var(--hh-shadow-md);
}

.hh-overflow__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.4rem 0.65rem;
  border: none;
  border-radius: var(--hh-radius-sm);
  background: transparent;
  font-family: var(--hh-font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hh-ink-soft);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--hh-t-fast) var(--hh-ease), color var(--hh-t-fast) var(--hh-ease);
}

.hh-overflow__item:hover {
  background: var(--hh-purple-soft);
  color: var(--hh-purple);
}

/* ---------- 2. Conversation ---------- */
.messages-container {
  height: min(54vh, 500px);
  min-height: 300px;
  overflow-y: auto;
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  scrollbar-width: thin;
  background:
    radial-gradient(520px 320px at 12% 0%, rgba(108, 75, 244, 0.05), transparent 70%),
    var(--hh-surface);
}

.welcome-message {
  margin: auto;
  max-width: 44ch;
  text-align: center;
  padding: 1.6rem 1rem;
  color: var(--hh-ink-muted);
}

.welcome-icon {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 0.7rem;
  padding: 9px;
  color: #fff;
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-deep) 100%);
  border-radius: 18px;
  box-shadow: var(--hh-shadow-sm);
}

.welcome-message h3 {
  font-family: var(--hh-font-display);
  color: var(--hh-ink);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.welcome-message p {
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 42ch;
  margin: 0 auto;
}

/* ---------- Messages (rendered by app.js) ---------- */
.message {
  display: flex;
  gap: 0.6rem;
  max-width: min(82%, 720px);
  animation: msgIn 220ms var(--hh-ease-out);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  color: var(--hh-ink-soft);
}

/* Hoolo: purple disc with a white owl glyph. The 🤖 fallback glyph that
   app.js sets as textContent is hidden visually, not removed. */
.message.ai .message-avatar {
  font-size: 0;
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-deep) 100%);
  border-color: transparent;
  box-shadow: var(--hh-shadow-xs);
  background-image: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-deep) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M10 14.5 13.6 4.6 20.4 10.9Zm28 0L34.4 4.6 27.6 10.9ZM24 8.2c9.4 0 17 6.8 17 15.8 0 3.2-.9 6.1-2.4 8.4 1 1 1.6 2 1.6 2.6 0 1.2-1.2 2-2.7 2-.6.1-1.1-.1-1.6-.3A17 17 0 0 1 24 40.8c-4.1 0-7.8-1.4-10.9-3.7-.5.2-1 .3-1.6.3-1.5 0-2.7-.8-2.7-2 0-.6.6-1.6 1.6-2.6A15.5 15.5 0 0 1 7 24C7 15 14.6 8.2 24 8.2Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 4px, center;
  background-size: cover, 24px 24px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.message.user .message-header {
  flex-direction: row-reverse;
}

.message-sender {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--hh-ink-muted);
}

.message-time {
  font-size: 0.7rem;
  color: var(--hh-ink-muted);
  opacity: 0.75;
}

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--hh-radius-md);
  font-size: 0.95rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

/* Tone AND shape differ, so this never relies on colour alone. */
.message.user .message-bubble {
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-strong) 100%);
  color: var(--hh-ink-on-accent);
  border-bottom-right-radius: 6px;
  box-shadow: var(--hh-shadow-sm);
}

.message.ai .message-bubble {
  background: var(--hh-surface-raised);
  color: var(--hh-ink);
  border: 1px solid var(--hh-line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--hh-shadow-xs);
}

.message-meta {
  margin-top: 0.45rem;
  font-size: 0.72rem;
}

.message-sources {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--hh-line);
  font-size: 0.74rem;
  opacity: 0.85;
}

.moderation-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: var(--hh-radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
}

.moderation-badge.allowed {
  background: var(--hh-mint-soft);
  color: var(--hh-mint-strong);
}

.moderation-badge.review {
  background: var(--hh-amber-soft);
  color: var(--hh-amber);
}

.moderation-badge.blocked {
  background: var(--hh-red-soft);
  color: var(--hh-red);
}

.message.user .moderation-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---------- Markdown in messages ---------- */
.message-bubble p {
  margin: 0.5em 0;
}

.message-bubble p:first-child {
  margin-top: 0;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  font-weight: 700;
}

.message-bubble em {
  font-style: italic;
}

.message-bubble code {
  font-family: var(--hh-font-mono);
  font-size: 0.86em;
  background: var(--hh-surface-sunk);
  padding: 0.14em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--hh-line);
}

.message-bubble pre {
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-sm);
  padding: 0.75rem;
  overflow-x: auto;
  font-family: var(--hh-font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.message-bubble pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
}

.message-bubble ul,
.message-bubble ol {
  margin: 0.5em 0;
  padding-left: 1.4rem;
}

.message-bubble li {
  margin: 0.25em 0;
}

.message-bubble blockquote {
  border-left: 3px solid var(--hh-purple);
  padding-left: 0.8rem;
  margin: 0.5em 0;
  color: var(--hh-ink-muted);
  font-style: italic;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  margin: 0.7em 0 0.35em;
  font-family: var(--hh-font-display);
  font-weight: 800;
  line-height: 1.3;
}

.message-bubble h1 {
  font-size: 1.28em;
}

.message-bubble h2 {
  font-size: 1.16em;
}

.message-bubble h3 {
  font-size: 1.06em;
}

.message-bubble hr {
  border: none;
  border-top: 1px solid var(--hh-line);
  margin: 0.85em 0;
}

.message-bubble a {
  color: var(--hh-purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The user bubble is a purple gradient, so the default accent link colour
   would sit at very low contrast on it. Inherit the bubble's own foreground
   and lean on the underline to stay distinguishable. */
.message.user .message-bubble a {
  color: inherit;
  text-decoration-thickness: 2px;
}

.message-bubble a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 3px;
}

.message-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: var(--hh-radius-sm);
  border: 1px solid var(--hh-line);
  margin: 0.35em 0;
}

/* Tables are common in comparison/worked-example answers. Scroll horizontally
   rather than forcing the bubble to overflow on narrow screens. */
.message-bubble table {
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 0.92em;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid var(--hh-line);
  padding: 0.35em 0.6em;
  text-align: left;
}

.message-bubble th {
  background: var(--hh-surface-sunk);
  font-weight: 700;
}

.message-bubble del {
  opacity: 0.75;
}

/* ---------- 3. Starter prompts ---------- */
.hh-starters {
  padding: 0.9rem 1.1rem 0.2rem;
  background: var(--hh-surface);
  border-top: 1px solid var(--hh-line);
}

.hh-starters__label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--hh-ink-muted);
  margin-bottom: 0.55rem;
}

.hh-starters__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.starter-prompt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.6rem 0.8rem;
  min-height: var(--hh-tap);
  text-align: left;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius);
  font-family: var(--hh-font-ui);
  cursor: pointer;
  transition: transform var(--hh-t-fast) var(--hh-ease), border-color var(--hh-t) var(--hh-ease),
    box-shadow var(--hh-t) var(--hh-ease), background var(--hh-t) var(--hh-ease);
}

.starter-prompt:hover {
  transform: translateY(-2px);
  background: var(--hh-purple-soft);
  border-color: var(--hh-purple);
  box-shadow: var(--hh-shadow-sm);
}

.starter-prompt__name {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--hh-purple);
}

.starter-prompt__hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--hh-ink-muted);
}

/* ---------- 4. Composer ---------- */
.input-container {
  padding: 0.9rem 1.1rem 1rem;
  background: var(--hh-surface);
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hh-identity-row {
  display: flex;
}

.email-input {
  width: 100%;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  padding: 0.5rem 0.8rem;
  color: var(--hh-ink);
  font-family: var(--hh-font-ui);
  font-size: 0.83rem;
  transition: border-color var(--hh-t) var(--hh-ease), box-shadow var(--hh-t) var(--hh-ease);
}

.message-input-wrapper {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  min-width: 0;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius-md);
  padding: 0.8rem 1rem;
  resize: none;
  color: var(--hh-ink);
  font-family: var(--hh-font-ui);
  font-size: 0.97rem;
  line-height: 1.5;
  min-height: var(--hh-tap);
  max-height: 170px;
  transition: border-color var(--hh-t) var(--hh-ease), box-shadow var(--hh-t) var(--hh-ease),
    background var(--hh-t) var(--hh-ease);
}

.email-input:focus,
.message-input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--hh-purple);
  background: var(--hh-surface);
  box-shadow: 0 0 0 4px var(--hh-purple-ring);
}

.hh-composer-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--hh-ink-muted);
}

.hh-key-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--hh-font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--hh-radius);
  padding: 0.7rem 1.15rem;
  min-height: var(--hh-tap);
  white-space: nowrap;
  transition: transform var(--hh-t-fast) var(--hh-ease), box-shadow var(--hh-t) var(--hh-ease),
    background var(--hh-t) var(--hh-ease), border-color var(--hh-t) var(--hh-ease),
    filter var(--hh-t) var(--hh-ease);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-strong) 100%);
  color: var(--hh-ink-on-accent);
  box-shadow: var(--hh-shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--hh-shadow);
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--hh-surface);
  border-color: var(--hh-line-strong);
  color: var(--hh-ink-soft);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--hh-purple-soft);
  border-color: var(--hh-purple);
  color: var(--hh-purple);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  min-height: 34px;
  font-size: 0.78rem;
  border-radius: var(--hh-radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-send {
  flex-shrink: 0;
  border-radius: var(--hh-radius-md);
  padding: 0.7rem 1.25rem;
  min-height: var(--hh-tap);
}

.btn-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.btn-close {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--hh-ink-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.4rem;
  border-radius: var(--hh-radius-sm);
  transition: background var(--hh-t-fast) var(--hh-ease), color var(--hh-t-fast) var(--hh-ease);
}

.btn-close:hover {
  color: var(--hh-ink);
  background: var(--hh-surface-sunk);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--hh-ink-muted);
  font-family: var(--hh-font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  min-height: 36px;
  border-radius: var(--hh-radius-sm);
}

.btn-text:hover {
  color: var(--hh-purple);
}

/* Hero buttons (larger, more expressive) */
.hh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--hh-tap);
  padding: 0.75rem 1.35rem;
  border-radius: var(--hh-radius-pill);
  border: 1px solid transparent;
  font-family: var(--hh-font-ui);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform var(--hh-t-fast) var(--hh-ease), box-shadow var(--hh-t) var(--hh-ease),
    background var(--hh-t) var(--hh-ease), border-color var(--hh-t) var(--hh-ease),
    color var(--hh-t) var(--hh-ease);
}

.hh-btn:hover {
  transform: translateY(-2px);
}

.hh-btn:active {
  transform: none;
}

.hh-btn--lg {
  min-height: 50px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.hh-btn--primary {
  background: linear-gradient(140deg, var(--hh-purple) 0%, var(--hh-purple-strong) 100%);
  color: var(--hh-ink-on-accent);
  box-shadow: var(--hh-shadow);
}

.hh-btn--primary:hover {
  box-shadow: var(--hh-shadow-md);
  filter: brightness(1.06);
}

.hh-btn--ghost {
  background: var(--hh-surface);
  border-color: var(--hh-line-strong);
  color: var(--hh-purple);
  box-shadow: var(--hh-shadow-xs);
}

.hh-btn--ghost:hover {
  background: var(--hh-purple-soft);
  border-color: var(--hh-purple);
  box-shadow: var(--hh-shadow-sm);
}

.hh-btn__icon {
  width: 19px;
  height: 19px;
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hh-ink-soft);
}

.form-control {
  width: 100%;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius);
  padding: 0.65rem 0.8rem;
  min-height: var(--hh-tap);
  color: var(--hh-ink);
  font-family: var(--hh-font-ui);
  font-size: 0.88rem;
  transition: border-color var(--hh-t) var(--hh-ease), box-shadow var(--hh-t) var(--hh-ease);
}

select.form-control {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b6690' stroke-width='1.8' stroke-linecap='round' d='m1.5 1.5 4.5 5 4.5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.1rem;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 600 !important;
  color: var(--hh-ink) !important;
  margin-bottom: 0 !important;
}

.checkbox-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--hh-purple);
  flex-shrink: 0;
}

/* ==========================================================================
   DEMO BANNER
   ========================================================================== */
.demo-banner {
  background: linear-gradient(135deg, rgba(108, 75, 244, 0.12), rgba(59, 130, 246, 0.12));
  border: 1px solid color-mix(in srgb, var(--hh-purple) 30%, transparent);
  border-radius: var(--hh-radius-md);
  padding: 0.85rem 1.1rem;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .demo-banner {
    border-color: var(--hh-line-strong);
  }
}

.demo-banner-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.demo-banner-icon {
  font-size: 1.3rem;
}

.demo-banner-text {
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
}

.demo-banner-text span {
  color: var(--hh-ink-muted);
  font-size: 0.8rem;
}

.demo-banner-stats {
  margin-left: auto;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.demo-badge {
  background: var(--hh-purple);
  color: #fff;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: var(--hh-radius-pill);
  white-space: nowrap;
}

/* ==========================================================================
   FOR GROWN-UPS
   ========================================================================== */
.hh-grownups__disclosure {
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  box-shadow: var(--hh-shadow-sm);
  overflow: hidden;
}

.hh-grownups__summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 72px;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
  transition: background var(--hh-t) var(--hh-ease);
}

.hh-grownups__summary::-webkit-details-marker {
  display: none;
}

.hh-grownups__summary:hover {
  background: var(--hh-surface-sunk);
}

.hh-grownups__badge {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hh-blue-soft);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  font-size: 1.15rem;
}

.hh-grownups__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hh-grownups__title {
  font-family: var(--hh-font-display);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--hh-ink);
  letter-spacing: -0.01em;
}

.hh-grownups__sub {
  font-size: 0.8rem;
  color: var(--hh-ink-muted);
}

.hh-grownups__chevron {
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--hh-ink-muted);
  transition: transform var(--hh-t) var(--hh-ease);
}

.hh-grownups__disclosure[open] .hh-grownups__chevron {
  transform: rotate(180deg);
}

.hh-grownups__body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--hh-line);
}

.hh-grownups__body > .dashboard-container {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 1.1rem 0 0;
}

/* ==========================================================================
   DASHBOARD (grown-up tools)
   ========================================================================== */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.dashboard-header h2 {
  font-family: var(--hh-font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.012em;
}

.dashboard-header p {
  color: var(--hh-ink-muted);
  font-size: 0.84rem;
  margin-top: 0.2rem;
}

.dashboard-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-md);
  padding: 1.05rem;
  box-shadow: var(--hh-shadow-xs);
}

.dashboard-card h3 {
  font-family: var(--hh-font-display);
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  color: var(--hh-ink);
}

.dashboard-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.7rem 0;
}

.dashboard-status {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--hh-ink-muted);
  margin-top: 0.5rem;
}

.dashboard-list {
  list-style: none;
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.81rem;
}

.dashboard-list li {
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-sm);
  padding: 0.45rem 0.65rem;
  color: var(--hh-ink-soft);
  overflow-wrap: anywhere;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.stat-item {
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--hh-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.stat-value {
  font-family: var(--hh-font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hh-ink);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal,
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(30, 26, 69, 0.44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden],
.login-modal[hidden] {
  display: none;
}

.modal-content,
.login-modal-content {
  position: relative;
  width: 100%;
  max-width: 470px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  box-shadow: var(--hh-shadow-lg);
  animation: modalIn var(--hh-t-slow) var(--hh-ease-out);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h2,
.login-modal-content h2 {
  font-family: var(--hh-font-display);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.login-modal-content p {
  color: var(--hh-ink-muted);
  font-size: 0.88rem;
  margin: 0.4rem 0 1.1rem;
}

.modal-body {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modal-body ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
  color: var(--hh-ink-soft);
  font-size: 0.86rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}

.hh-help-list {
  list-style: none;
  margin: 0.7rem 0 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hh-help-list li {
  padding: 0.7rem 0.85rem;
  background: var(--hh-surface-sunk);
  border: 1px solid var(--hh-line);
  border-left: 3px solid var(--hh-purple);
  border-radius: var(--hh-radius);
  color: var(--hh-ink-soft);
  font-size: 0.87rem;
}

.hh-help-foot {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--hh-line);
  color: var(--hh-ink-muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

#loginClose {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  font-size: 1.4rem;
  min-width: 36px;
}

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(370px, calc(100vw - 2.4rem));
}

.toast {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.86rem;
}

.toast-content {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-left: 4px solid var(--hh-blue);
  border-radius: var(--hh-radius);
  box-shadow: var(--hh-shadow-md);
  animation: msgIn 220ms var(--hh-ease-out);
}

.toast.success .toast-content {
  border-left-color: var(--hh-mint);
}

.toast.error .toast-content {
  border-left-color: var(--hh-red);
}

.toast.info .toast-content {
  border-left-color: var(--hh-blue);
}

.toast-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.toast-title {
  font-weight: 700;
  font-size: 0.83rem;
  color: var(--hh-ink);
}

.toast-message {
  color: var(--hh-ink-muted);
  font-size: 0.81rem;
  margin-top: 0.1rem;
}

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(30, 26, 69, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.6rem 2rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  box-shadow: var(--hh-shadow-lg);
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--hh-line);
  border-top-color: var(--hh-purple);
  animation: hh-spin 900ms linear infinite;
}

.loading-status {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--hh-ink);
}

.loading-progress-container {
  width: 220px;
  height: 7px;
  background: var(--hh-line);
  border-radius: var(--hh-radius-pill);
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--hh-radius-pill);
  background: linear-gradient(90deg, var(--hh-purple), var(--hh-blue-bright));
  transition: width 300ms var(--hh-ease);
}

/* ==========================================================================
   AI TRANSPARENCY NOTICE (first use — AI-03)
   Lightweight strip; not a card stack. Sits above the cookie banner.
   ========================================================================== */
.ai-notice {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 3001;
  max-width: min(360px, calc(100vw - 2.4rem));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-md);
  box-shadow: var(--hh-shadow-lg);
  font-size: 0.84rem;
}

.ai-notice[hidden] {
  display: none;
}

.ai-notice-title {
  margin: 0;
  font-weight: 600;
  color: var(--hh-ink);
  line-height: 1.35;
}

.ai-notice-text {
  margin: 0;
  color: var(--hh-ink-soft);
  line-height: 1.55;
}

.ai-notice-text a {
  color: var(--hh-purple);
}

.ai-notice-actions {
  display: flex;
  gap: 0.5rem;
}

body:has(#ai-notice:not([hidden])) .hh-main {
  padding-bottom: calc(var(--hh-space-12) + 140px);
}

/* ==========================================================================
   COOKIE CONSENT
   ========================================================================== */
.cookie-consent {
  position: fixed;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 3000;
  max-width: min(430px, calc(100vw - 2.4rem));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--hh-surface);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-md);
  box-shadow: var(--hh-shadow-lg);
  font-size: 0.82rem;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-text p {
  color: var(--hh-ink-soft);
  line-height: 1.6;
}

.cookie-consent-text a {
  color: var(--hh-purple);
}

.cookie-consent-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* While the consent banner is on screen it is a fixed overlay, so reserve room
   for it. This keeps the composer and the grown-up tools reachable instead of
   trapping them underneath the banner. */
body:has(#cookie-consent:not([hidden])) .hh-main {
  padding-bottom: calc(var(--hh-space-12) + 170px);
}

body:has(#cookie-consent:not([hidden])) .hh-footer {
  padding-bottom: 0.6rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.hh-footer {
  border-top: 1px solid var(--hh-line);
  background: color-mix(in srgb, var(--hh-surface) 60%, transparent);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hh-footer {
    background: var(--hh-surface);
  }
}

.hh-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.4rem var(--hh-space-5);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--hh-ink-muted);
}

.hh-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--hh-font-display);
  font-weight: 800;
  color: var(--hh-ink-soft);
}

.hh-footer__links {
  display: flex;
  gap: 1rem;
}

.hh-footer__links a {
  color: var(--hh-ink-muted);
  text-decoration: none;
}

.hh-footer__links a:hover {
  color: var(--hh-purple);
  text-decoration: underline;
}

.hh-footer__note {
  margin-left: auto;
}

/* ==========================================================================
   RESPONSIVE — 1280 / 768 / 390
   ========================================================================== */
@media (max-width: 1080px) {
  .hh-hero {
    gap: var(--hh-space-6);
  }

  .hh-note--left {
    left: -0.5rem;
  }

  .hh-note--right {
    right: -0.5rem;
  }
}

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

  .hh-icon-btn--menu {
    display: inline-flex;
  }

  .hh-mobile-nav {
    display: flex;
  }

  .hh-main {
    padding: var(--hh-space-5) var(--hh-space-4) var(--hh-space-10);
    gap: var(--hh-space-6);
  }

  /* Owl above the hero copy on small screens. */
  .hh-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hh-space-5);
    padding-top: var(--hh-space-4);
  }

  .hh-hero__art {
    order: -1;
  }

  .hh-owl-stage {
    width: min(72%, 280px);
  }

  .hh-hero__lede {
    margin-bottom: var(--hh-space-5);
  }

  .hh-note--left {
    left: 4%;
    bottom: 8%;
  }

  .hh-note--right {
    right: 4%;
    top: 6%;
  }

  .hh-chat-top__right {
    margin-left: 0;
    width: 100%;
  }

  .hh-starters__row {
    grid-template-columns: 1fr;
  }

  .starter-prompt {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .hh-header__inner {
    padding: 0.5rem var(--hh-space-4);
  }

  .hh-brand__tag {
    display: none;
  }

  .hh-icon-btn--wide {
    padding: 0 0.55rem;
    font-size: 0;
    gap: 0;
  }

  .hh-icon-btn--wide::before {
    content: '🌗';
    font-size: 1rem;
  }

  .hh-main {
    padding: var(--hh-space-4) var(--hh-space-4) var(--hh-space-8);
  }

  .hh-hero__title {
    font-size: clamp(2rem, 9.5vw, 2.6rem);
  }

  .hh-hero__cta {
    gap: 0.5rem;
  }

  .hh-btn--lg {
    width: 100%;
  }

  .hh-trust {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hh-note {
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
  }

  .messages-container {
    height: 58vh;
    min-height: 260px;
    padding: 1rem 0.9rem;
  }

  .message {
    max-width: 94%;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
  }

  .message-bubble {
    font-size: 0.92rem;
    padding: 0.65rem 0.85rem;
  }

  .hh-chat-top,
  .hh-starters,
  .input-container,
  .hh-grownups__body {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hh-chat-top__right {
    gap: 0.55rem;
  }

  .compliance-bar {
    gap: 0.55rem;
  }

  .message-input-wrapper {
    gap: 0.45rem;
  }

  .btn-send {
    padding: 0.7rem 0.95rem;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .dashboard-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .modal-content,
  .login-modal-content {
    padding: 1.2rem;
  }

  .toast-container {
    left: 0.85rem;
    right: 0.85rem;
    max-width: none;
  }

  .ai-notice {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
    max-width: none;
  }

  .cookie-consent {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
    max-width: none;
  }

  .cookie-consent-actions .btn {
    flex: 1;
  }

  .hh-footer__note {
    margin-left: 0;
  }
}

/* ==========================================================================
   HOOLO COMPANION STAGE — replaces hero + chat-card on student dashboard
   Desktop: mascot left + chat right. Mobile: segmented buddy/chat toggle.
   ========================================================================== */

/* --- Stage Container --- */
.hh-hoolo-stage {
  background: var(--hh-warm-canvas);
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Desktop layout (md+) */
.hh-hoolo-desktop {
  display: none;
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3.5rem;
  padding: 2rem 3rem;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 768px) {
  .hh-hoolo-desktop { display: flex; }
  .hh-hoolo-mobile { display: none !important; }
}

/* Ambient warm halo behind mascot on desktop */
.hh-hoolo-desktop::before {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: var(--hh-warm-halo);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* Mobile layout (< md) */
.hh-hoolo-mobile {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem 2rem;
  position: relative;
}

/* --- Top Bar Controls (replay wake-up, voice picker, mute) --- */
.hh-hoolo-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  background: var(--hh-warm-surface);
  border-bottom: 1px solid var(--hh-warm-border);
}

.hh-hoolo-topbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--hh-warm-canvas);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius);
  color: var(--hh-warm-ink);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--hh-t-fast) var(--hh-ease);
}

.hh-hoolo-topbar__btn:hover {
  background: var(--hh-warm-sunk);
}

.hh-hoolo-topbar__btn:active {
  transform: scale(0.95);
}

.hh-hoolo-topbar__btn--active {
  background: var(--hh-warm-ink);
  color: var(--hh-warm-surface);
  border-color: var(--hh-warm-ink);
}

.hh-hoolo-topbar__icon {
  font-size: 1rem;
}

/* --- Mascot Wrapper --- */
.hh-hoolo-mascot-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.15s ease-out;
}

.hh-hoolo-mascot-area__hint {
  font-size: 0.6875rem;
  color: var(--hh-warm-ink-soft);
  font-weight: 500;
  margin-top: -0.25rem;
  text-align: center;
}

/* Mascot wrapper (created by HooloMascot.create) */
.hoolo-mascot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18rem;
  height: 18rem;
  transition: transform 0.15s ease-out;
  user-select: none;
}

@media (min-width: 640px) {
  .hoolo-mascot-wrap { width: 22rem; height: 22rem; }
}

@media (min-width: 768px) {
  .hoolo-mascot-wrap { width: 26rem; height: 26rem; }
}

.hoolo-mascot-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 16px 32px rgba(62, 39, 35, 0.22));
  transition: filter 0.3s ease;
}

.hoolo-mascot-svg.hoolo-glow {
  filter: drop-shadow(0 0 28px rgba(253, 224, 71, 0.7));
}

/* Zzz sleeping indicator */
.hoolo-zzz {
  position: absolute;
  top: -0.5rem;
  right: 3rem;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  z-index: 20;
  pointer-events: none;
  animation: hoolo-zzz-float 2s ease-in-out infinite;
}

.hoolo-zzz span {
  color: var(--hh-warm-ink-muted);
  font-weight: 800;
  opacity: 0.8;
}

.hoolo-zzz span:nth-child(1) { font-size: 0.85rem; }
.hoolo-zzz span:nth-child(2) { font-size: 1rem; transform: translateY(-2px); }
.hoolo-zzz span:nth-child(3) { font-size: 1.125rem; transform: translateY(-4px); }

/* --- Chat Area Wrapper --- */
.hh-hoolo-chat-area {
  width: 100%;
  max-width: 36rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HOOLO CHAT PANEL
   ========================================================================== */

.hoolo-chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--hh-warm-sunk);
  border-radius: var(--hh-radius-lg);
  border: 2px solid var(--hh-warm-border);
  box-shadow: var(--hh-shadow);
  overflow: hidden;
  height: 34rem;
}

@media (min-width: 640px) {
  .hoolo-chat-panel { height: 37rem; }
}

@media (min-width: 768px) {
  .hoolo-chat-panel { height: 38rem; }
}

/* Chat Header */
.hoolo-chat-header {
  height: 4rem;
  background: var(--hh-warm-surface-raised);
  border-bottom: 1px solid var(--hh-warm-border);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(30, 26, 69, 0.04);
}

.hoolo-chat-header__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hoolo-chat-avatar {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--hh-warm-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--hh-shadow-xs);
}

.hoolo-chat-avatar__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid white;
}

.hoolo-chat-header__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--hh-warm-ink);
  line-height: 1.2;
}

.hoolo-chat-header__subtitle {
  font-size: 0.6875rem;
  color: var(--hh-warm-ink-soft);
  line-height: 1;
}

.hoolo-chat-status--thinking {
  color: var(--hh-warm-accent-strong) !important;
  font-weight: 700;
  animation: hh-pulse 1.5s ease-in-out infinite;
}

.hoolo-chat-header__badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--hh-warm-canvas);
  border-radius: var(--hh-radius-pill);
  border: 1px solid var(--hh-warm-border-strong);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--hh-warm-accent-strong);
}

/* Messages Area */
.hoolo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: radial-gradient(ellipse at center, var(--hh-warm-canvas) 0%, var(--hh-warm-sunk) 100%);
}

/* Message Bubbles */
.hoolo-msg {
  display: flex;
  width: 100%;
  animation: hoolo-fade-in-up 0.15s ease-out;
}

.hoolo-msg--user { justify-content: flex-end; }
.hoolo-msg--hoolo { justify-content: flex-start; }

.hoolo-msg__bubble {
  position: relative;
  max-width: 82%;
  border-radius: var(--hh-radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  box-shadow: var(--hh-shadow-xs);
}

@media (min-width: 640px) {
  .hoolo-msg__bubble { max-width: 76%; }
}

.hoolo-msg--user .hoolo-msg__bubble {
  background: var(--hh-warm-user-bubble);
  color: var(--hh-warm-ink);
  border: 1px solid var(--hh-warm-user-border);
  border-top-right-radius: 2px;
}

.hoolo-msg--hoolo .hoolo-msg__bubble {
  background: var(--hh-warm-hoolo-bubble);
  color: var(--hh-warm-ink);
  border: 1px solid var(--hh-warm-hoolo-border);
  border-top-left-radius: 2px;
}

.hoolo-msg__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.hoolo-msg__sender {
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--hh-warm-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hoolo-msg__speak-btn {
  padding: 0.25rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--hh-warm-ink-soft);
  transition: background var(--hh-t-fast) var(--hh-ease);
}

.hoolo-msg__speak-btn:hover {
  background: var(--hh-warm-canvas);
  color: var(--hh-warm-ink);
}

.hoolo-msg__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.hoolo-msg__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.5625rem;
  color: var(--hh-warm-ink-soft);
}

.hoolo-msg__check {
  color: var(--hh-warm-check);
}

/* Quick Prompts Row */
.hoolo-chat-quick {
  background: var(--hh-warm-surface-raised);
  padding: 0.5rem 0.75rem 0.25rem;
  border-top: 1px solid var(--hh-warm-border);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.hoolo-chat-quick::-webkit-scrollbar { display: none; }

.hoolo-chat-quick__label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--hh-warm-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.hoolo-chat-quick__btn {
  padding: 0.25rem 0.625rem;
  background: var(--hh-warm-hoolo-bubble);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hh-warm-ink);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--hh-t-fast) var(--hh-ease),
              border-color var(--hh-t-fast) var(--hh-ease);
  box-shadow: var(--hh-shadow-xs);
}

.hoolo-chat-quick__btn:hover {
  background: var(--hh-warm-canvas);
  border-color: var(--hh-warm-accent);
}

/* Thinking Indicator */
.hoolo-chat-thinking {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--hh-warm-hoolo-bubble);
  border-radius: var(--hh-radius-md);
  border-top-left-radius: 2px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--hh-warm-hoolo-border);
  box-shadow: var(--hh-shadow-xs);
  width: fit-content;
}

.hoolo-chat-thinking__text {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--hh-warm-ink-soft);
}

.hoolo-chat-thinking__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--hh-warm-accent-strong);
  animation: hoolo-bounce-dot 0.6s ease-in-out infinite;
}

.hoolo-chat-thinking__dot:nth-child(3) { animation-delay: 0.15s; }
.hoolo-chat-thinking__dot:nth-child(4) { animation-delay: 0.3s; }

/* Input Bar */
.hoolo-chat-input-bar {
  min-height: 4rem;
  background: var(--hh-warm-surface-raised);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--hh-warm-border);
  flex-shrink: 0;
}

.hoolo-chat-mic {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--hh-warm-border-strong);
  background: var(--hh-warm-hoolo-bubble);
  color: #54656F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--hh-t-fast) var(--hh-ease);
  box-shadow: var(--hh-shadow-xs);
}

.hoolo-chat-mic:hover {
  color: var(--hh-warm-accent-strong);
  background: var(--hh-warm-canvas);
}

.hoolo-chat-mic:active { transform: scale(0.95); }

.hoolo-chat-mic--listening {
  background: #f43f5e;
  color: white;
  border-color: #f43f5e;
  animation: hoolo-pulse-ring 1.5s ease infinite;
}

.hoolo-chat-input {
  flex: 1;
  height: 2.75rem;
  padding: 0 1rem;
  font-size: 1rem;
  background: var(--hh-warm-hoolo-bubble);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius-pill);
  color: var(--hh-warm-ink);
  outline: none;
  box-shadow: var(--hh-shadow-xs);
}

@media (min-width: 640px) {
  .hoolo-chat-input { font-size: 0.875rem; height: 3rem; }
}

.hoolo-chat-input:focus {
  border-color: var(--hh-warm-accent-strong);
}

.hoolo-chat-input::placeholder {
  color: #8696A0;
}

.hoolo-chat-input:disabled {
  opacity: 0.5;
}

.hoolo-chat-send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  background: var(--hh-warm-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--hh-t-fast) var(--hh-ease),
              transform var(--hh-t-fast) var(--hh-ease);
  box-shadow: var(--hh-shadow-sm);
}

.hoolo-chat-send:hover { background: var(--hh-warm-accent-hover); }
.hoolo-chat-send:active { transform: scale(0.95); }
.hoolo-chat-send:disabled { opacity: 0.4; cursor: default; }

/* ==========================================================================
   HOOLO MOBILE VIEW
   ========================================================================== */

.hoolo-mobile-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Segmented Toggle */
.hoolo-mobile-toggle {
  display: flex;
  background: var(--hh-warm-sunk);
  padding: 0.25rem;
  border-radius: var(--hh-radius-pill);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
  max-width: 20rem;
  margin: 0 auto;
  width: 100%;
}

.hoolo-mobile-toggle__btn {
  flex: 1;
  padding: 0.375rem 0.75rem;
  border-radius: var(--hh-radius-pill);
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--hh-warm-ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: all var(--hh-t-fast) var(--hh-ease);
}

.hoolo-mobile-toggle__btn--active {
  background: var(--hh-warm-hoolo-bubble);
  color: var(--hh-warm-ink);
  box-shadow: var(--hh-shadow-xs);
}

/* Buddy Pane */
.hoolo-mobile-buddy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
  max-width: 32rem;
  margin: 0 auto;
  width: 100%;
}

.hoolo-mobile-mascot-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.hoolo-mobile-mascot-stage:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.hoolo-mobile-halo {
  position: absolute;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.15);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

.hoolo-mobile-mascot-slot {
  width: 16rem;
  height: 16rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hoolo-mobile-mascot-slot .hoolo-mascot-wrap {
  width: 100%;
  height: 100%;
}

.hoolo-mobile-tap-prompt {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hh-warm-ink-muted);
  box-shadow: var(--hh-shadow-xs);
  margin-top: -0.5rem;
}

/* Sparkle effect on mascot tap */
.hoolo-mobile-sparkle {
  position: absolute;
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 30;
  animation: hoolo-sparkle-float 1.2s ease-out forwards;
}

/* Speech Card */
.hoolo-mobile-speech-card {
  width: 100%;
  background: var(--hh-warm-hoolo-bubble);
  border-radius: var(--hh-radius-lg);
  padding: 1rem;
  border: 2px solid var(--hh-warm-border);
  box-shadow: var(--hh-shadow-md);
}

.hoolo-mobile-speech-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hoolo-mobile-speech-card__label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hh-warm-accent-strong);
}

.hoolo-mobile-speak-btn {
  margin-left: auto;
  padding: 0.375rem;
  border-radius: 50%;
  border: none;
  background: var(--hh-warm-canvas);
  color: var(--hh-warm-ink-soft);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--hh-t-fast) var(--hh-ease);
}

.hoolo-mobile-speak-btn:hover {
  color: var(--hh-warm-ink);
}

.hoolo-mobile-speech-card__body {
  font-size: 0.875rem;
  color: var(--hh-warm-ink);
  line-height: 1.6;
  font-weight: 500;
}

.hoolo-mobile-speech-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--hh-warm-canvas);
}

.hoolo-mobile-speech-card__footer > span {
  font-size: 0.625rem;
  color: var(--hh-warm-ink-soft);
  font-weight: 600;
}

.hoolo-mobile-open-chat-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: var(--hh-warm-canvas);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hh-warm-accent-strong);
  cursor: pointer;
  transition: all var(--hh-t-fast) var(--hh-ease);
}

.hoolo-mobile-open-chat-btn:hover {
  background: var(--hh-warm-sunk);
}

/* Push-to-Talk Mic Button */
.hoolo-mobile-mic {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: var(--hh-radius-md);
  border: none;
  background: linear-gradient(135deg, var(--hh-warm-accent), var(--hh-warm-accent-hover));
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: var(--hh-shadow-md);
  transition: all var(--hh-t-fast) var(--hh-ease);
}

.hoolo-mobile-mic:hover {
  background: linear-gradient(135deg, var(--hh-warm-accent-hover), var(--hh-warm-accent-strong));
}

.hoolo-mobile-mic:active { transform: scale(0.98); }

.hoolo-mobile-mic--listening {
  background: #f43f5e;
  animation: hoolo-pulse-ring 1.5s ease infinite;
}

.hoolo-mobile-mic-hint {
  font-size: 0.625rem;
  color: var(--hh-warm-ink-soft);
  font-weight: 500;
  text-align: center;
}

/* Discovery Cards */
.hoolo-mobile-cards-section {
  width: 100%;
}

.hoolo-mobile-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  margin-bottom: 0.5rem;
}

.hoolo-mobile-cards-header__title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hh-warm-ink);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.hoolo-mobile-cards-header__sub {
  font-size: 0.625rem;
  color: var(--hh-warm-ink-soft);
  font-weight: 700;
}

.hoolo-mobile-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.hoolo-mobile-card {
  padding: 0.75rem;
  border-radius: var(--hh-radius-md);
  border: 2px solid;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--hh-t-fast) var(--hh-ease);
  box-shadow: var(--hh-shadow-xs);
}

.hoolo-mobile-card:hover {
  box-shadow: var(--hh-shadow-md);
}

.hoolo-mobile-card:active { transform: scale(0.95); }

.hoolo-mobile-card--dino {
  background: #FFFBEB; border-color: #FDE68A; color: #78350F;
}

.hoolo-mobile-card--space {
  background: #EEF2FF; border-color: #C7D2FE; color: #312E81;
}

.hoolo-mobile-card--ocean {
  background: #F0FDFA; border-color: #99F6E4; color: #134E4A;
}

.hoolo-mobile-card--rainbow {
  background: #FFF1F2; border-color: #FECDD3; color: #9F1239;
}

.hoolo-mobile-card__icon {
  font-size: 1.5rem;
  margin-bottom: 0.375rem;
}

.hoolo-mobile-card__title {
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.hoolo-mobile-card__subtitle {
  font-size: 0.625rem;
  opacity: 0.8;
  line-height: 1.2;
  margin-top: 0.125rem;
}

/* Action Chips */
.hoolo-mobile-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}

.hoolo-mobile-chip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--hh-warm-hoolo-bubble);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hh-warm-ink);
  cursor: pointer;
  box-shadow: var(--hh-shadow-xs);
  transition: all var(--hh-t-fast) var(--hh-ease);
}

.hoolo-mobile-chip:hover {
  background: var(--hh-warm-canvas);
}

.hoolo-mobile-chip:active { transform: scale(0.95); }

/* Mobile chat pane */
.hoolo-mobile-chat {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.hoolo-mobile-chat .hoolo-chat-panel {
  height: 70vh;
  min-height: 28rem;
}

/* ==========================================================================
   VOICE PICKER POPOVER
   ========================================================================== */

.hoolo-voice-popover {
  position: absolute;
  right: 0;
  top: 3rem;
  width: 20rem;
  background: var(--hh-warm-hoolo-bubble);
  border-radius: var(--hh-radius-md);
  border: 2px solid var(--hh-warm-border);
  box-shadow: var(--hh-shadow-lg);
  padding: 1rem;
  z-index: 50;
  color: var(--hh-warm-ink);
  animation: hoolo-fade-in-up 0.15s ease-out;
}

@media (max-width: 767px) {
  .hoolo-voice-popover {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    border-radius: var(--hh-radius-lg) var(--hh-radius-lg) 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
  }
}

.hoolo-voice-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hh-warm-canvas);
  padding-bottom: 0.5rem;
  margin-bottom: 0.625rem;
}

.hoolo-voice-popover__title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hh-warm-ink);
}

.hoolo-voice-popover__subtitle {
  font-size: 0.625rem;
  color: var(--hh-warm-ink-soft);
}

.hoolo-voice-popover__close {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hh-warm-ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hoolo-voice-popover__close:hover {
  color: var(--hh-warm-ink);
}

.hoolo-voice-popover__select {
  width: 100%;
  padding: 0.5rem;
  background: var(--hh-warm-canvas);
  border: 1px solid var(--hh-warm-border-strong);
  border-radius: var(--hh-radius);
  font-size: 0.75rem;
  color: var(--hh-warm-ink);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.hoolo-voice-popover__select:focus {
  outline: none;
  border-color: var(--hh-warm-accent-strong);
}

.hoolo-voice-popover__test-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--hh-warm-accent);
  color: white;
  border: none;
  border-radius: var(--hh-radius);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--hh-t-fast) var(--hh-ease);
}

.hoolo-voice-popover__test-btn:hover {
  background: var(--hh-warm-accent-hover);
}

/* Voice popover backdrop (mobile only) */
.hoolo-voice-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 49;
  animation: hoolo-fade-in-up 0.15s ease-out;
}

/* ==========================================================================
   REDUCED MOTION — restated here so page-level opt-out is explicit
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hh-owl-medallion,
  .hh-owl-glow,
  .status-dot {
    animation: none !important;
  }

  .hh-rise,
  .message,
  .modal-content,
  .login-modal-content,
  .toast-content {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hh-btn:hover,
  .btn:hover:not(:disabled),
  .hh-icon-btn:hover,
  .starter-prompt:hover,
  .hh-overflow__trigger:hover {
    transform: none !important;
  }

  .hoolo-mascot-svg,
  .hoolo-zzz,
  .hoolo-mobile-sparkle {
    animation: none !important;
  }
}
