/* ─── KAIRO · Vibrant White & Yellow Theme ─── */
/* Status bar removed */
:root {
  --bg-0: #fffdf0;
  --bg-1: #fff9d6;
  --bg-2: #fffbea;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.52);
  --line: rgba(255, 200, 0, 0.28);
  --line-strong: rgba(255, 180, 0, 0.56);
  --text: #1a1400;
  --muted: #6b5800;
  --purple: #f5a800;
  --blue: #ffd000;
  --pink: #ffe566;
  --teal: #ffb300;
  --shadow: 0 28px 86px rgba(200, 140, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 230, 0, 0.55), transparent 30%),
    radial-gradient(circle at 92% 88%, rgba(255, 200, 0, 0.42), transparent 32%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.88), transparent 55%),
    linear-gradient(170deg, #fff9cc, #fffdf0 50%, #fff5cc);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

/* ─── Background Orbs ─── */
.bg-orbit {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.55;
  pointer-events: none;
}

.bg-orbit--one {
  width: 400px;
  height: 400px;
  left: -110px;
  top: -60px;
  background: radial-gradient(circle, rgba(255, 220, 0, 0.9), rgba(255, 255, 100, 0.15));
}

.bg-orbit--two {
  width: 340px;
  height: 340px;
  right: -90px;
  bottom: 30px;
  background: radial-gradient(circle, rgba(255, 200, 0, 0.82), rgba(255, 240, 100, 0.12));
}

/* ─── Stage ─── */
.app-stage {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

/* ─── Device Shell ─── */
.device-shell {
  position: relative;
  width: min(100%, 430px);
  height: min(100vh - 36px, 932px);
  border-radius: 34px;
  border: 1.5px solid rgba(255, 215, 0, 0.52);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.98), transparent 42%),
    radial-gradient(circle at 80% 92%, rgba(255, 235, 100, 0.44), transparent 44%),
    linear-gradient(180deg, rgba(255, 252, 220, 0.98), rgba(255, 248, 200, 0.96));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -22px 38px rgba(255, 200, 0, 0.1),
    0 0 0 1px rgba(255, 200, 0, 0.12);
  backdrop-filter: blur(34px) saturate(145%);
  overflow: hidden;
}

.device-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.2) 24%, transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 28%);
  mix-blend-mode: screen;
  z-index: 1;
}

.device-shell::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 33px;
  pointer-events: none;
  border: 1px solid rgba(255, 220, 0, 0.22);
  z-index: 1;
}

/* ─── Status Bar ─── */
.status-bar {
  position: relative;
  z-index: 4;
  height: 44px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(30, 20, 0, 0.9);
}

.status-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 200, 0, 0.22);
  border: 1px solid rgba(255, 180, 0, 0.3);
  color: #6b4400;
}

.status-signal {
  width: 18px;
  height: 12px;
  position: relative;
}

.status-signal::before,
.status-signal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(30, 20, 0, 0.8) 10% 24%, transparent 24% 36%, rgba(30, 20, 0, 0.8) 36% 50%, transparent 50% 100%);
  mask:
    linear-gradient(90deg, transparent 0 6%, #000 6% 12%, transparent 12% 100%);
  opacity: 0.7;
}

.status-battery {
  width: 26px;
  height: 13px;
  border-radius: 4px;
  border: 1.5px solid rgba(30, 20, 0, 0.7);
  position: relative;
  padding: 1px;
}

.status-battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 7px;
  border-radius: 99px;
  background: rgba(30, 20, 0, 0.65);
}

.status-battery span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffd700, #ffed4a);
}

/* ─── Screen Stack ─── */
.screen-stack {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  /* Isolate all screen stacking contexts so the bottom-nav z-index wins */
  isolation: isolate;
}

/* Inactive screens: fully hidden from all pointer/touch events */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  /* blocks ALL touch/pointer events */
  transform: translateY(22px);
  pointer-events: none;
  /* NO will-change here — it breaks z-index by creating rogue GPU layers */
  transition:
    opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 300ms;
  /* hide AFTER fade completes */
}

/* Active screen: visible instantly, then fades in smoothly */
.screen.is-active {
  opacity: 1;
  visibility: visible;
  /* shown BEFORE the fade (0s delay) */
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0s;
}

.screen-shell {
  width: 100%;
  height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  /* Isolate scroll context so inactive screens can't intercept scroll */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.screen-shell--center {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.screen-shell--app,
.screen-shell--chat {
  padding-top: 14px;
  padding-bottom: 100px;
  /* leaves room for 78px nav + 12px gap + 10px breathing */
}

.screen-shell--chat {
  padding: 12px 12px 12px;
  /* Properly fills the space while allowing the floating navbar to breathe */
  gap: 12px;
  justify-content: space-between;
}

/* ─── Brand Chip ─── */
.brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5a3a00;
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.9), rgba(255, 240, 100, 0.7));
  border: 1.5px solid rgba(255, 180, 0, 0.5);
  box-shadow:
    0 8px 28px rgba(200, 140, 0, 0.35),
    0 0 0 4px rgba(255, 230, 0, 0.18);
}

/* ─── Hero Art & Robot ─── */
.hero-art {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 10px 0 6px;
  display: grid;
  place-items: center;
}

.hero-orb {
  position: absolute;
  inset: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(255, 220, 0, 0.8), rgba(255, 248, 150, 0.45) 58%, transparent 70%);
  filter: blur(10px);
  animation: pulseGlow 6s ease-in-out infinite;
}

.robot {
  position: relative;
  width: 160px;
  height: 180px;
  animation: float 5.5s ease-in-out infinite;
}

.robot-halo {
  position: absolute;
  inset: 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.6), rgba(255, 248, 150, 0.28) 58%, transparent 72%);
  filter: blur(18px);
}

.robot-head {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: 116px;
  height: 80px;
  border-radius: 32px 32px 28px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 245, 180, 0.92));
  border: 1.5px solid rgba(255, 200, 0, 0.38);
  box-shadow:
    0 26px 38px rgba(180, 120, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 0 4px rgba(255, 220, 0, 0.15);
}

.robot-head::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  width: 16px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #ffd700);
  transform: translateX(-50%);
  box-shadow: 0 0 16px rgba(255, 200, 0, 0.65);
}

.robot-head span {
  position: absolute;
  top: 31px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a2000, #1a0f00);
  box-shadow: 0 0 12px rgba(255, 180, 0, 0.4);
}

.robot-head span:first-of-type {
  left: 32px;
}

.robot-head span:last-of-type {
  right: 32px;
}

.robot-body {
  position: absolute;
  left: 50%;
  top: 88px;
  transform: translateX(-50%);
  width: 132px;
  height: 82px;
  border-radius: 34px 34px 28px 28px;
  background: linear-gradient(180deg, #ffd700, #ffb300);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 26px 38px rgba(180, 110, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.robot-body::before {
  content: "";
  position: absolute;
  inset: 14px 20px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.15));
}

.robot-base {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: 92px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 200, 0, 0.35);
  backdrop-filter: blur(10px);
}

/* ─── Hero Text ─── */
.hero-title {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
  color: #1a1000;
}

.hero-subtitle {
  margin: 0;
  max-width: 24ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ─── CTA Button ─── */
.cta-button {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #3a2000;
  border: 1.5px solid rgba(255, 200, 0, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12)),
    linear-gradient(135deg, #ffd700, #ffe84d, #fff5a0);
  box-shadow:
    0 18px 38px rgba(200, 140, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 0 3px rgba(255, 220, 0, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 26px 48px rgba(200, 140, 0, 0.46),
    0 0 32px rgba(255, 215, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cta-button--full {
  width: 100%;
}

/* ─── Auth Shell ─── */
.auth-shell {
  padding-top: 18px;
}

.screen-head,
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.screen-head {
  flex-direction: column;
}

.screen-head--compact {
  flex-direction: row;
  align-items: center;
}

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

.page-head h2,
.screen-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  letter-spacing: -0.04em;
  color: #1a1000;
}

.screen-note,
.screen-head p,
.page-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(100, 70, 0, 0.75);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.eyebrow--glow {
  color: #c98000;
}

/* ─── Glass Card / Panel ─── */
.glass-card,
.glass-panel {
  border: 1.5px solid rgba(255, 200, 0, 0.32);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 200, 0.68));
  backdrop-filter: blur(28px) saturate(145%);
  box-shadow:
    0 20px 38px rgba(180, 120, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 26px rgba(255, 200, 0, 0.15);
}

.auth-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

/* ─── Field Labels & Inputs ─── */
.field-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4a3000;
}

.auth-card input,
textarea {
  width: 100%;
  color: #1a1000;
  border: 1.5px solid rgba(255, 190, 0, 0.38);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  padding: 14px 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrapper input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  color: rgba(100, 70, 0, 0.6);
  cursor: pointer;
  border-radius: 8px;
  transition: background 150ms ease, color 150ms ease;
}

.password-toggle:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #c68000;
}

.password-toggle .lucide {
  width: 18px;
  height: 18px;
}

.auth-card input::placeholder,
textarea::placeholder {
  color: rgba(100, 70, 0, 0.5);
}

.auth-card input:focus,
textarea:focus {
  border-color: rgba(255, 180, 0, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 200, 0, 0.28);
  background: #fff;
}

.auth-row,
.auth-switch,
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-row--split {
  justify-content: space-between;
}

.check-row {
  color: var(--muted);
  font-size: 0.9rem;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: #ffd700;
}

.text-button {
  padding: 0;
  background: none;
  color: #c68000;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: #ff9d00;
}

/* ─── Divider ─── */
.divider {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.divider::before {
  content: "";
  width: 100%;
  height: 1px;
  background: rgba(200, 140, 0, 0.22);
  grid-area: 1 / 1;
}

.divider span {
  grid-area: 1 / 1;
  padding: 0 10px;
  background: rgba(255, 250, 210, 0.96);
}

/* ─── Social Buttons ─── */
.social-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.social-button,
.chip-button,
.voice-chip,
.attach-chip,
.send-button,
.avatar-button,
.action-card,
.nav-item,
.settings-row {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.social-button {
  min-height: 48px;
  border-radius: 16px;
  color: #3a2000;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(255, 200, 0, 0.32);
  backdrop-filter: blur(22px);
  cursor: pointer;
  font-weight: 700;
}

.social-button:hover,
.chip-button:hover,
.voice-chip:hover,
.attach-chip:hover,
.send-button:hover,
.avatar-button:hover,
.action-card:hover,
.nav-item:hover,
.settings-row:hover {
  transform: translateY(-1px);
}

.auth-switch {
  justify-content: center;
  color: var(--muted);
  flex-wrap: wrap;
  text-align: center;
}

/* ─── Home Hero Panel ─── */
.home-hero,
.home-chat-panel,
.activity-panel,
.profile-card,
.settings-panel,
.history-panel {
  padding: 16px;
}

.home-hero {
  display: grid;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(255, 215, 0, 0.42), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 248, 200, 0.6));
  border: 1.5px solid rgba(255, 200, 0, 0.25);
  border-radius: 22px;
}

.home-hero h3 {
  margin: 8px 0 8px;
  font-size: 1.08rem;
  color: #1a1000;
}

.home-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mini-badge {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.22);
  border: 1px solid rgba(255, 190, 0, 0.3);
  font-size: 0.78rem;
  color: #7a4e00;
}

/* ─── Action Grid ─── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.action-card {
  min-height: 128px;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 248, 200, 0.68));
  border: 1.5px solid rgba(255, 200, 0, 0.3);
  color: #1a1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 12px 28px rgba(180, 120, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.action-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -20% auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 210, 0, 0.45), transparent 68%);
  filter: blur(6px);
}

.action-card span:last-child {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2a1a00;
}

.action-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 215, 0, 0.28);
  border: 1px solid rgba(255, 190, 0, 0.3);
}

/* ─── Icons ─── */
.action-icon svg,
.nav-item svg,
.kairo-icon-button .lucide,
.nav-item .lucide,
.attach-chip .lucide,
.chip-button .lucide,
.voice-chip .lucide,
.kairo-suggestion-chip .lucide,
.kairo-icon-button [data-lucide],
.nav-item [data-lucide],
.attach-chip [data-lucide],
.chip-button [data-lucide],
.voice-chip [data-lucide],
.kairo-suggestion-chip [data-lucide] {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Panel Title Row ─── */
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h3 {
  margin: 0;
  font-size: 1rem;
  color: #1a1000;
}

.panel-title-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ─── Activity / History Lists ─── */
.activity-list,
.history-list {
  display: grid;
  gap: 12px;
}

.activity-item,
.history-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(255, 200, 0, 0.28);
  backdrop-filter: blur(24px);
}

.history-item {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.history-item:hover {
  border-color: rgba(255, 170, 0, 0.62);
  background: rgba(255, 235, 100, 0.28);
}

.activity-item {
  display: grid;
  gap: 4px;
}

.activity-item strong,
.history-item strong {
  font-size: 0.95rem;
  color: #1a1000;
}

.activity-item p,
.history-item p,
.profile-top p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.activity-meta,
.history-meta {
  font-size: 0.75rem;
  color: rgba(80, 55, 0, 0.62);
}

/* ─── Page Head ─── */
.page-head {
  align-items: center;
}

/* ─── Avatar Button ─── */
.avatar-button {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #3a2000;
  border: 1.5px solid rgba(255, 200, 0, 0.4);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.3)),
    linear-gradient(135deg, #ffd700, #ffe84d);
  box-shadow: 0 14px 28px rgba(180, 120, 0, 0.28);
  cursor: pointer;
  font-weight: 800;
}

/* ─── Chat Stream ─── */
.screen-shell--chat .chat-stream {
  flex: 1;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

/* ─── Chat Messages ─── */
.chat-message {
  max-width: 84%;
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 200, 0, 0.28);
  box-shadow:
    0 10px 24px rgba(180, 120, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  line-height: 1.55;
  white-space: pre-wrap;
  display: grid;
  gap: 10px;
  animation: rise 220ms ease;
}

.chat-message--bot {
  align-self: flex-start;
  background:
    radial-gradient(circle at 14% 6%, rgba(255, 255, 255, 0.98), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 210, 0.8));
  backdrop-filter: blur(26px) saturate(140%);
  color: #1a1000;
}

.chat-message--user {
  align-self: flex-end;
  background:
    radial-gradient(circle at 86% 20%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(135deg, #ffd700, #ffe84d, #fff5a0);
  border-color: rgba(255, 190, 0, 0.45);
  color: #2a1500;
}

.chat-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(80, 55, 0, 0.72);
}

.chat-message--bot .chat-label {
  color: #c68000;
}

.chat-message--user .chat-label {
  color: rgba(60, 40, 0, 0.85);
}

.chat-content {
  font-size: 0.98rem;
  line-height: 1.58;
}

/* ─── Typing Indicator ─── */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffa000;
  animation: pulseDot 1.1s infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ─── Chat Meta ─── */
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  color: rgba(80, 55, 0, 0.65);
}

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

.speak-btn {
  padding: 7px 10px;
  border-radius: 10px;
  color: #3a2000;
  background: rgba(255, 215, 0, 0.22);
  border: 1px solid rgba(255, 180, 0, 0.3);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ─── Chat Content Area ─── */
.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Chat Composer ─── */
.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(255, 200, 0, 0.4);
  border-radius: 28px;
  backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    0 16px 36px rgba(180, 120, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-chat-panel {
  display: grid;
  gap: 10px;
}

/* ─── Gemini Home Shell ─── */
.gemini-home-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 10px;
  padding-bottom: 18px;
}

/* ─── Kairo Topbar ─── */
.kairo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 0 4px;
}

.kairo-topbar h2 {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1000;
}

.kairo-topbar-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

/* Completely hide the topbar chat-actions — moved to hamburger */
.home-chat-actions {
  display: none !important;
}

/* ─── Home Menu (Hamburger) ─── */
.home-menu {
  position: absolute;
  top: 60px;
  left: 12px;
  z-index: 6;
  width: min(240px, calc(100% - 24px));
  padding: 6px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 200, 0, 0.38);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.95), transparent 34%),
    rgba(255, 250, 215, 0.96);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    0 24px 40px rgba(180, 120, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-menu.is-hidden {
  display: none;
}

.home-menu-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: #2a1800;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 140ms ease, border-color 140ms ease;
}

.home-menu-item:hover {
  background: rgba(255, 210, 0, 0.22);
  border-color: rgba(255, 190, 0, 0.3);
}

.home-menu-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.home-menu-divider {
  height: 1px;
  margin: 4px 10px;
  background: rgba(200, 150, 0, 0.2);
  border-radius: 1px;
}

.home-menu-item--signout {
  color: #8b0000;
  opacity: 0.85;
}

.home-menu-item--signout:hover {
  background: rgba(220, 60, 60, 0.1);
  border-color: rgba(200, 50, 50, 0.2);
  opacity: 1;
}

/* ─── Kairo Icon Button ─── */
.kairo-icon-button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 200, 0, 0.36);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 200, 0.65));
  color: #3a2200;
  display: inline-grid;
  place-items: center;
  backdrop-filter: blur(26px) saturate(135%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(180, 120, 0, 0.2),
    0 0 14px rgba(255, 200, 0, 0.22);
  cursor: pointer;
}

.kairo-icon-button [data-lucide] {
  width: 18px;
  height: 18px;
}

.kairo-icon-button .lucide {
  width: 18px;
  height: 18px;
}

/* ─── Gemini Avatar ─── */
.avatar-button--gemini {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 0.8rem;
  box-shadow:
    0 12px 26px rgba(160, 100, 0, 0.3),
    0 0 20px rgba(255, 200, 0, 0.35);
}

/* ─── Greeting ─── */
.kairo-greeting {
  margin-top: 22px;
  text-align: left;
  /* Smooth show/hide */
  transition: opacity 280ms ease, transform 280ms ease;
  transform-origin: top left;
}

/* ─── HIDDEN STATE ─── */
.kairo-greeting.is-hidden {
  display: none !important;
}

.chat-stream.is-hidden {
  display: none !important;
}

.kairo-greeting p {
  margin: 0;
  color: rgba(60, 40, 0, 0.78);
  font-size: 1.04rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.kairo-greeting h3 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 8vw, 2.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1a1000;
}

/* ─── Suggestion Chips ─── */
.kairo-suggestions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.kairo-suggestion-chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 200, 0, 0.32);
  background: rgba(255, 255, 255, 0.76);
  color: #2a1800;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 18px rgba(180, 120, 0, 0.12),
    0 0 10px rgba(255, 200, 0, 0.14);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.kairo-suggestion-chip:hover,
.kairo-suggestion-chip:active {
  border-color: rgba(255, 160, 0, 0.6);
  background: rgba(255, 240, 100, 0.32);
  transform: translateY(-1px);
}

.kairo-suggestion-chip [data-lucide],
.kairo-suggestion-chip .lucide {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 2.2;
  opacity: 0.75;
}

/* ─── Kairo Input Dock ─── */
.kairo-input-dock {
  margin-top: auto;
  border-radius: 28px;
  border: 1.5px solid rgba(255, 200, 0, 0.4);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.95), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 200, 0.78));
  backdrop-filter: blur(30px) saturate(140%);
  box-shadow:
    0 24px 48px rgba(180, 120, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 28px rgba(255, 200, 0, 0.26);
  padding: 12px;
}

.kairo-home-composer {
  gap: 8px;
}

.kairo-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.kairo-input-left,
.kairo-input-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kairo-home-composer textarea {
  min-height: 44px;
  max-height: 110px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #1a1000;
  padding: 12px 10px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 190, 0, 0.36);
}

.kairo-home-composer textarea:focus {
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 160, 0, 0.6),
    0 0 0 4px rgba(255, 200, 0, 0.2);
  background: #fff;
}

/* ─── Fast Chip ─── */
.fast-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 0, 0.3);
  background: rgba(255, 255, 255, 0.7);
  color: #2a1800;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

/* ─── AI Voice Button ─── */
.ai-voice-btn {
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd700, #ffe84d);
  border-color: transparent;
  color: #3a2000;
  box-shadow:
    0 12px 24px rgba(180, 120, 0, 0.35),
    0 0 18px rgba(255, 210, 0, 0.4);
}

.ai-voice-btn[aria-pressed="true"] {
  box-shadow:
    0 14px 26px rgba(180, 110, 0, 0.42),
    0 0 24px rgba(255, 200, 0, 0.5);
}

/* ─── Image Preview ─── */
.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(255, 200, 0, 0.3);
  backdrop-filter: blur(22px);
}

.image-preview.is-hidden {
  display: none;
}

.image-preview img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 200, 0, 0.2);
}

.image-preview-info {
  flex: 1;
  display: grid;
  gap: 3px;
}

.image-preview-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1000;
}

.image-preview-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.remove-image {
  padding: 8px 10px;
  border-radius: 10px;
  color: #3a2000;
  background: rgba(255, 210, 0, 0.2);
  border: 1px solid rgba(255, 180, 0, 0.28);
  cursor: pointer;
}

/* ─── Chat Composer Textarea ─── */
.chat-composer textarea {
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 16px;
}

/* ─── Composer Actions ─── */
.composer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-chip {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.icon-chip [data-lucide],
.icon-chip .lucide {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2.2 !important;
}

.voice-chip,
.attach-chip,
.send-button,
.chip-button,
.settings-row,
.nav-item {
  cursor: pointer;
}

.chip-button--new {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 14px;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

/* ─── Chips & Settings Row ─── */
.voice-chip,
.attach-chip,
.chip-button,
.settings-row {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  color: #2a1800;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 200, 0.65));
  border: 1.5px solid rgba(255, 200, 0, 0.3);
  backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.voice-chip[aria-pressed="true"] {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2)),
    linear-gradient(135deg, #ffd700, #ffe84d);
  border-color: rgba(255, 180, 0, 0.6);
  box-shadow:
    0 0 0 3px rgba(255, 200, 0, 0.3),
    0 8px 20px rgba(180, 120, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: voiceActiveGlow 2s ease-in-out infinite;
}

@keyframes voiceActiveGlow {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.3), 0 8px 20px rgba(180, 120, 0, 0.28);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(255, 200, 0, 0.5), 0 8px 24px rgba(180, 120, 0, 0.38);
  }
}

.attach-chip {
  min-width: 84px;
}

.attach-chip.icon-chip {
  min-width: 46px;
}

/* ─── Send Button ─── */
.send-button {
  flex: 1;
  min-width: 64px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  color: #2a1500;
  border: 1.5px solid rgba(255, 180, 0, 0.5);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, #ffd700, #ffe84d, #fff5a0);
  box-shadow:
    0 16px 32px rgba(180, 120, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-weight: 800;
  font-size: 0.9rem;
}

/* ─── History / Profile / Settings Panels ─── */
.history-panel,
.profile-card,
.settings-panel {
  display: grid;
  gap: 12px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #2a1500;
  background: linear-gradient(135deg, #ffd700, #ffe84d);
  border: 2px solid rgba(255, 200, 0, 0.45);
  overflow: hidden;
  /* clips the photo to the rounded square */
  position: relative;
  box-shadow: 0 4px 16px rgba(255, 180, 0, 0.3);
}

.profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.profile-photo.is-hidden {
  display: none;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-top h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a1000;
}

.profile-email {
  font-size: 0.8rem;
  color: rgba(80, 55, 0, 0.65);
  font-weight: 500;
  word-break: break-all;
  margin: 0;
}

/* ─── Avatar button with photo ─── */
.avatar-button--gemini {
  overflow: hidden;
  position: relative;
}

.avatar-button--gemini img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}



/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(255, 200, 0, 0.28);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 4px;
  text-align: center;
}

.stat-card strong {
  font-size: 0.98rem;
  color: #1a1000;
}

.stat-card span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Profile Actions ─── */
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(255, 200, 0, 0.32);
  color: #2a1800;
  transition: transform 150ms ease, background 150ms ease;
}

.profile-action-btn:hover {
  background: rgba(255, 235, 100, 0.32);
  transform: translateY(-1px);
}

.profile-action-btn [data-lucide],
.profile-action-btn .lucide {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.profile-action-btn--danger {
  background: rgba(255, 240, 240, 0.85);
  border-color: rgba(220, 60, 60, 0.25);
  color: #8b0000;
}

.profile-action-btn--danger:hover {
  background: rgba(220, 60, 60, 0.12);
}

/* ─── Settings Row ─── */
.settings-row {
  justify-content: space-between;
  width: 100%;
  font-size: 0.94rem;
}

.settings-row span:last-child {
  color: var(--muted);
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 78px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 200, 0.72));
  border: 1.5px solid rgba(255, 200, 0, 0.34);
  backdrop-filter: blur(30px) saturate(145%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 10px 8px max(10px, env(safe-area-inset-bottom));
  box-shadow:
    0 18px 36px rgba(180, 120, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  /* Must be above ALL screen content — guaranteed by own GPU layer */
  z-index: 100;
  transform: translateZ(0);
  /* promote to own compositing layer */
}

.bottom-nav.is-hidden {
  display: none;
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 18px;
  background: transparent;
  color: rgba(80, 55, 0, 0.62);
  font-weight: 600;
  font-size: 0.72rem;
  -webkit-tap-highlight-color: transparent;
  /* remove grey flash on mobile */
  transition: transform 120ms ease, background 180ms ease, color 180ms ease;
}

.nav-item:active {
  transform: scale(0.9);
  /* immediate press feedback */
}

.nav-item.is-active {
  color: #3a2200;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18)),
    linear-gradient(135deg, rgba(255, 210, 0, 0.72), rgba(255, 240, 100, 0.5));
  box-shadow:
    0 0 0 1.5px rgba(255, 195, 0, 0.55) inset,
    0 0 18px rgba(255, 200, 0, 0.28);
}

.nav-item svg,
.nav-item .lucide,
.nav-item [data-lucide] {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ─── Utility ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ─── Animations ─── */
/* ─── Microphone Active Animation ─── */
.is-listening {
  animation: pulseListen 1s infinite alternate;
  background: rgba(255, 60, 60, 0.15) !important;
  border-color: rgba(255, 60, 60, 0.5) !important;
  color: #c00 !important;
}

@keyframes pulseListen {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 60, 60, 0.4);
  }

  100% {
    box-shadow: 0 0 0 8px rgba(255, 60, 60, 0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseDot {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.45;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .app-stage {
    padding: 0;
  }

  .device-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .screen-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .action-grid,
  .social-row,
  .stats-grid {
    gap: 10px;
  }

  .chat-message {
    max-width: 92%;
  }

  .screen-shell--chat {
    padding-bottom: 100px;
  }

  .gemini-home-shell {
    padding-top: 10px;
  }

  .kairo-greeting {
    margin-top: 24px;
  }

  .kairo-greeting h3 {
    font-size: 2.05rem;
  }

  .kairo-input-dock {
    padding: 10px;
  }

  .kairo-input-row {
    gap: 8px;
  }

  .kairo-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .avatar-button--gemini {
    width: 38px;
    height: 38px;
  }

  .kairo-home-composer textarea {
    min-height: 40px;
    padding: 10px 8px;
  }

  .fast-chip {
    min-height: 32px;
    padding: 0 10px;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

/* ═══════════════════════════════════════════
   SPLASH SCREEN
═══════════════════════════════════════════ */
.kairo-splash {
  position: absolute;
  inset: 0;
  z-index: 500;
  /* above everything */
  background: linear-gradient(160deg, #fffff8 0%, #fff9c0 50%, #fffbd8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  transition: opacity 450ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 450ms;
}

.kairo-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.kairo-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: splash-appear 0.5s ease both;
}

@keyframes splash-appear {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mini robot icon on splash */
.splash-robot-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  animation: splash-bob 2.4s ease-in-out infinite;
}

@keyframes splash-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.splash-robot-head {
  width: 52px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd700, #ffe566);
  border: 2px solid rgba(180, 120, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(255, 200, 0, 0.35);
}

.splash-robot-head span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2a1500;
  animation: splash-blink 3s ease-in-out infinite;
}

.splash-robot-head span:last-child {
  animation-delay: 0.15s;
}

@keyframes splash-blink {

  0%,
  90%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0.1);
  }
}

.splash-robot-body {
  width: 36px;
  height: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe566, #ffeea0);
  border: 1.5px solid rgba(180, 120, 0, 0.2);
}

.splash-brand {
  font-size: 2.2rem;
  font-weight: 900;
  color: #2a1500;
  letter-spacing: 0.18em;
}

.splash-tagline {
  font-size: 0.88rem;
  color: rgba(80, 55, 0, 0.65);
  font-weight: 500;
  margin: 0;
}

/* Bouncing dots */
.splash-dots {
  display: flex;
  gap: 7px;
  margin-top: 4px;
}

.splash-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffc800, #ffe566);
  box-shadow: 0 2px 6px rgba(255, 180, 0, 0.55);
  animation: dot-bounce 1.3s ease-in-out infinite;
}

.splash-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.splash-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0) scale(1);
  }

  30% {
    transform: translateY(-11px) scale(1.15);
  }
}

/* ═══════════════════════════════════════════
   GREETING OVERLAY
═══════════════════════════════════════════ */
.kairo-greeting-overlay {
  position: absolute;
  inset: 0;
  z-index: 400;
  background: rgba(255, 253, 228, 0.88);
  backdrop-filter: blur(20px) saturate(130%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  transition: opacity 380ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 380ms;
}

.kairo-greeting-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.greeting-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 200, 0.85));
  border-radius: 28px;
  border: 1.5px solid rgba(255, 200, 0, 0.35);
  box-shadow:
    0 20px 60px rgba(180, 120, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 280px;
  width: 88%;
  animation: greeting-slide-up 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes greeting-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.greeting-wave {
  font-size: 2.8rem;
  animation: wave-hand 1.2s ease-in-out 0.3s both;
  transform-origin: 70% 70%;
}

@keyframes wave-hand {
  0% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-15deg);
  }

  40% {
    transform: rotate(12deg);
  }

  60% {
    transform: rotate(-10deg);
  }

  80% {
    transform: rotate(8deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.greeting-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1a1000;
  margin: 0;
  line-height: 1.25;
}

.greeting-card p {
  font-size: 0.9rem;
  color: rgba(80, 55, 0, 0.7);
  margin: 0;
  line-height: 1.45;
}


/* ─── Social Auth (Google / Apple) ─── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(80, 55, 0, 0.5);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(200, 140, 0, 0.22);
}

.social-auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.social-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  min-height: 68px;
  padding: 8px 36px 8px 8px;
  border-radius: 999px;
  /* Pill shape */
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  /* Yellowish frosted glass */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 240, 150, 0.3));
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 12px 32px rgba(255, 200, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(255, 200, 0, 0.1);
}

.social-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 36px rgba(255, 200, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(255, 200, 0, 0.1);
}

.social-icon-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 1),
    inset 0 -4px 6px rgba(255, 200, 0, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.05);
}

.social-auth-btn--apple {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 180, 0.5));
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 
    0 12px 30px rgba(255, 200, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 1);
  font-weight: 600;
  color: #111;
}

.social-auth-btn--apple .social-icon-orb {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 
    inset 0 1px 4px rgba(255, 255, 255, 1),
    0 4px 12px rgba(0, 0, 0, 0.05);
}

.social-auth-btn--apple .social-icon-orb svg {
  color: #000;
  width: 24px;
  height: 24px;
}

/* Prevent unwanted stretching but allow intrinsic proportions */
.social-icon-orb svg {
  max-width: 24px;
  max-height: 24px;
  display: block;
  flex-shrink: 0;
}

/* ─── Responsive Fixes (Cross-Platform) ─── */

/* Use dvh (dynamic viewport height) for better Windows / Android support.
   Falls back to svh then 100vh on older browsers. */
html {
  height: 100%;
  height: 100dvh;
}

body {
  height: 100%;
  height: 100dvh;
  /* Remove fixed overflow:hidden — let the device-shell clip instead */
  overflow: hidden;
}

.app-stage {
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: clamp(0px, 2vw, 18px);
  /* prevent stage from scrolling on Windows where scrollbar steals width */
  overflow: hidden;
}

.device-shell {
  /* Use svh so it won't expand behind address bar on mobile / Windows browser chrome */
  width: min(100%, 430px);
  /* clamp keeps it from being too short on small laptop screens */
  height: clamp(500px, calc(100dvh - 36px), 932px);
}

/* Scrollbars on Windows are visible by default and steal 15-17px.
   Use an overlay scrollbar approach for interior scroll areas. */
.screen-shell,
.chat-stream,
.chat-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 140, 0, 0.3) transparent;
}

.screen-shell::-webkit-scrollbar,
.chat-stream::-webkit-scrollbar,
.chat-content::-webkit-scrollbar {
  width: 4px;
}

.screen-shell::-webkit-scrollbar-track,
.chat-stream::-webkit-scrollbar-track,
.chat-content::-webkit-scrollbar-track {
  background: transparent;
}

.screen-shell::-webkit-scrollbar-thumb,
.chat-stream::-webkit-scrollbar-thumb,
.chat-content::-webkit-scrollbar-thumb {
  background: rgba(200, 140, 0, 0.3);
  border-radius: 999px;
}

/* Auth screen: make sure content is scrollable when windows is smaller */
.screen--auth .screen-shell.auth-shell {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Tablet / small desktop (480–900px wide): stretch shell slightly */
@media (min-width: 481px) and (max-width: 900px) {
  .app-stage {
    padding: 12px;
  }

  .device-shell {
    width: min(96%, 430px);
    height: clamp(500px, calc(100dvh - 24px), 932px);
  }
}

/* Large desktop (> 900px): center shell nicely */
@media (min-width: 901px) {
  .app-stage {
    padding: 24px;
  }

  .device-shell {
    width: 430px;
    height: min(calc(100dvh - 48px), 932px);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease;
  }

  .device-shell.is-expanded {
    width: min(96%, 1200px) !important;
    max-width: 96% !important;
  }
}

.hide-on-mobile {
  display: flex !important;
}

/* Mobile (<= 480px): full-bleed, no rounded corners */
@media (max-width: 480px) {
  .app-stage {
    padding: 0;
  }

  .device-shell {
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .social-auth-row {
    gap: 8px;
  }

  .social-auth-btn {
    font-size: 0.85rem;
    padding: 0 10px;
    gap: 6px;
  }

  .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 24px;
    height: 72px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .screen-shell--chat {
    padding-bottom: 16px !important; /* Tight margin to match the requested look */
  }
}

/* Very short screens (landscape phones, small netbooks) */
@media (max-height: 600px) {
  .auth-shell {
    padding-top: 10px;
  }

  .screen-head h2 {
    font-size: 1.35rem;
  }

  .auth-card {
    gap: 8px;
    padding: 14px;
  }

  .hero-art {
    width: 160px;
    height: 160px;
    margin: 4px 0;
  }

  .robot {
    width: 120px;
    height: 140px;
  }

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


/* ─── Email Verification Screen ─── */
.verify-card {
  align-items: center;
  text-align: center;
  gap: 16px;
}

.verify-icon-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 0;
}

.verify-envelope {
  width: 72px;
  height: 54px;
  background: linear-gradient(135deg, #fff8d6, #fef3b0);
  border: 2px solid rgba(200, 170, 0, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(200, 170, 0, 0.15);
  animation: envelope-float 3s ease-in-out infinite;
  z-index: 1;
}

.verify-envelope-letter {
  font-size: 2rem;
  line-height: 1;
}

.verify-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(200, 170, 0, 0.4);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes envelope-float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.verify-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #888);
  line-height: 1.5;
  margin: 0;
}

.cta-button--outline {
  background: transparent;
  border: 2px solid currentColor;
  color: inherit;
  opacity: 0.75;
}

.cta-button--outline:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

/* ─── OTP Digit Inputs ─── */
.otp-input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 8px;
}

.otp-digit {
  width: 44px;
  height: 54px;
  border: 2px solid rgba(130, 181, 145, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  caret-color: transparent;
}

.otp-digit:focus {
  border-color: rgba(130, 181, 145, 0.8);
  box-shadow: 0 0 0 3px rgba(130, 181, 145, 0.15);
  transform: scale(1.05);
}

.otp-digit:not(:placeholder-shown) {
  border-color: rgba(130, 181, 145, 0.6);
  background: rgba(130, 181, 145, 0.08);
}

.otp-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}