.button {
  border: none;
  border-radius: 44px;
  background: #E4DCFF;
  cursor: pointer;
  color: #4829AF;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 14px;
  height: 44px;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 0.3px;
  min-width: 90px;
  justify-content: center;
  position: relative;
  gap: 8px;
  transition: filter 150ms ease;
}

.button:focus {
  outline: none;
}

.button:focus:before {
  content: '';
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--focus-ring-inner-color) inset, 0 0 0 2px var(--focus-ring-outer-color);
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: -2px;
  right: -2px;
}

.button:hover {
  filter: brightness(105%);
}

.button--primary:hover {
  filter: brightness(115%);
}

.button:active:after {
  content: '';
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.2);
  transition: none;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.button[disabled] {
  cursor: default;
  color: gray;
  pointer-events: none;
}

.button--icon-position-end {
  flex-direction: row-reverse;
}

.button--alignment-edge {
  justify-content: space-between;
}

.button--transparent {
  background: none;
  border: none;
}

.button--icon-only {
  color: var(--text-color-dark);
  width: 44px;
  justify-content: center;
  padding: 0;
  min-width: 0px;
}

.button--primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-color-light);
  font-weight: bold;
}

.button--secondary {
  background: transparent;
  border-color: transparent;
  color: var(--text-color-dark);
  font-weight: bold;
  padding: 0 10px;
  min-width: 0px;
}

.button--small {
  width: 22px;
  height: 22px;
}

.button__icon {
  width: 24px;
}

.button__label {
  margin-top: 1px;
}

/* This label is for when rendering the page without CSS icon only buttons have content */
.button__hidden-label {
  display: none;
}

.icon svg {
  display: block;
}

.overlay {
  position: fixed;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 0;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0);
  border-radius: 38px;
  transition: all 300ms ease;
}

.overlay--show {
  background-color: rgba(0, 0, 0, 0.2);
}

@media(max-width: 420px) {
  .overlay {
    border-radius: 36px;
    align-items: flex-end;
  }
}

.overlay__hit-area {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.modal {
  background: white;
  border-radius: 31px;
  box-shadow: 0 0 0 2px #999999, 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  display: flex;
  flex-direction: column;
  min-width: 400px;
  margin: 10px;
  position: relative;
  max-height: 95vh;
  overflow: hidden;
}

.modal__header {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  padding: 20px 0 20px;
}

.modal__content {
  line-height: 1.3;
  padding: 5px 20px 30px;
  text-align: center;
}

.modal__content--has-no-actions {
  line-height: 1.3;
  padding: 5px 20px 35px;
  text-align: center;
}

.modal__content--scrollable {
  overflow: auto;
}

.modal__actions {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  padding: 15px;
  padding-top: 0;
}

.modal__actions--single-action {
  justify-content: center;
}

.modal__action--primary {
  margin-left: auto;
}

.modal__close-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

@media(max-width: 420px) {
  .modal {
    border-radius: 36px;
    width: 100%;
    min-height: 40%;
    min-width: 0;
  }

  .modal__actions {
    margin-top: auto;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }
}

.modal {
  transform: translateY(101%);
}

.modal-transition-enter, .modal-transition-exit {
  transition: all 150ms ease;
}

.modal-transition-enter-active, .modal-transition-exit, .modal-transition-enter-done {
  transform: translateY(0%);
}

.modal-transition-exit-active, .modal-transition-exit-done {
  transform: translateY(101%);
}

@media(min-width: 420px) {
  .modal {
    transform: scale(1);
    opacity: 0;
  }

  .modal-transition-enter, .modal-transition-exit {
    transition: all 150ms ease;
  }

  .modal-transition-enter-active, .modal-transition-exit, .modal-transition-enter-done {
    transform: scale(1);
    opacity: 1;
  }

  .modal-transition-exit-active, .modal-transition-exit-done {
    transform: scale(1);
    opacity: 0;
  }
}

.progress {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  height: 30px;
  padding: 0 11px 11px;
  position: relative;
  z-index: 1;
}

.progress progress {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  opacity: 0;
  position: absolute;
}

.progress__label {
  color: gray;
  font-size: 13px;
}

.progress__bar {
  border-radius: 100px;
  background: #eee;
  width: 100%;
  height: 8px;
  position: relative;
  overflow: hidden;
}

.progress__bar:after {
  content: '';
  width: 110%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.08) 10px,
    rgba(0, 0, 0, 0.08) 20px
  );
  position: absolute;
  left: 0;
  animation: stripes 400ms linear infinite;
  z-index: 1;
}

.progress__fill {
  background: var(--accent-color);
  border-radius: 100px 0 0 100px;
  width: 30%;
  height: 100%;
  position: absolute;
  transition: 50ms width ease-in-out;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 2px 5px red;
}

.progress__fill:after {
  content: '';
  background: var(--accent-color);
  border-radius: 0 100px 100px 0;
  width: 8px;
  height: 8px;
  position: absolute;
  right: -8px;
}

@keyframes stripes {
  from {
    transform: translateX(0px);
  }
  
  to {
    transform: translateX(-28px);
  }
}

.text-field {
  position: relative;
}

.text-field__label {
  display: block;
  color: var(--text-field-text-color-dark);
  font-weight: 500;
  margin-bottom: 6px;
  text-align: left;
}

.text-field__input {
  background-color: var(--text-field-background-color);
  border: 2px solid var(--text-field-border-color);
  border-radius: 8px;
  font-family: "Roboto Mono", sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  width: 100%;
  height: 44px;
  padding: 10px;
  transition: filter 150ms ease;
}

.text-field__input:hover {
  filter: brightness(103%);
}

.text-field__input:focus {
  box-shadow: 0 0 0 2px var(--focus-ring-inner-color), 0 0 0 4px var(--focus-ring-outer-color);
  filter: brightness(103%);
  outline: none;
}

.text-field__input::placeholder {
  color: var(--input-placeholder-color);
}

.text-field__input--collapsed {
  border: 0;
  background-color: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 65px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.text-field__input--inactive {
  pointer-events: none;
  user-select: none;
}

.text-field__input--uppercase {
  text-transform: uppercase;
}

.text-field__input--toggle-visible {
  padding-right: 60px;
}

.text-field__required {
  color: var(--error-color);
}

.text-field__input-container {
  position: relative;
}

.text-field__toggle-button {
  border-radius: 8px;
  pointer-events: none;
  position: absolute;
  width: 65px;
  min-width: 0;
  top: 0;
  right: 0;
  z-index: 3;
}

.join-modal__message {
  color: var(--error-color);
  text-align: left;
  margin-top: 12px;
}

@media (max-width: 420px) {
  .scan-qr-modal {
    min-height: 0;
  }
}

.scan-qr-modal__content {
  padding: 0px;
}

.scan-qr-modal__header {
  filter: drop-shadow(0px 0px 1px black);
  position: absolute;
  width: 100%;
  color: var(--text-color-light);
  z-index: 2;
}

.scan-qr-modal__close-icon {
  color: var(--text-color-light);
}

.scan-qr-modal__view-finder {
  background-color: #DDDDDD;
  background-size: 100px 100px;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
  animation: noise 500ms steps(1) infinite;
}

@keyframes noise {
  0% {
    background-position: 0px 0px;
  }

  25% {
    background-position: 20px 50px;
  }

  50% {
    background-position: -12px 5px;
  }

  75% {
    background-position: 5px 80px;
  }

  100% {
    background-position: 35px 70px;
  }
}

.scan-qr-modal__video {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  z-index: 1; 
}

.scan-qr-modal__video-container {
  background: black;
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.scan-qr-modal__video-container--not-ready {
  transform: scale(0%, 0%);
}

.scan-qr-modal__video-container--ready {
  animation: video-open-simple 300ms ease-in-out both;
}

@keyframes video-open-simple {
  0% {
    opacity: 0;
    transform: scale(1.1);
  }

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

.scan-qr-modal__message {
  color: var(--text-color-light);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  font-weight: 500;
  z-index: 3;
  position: absolute;
}

.scan-qr-modal__message--transition-enter, .scan-qr-modal__message--transition-enter-done {
  animation: message-enter 300ms ease forwards;
}

.scan-qr-modal__message--transition-exit, .scan-qr-modal__message--transition-exit-done {
  animation: message-exit 300ms ease forwards;
}

@keyframes message-enter {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

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

@keyframes message-exit {
  from {
    transform: translateY(0px);
    opacity: 1;
  }

  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

.scan-qr-modal__target {
  color: var(--qr-scanner-target-normal-color);
  position: absolute;
  inset: 20%;
  z-index: 2;
  animation: qr-idle 4s ease-in-out infinite;
}

.scan-qr-modal__target-shadow {
  box-shadow: 0 0 0 100px rgba(0, 0, 0, 0.7), 0 0 5px 10px rgba(0, 0, 0, 0.7) inset;
  position: absolute;
  inset: 20%;
  z-index: 2;
}

.scan-qr-modal__target-corners {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: all 300ms ease;
  z-index: 3;
}

.scan-qr-modal__target-corners--failed {
  animation: qr-error 700ms ease forwards;
}

.scan-qr-modal__target-corners--success {
  animation: qr-success 700ms ease forwards;
}

.scan-qr-modal__target-corner {
  filter: drop-shadow(0px 0px 1px black);
  background-color: currentColor;
  border-radius: 100px;
  width: 20px;
  height: 6px;
  position: absolute;
  transform-origin: top 6px;
}

.scan-qr-modal__target-corner::after {
  content: "";
  background: currentColor;
  border-radius: 100px;
  width: 6px;
  height: 20px;
  position: absolute;
  left: 0;
}

.scan-qr-modal__target-corner:nth-child(1) {
  top: 0;
  left: 0;
}

.scan-qr-modal__target-corner:nth-child(2) {
  top: 0;
  right: 0;
  transform: scale(-1, 1);
}

.scan-qr-modal__target-corner:nth-child(3) {
  bottom: 0;
  right: 0;
  transform: scale(-1, -1);
}

.scan-qr-modal__target-corner:nth-child(4) {
  bottom: 0;
  left: 0;
  transform: scale(1, -1);
}

@keyframes qr-idle {
  0% {
    transform: scale(1.05);
  }
  
  50% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.05);
  }
}

@keyframes qr-error {
  0% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(-15px);
  }

  10% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(15px);
  }

  20% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(-10px);
  }

  30% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(10px);
  }

  40% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(-5px);
  }

  50% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(5px);
  }

  60% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(-2px);
  }

  70% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(2px);
  }

  80% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(0px);
  }

  90% {
    color: var(--qr-scanner-target-error-color);
    transform: translateX(0px);
  }

  100% {
    color: var(--qr-scanner-target-normal-color);
    transform: translateX(0px);
  }
}

@keyframes qr-success {
  0% {
    color: var(--qr-scanner-target-success-color);
    transform: scale(1);
  }

  25% {
    color: var(--qr-scanner-target-success-color);
    transform: scale(0.9);
  }

  85% {
    color: var(--qr-scanner-target-success-color);
    transform: scale(1);
  }

  100% {
    color: var(--qr-scanner-target-normal-color);
    transform: scale(1);
  }
}

.recent-rooms {}

.recent-rooms__title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  padding-left: 23px;
}

.recent-rooms__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-rooms__button {
  background: transparent;
  box-shadow: 0 0 0 2px #9B85E5 inset;
  color: #4829AF;
  width: 100%;
  padding: 0 22px;
  padding-right: 19px; /* Account for empty space around icon. */
  font-size: 18px;
  font-weight: 500;
  width: 100%;
  height: 54px;
  transition: box-shadow 150ms ease;
}

.recent-rooms__button:hover {
  box-shadow: 0 0 0 2px #4829AF inset;
  filter: brightness(100%);
}

.recent-rooms__button svg {
  stroke: #4829AF;
}

.recent-rooms__button[disabled] {
  box-shadow: 0 0 0 2px #DADADA inset;
}

.recent-rooms__button-label {
  font-size: 13px;
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
}

@media(max-width: 800px) {
  .recent-rooms {
    padding-bottom: 15px;
  }

  .recent-rooms__title {
    padding: 0;
  }
}

.start-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.start-buttons__group {
  display: flex;
  gap: 10px;
}

.start-buttons__button {
  flex-grow: 1;
  font-size: 18px;
  height: 54px;
}

.start-buttons__button--icon-only {
  width: 54px;
  flex-grow: 0;
}

.start-buttons__icon {
  color: #4829AF;
}

.spinner {
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
}

.spinner--gray {
  color: #B3E3CE;
}

.spinner__flower {
  animation: spin 3s linear infinite;
}

.spinner__flower, .spinner__flower-stem {
  background-color: currentColor;
  border-radius: 100px;
  width: 11px;
  height: 43px;
  position: absolute;
}

.spinner__flower:before, .spinner__flower:after {
  content: '';
  position: absolute;
  background-color: currentColor;
  border-radius: 100px;
  width: 11px;
  height: 43px;
}

.spinner__flower-stem {
  transform: rotate(90deg);
}

.spinner__flower:before {
  transform: rotate(45deg);
}

.spinner__flower:after {
  transform: rotate(135deg);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

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

.welcome-screen {
  background-color: var(--welcome-screen-background-color);
  color: var(--text-color-dark);
  position: absolute;
  width: 100%;
  /*
    Height is set to 99.9% because it stops the Samsung browser hiding the UI
    when scrolling down. The Samsung browser behaves as if the user is scrolling
    the whole page when the element being actively scrolled is 100% width and
    height, and absolutely positioned. Kind of clever really.

    Normally this wouldn't be a problem, but when scrolling down on the welcome
    screen and then navigating to the messages screen, the message composer
    will not be pinned to the bottom of the viewport. Instead there will be
    a big gap!

    The only way to get rid of the gap as a user is to manually scroll back to
    the top of the page. I tried programmatically scrolling to the top when
    navigating to the messages screen but this did not work in resetting
    the viewport.

    So here we are, until I find a cleaner fix.
  */
  height: 99.9%;
  min-height: 540px;
  overflow: auto;
}

.welcome-screen__special-message {
  background: #ffeead;
  position: absolute;
  padding: 5px;
  font-size: 12px;
  width: 100%;
  text-align: center;
}

@media(max-width: 400px) {
  .welcome-screen__special-message {
    font-size: 8px;
  }
}

.welcome-screen__content {
  margin: 0 auto;
  max-width: 1200px;
  padding: 60px 50px;
  display: grid;
  grid-template-columns: auto;
  grid-auto-rows: auto;
  grid-template-areas:
    "title title"
    "subtitle illustration"
    "actions illustration"
    "footer footer";
  height: 100%;
}

.welcome-screen__logo {
  height: 46px;
}

.welcome-screen__title {
  grid-area: title;
  align-self: start;
  font-size: 22px;
  font-weight: bold;
  text-transform: uppercase;
}

.welcome-screen__hidden-title {
  display: none;
}

.welcome-screen__subtitle {
  align-self: end;
  grid-area: subtitle;
  font-size: 42px;
  font-weight: bold;
  line-height: 1.25;
  margin-bottom: 30px;
}

.welcome-screen__actions {
  display: flex;
  flex-direction: column;
  gap: 40px;
  grid-area: actions;
  align-self: start;
  max-width: 280px;
  width: 100%;
  margin-top: 30px;
}

.welcome-screen__illustration-container {
  grid-area: illustration;
  padding-left: 50px;
  align-self: center;
  justify-self: end;
}

.welcome-screen__illustration {
  image-rendering: pixelated;
  position: relative;
}

.welcome-screen__illustration img {
  width: 100%;
}

.welcome-screen__footer {
  grid-area: footer;
  align-self: end;
  text-align: center;
  font-size: 16px;
}

.welcome-screen__footer-link {
  display: inline;
  color: inherit;
  text-decoration: none;
  margin-right: 10px;
  position: relative;
  padding: 5px 6px;
  border-radius: 4px;
  transition: background 100ms ease;
}

.welcome-screen__footer-link:hover {
  background: #eee;
}

.welcome-screen__footer-link:active {
  background: #d4d4d4;
}

.welcome-screen__footer-link:focus {
  border-radius: 4px;
  outline: 2px solid var(--focus-ring-outer-color);
}

.welcome-screen__footer-link--twitter {
  color: var(--link-color);
}

.welcome-screen__footer-link:last-child {
  margin-right: 0;
}

@media(max-width:960px) {
  .welcome-screen__subtitle {
    font-size: 32px;
  }
}

@media(max-width: 800px) {
  .welcome-screen {
    min-height: 0;
  }

  .welcome-screen__credit {
    display: inline-block;
    margin-top: 8px;
  }

  .welcome-screen__content {
    row-gap: 10px;
    text-align: center;
    padding: 30px 25px;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;

    /* TODO: LOL what is this possible to avoid? */
    grid-auto-rows: minmax(min-content, max-content) minmax(min-content, max-content) auto auto;
    grid-template-areas:
      "title"
      "subtitle"
      "illustration"
      "actions"
      "footer";
    height: 100%;
  }

  .welcome-screen__subtitle {
    font-size: 22px;
    align-self: start;
    margin-bottom: 0;
  }

  .welcome-screen__illustration-container {
    width: 100%;
    max-width: 433px;
    padding-left: 0;
    padding: 30px 30px;
    justify-self: center;
    align-self: center;
  }

  .welcome-screen__illustration {
    width: 100%;
    padding-bottom: 78.98%; /* 342/433 */
    position: relative;
  }

  .welcome-screen__illustration img {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: absolute
  }

  .welcome-screen__actions {
    align-self: center;
    justify-self: center;
    margin-top: 0;
  }

  .welcome-screen__footer {
    padding: 15px 0;
  }

  .welcome-screen__footer-link--twitter:hover:after {
    left: -100%;
  }
}

@media(max-width: 400px) {
  .welcome-screen__content {
    row-gap: 5px;
    padding: 20px;
  }

  .welcome-screen__subtitle {
    font-size: 18px;
  }

  .welcome-screen__illustration-container {
    width: 85%;
  }

  .welcome-screen__illustration {
    image-rendering: auto;
  }
}

@media(max-height: 600px) and (min-width: 800px) {
  .welcome-screen__subtitle {
    margin-bottom: 15px;
  }

  .welcome-screen__actions {
    margin-top: 15px;
  }
}

.text-reference {
  background: red;
  position: absolute;
  pointer-events: none;
  user-select: none;
  visibility: hidden;

  /*
    Line height needs to be reset because it inherits a line height from
    the CSS reset that sets it to `1`, and that causes clipping of
    type descenders.

    https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align
    https://actsofvolition.com/2019/10/font-descenders-cut-off-in-safari-buttons-when-line-height-set-to-1/
  */
  line-height: normal;
}

.text-reference__text {
  background: yellow;
  word-wrap: break-word;
  white-space: pre-line;
}

.composer {
  background: var(--modal-background-color);
  border-radius: 30px;
  box-shadow: 0 0 0 2px var(--modal-border-color), 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  display: flex;
  align-items: flex-end;
  height: 60px;
  position: relative;
  transition: height 150ms cubic-bezier(0.45, 0, 0.55, 1);
  z-index: 4;
}

.composer--expanded {
  height: 250px;
}

.composer__file-form {
  display: none;
}

.composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  padding: 0 8px;
  transition: box-shadow 250ms cubic-bezier(0.45, 0, 0.55, 1);
}

.composer__text-reference {
  height: 100%;
  top: 0;
  left: 64px;
  right: 64px;
  position: absolute;
  padding: 0 15px;
}

.composer__text-input-container {
  background-color: var(--text-field-background-color);
  display: flex;
  align-items: center;
  border-radius: 22px;
  left: 8px;
  right: 62px;
  top: 8px;
  bottom: 8px;
  position: absolute;
  overflow: hidden;
  transition:
    left 250ms cubic-bezier(0.45, 0, 0.55, 1),
    top 250ms cubic-bezier(0.45, 0, 0.55, 1),
    right 250ms cubic-bezier(0.45, 0, 0.55, 1),
    bottom 250ms cubic-bezier(0.45, 0, 0.55, 1)
  ;
}

.composer__text-input-container:focus-within {
  box-shadow: 0 0 0 2px var(--focus-ring-outer-color);
}

.composer__text-input-container--expanded {
  background: var(--text-field-background-color);
  border-radius: 22px;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 60px;
  height: auto;
}

.composer__text-input {
  background-color: inherit;
  border: 0;
  width: 100%;
  line-height: 1.2;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  /*
    Padding on top and bottom to increase effective click area / tap target.
    Can't fake it with click handler because context menu on phone relies on
    actually clicking an input field.
  */
  padding: 16px 15px;
  padding-left: 45px;
  resize: none;
  overflow: hidden;
  transition: background 250ms cubic-bezier(0.45, 0, 0.55, 1), padding 250ms cubic-bezier(0.45, 0, 0.55, 1);
}

.composer__text-input:focus {
  outline: none;
}

.composer__text-input--expanded {
  background: transparent;
  padding-top: 12px;
  padding-bottom: 10px;
  padding-left: 15px;
  line-height: 1.4;
  overflow-y: scroll;
}

.composer__help-message {
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 250ms cubic-bezier(0.45, 0, 0.55, 1);
}

.composer__help-message--expanded {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.composer__send-icon {
  color: var(--text-color-light);
}

.composer-transition-enter-active {
  animation: composer-bounce-open 500ms 150ms ease forwards;
}

.composer-transition-exit-active {
  animation: composer-bounce-close 450ms 150ms ease forwards;
}


@keyframes composer-bounce-open {
  0% {
    transform: translateY(0px)
  }

  25% {
    transform: translateY(-10px)
  }

  75% {
    transform: translateY(2px)
  }

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

@keyframes composer-bounce-close {
  0% {
    transform: translateY(0px)
  }

  25% {
    transform: translateY(10px)
  }

  75% {
    transform: translateY(-2px)
  }

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

.send-box {
  max-width: 480px;
  margin: 0 auto;
  pointer-events: auto;
}

@media(max-width: 419px) {
  .send-box {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 15px);
  text-align: center;
  line-height: 1.4;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

.empty-state__title {
  color: #4A4A4A;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state__text {
  color: #696969;
  width: 280px;
}

@media(max-height: 420px) {
  .empty-state {
    display: none;
  }
}

.room-errors {
  background: var(--warning-background-color);
  padding: 10px;
  color: var(--warning-text-color);
  text-align: center;
}

@media (orientation: landscape) {
  .room-errors {
    padding-left: calc(10px + env(safe-area-inset-bottom));
    padding-right: calc(10px + env(safe-area-inset-bottom));
  }
}

.tooltip-bubble {
  background: var(--tooltip-background-color);
  color: var(--tooltip-text-color);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  border-radius: 15px;
  padding: 12px 8px;
  position: fixed;
  font-weight: 500;
  z-index: 99;
  line-height: 1.35;
  max-width: 280px;
  text-align: center;
  transition: 300ms opacity ease-in-out;
  opacity: 1;
}

.tooltip-bubble--transition-enter {
  transition: none;
}

.tooltip-bubble--transition-exit-active {
  opacity: 0;
}

.room-details {
  background-color: var(--primary-color);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  border-radius: 60px;
  height: 60px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-family: "Roboto Mono", sans-serif;
  transition: filter 150ms ease;
  animation: button-bounce 1s ease forwards;
}

@keyframes button-bounce {
  0% {
    transform: translateY(0);
  }

  25% {
    transform: translateY(1.5px);
  }

  75% {
    transform: translateY(-0.5px);
  }

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

.room-details__icon {
  color: var(--text-color-light);
  width: 22px;
  margin-right: 10px;
}

.room-details__code {
  color: var(--text-color-light);
  display: inline-flex;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.room-details__character {
  animation: character-bounce 1s ease forwards;
}

.room-details__character--empty {
  width: 8px;
}

@keyframes character-bounce {
  0% {
    transform: translateY(0);
  }

  25% {
    transform: translateY(-2px);
  }

  50% {
    transform: translateY(0.5px);
  }

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

/* Bar 1 */
.room-details__icon path:nth-child(3) {
  animation: room-details-pulse 5s 0.1s ease-in-out infinite;
}

/* Bar 2 */
.room-details__icon path:nth-child(1) {
  animation: room-details-pulse 5s 0.35s ease-in-out infinite;
}

/* Bar 3 */
.room-details__icon path:nth-child(2) {
  animation: room-details-pulse 5s 0.6s ease-in-out infinite;
}


@keyframes room-details-pulse {
  0% {
    opacity: 1;
  }

  10% {
    opacity: 1;
  }

  15% {
    opacity: 0.3;
  }

  20% {
    opacity: 1;
  }

  30% {
    opacity: 1;
  }

  35% {
    opacity: 0.3;
  }

  40% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

@media(max-width: 530px) {
  .room-details {
    height: 44px;
    padding: 0 15px;   
  }

  .room-details__code {
    font-size: 21px;
    line-height: 30px;
  }

  .room-details__character--empty {
    width: 6px;
  }
}

.qr-code {
  background: #eee;
  border: 0;
  padding: 0;
  transition: all 300ms ease;
  width: 160px;
  height: 160px;
}

.qr-code__image {
  display: block;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}

.big-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 32px;
  font-weight: bold;
  text-transform: uppercase;
}

.big-code__char {
  background: var(--text-field-background-color);
  border-radius: 8px;
  font-family: "Roboto Mono", sans-serif;
  color: var(--text-color-dark);
  display: inline-flex;
  width: 35px;
  height: 45px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  position: relative;
}

.big-code__char--empty {
  width: 8px;
  height: 0;
}

.big-code__char--number {}

.share-modal__message {
  max-width: 274px;
  margin: 0 auto;
  line-height: 1.3;
}

.share-modal__message a {
  color: var(--link-color);
  text-decoration: none;
}

.share-modal__code {
  margin: 15px 0 18px
}

.share-modal__qr {
  display: flex;
  justify-content: center;
}

.header {
  position: relative;
  height: 80px;
  z-index: 1;
}

.header__foreground {
  position: relative;
  width: 100%;
  height: 100px;
  top: 0;
  left: 0;
  z-index: 2;

  display: flex;
  justify-content: space-between;
  padding: 0 28px;
  gap: 8px;
}

.header__group {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 8px;
}

.header__group--center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.header__button, .header__button:disabled {
  background: var(--primary-color);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  color: var(--text-color-light);
  min-width: 0;
}

.header__icon {
  color: var(--text-color-light);
}

@media(max-width: 530px) {
  .header {
    height: 73px;
  }

  .header__group--center {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
  }
}

@media(max-width: 420px) {
  .header {
    height: 57px;
  }

  .header__foreground {
    height: 70px;
    padding: 0 15px;
  }
}

.message-bubble {
  background: var(--message-bubble-background-color);
  color: var(--message-bubble-text-color);
  border-radius: 30px;
  border: 2px solid var(--message-bubble-border-color);
  display: inline-flex;
  flex-direction: column;
  min-width: 320px;
  max-width: 500px;
}

.message-bubble--warning {
  background: var(--warning-background-color);
  text-align: center;
}

@media(max-width: 530px) {
  .message-bubble {
    width: 100%;
    min-width: 220px;
    max-width: none;
  }
}

.message-content {
  font-weight: 500;
  line-height: 1.4;
  padding: 25px;
  word-break: break-word;
}

.message-content--with-header {
  padding-top: 12px;
}

.message-content--with-footer {
  padding-bottom: 6px;
}

@media(max-width: 530px) {
  .message-content {
    padding: 20px;
  }

  .message-content--with-header {
    padding-top: 12px;
  }

  .message-content--with-footer {
    padding-bottom: 6px;
  }
}

.message-footer {
  display: flex;
  align-items: center;
  padding: 15px;
  padding-top: 0;
}

.message-footer__actions {
  display: flex;
  margin-left: auto;
}

.message-footer__metadata {
  display: flex;
  margin-left: -2px;
}

.message-footer__action, .message-footer__metadata {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  margin-right: 5px;
}

.message-footer__meta {
  padding: 0 12px;
}

.message-footer__action:last-child, .message-footer__meta:last-child {
  margin-right: 0px;
}

@media(max-width: 530px) {
  .message-footer {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
  }
}

.copy-to-clipboard {
  background: var(--tooltip-background-color);
  border-radius: 100px;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  color: var(--text-color-light);
  position: absolute;
  padding: 10px 12px;
  transform: translateY(-40px);
  user-select: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.copy-to-clipboard--transition-enter, .copy-to-clipboard--transition-enter-done {
  opacity: 1;
  animation: copy-to-clipboard-in 500ms ease-in-out forwards;
}

.copy-to-clipboard--transition-exit, .copy-to-clipboard--transition-exit-done {
  opacity: 1;
  animation: copy-to-clipboard-out 500ms ease-in-out forwards;
}

@keyframes copy-to-clipboard-in {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }

  40% {
    transform: translateY(-42px);
    opacity: 1;
  }

  100% {
    transform: translateY(-40px);
    opacity: 1;
  }
}


@keyframes copy-to-clipboard-out {
  0% {
    transform: translateY(-40px);
    opacity: 1;
  }

  100% {
    transform: translateY(-38px);
    opacity: 0;
  }
}

.attachment {
  display: flex;
  flex-direction: row;
  align-items: top;
  text-align: left;
  padding-right: 2px;
}

.attachment--clickable {
  cursor: pointer;
}

.attachment__icon {
  background: #EFEFEF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-right: 12px;
}

.attachment__icon .icon {
  color: #AEAEAE;
  width: 24px;
}

.attachment__name {
  /* TODO: Ellipsis filename in the middle */
  font-size: 14px;
  font-weight: 500;
  line-height: 1.15;
  word-break: break-all;
  margin-top: 1px;
}

.attachment__meta {
  color: gray;
  font-size: 12px;
  margin-top: 3px;
}

.text {
  white-space: pre-wrap;
}

.text a, .text a:visited {
  color: var(--link-color);
  text-decoration: none;
}

.text a:focus {
  border-radius: 4px;
  outline: 2px solid var(--focus-ring-outer-color);
}

.countdown {
  border-radius: 100px;
  display: flex;
  align-items: center;
  height: 14px;
}

.countdown svg {
  flex-shrink: 0;
}

.countdown path {
  fill: var(--accent-color);
  transition: fill 1s ease-in-out, opacity 300ms ease-in-out;
}

.countdown--disabled path,
.countdown--disabled .countdown__label {
  opacity: 0;
}

.countdown--green {
  fill: var(--accent-color);
}

.countdown--orange {
  fill: var(--accent-color);
}

.countdown--red path {
  fill: #fa1900;
}

.countdown--show-alert .countdown__label {
  transform: translateX(0);
}

.countdown__label {
  color: gray;
  font-size: 13px;
  margin-left: 8px;
  user-select: none;
  transform: translateX(-5px);
  transition: all 300ms ease-in-out;
}

.message__error {
  background: #f24438;
  border-radius: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-color-light);
  font-weight: 500;
  padding: 10px;
  width: 100%;
}

.message-stack {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.message-stack__item {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.message-stack__item:last-child {
  margin-bottom: 0;
}

@media(max-width: 530px) {
  /*
    Hard-coded to push all messages after the warning message to the end.
    This is useful on iOS phones where showing the keyboard will hide the
    first few messages at the top of the screen. So instead, we push the
    messages down to the bottom like other chat apps.

    Issue demo here:
    https://blog.opendigerati.com/the-eccentric-ways-of-ios-safari-with-the-keyboard-b5aa3f34228d
  */
  .message-stack__item:nth-child(2) {
    margin-top: auto;
  }

  .message-stack__item {
    margin-bottom: 15px;
  }
}

.drop-zone {
  background-color: rgba(124, 91, 235, 0.7);
  border-radius: 38px;
  position: fixed;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 0 0 50px var(--accent-color);
  border: 4px dashed white;
  backdrop-filter: grayscale(100%);
  display: none;
}

.drop-zone--ready {
  animation: drop-highlight 500ms ease-in-out infinite;
  display: flex;
}

.drop-zone__message {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 100px;
  color: var(--accent-color);
  font-size: 20px;
  font-weight: bold;
  padding: 10px 18px;
  pointer-events: none;
}

@keyframes drop-highlight {
  0% {
    border-color: white;
  }

  50% {
    border-color: rgba(255, 255, 255, 0.5);
  }

  100% {
    border-color: white;
  }
}

@media(max-width: 420px) {
  .drop-zone {
    border-radius: 30px;
  }
}

.scroll-to-end-button {
  background: var(--primary-color);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 5px 10px 0 rgba(0, 0, 0, 0.13);
  left: 50%;
  width: 38px;
  height: 38px;
  transform: translateX(-50%) translateY(0);
  transition: all 150ms ease-out;
  pointer-events: auto;
  position: absolute;
  top: -58px;
  z-index: 3;
}

.scroll-to-end-button--hidden {
  visibility: hidden;
  transform: translateX(-50%) translateY(80px) scale(0.5);
}

.scroll-to-end-button__icon {
  color: var(--text-color-light);
  width: 24px;
}

.clipboard-zone {}

.clipboard-zone__preview {
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.05) 75%, rgba(0, 0, 0, 0.05)),
    linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.05) 75%, rgba(0, 0, 0, 0.05));
  background-size: 20px 20px;
  background-position: 0 0, 30px 30px;
  border: 1px solid silver;
  width: 100%;
  max-width: 600px;
  max-height: 200px;
  object-fit: scale-down;
  margin-bottom: 15px;
}

.clipboard-zone__attachment {
  margin-bottom: 10px;
}

.clipboard-zone__attachment:last-child {
  margin-bottom: 0;
}

.smart-actions__item--transition-enter {
  opacity: 0;
  transform: scale(0.9);
}

.smart-actions__item--transition-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: all 300ms 100ms ease;
}

.smart-actions__item--transition-exit {
  opacity: 1;
}

.smart-actions__item--transition-exit-active {
  opacity: 0;
  transform: scale(0.9);
  transition: all 300ms ease;
}

.home-screen {
  display: flex;
  flex-direction: column;
  position: absolute;
  background-color: var(--room-background-color);
  border-radius: 38px;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  overflow: hidden;
}

.home-screen__title {
  /* Hidden in accessible way for screenreaders */
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.home-screen__header {
  position: relative;
  z-index: 2;
}

.home-screen__header:after {
  content: "";
  position: absolute;
  height: 20px;
  bottom: -20px;
  left: 20px;
  right: 20px;
  background: linear-gradient(to bottom, var(--room-background-color) 0%, var(--room-background-transparent-color) 100%);
}

.home-screen__messages {
  padding: 25px 15px 20px;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  position: relative;
  overflow: auto;
}

.home-screen__footer {
  position: relative;
  padding: 0 20px 22px;
}

.home-screen__footer:after {
  content: "";
  position: absolute;
  height: 20px;
  top: -20px;
  left: 20px;
  right: 20px;
  background: linear-gradient(to top, var(--room-background-color) 0%, var(--room-background-transparent-color) 100%);
}

@media(max-width: 530px) {
  .home-screen__messages {
    padding-top: 20px;
  }
}

@media(max-width: 420px) {
  .home-screen {
    border-radius: 36px;
  }
}

/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
*, *:before, *:after { box-sizing: border-box; }

:root {
  --primary-color: #01A05A; /* Green */
  --accent-color: #7C5BEB; /* Purple */
  --error-color: #E63B3B; /* Red */
  
  --text-color-dark: black;
  --text-color-light: white;

  --text-field-background-color: #EEEEF0; /* Blue-ish gray */
  --text-field-text-color-dark: black;
  --text-field-border-color: rgba(0, 0, 0, 0.15);

  --warning-background-color: #fff5d1;
  --warning-text-color: black;

  --modal-background-color: white;
  --modal-border-color: #ABABAB;

  --room-background-color: #EEEEF0;
  --room-background-transparent-color: rgba(238, 238, 240, 0);

  --message-bubble-background-color: white;
  --message-bubble-text-color: black;
  --message-bubble-border-color: rgba(0, 0, 0, 0.15);

  --tooltip-background-color: black;
  --tooltip-text-color: white;

  --welcome-screen-background-color: white;

  --qr-scanner-target-normal-color: white;
  --qr-scanner-target-success-color: lime;
  --qr-scanner-target-error-color: var(--error-color);

  --focus-ring-outer-color: var(--accent-color);
  --focus-ring-inner-color: white;

  --link-color: var(--accent-color);
}

body {
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  overflow: hidden;
}

