:root {
  color-scheme: dark;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-0: #09090b;
  --bg-1: #0d0d11;
  --glass-bg: rgba(255, 255, 255, .06);
  --glass-bg-strong: rgba(255, 255, 255, .095);
  --glass-border: rgba(255, 255, 255, .10);
  --glass-border-strong: rgba(255, 255, 255, .20);
  --text: rgba(255, 255, 255, .92);
  --text-muted: rgba(255, 255, 255, .68);
  --text-dim: rgba(255, 255, 255, .48);
  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-ink: #04110f;
  --blur-sm: 12px;
  --blur-md: 20px;
  --blur-lg: 30px;
  --blur-xl: 40px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 999px;
  --shadow-glass: 0 26px 80px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .12);
  --shadow-soft: 0 18px 54px rgba(0, 0, 0, .34);
  --container: 80rem;
  --composer: 48rem;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, .18), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgba(99, 102, 241, .16), transparent 32rem),
    radial-gradient(circle at 54% 86%, rgba(14, 165, 233, .12), transparent 34rem),
    linear-gradient(180deg, #09090b 0%, #0a0a0c 48%, #08080a 100%);
}

.aurora-bg::after {
  content: "";
  position: absolute;
  inset: -1px;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 74%);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.container {
  width: min(100% - 3rem, var(--container));
  margin-inline: auto;
}

/* Sticky glass navigation for product shells. */
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(9, 9, 11, .80);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
}

.nav-inner {
  min-height: calc(4.25rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.brand-mark::before {
  content: "";
  width: .52rem;
  height: .52rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 24px rgba(94, 234, 212, .48);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .045);
  color: var(--text-muted);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.icon-btn:active {
  transform: translateY(1px) scale(.98);
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.hero {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 2.35rem;
  padding-block: clamp(3.25rem, 9vh, 7.5rem) clamp(2.5rem, 8vh, 6rem);
}

.hero-copy {
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: 0;
}

.subline {
  max-width: 38rem;
  margin: 1.15rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  line-height: 1.65;
}

/* Reusable glass surface with controlled depth and hover lift. */
.glass-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  box-shadow: var(--shadow-glass);
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-strong);
  background: var(--glass-bg-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .50), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.composer {
  width: min(100%, var(--composer));
  margin-inline: auto;
  padding: .75rem;
}

.composer-field {
  position: relative;
}

/* Glass input fields for textarea and future form controls. */
.glass-input {
  width: 100%;
  min-height: 9.5rem;
  max-height: 18rem;
  resize: none;
  display: block;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: calc(var(--r-xl) - .75rem);
  outline: none;
  background: rgba(3, 7, 18, .26);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  padding: 1.25rem 1.25rem 1rem;
  font-size: 1.06rem;
  line-height: 1.55;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, .42);
}

.glass-input:focus {
  border-color: rgba(94, 234, 212, .62);
  background: rgba(3, 7, 18, .34);
  box-shadow:
    0 0 0 4px rgba(94, 234, 212, .10),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .25rem .1rem;
}

.mode-list,
.send-cluster,
.chip-list {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.send-cluster {
  justify-content: flex-end;
}

.glass-pill,
.glass-chip {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.glass-pill {
  padding: 0 .9rem;
  font-size: .86rem;
  font-weight: 500;
}

.glass-pill.is-active {
  border-color: rgba(94, 234, 212, .36);
  background: rgba(94, 234, 212, .12);
  color: rgba(236, 253, 245, .94);
}

.glass-chip {
  padding: 0 1rem;
  font-size: .9rem;
  font-weight: 500;
}

.glass-pill:hover,
.glass-chip:hover {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  transform: translateY(-1px);
}

/* Button system with accent primary and quiet glass outline variant. */
.glass-btn {
  min-height: 2.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid rgba(94, 234, 212, .42);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(94, 234, 212, .95), rgba(129, 140, 248, .88));
  color: var(--accent-ink);
  box-shadow: 0 16px 34px rgba(45, 212, 191, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
  padding: 0 1.15rem 0 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.glass-btn:hover,
.glass-btn:focus-visible {
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(45, 212, 191, .24), inset 0 1px 0 rgba(255, 255, 255, .42);
}

.glass-btn:active {
  transform: translateY(1px) scale(.99);
}

.glass-btn[disabled] {
  cursor: default;
  filter: saturate(.8) brightness(.85);
  opacity: .76;
}

.glass-btn--ghost {
  width: 2.85rem;
  min-width: 2.85rem;
  padding: 0;
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, .045);
  color: var(--text-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.glass-btn--ghost:hover,
.glass-btn--ghost:focus-visible {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.glass-btn svg {
  width: 1rem;
  height: 1rem;
}

.enter-hint {
  color: rgba(4, 17, 15, .62);
  font-size: .74rem;
  font-weight: 500;
}

.feedback {
  min-height: 1.4rem;
  margin: .85rem .2rem 0;
  color: var(--text-dim);
  font-size: .86rem;
  font-weight: 400;
  text-align: center;
}

.suggestions {
  width: min(100%, var(--composer));
  margin-inline: auto;
  justify-content: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 1.5rem, var(--container));
  }

  .nav-inner {
    min-height: calc(3.75rem + env(safe-area-inset-top));
  }

  .hero {
    align-content: start;
    gap: 1.7rem;
    padding-block: clamp(2.5rem, 8vh, 4rem) 2.5rem;
  }

  .eyebrow {
    margin-bottom: .8rem;
    font-size: .72rem;
  }

  .subline {
    margin-top: 1rem;
    font-size: .98rem;
    line-height: 1.55;
  }

  .composer {
    border-radius: 1.55rem;
    padding: .55rem;
  }

  .glass-input {
    min-height: 8.2rem;
    border-radius: 1.15rem;
    padding: 1rem;
    font-size: 1rem;
  }

  .composer-bar {
    align-items: stretch;
    flex-direction: column;
    padding-top: .65rem;
  }

  .mode-list,
  .send-cluster {
    width: 100%;
  }

  .mode-list {
    gap: .45rem;
  }

  .glass-pill {
    min-height: 2.4rem;
    flex: 1 1 auto;
    padding-inline: .7rem;
  }

  .send-cluster {
    justify-content: space-between;
  }

  .glass-btn:not(.glass-btn--ghost) {
    flex: 1 1 auto;
  }

  .enter-hint {
    display: none;
  }

  .suggestions {
    justify-content: flex-start;
  }

  .glass-chip {
    flex: 1 1 calc(50% - .55rem);
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
}

body.chat-page {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.chat-app {
  height: 100svh;
  min-height: 0;
  padding-bottom: 0;
}

.chat-frame {
  width: min(100% - 2rem, 50rem);
  margin-inline: auto;
}

.chat-topbar {
  flex: 0 0 auto;
}

.topbar-inner {
  min-height: calc(4rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: env(safe-area-inset-top);
}

.chat-brand {
  gap: .55rem;
  font-size: 1rem;
}

.brand-dot {
  width: .55rem;
  height: .55rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(94, 234, 212, .45);
}

.read-toggle {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--text-muted);
  font-size: .86rem;
  font-weight: 450;
}

.read-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.switch {
  width: 3rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .07);
  padding: .16rem;
  transition: background .18s ease, border-color .18s ease;
}

.switch-thumb {
  width: 1.22rem;
  height: 1.22rem;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
  transform: translateX(0);
  transition: transform .18s ease, background .18s ease;
}

.switch.is-on {
  border-color: rgba(94, 234, 212, .45);
  background: rgba(94, 234, 212, .18);
}

.switch.is-on .switch-thumb {
  background: var(--accent);
  transform: translateX(1.32rem);
}

.chat-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1.2rem 0 1.35rem;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

.chat-message {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
}

.chat-message--sparrow {
  justify-content: flex-start;
}

.chat-message--me {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(78%, 34rem);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .065);
  color: var(--text);
  padding: .78rem .86rem .48rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
}

.chat-message--sparrow .chat-bubble {
  border-bottom-left-radius: 7px;
}

.chat-message--me .chat-bubble {
  border-color: rgba(94, 234, 212, .26);
  border-bottom-right-radius: 7px;
  background: linear-gradient(135deg, rgba(94, 234, 212, .18), rgba(129, 140, 248, .14));
}

.chat-bubble p {
  margin: 0;
  color: rgba(255, 255, 255, .90);
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-time {
  display: block;
  margin-top: .34rem;
  color: var(--text-dim);
  font-size: .69rem;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.voice-label {
  margin-bottom: .5rem;
  color: rgba(255, 255, 255, .78);
  font-size: .84rem;
  font-weight: 500;
}

.chat-bubble audio {
  width: min(18rem, 100%);
  display: block;
}

.chat-composer-wrap {
  flex: 0 0 auto;
  border-top: 1px solid var(--glass-border);
  background: rgba(9, 9, 11, .78);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  padding: .72rem 0 calc(.72rem + env(safe-area-inset-bottom));
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: .65rem;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .10);
  padding: .68rem;
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.7rem;
  max-height: 8.25rem;
  border-radius: 14px;
  padding: .72rem .86rem;
  font-size: 1rem;
  line-height: 1.35;
  scrollbar-width: none; /* Firefox: keine Scrollbar/Pfeile */
}
.chat-input::-webkit-scrollbar { width: 0; height: 0; } /* Chromium/Safari: keine Scrollbar-Pfeile */

.composer-actions {
  flex: 0 0 auto;
  min-width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.composer-icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.composer-icon-btn:hover,
.composer-icon-btn:focus-visible {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, .10);
}

.composer-icon-btn:active {
  transform: translateY(1px) scale(.98);
}

.composer-icon-btn svg {
  width: 1.18rem;
  height: 1.18rem;
}

.send-btn {
  border-color: rgba(94, 234, 212, .44);
  background: linear-gradient(135deg, rgba(94, 234, 212, .95), rgba(129, 140, 248, .88));
  color: var(--accent-ink);
}

.voice-btn .recording-time {
  display: none;
}

.voice-btn.is-recording {
  width: 5rem;
  border-radius: var(--r-full);
  border-color: rgba(248, 113, 113, .55);
  background: rgba(248, 113, 113, .16);
  color: #fecaca;
  animation: recordPulse 1.1s ease-in-out infinite;
}

.voice-btn.is-recording .icon-mic {
  width: 1rem;
  height: 1rem;
}

.voice-btn.is-recording .recording-time {
  display: inline;
  font-size: .78rem;
  font-weight: 500;
}

.chat-notice {
  min-height: 1.1rem;
  width: min(100% - 2rem, 50rem);
  margin: .42rem auto 0;
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 400;
  text-align: center;
}

@keyframes recordPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, .22), inset 0 1px 0 rgba(255, 255, 255, .10);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(248, 113, 113, 0), inset 0 1px 0 rgba(255, 255, 255, .10);
  }
}

@media (max-width: 720px) {
  body.chat-page {
    position: fixed;
    inset: 0;
    width: 100%;
  }

  .chat-frame {
    width: min(100% - 1rem, 50rem);
  }

  .topbar-inner {
    min-height: calc(3.65rem + env(safe-area-inset-top));
  }

  .read-toggle {
    gap: .42rem;
  }

  .read-toggle-text {
    display: none;
  }

  .chat-thread {
    gap: .58rem;
    padding-block: .9rem 1rem;
  }

  .chat-bubble {
    max-width: 86%;
    border-radius: 16px;
    padding: .72rem .78rem .44rem;
  }

  .chat-bubble p {
    font-size: .95rem;
  }

  .chat-composer-wrap {
    padding-top: .55rem;
  }

  .chat-composer {
    width: min(100% - .75rem, 50rem);
    gap: .5rem;
    border-radius: 18px;
    padding: .5rem;
  }

  .chat-input {
    min-height: 2.65rem;
    padding: .7rem .78rem;
  }

  .composer-icon-btn {
    width: 2.65rem;
    height: 2.65rem;
    min-width: 2.65rem;
  }

  .voice-btn.is-recording {
    width: 4.75rem;
  }
}
