:root {
  --bg: #101c28;
  --panel: #ffffff10;
  --line: #d5edf323;
  --muted: #acbdcc;
  --green: #73e8c1;
  --text: #f3f8fe;
}
body {
  background:
    radial-gradient(ellipse at 8% 0, #214555, transparent 61%),
    radial-gradient(ellipse at 96% 97%, #164541, transparent 56%), #101c28;
}
header,
footer,
dialog,
#auth,
#quick {
  background: #0f1a28ad;
  -webkit-backdrop-filter: blur(27px) saturate(145%);
  backdrop-filter: blur(27px) saturate(145%);
}
header {
  border-bottom: 1px solid var(--line);
}
footer {
  border-top: 1px solid var(--line);
}
dialog,
#auth {
  border: 1px solid #c5ecff33;
  border-radius: 30px;
  box-shadow: 0 24px 65px #05121f5c;
}
#auth {
  width: min(92vw, 390px);
  padding: 28px 23px;
}
#messages {
  background: transparent;
}
button,
input,
textarea,
select {
  border: 1px solid #e0f5ff1e;
  border-radius: 20px;
}
button {
  font-weight: 500;
  transition:
    transform 0.18s,
    background 0.18s;
}
button:active {
  transform: scale(0.96);
}
#quick {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 12px 10px;
  background: none;
  scrollbar-width: none;
}
#quick button {
  font-size: 14px;
  padding: 5px 11px;
  white-space: nowrap;
  min-height: 36px;
}
#dates.due {
  box-shadow: inset 0 0 0 1px var(--green);
}
#people {
  padding: 0 8px;
}
.person {
  border: none;
  border-bottom: 1px solid #d5edf314;
}
.person.active {
  border-radius: 20px;
  background: #66f4c91c;
}
.avatar,
#profile {
  background: linear-gradient(150deg, #285f67, #17463c);
  color: #aaffdf;
}
#dialog header {
  gap: 5px;
}
#dialog header button,
#controls button {
  display: grid;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 39px;
  height: 39px;
  min-height: 39px;
  flex: none;
  padding: 0;
}
#dialog #back {
  display: none;
  line-height: 1;
}
#chatMenu {
  letter-spacing: 1px;
  font-size: 12px;
}
#dialog svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#mic,
#callAudio,
#callVideo,
.tag {
  color: var(--green);
}
.tag {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 2px 4px;
}
.bubble {
  border: 1px solid #d8f2ff0c;
  border-radius: 20px 20px 20px 6px;
  background: #243647eb;
  box-shadow: 0 3px 9px #0001;
}
.bubble.mine {
  background: #145448f2;
  border-radius: 20px 20px 6px 20px;
}
.day {
  background: #0c14208c;
  border-radius: 18px;
}
#sheet {
  background: #122333ee;
}
#sheet article {
  padding-top: 12px;
}
article > * {
  min-width: 0;
}
#rtc {
  padding: 24px;
  text-align: center;
  background: #14293afa;
}
#rtc h2 {
  margin: 10px 0;
  overflow-wrap: anywhere;
}
#rtc .movie {
  position: relative;
}
#rtc video {
  margin-top: 15px;
  width: 100%;
  max-height: 50dvh;
  border-radius: 20px;
  background: #06101c;
  object-fit: contain;
}
#rtc video.mini {
  width: 28%;
  max-height: 20dvh;
  position: absolute;
  bottom: 18px;
  right: 12px;
  border: 1px solid #fff7;
  transform: scaleX(-1);
}
.rtcButtons,
.resultList,
.poll {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.rtcButtons .hangup {
  background: #c83552;
}
.resultList button,
.bubble .poll button {
  text-align: left;
  overflow-wrap: anywhere;
  color: var(--text);
  white-space: normal;
}
.resultList small {
  display: block;
  margin-bottom: 4px;
}
.bubble .poll button {
  margin: 0;
  background: linear-gradient(
    90deg,
    #71ebc631 var(--pct),
    #06132138 var(--pct)
  );
  border-radius: 13px;
  opacity: 1;
}
.poll {
  min-width: min(230px, 54vw);
}
audio {
  width: 100%;
}
#text {
  flex: 1;
  min-width: 0;
}
@media (max-width: 740px) {
  #dialog #back {
    display: grid;
  }
  #controls {
    padding: 7px 8px;
  }
  #dialog header button,
  #controls button {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
  #quick {
    gap: 4px;
  }
  #quick button {
    padding-inline: 9px;
  }
  #dialog header {
    min-height: 64px;
  }
}
@media (max-width: 360px) {
  #controls #smile {
    display: none;
  }
  #dialog header {
    padding-inline: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.relayImage {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  margin-top: 14px;
  border-radius: 18px;
}

/* A revision belongs to one message. Only the earlier versions scroll. */
.revisionLine {
  display:flex;
  max-width:100%;
  margin:7px 0;
  gap:0;
  align-items:center;
}
.revisionLine.outgoing {justify-content:flex-end}
.revisionLine > .bubble {margin:0; flex:0 0 auto; max-width:66%; min-width:0;}
.revisionLine > .bubble > .body {font-weight:600}
.previousVersions {
  display:flex;
  min-width:0;
  overflow-x:auto;
  flex:0 1 auto;
  align-items:center;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
  scrollbar-color:#45616e transparent;
}
.oldVersion {
  flex:none;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  min-width:132px;
  max-width:min(235px,55vw);
  min-height:54px;
  border-radius:14px;
  border:0;
  background:#263746;
  color:#cad6dd;
  padding:7px 12px;
  gap:4px;
  text-align:left;
}
.versionBody {
  display:block;
  align-self:stretch;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
  font-size:15px;
}
.versionTime {display:block;color:#b6cad6;font-size:12px;font-weight:400}
.versionArrow {color:#92b5c9;flex:none;width:25px;text-align:center}
.fullVersions .body {overflow-wrap:anywhere;margin:6px 0 17px;user-select:text;}
.fullVersions .versionTime {color:#8edfc8}
.removedMessage.bubble {background:#263746;color:#bbcad3;font-style:italic;}
.removedMessage .meta {color:#b6cad6;font-style:normal;}
@media(max-width:540px) {
  .revisionLine > .bubble {max-width:57%}
  .oldVersion {min-width:109px;max-width:36vw;padding:7px 8px;}
  .versionArrow {width:18px}
  .versionTime {font-size:11px}
}
@media (max-width:540px) {
  .oldVersion {min-width:96px;max-width:26vw; padding:7px 5px;gap:3px;}
  .versionArrow {width:15px;}
  .versionBody {font-size:13px;}
  .oldVersion .versionTime {font-size:10px; line-height:1.2; text-align:right;}
  .revisionLine > .bubble > .body {font-size:14px;}
}
