:root {
  color-scheme: light dark;
  --background:#ffffff;
  --surface:#f1f5f9;
  --foreground:#172334;
  --blue:#1689dc;
  --outgoing:#d9efff;
  font-family:system-ui,sans-serif;
}
* { box-sizing:border-box; }
body {
  margin:0;
  height:100dvh;
  display:flex;
  flex-direction:column;
  background:var(--background);
  color:var(--foreground);
}
header {
  padding:18px;
  background:var(--blue);
  color:white;
}
.brand { font-size:21px;font-weight:700; }
.brand small { font-size:15px;font-weight:400; }
#status { font-size:12px;margin-top:4px; }
main {
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.notice {
  text-align:center;
  font-size:13px;
  margin:24px auto;
  max-width:340px;
}
.bubble {
  padding:10px 14px;
  border-radius:16px;
  max-width:85%;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  background:var(--surface);
  align-self:flex-start;
}
.outgoing {
  align-self:flex-end;
  background:var(--outgoing);
}
footer {
  padding:10px 12px;
  padding-bottom:max(12px,env(safe-area-inset-bottom));
}
form { display:flex;gap:8px;align-items:center; }
textarea {
  flex:1;
  min-width:0;
  height:46px;
  max-height:140px;
  resize:vertical;
  border:0;
  border-radius:22px;
  background:var(--surface);
  color:var(--foreground);
  padding:12px;
  font:inherit;
}
button {
  border:0;
  border-radius:22px;
  background:var(--blue);
  color:white;
  min-height:44px;
  padding:0 14px;
  cursor:pointer;
}
button:disabled,textarea:disabled {
  opacity:.45;
  cursor:default;
}
audio { width:240px;max-width:100%; }
#recording { color:#dc2626;padding:8px; }
#share { margin-top:8px; }
@media(prefers-color-scheme:dark) {
  :root {
    --background:#101b2b;
    --surface:#202f43;
    --foreground:#edf5ff;
    --outgoing:#17486c;
  }
}