/* ---------- iOS Liquid Glass ----------
   Floating controls (round buttons, pill buttons, the composer and the tab bar) are frosted glass:
   see-through with a strong blur, a bright rim, a soft top highlight and a gentle shadow, and they
   squish a little when pressed. Loaded last so it applies everywhere these classes are used. */

:root {
  --glass-fill: rgba(255, 255, 255, 0.52);
  --glass-rim: rgba(255, 255, 255, 0.85);
  --glass-edge: rgba(16, 17, 19, 0.07);
  --glass-blur: blur(22px) saturate(1.9) brightness(1.05);
  --glass-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(16, 17, 19, 0.04),
    0 0 0 0.5px var(--glass-edge),
    0 8px 28px rgba(16, 17, 19, 0.10),
    0 2px 6px rgba(16, 17, 19, 0.05);
}

.round-btn,
.pill-btn,
.composer,
.tabbar {
  position: relative;
  isolation: isolate;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-shadow);
}
.tabbar { position: absolute; } /* keep its floating position */

/* The specular sheen across the top half, like light catching curved glass. */
.round-btn::before,
.pill-btn::before,
.composer::before,
.tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}

.composer:focus-within { border-color: var(--glass-rim); box-shadow: var(--glass-shadow), 0 0 0 3px rgba(10, 132, 255, 0.10); }

/* The selected tab is a small lens of brighter glass. */
.tab-indicator {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0.5px #fff, 0 0 0 0.5px rgba(16, 17, 19, 0.06), 0 2px 8px rgba(16, 17, 19, 0.08);
}

/* Press: a quick squish, then spring back. */
.round-btn, .pill-btn { transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.15s; }
.round-btn:active, .pill-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.68); }

/* Browsers without backdrop blur get solid white so text stays readable. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .round-btn, .pill-btn, .composer, .tabbar { background: rgba(255, 255, 255, 0.96); }
}
@media (prefers-reduced-transparency: reduce) {
  .round-btn, .pill-btn, .composer, .tabbar { background: rgba(255, 255, 255, 0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .round-btn, .pill-btn { transition: none; }
  .round-btn:active, .pill-btn:active { transform: none; }
}

/* ---------- Apple Messages-style composer ----------
   The + is its own round button beside a slimmer message pill (mic inside the pill), like iOS Messages.
   The form stays one element (voice bar, submit and keyboard logic unchanged); the pill is drawn on the
   text area's parent through a wrapper class set in 02-chat.js. */
.composer {
  min-height: 44px;
  padding: 0;
  gap: 10px;
  align-items: flex-end;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
}
.composer::before { display: none; }
.composer:focus-within { box-shadow: none; }
#attach-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  color: var(--text);
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-shadow);
  position: relative;
  isolation: isolate;
}
#attach-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}
#attach-btn:hover { background: var(--glass-fill); }
#attach-btn svg { width: 22px; height: 22px; stroke-width: 2; }
.composer-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  min-height: 44px;
  padding: 4px 4px 4px 18px;
  border-radius: 22px;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-shadow);
  position: relative;
  isolation: isolate;
}
.composer-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}
.composer-pill:focus-within { box-shadow: var(--glass-shadow), 0 0 0 3px rgba(10, 132, 255, 0.10); }
.composer-pill textarea { min-height: 24px; padding: 5px 0; font-size: 1.0625rem; }
.composer-pill #mic-btn { width: 34px; height: 34px; color: var(--text-2); }
.composer-pill #mic-btn svg { width: 22px; height: 22px; }
.composer-pill .send { width: 34px; height: 34px; }
.composer-pill .send svg { width: 18px; height: 18px; }
.composer.voice-on .composer-pill { padding-left: 8px; }
/* While recording, the whole form becomes the pill (the + and the text pill are hidden by 02c-voice.css). */
.composer.voice-on {
  min-height: 44px;
  padding: 0 4px 0 8px;
  border-radius: 22px;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-shadow);
}

/* Chat text a step smaller, like Messages. */
.bubble { font-size: 0.9375rem; line-height: 1.42; padding: 12px 16px; border-radius: 22px; }
