/* Grundlegendes Reset und Body Styling */
* {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* overscroll-behavior-y: none; */
  word-wrap: break-word;

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
:root {
  --header-height: 3.5rem;

  --anim-time-01: .2s;
  --anim-time-02: .1s;

  --border-radius-01: .2rem;
  --border-radius-02: .5rem;
  --border-radius-03: .7rem;

  --anim-type-01: ease;
  --backdrop-blur-01: blur(50px);

  --color-light-01: #ECE8ED;
  --color-light-02: #ECFEFF;
  --color-light-03: #ECFEFF;
  --color-light-hover: #5d585f;

  --color-dark-01: #333;
  --color-dark-02: #211f24;
  --color-dark-03: #333;
  
  --color-accent-01: #24707B;
  --color-accent-switch: #24707B;
  
  --color-background-01: #1A191D;
  --color-background-02: #131015d9;
  --color-background-03: #0f0e11a8;

  --color-message-other: #2a282d;
  --color-message-other-text: #ECE8ED;
  --color-border-subtle: #ffffff18;
  --color-link: #78b2ba;
  --color-on-accent-link: #e7f5f6;
  --icon-filter-message-other: none;

  --color-placeholder: #A9A9A9;
  
  --background-patern-url: url(/images/background-pattern.webp);
  --icon-filter-invert: none;
}

:root[data-theme="dark"] {
  --color-light-01: #ECE8ED;
  --color-light-02: #ECFEFF;
  --color-light-03: #ECFEFF;
  --color-light-hover: #5d585f;

  --color-dark-01: #333;
  --color-dark-02: #211f24;
  --color-dark-03: #333;
  
  --color-accent-01: #24707B;
  --color-accent-switch: #24707B;
  
  --color-background-01: #1A191D;
  --color-background-02: #131015d9;
  --color-background-03: #0f0e11a8;

  --color-message-other: #2a282d;
  --color-message-other-text: #ECE8ED;
  --color-border-subtle: #ffffff18;
  --color-link: #78b2ba;
  --color-on-accent-link: #e7f5f6;
  --icon-filter-message-other: none;

  --color-placeholder: #A9A9A9;
  
  --background-patern-url: url(/images/background-pattern.webp);
  --icon-filter-invert: none;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-light-01: #333;
    --color-light-02: #cce3e4;
    --color-light-03: #ECFEFF;
    --color-light-hover: #b8c3c4;
    
    --color-dark-01: #333;
    --color-dark-02: #c8c6cc;
    --color-dark-03: #ECFEFF;
    
    --color-accent-01: #24707B;
    --color-accent-switch: #24707B;
    
    --color-background-01: #f4f1f4;
    --color-background-02: #e8e4e9e6;
    --color-background-03: #f4f1f4d9;

    --color-message-other: #e8e4e9;
    --color-message-other-text: #272429;
    --color-border-subtle: #1a191d1f;
    --color-link: #1d5c65;
    --color-on-accent-link: #f2fbfc;
    --icon-filter-message-other: invert(1);

    --color-placeholder: #6a6a6a;
    
    --background-patern-url: url(/images/background-pattern-light.webp);
    --icon-filter-invert: invert(1);
  }
}
:root[data-theme="light"] {
  --color-light-01: #333;
  --color-light-02: #cce3e4;
  --color-light-03: #ECFEFF;
  --color-light-hover: #b8c3c4;
  
  --color-dark-01: #333;
  --color-dark-02: #c8c6cc;
  --color-dark-03: #ECFEFF;
  
  --color-accent-01: #24707B;
  --color-accent-switch: #24707B;
  
  --color-background-01: #f4f1f4;
  --color-background-02: #e8e4e9e6;
  --color-background-03: #f4f1f4d9;

  --color-message-other: #e8e4e9;
  --color-message-other-text: #272429;
  --color-border-subtle: #1a191d1f;
  --color-link: #1d5c65;
  --color-on-accent-link: #f2fbfc;
  --icon-filter-message-other: invert(1);

  --color-placeholder: #6a6a6a;
  
  --background-patern-url: url(/images/background-pattern-light.webp);
  --icon-filter-invert: invert(1);
}

body {
  font-family: Arial, sans-serif;
  background: var(--color-background-01);
  /* background: #121215; */
}

input, label, h1, h2, h3, h4, h5, h6, p {
  color: var(--color-light-01);
}
.text-content {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}
*::selection {
  background-color: #24707Bcc;
  color: white;
}

#main-container {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

#chatList {
  position: relative;
  flex: 0 0 min(25rem, 45vw);
  width: min(25rem, 45vw);
  height: 100dvh;
  z-index: 30;
  overflow: hidden;
  background-color: var(--color-background-02);

  transition: width var(--anim-time-01) var(--anim-type-01);
}
#chatList.closed {
  flex-basis: 0;
  width: 0;
  min-width: 0;
}
.camayo-brand {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-width: 16rem;
  padding: .75rem 4rem .75rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
  cursor: pointer;
  transition: background-color var(--anim-time-01) var(--anim-type-01);
}
body:not(.touch) .camayo-brand:hover,
.camayo-brand:focus-visible {
  background-color: color-mix(in srgb, var(--color-light-01) 7%, transparent);
}
.camayo-brand img {
  flex: 0 0 auto;
  border-radius: .75rem;
}
.camayo-brand strong,
.camayo-brand span {
  display: block;
  color: var(--color-light-01);
}
.camayo-brand span {
  margin-top: .1rem;
  font-size: .75rem;
  opacity: .65;
}
.camayo-brand .camayo-identity {
  max-width: 20rem;
  margin-top: .25rem;
  overflow: hidden;
  color: var(--color-light-01);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
  opacity: .9;
}
.settings-security-warning {
  margin: .5rem 0;
  padding: .65rem;
  border: 1px solid color-mix(in srgb, #d89a38 55%, transparent);
  border-radius: .55rem;
  background: color-mix(in srgb, #d89a38 16%, transparent);
}
#chatList ul{
	margin: 1rem 0 0 0;
}
#chatList li{
	list-style: none;
	background: var(--color-accent-01);
}
#chatList a{
	display: inline-block;
	color: var(--color-light-01);
	text-decoration: none;
	padding: .5rem 1rem .5rem 1rem;
}

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

.app-notification-region {
  position: fixed;
  z-index: 1200;
  inset-block-start: calc(var(--keyboard-viewport-top, 0px) + max(.75rem, env(safe-area-inset-top)));
  inset-inline-end: max(.75rem, env(safe-area-inset-right));
  display: grid;
  width: min(25rem, calc(100vw - 1.5rem));
  gap: .5rem;
  pointer-events: none;
}

.app-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: .25rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 1rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  box-shadow: 0 .5rem 1.5rem #0004;
  animation: app-notification-in .18s ease-out;
  pointer-events: auto;
}

.app-notification[data-replying] { order: -1; }
.app-notification button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: .65rem;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.app-notification button:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.app-notification :is(button, textarea):focus-visible { outline: 2px solid var(--camayo-focus-ring, var(--color-accent-01)); outline-offset: -2px; }

.app-notification .app-notification-open {
  grid-template-columns: 2.5rem minmax(0, 1fr);
  justify-items: start;
  align-content: center;
  gap: .65rem;
  min-width: 0;
  padding: .55rem .35rem .55rem .55rem;
  text-align: start;
  touch-action: pan-y;
  user-select: none;
  -webkit-touch-callout: none;
}

.app-notification-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--color-background-02);
}
.app-notification-avatar > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: .82rem;
  font-weight: 650;
}
.app-notification-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-notification-avatar .ui-icon, .app-notification-actions .ui-icon, .app-notification-send .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.app-notification-copy { display: grid; gap: .14rem; min-width: 0; width: 100%; line-height: 1.3; }
.app-notification-copy :is(strong, .app-notification-subtitle, .app-notification-body) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-notification-copy strong { font-size: .92rem; }
.app-notification-subtitle { font-size: .75rem; opacity: .75; }
.app-notification-body { font-size: .85rem; opacity: .9; }
.app-notification-media-icon { display: inline-grid; margin-inline-end: .3rem; vertical-align: -.12em; }
.app-notification-media-icon .ui-icon { width: .95em; height: .95em; }
.app-notification-actions { display: flex; align-self: start; }
.app-notification-actions button { width: 2.75rem; height: 2.75rem; padding: 0; }
.app-notification-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.75rem;
  align-items: end;
  gap: .45rem;
  margin: .25rem .55rem .55rem;
  padding: .65rem 0 0;
  border-top: 1px solid var(--color-border-subtle);
  background: transparent;
}
.app-notification-form:where(#form) textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  max-height: 8rem;
  padding: .55rem .7rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  resize: vertical;
  font: inherit;
  font-size: max(1rem, 16px);
  color: inherit;
  background: var(--color-background-02);
}
.app-notification button.app-notification-send { height: 2.75rem; padding: 0; background: #24707b; color: #fff; }
.app-notification button.app-notification-send:disabled { opacity: .5; cursor: default; }
.app-notification-status { grid-column: 1 / -1; margin: 0; font-size: .82rem; }
.app-notification-status:empty { margin-top: -.45rem; }
.app-notification-status[data-error] { color: var(--color-danger-01); }
.app-notification [hidden] { display: none; }

@keyframes app-notification-in {
  from { opacity: 0; transform: translateY(-.35rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .app-notification { animation: none; }
}
.database-sidebar {
  height: calc(100dvh - 4.6rem);
  min-width: 16rem;
  overflow-y: auto;
  padding: .8rem 1rem 4.2rem;
  scrollbar-gutter: stable;
}
.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .5rem;
}
.sidebar-toolbar-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.sidebar-toolbar h2,
.sidebar-section h2,
.sidebar-section h3 {
  color: var(--color-light-01);
}
.sidebar-toolbar h2 {
  font-size: 1rem;
}
.sidebar-section h2,
.sidebar-section h3 {
  margin: .9rem .45rem .25rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .68;
}
.sidebar-add-button,
.sidebar-conversation-button,
.sidebar-person-button {
  all: unset;
  box-sizing: border-box;
  color: var(--color-light-01);
  cursor: pointer;
}
.sidebar-add-button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 22%, transparent);
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}
.sidebar-add-button[hidden],
.sidebar-archive-toggle[hidden] {
  display: none;
}
.sidebar-add-button:hover,
.sidebar-add-button:focus-visible {
  background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
}
.sidebar-archive-toggle {
  padding: .45rem .65rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 22%, transparent);
  border-radius: 999px;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
}
.sidebar-archive-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: calc(100% - .7rem);
  min-height: 2.35rem;
  margin: .85rem .35rem .2rem;
  font-size: .78rem;
}
.sidebar-archive-footer svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-archive-toggle[aria-pressed="true"] {
  color: var(--color-light-03);
  background: var(--color-accent-01);
}
.sidebar-status {
  position: absolute;
  z-index: 60;
  inset: auto .75rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 1.5rem);
  padding: .65rem .85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: .75rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-background-03) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 .25rem 1rem #0002;
  font-size: .82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.sidebar-status[hidden] {
  display: none;
}
.sidebar-status[data-state="error"] {
  border-color: color-mix(in srgb, #c7475b 45%, var(--color-border-subtle));
  background: color-mix(in srgb, #c7475b 15%, var(--color-background-01));
}
.database-sidebar {
  position: relative;
}
.conversation-sections[aria-busy="true"]:empty {
  min-block-size: 13.8rem;
  border-radius: .6rem;
  background: linear-gradient(90deg, transparent 0 4%, #ffffff06 4% 96%, transparent 96%) 0 1.9rem / 100% 3.7rem repeat-y;
}
.sidebar-conversation-button .sidebar-item-details {
  min-block-size: 1.15em;
}
#chatList .sidebar-list {
  margin: .15rem 0 .7rem;
  padding: 0;
}
#chatList .sidebar-list li {
  list-style: none;
  background: transparent;
}
#chatList .sidebar-list li.sidebar-item-with-action {
  position: relative;
  display: block;
}
.new-chat-person-list li.sidebar-item-with-action {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .15rem;
}
.sidebar-item-actions {
  display: flex;
  align-items: center;
  gap: .1rem;
}
.sidebar-context-actions {
  position: absolute;
  z-index: 4;
  top: -.4rem;
  inset-inline-end: .18rem;
  justify-content: center;
  pointer-events: none;
}
.sidebar-item-action {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 50%;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
  opacity: .55;
}
.overflow-menu-button {
  --overflow-menu-width: 1.6rem;
  --overflow-menu-height: var(--overflow-menu-width);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--overflow-menu-width);
  height: var(--overflow-menu-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: .42rem;
  background: color-mix(in srgb, var(--color-light-01) 8%, var(--color-background-01));
  color: var(--color-light-01);
  box-shadow: 0 .12rem .3rem #0002;
  cursor: pointer;
  transition: background-color .15s, opacity .15s ease-out, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.overflow-menu-button svg {
  display: block;
  width: .85rem;
  height: .85rem;
  fill: currentColor;
  stroke: none;
  pointer-events: none;
}
.overflow-menu-button:is(:hover, :focus-visible, [aria-expanded="true"]) {
  background: color-mix(in srgb, var(--color-light-01) 16%, var(--color-background-01));
}
.overflow-menu-button:focus-visible {
  outline: 2px solid color-mix(in srgb, currentColor 70%, transparent);
  outline-offset: -2px;
}
:is(.overflow-menu-button, .conversation-menu-button, #chatListActions, .media-viewer-control) {
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: reduce) { .overflow-menu-button { transition: none; } }
.sidebar-context-trigger {
  position: relative;
  opacity: 0;
  pointer-events: none;
  transform: translateX(.3rem) scale(.9);
}
.sidebar-context-trigger::before {
  content: '';
  position: absolute;
  width: 2.75rem;
  height: 2.75rem;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
body:not(.touch) .sidebar-item-with-action:is(:hover, :focus-within) .sidebar-context-trigger,
.sidebar-context-trigger[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
body:not(.touch) .sidebar-item-with-action:is(:hover, :focus-within) .sidebar-context-actions,
.sidebar-context-actions:has(.sidebar-context-trigger[aria-expanded="true"]) { pointer-events: auto; }
body.touch .sidebar-context-actions { display: none; }
.sidebar-item-action svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.sidebar-item-action.is-leave:hover,
.sidebar-item-action.is-leave:focus-visible {
  color: #ffdbe0;
  background: #8a2634;
}
.sidebar-item-action:hover,
.sidebar-item-action:focus-visible {
  background: color-mix(in srgb, var(--color-light-01) 12%, transparent);
  opacity: 1;
}
.sidebar-conversation-button,
.sidebar-person-button {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  width: 100%;
  min-height: 2.25rem;
  padding: .35rem .55rem;
  border-radius: .5rem;
  transition: background-color var(--anim-time-02) var(--anim-type-01);
}
.sidebar-person-button:is(:active,:focus-visible), .sidebar-conversation-button:focus-visible {
  background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
}
@media (hover: hover) and (pointer: fine) {
  .sidebar-person-button:hover {
    background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
  }
}
.sidebar-conversation-button:disabled,
.sidebar-person-button:disabled {
  cursor: default;
  opacity: .55;
}
.sidebar-item-icon {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  font-size: .82rem;
  opacity: .75;
  border-radius: .45rem;
  object-fit: cover;
}
.sidebar-avatar-image,
.sidebar-avatar-initials {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.sidebar-avatar-initials {
  display: grid;
  place-items: center;
}
.sidebar-avatar-image {
  object-fit: cover;
  opacity: 0;
}
.sidebar-avatar-image[data-avatar-loaded] {
  opacity: 1;
}
.sidebar-avatar-image[data-avatar-loaded] + .sidebar-avatar-initials {
  visibility: hidden;
}
.sidebar-item-label {
  overflow: hidden;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.sidebar-unread-badge {
  display: inline-grid;
  grid-column: 3;
  grid-row: 1 / span 2;
  min-width: 1.55rem;
  height: 1.55rem;
  margin-left: auto;
  padding: 0 .42rem;
  place-items: center;
  align-self: center;
  border: 2px solid color-mix(in srgb, #ff4968 72%, white);
  border-radius: 999px;
  color: #fff;
  background: #d7193f;
  box-shadow: 0 0 0 2px #160f14, 0 0 .7rem #ff315980;
  font-size: .74rem;
  font-weight: 850;
  line-height: 1;
}
.sidebar-conversation-button.has-unread .sidebar-item-label {
  color: var(--color-light-01);
  font-weight: 750;
}
.sidebar-conversation-button.has-unread .sidebar-item-details {
  color: color-mix(in srgb, var(--color-light-01) 82%, transparent);
}
.sidebar-person-avatar {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 50%;
  color: var(--color-light-03);
  background: var(--color-accent-01);
  font-size: .72rem;
  font-weight: 700;
}
.sidebar-people {
  margin-top: .75rem;
  padding-top: .25rem;
  border-top: 1px solid color-mix(in srgb, var(--color-light-01) 12%, transparent);
}
.sidebar-people-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-people-heading .sidebar-add-button {
  width: 1.7rem;
  height: 1.7rem;
  margin-right: .35rem;
  font-size: 1rem;
}
.sidebar-empty {
  margin: .35rem .55rem .8rem;
  color: var(--color-light-01);
  font-size: .78rem;
  line-height: 1.35;
  opacity: .65;
}
.new-chat-dialog {
  width: min(32rem, calc(100vw - 2rem));
}
.new-chat-tab-panel > label {
  display: block;
  margin-bottom: .35rem;
  color: var(--color-light-01);
  font-size: .82rem;
}
.new-chat-tab-panel > input[type="search"] {
  width: 100%;
  padding: .72rem .8rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 22%, transparent);
  border-radius: .55rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  font: inherit;
}
.new-chat-person-list {
  max-height: min(24rem, 50dvh);
  margin-top: .75rem;
  padding: 0;
  overflow-y: auto;
}
.new-chat-person-list li { list-style: none; }
.new-chat-person-list .sidebar-item-action {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 9%, transparent);
  opacity: 1;
  touch-action: manipulation;
}
.new-chat-private-hint {
  margin: .65rem 0 0;
  color: color-mix(in srgb, var(--color-light-01) 72%, transparent);
  font-size: .78rem;
  line-height: 1.4;
}
.new-chat-tab-panel[hidden] { display: none; }
.new-chat-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2rem;
  margin-bottom: .45rem;
}
.new-chat-panel-heading h3 {
  margin: 0;
  color: var(--color-light-01);
  font-size: .9rem;
}
.new-chat-panel-heading .sidebar-add-button {
  width: 1.8rem;
  height: 1.8rem;
  font-size: 1.1rem;
}
.new-chat-conversation-list {
  max-height: min(24rem, 50dvh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.new-chat-conversation-list li { list-style: none; }
.new-chat-permission-hint {
  margin: .65rem 0 0;
  color: var(--color-light-01);
  font-size: .78rem;
  opacity: .68;
}

#chatListIcon {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: .45rem;
  cursor: pointer;
  width: var(--header-height);
  height: var(--header-height);
  z-index: 200;

  background-image: url(/images/side-panel.svg);
  background-position: center center;
  background-size: 1.55rem auto;
  background-repeat: no-repeat;

  filter: var(--icon-filter-invert);
  transition: left var(--anim-time-01) var(--anim-type-01), opacity var(--anim-time-01) var(--anim-type-01), background-size var(--anim-time-01) var(--anim-type-01);
}
#chatListIcon.side-open {
  left: calc(min(25rem, 45vw) - var(--header-height) - .45rem);
}
body:not(.touch) #chatListIcon:hover {
  opacity: .6;
  background-size: 1.7rem auto;
}
#chatListIcon:active {
  background-size: 1.35rem auto !important;
}
#chatListIcon .mobile-back-icon {
  display: none;
}

#container {
  --composer-bar-space: 4.5rem;
  --composer-extra-space: 0px;
  --chat-bottom-clearance: 6rem;
  --chat-scroll-space: max(6rem, var(--chat-bottom-clearance));
  position: relative;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  background: var(--color-background-01);
  background-image: var(--background-patern-url);

  transition: width var(--anim-time-01) var(--anim-type-01);
}

/* A stationary overlay keeps the native scrolling layer unmasked. */
#chatViewport {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 90rem;
  margin: auto;
}
#chatViewport::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: var(--chat-scroll-space);
  pointer-events: none;
  background: linear-gradient(transparent, var(--color-background-01));
}
#chatWrapper {
  position: relative;
  margin: auto;
  top: 0; left: 0;
  overflow-y: auto;
  scroll-behavior: auto;
  padding: 5px;
  /* Keep messages scrolling behind the floating composer, not into a hard edge
     above it. Clearance belongs to the content, never the viewport height. */
  height: 100dvh; width: 100%;
  max-width: 90rem;
  scrollbar-gutter: stable;
  scroll-padding-bottom: var(--chat-scroll-space);
  overscroll-behavior-y: auto;
}

#chatWrapper.is-jumping-to-latest,
#chatWrapper.is-prepending-history,
#chatWrapper.is-switching-chat {
  overflow-y: hidden;
  overscroll-behavior: none;
  scroll-behavior: auto;
}

#chatWrapper.is-jumping-to-latest,
#chatWrapper.is-prepending-history {
  -webkit-overflow-scrolling: auto;
}

#chat {
  padding: 4rem clamp(8px, 2.6vw, 32px) var(--chat-scroll-space) clamp(8px, 2.6vw, 32px);
}

.chat-empty-state {
  min-height: calc(100dvh - 10rem);
  display: grid;
  place-content: center;
  gap: .45rem;
  padding: 2rem;
  text-align: center;
}
.chat-empty-version {
  min-width: 0;
  color: var(--color-placeholder);
  font-size: .75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.chat-loading-state {
  min-height: calc(100dvh - 10rem);
  display: grid;
  place-content: center;
  color: var(--color-placeholder);
  font-size: .85rem;
}
.chat-loading-state.is-skeleton {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .5rem;
  padding-block-end: .5rem;
  animation: chat-skeleton-in .35s .3s ease-out both;
}
.chat-skeleton {
  block-size: 2.4rem;
  max-inline-size: 22rem;
  border-radius: 1.2rem;
  inline-size: 58%;
  background: color-mix(in srgb, var(--color-background-01) 92%, var(--color-light-01));
  animation: chat-skeleton-pulse 1.4s ease-in-out infinite alternate;
}
.chat-skeleton.is-mine { align-self: flex-end; background: color-mix(in srgb, var(--color-accent-01) 45%, transparent); }
.chat-skeleton:nth-child(3) { inline-size: 38%; }
.chat-skeleton:nth-child(4) { inline-size: 46%; }
.chat-skeleton:nth-child(5) { inline-size: 66%; }
.chat-skeleton:nth-child(6) { inline-size: 30%; }
.chat-skeleton:nth-child(3n) { animation-delay: .2s; }
.chat-skeleton:nth-child(3n + 1) { animation-delay: .4s; }
@keyframes chat-skeleton-in { from { opacity: 0; } }
@keyframes chat-skeleton-pulse { to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .chat-loading-state.is-skeleton, .chat-skeleton { animation: none; }
}

.chat-load-error {
  justify-items: center;
  align-content: center;
  gap: .75rem;
  padding: 1rem;
  text-align: center;
}

.chat-load-error p { margin: 0; }
.chat-load-error:not(:only-child) {
  min-height: 0;
  margin-block: .6rem;
}

.chat-empty-logo {
  display: block;
  width: 7rem;
  height: 7rem;
  justify-self: center;
  object-fit: contain;
  filter: var(--app-startup-logo-filter, none);
}
.chat-empty-state h2 {
  margin: 0;
  color: var(--color-light-01);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
}

#chat p {
  margin-bottom: 8px;
  line-height: 1.4;
}

#chat .file-preview {
	max-width: 100%;
}
.bubble {
  position: relative;
  display: flex;
  flex-direction: column;
	max-inline-size: min(85%, 38rem);
  min-width: 1rem;
  margin-top: 1rem;
	margin-bottom: none;
  inline-size: fit-content;
}
.bubble.is-entering,
.bubble .text.is-entering {
  animation: message-bubble-in .2s ease-out both;
}
@keyframes message-bubble-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bubble .text {
  --bubble-radius-top-left: 1rem;
  --bubble-radius-top-right: 1rem;
  --bubble-radius-bottom-right: 1rem;
  --bubble-radius-bottom-left: 1rem;
  position: relative;
  margin: 2px 0;
  inline-size: fit-content;
  text-align: start;
  max-inline-size: 100%;
  font-size: 14px;
  word-wrap: break-word;
  border-radius:
    var(--bubble-radius-top-left)
    var(--bubble-radius-top-right)
    var(--bubble-radius-bottom-right)
    var(--bubble-radius-bottom-left);
  transition: background-color .32s ease-out, box-shadow .32s ease-out, filter .18s ease-out;
}
/* One translated surface, with the action below a duplicate of the bubble background.
   Both offsets are painted in the same frame, including the return animation. */
#chat .bubble .text:is(.is-reply-swiping,.is-reply-settling) {
  border-radius:
    calc(var(--bubble-radius-top-left) * (1 - var(--swipe-corner-progress, 0)) + 1rem * var(--swipe-corner-progress, 0))
    calc(var(--bubble-radius-top-right) * (1 - var(--swipe-corner-progress, 0)) + 1rem * var(--swipe-corner-progress, 0))
    calc(var(--bubble-radius-bottom-right) * (1 - var(--swipe-corner-progress, 0)) + 1rem * var(--swipe-corner-progress, 0))
    calc(var(--bubble-radius-bottom-left) * (1 - var(--swipe-corner-progress, 0)) + 1rem * var(--swipe-corner-progress, 0));
  transform: translate3d(var(--reply-swipe-x,0px),0,0);
  isolation: isolate; background: transparent; will-change: transform; transition: none;
}
/* Swiping right, the author's picture stays where it is instead of riding
   over the revealed action; swiping left it moves with the bubble. */
#chat .bubble .text:is(.is-reply-swiping,.is-reply-settling) > .message-author-avatar { translate: calc(-1 * max(0px, var(--reply-swipe-x, 0px))) 0; }
/* Chat list rows use the same swipe, square: the row slides over the action,
   which spans the list from edge to edge. */
.sidebar-conversation-button:is(.is-reply-swiping,.is-reply-settling,.is-reply-ready) {
  transform: translate3d(var(--reply-swipe-x,0px),0,0); isolation: isolate; will-change: transform;
}
.sidebar-conversation-button:is(.is-reply-swiping,.is-reply-settling,.is-reply-ready):not(#_)::before {
  inset-inline: 0; opacity: 1; background: var(--sidebar-background, var(--color-background-01)); transition: none;
}
/* The row's "…" button and tooltip stay out of the way while it slides. */
.sidebar-item-with-action:has(> .sidebar-conversation-button:is(.is-reply-swiping,.is-reply-settling)) > .sidebar-context-actions { opacity: 0; pointer-events: none; }
.sidebar-conversation-button > .message-swipe-underlay {
  left: calc(-1 * var(--swipe-distance) - .65rem); width: calc(100% + var(--swipe-distance) + .65rem); border-radius: 0;
}
.sidebar-conversation-button.is-reply-left > .message-swipe-underlay { left: auto; right: calc(-1 * var(--swipe-distance) - .65rem); }
.sidebar-conversation-button > .message-swipe-underlay > .message-swipe-window { width: calc(var(--swipe-distance) + .65rem); }
.sidebar-conversation-button.is-swipe-cleanup { transition: none; }
#chat .bubble .text:is(.is-reply-swiping,.is-reply-settling)::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--bubble-background); z-index: -1; pointer-events: none;
}
.message-swipe-underlay {
  position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--swipe-distance));
  /* Cover the original bubble footprint, avoiding clipped/clamped corners
     when only a few pixels of the action have been revealed. */
  width: calc(100% + var(--swipe-distance));
  border-radius: inherit;
  background: var(--message-action-blue); color: #fff; z-index: -2; pointer-events: none; overflow: hidden;
  transition: background-color 300ms cubic-bezier(.4,0,.2,1);
}
.is-reply-left > .message-swipe-underlay { left: auto; right: calc(-1 * var(--swipe-distance)); }
.is-wheel-preview.is-reply-swiping > .message-swipe-underlay { cursor: pointer; }
.message-swipe-underlay[data-tone="sky"] { background: var(--message-action-sky); }
.message-swipe-underlay[data-tone="indigo"] { background: var(--message-action-indigo); }
.message-swipe-underlay[data-tone="mint"] { background: var(--message-action-mint); }
.message-swipe-underlay[data-tone="green"] { background: var(--message-action-green); }
.message-swipe-underlay[data-tone="orange"] { background: var(--message-action-orange); }
.message-swipe-underlay[data-tone="danger"] { background: var(--message-action-danger); }
.message-swipe-window { position: absolute; inset: 0 auto 0 0; width: var(--swipe-distance); overflow: visible; pointer-events: auto; }
.is-reply-left .message-swipe-window { left: auto; right: 0; }
/* Before engaging, the icon waits at the outer edge of the revealed colour. */
.message-swipe-icon { position: absolute; left: 26px; top: 50%; display: grid; place-items: center; width: 28px; height: 28px; opacity: 0; pointer-events: none; transform: translate(-50%,-50%) scale(.68); transition: opacity .14s ease, transform .26s cubic-bezier(.3,1.5,.5,1), background-color .2s ease; }
.is-reply-left .message-swipe-icon { left: calc(100% - 26px); }
.message-swipe-icon.is-active { opacity: .85; transform: translate(-50%,-50%); }
/* Engaged: it slides with some weight towards the message, keeping a gap;
   later stages only change colour and icon. */
.is-reply-ready .message-swipe-icon { left: calc(100% - 26px); }
.is-reply-ready.is-reply-left .message-swipe-icon { left: 26px; }
.is-swipe-shifting .message-swipe-icon { transition: opacity .14s ease, transform .26s cubic-bezier(.3,1.5,.5,1), left .36s cubic-bezier(.34,1.42,.52,1); }
.is-reply-ready .message-swipe-icon.is-active { opacity: 1; transform: translate(-50%,-50%); }
.message-swipe-icon .ui-icon { display: block; width: 26px; height: 26px; fill: currentColor; stroke: none; }
.swipe-emoji { font-size: 24px; }
#chat .text { touch-action: pan-y; }
#chat .text.is-swipe-cleanup { transition: none; }
@media (prefers-reduced-motion: reduce) { .message-swipe-underlay,.message-swipe-icon { transition: none; } }
:is(#chatWrapper, #conversationSections).message-reply-scroll-lock {
  overscroll-behavior: none;
}
.bubble.me .text ~ .text {
  --bubble-radius-top-right: .5rem;
}
.bubble.me .text:has(~ .text) {
  --bubble-radius-bottom-right: .5rem;
}
.bubble.other .text ~ .text {
  --bubble-radius-top-left: .5rem;
}
.bubble.other .text:has(~ .text) {
  --bubble-radius-bottom-left: .5rem;
}
.bubble.me .text:has(> .bubble-tail) {
  --bubble-radius-bottom-right: .7rem;
}
.bubble.other .text:has(> .bubble-tail) {
  --bubble-radius-bottom-left: .7rem;
}
.bubble .text .text-content {
  padding: 0.4rem 0.8rem;
}
.bubble .text:has(.text-reply) {
  min-inline-size: min(16rem, 100%);
}

/* Image previews provide the intrinsic width of their message segment. Captions
   fill that width and wrap without making the bubble wider. */
.bubble .text.has-media-preview .attachment-caption {
  contain: inline-size;
}

.bubble .text:has(.reaction) {
  margin-bottom: 1.5rem;
}
/* .bubble .text:has(.attachment-frame) .text-content {
  display: none;
  padding: 0 0;
} */

.bubble.me .text {
  background: var(--bubble-background);
  color: var(--color-light-03);
}
.bubble.other .text {
  background: var(--bubble-background);
  color: var(--color-message-other-text);
}
.bubble.me {
  --bubble-background: var(--color-accent-01);
  align-items: end;
  text-align: right;
  margin-left: auto;
}
.bubble.other {
  --bubble-background: var(--color-message-other);
  text-align: left;
}

mark {
  background-color: yellow;
  color: black;
  padding: 0 2px;
  border-radius: 2px;
}

.bubble-tail {
  position: absolute;
  bottom: -.05rem;
  display: block;
  height: .8rem;
  aspect-ratio: 62 / 66;
  color: var(--bubble-background);
  z-index: -1;
  opacity: 1;
  transform: translate3d(0, 0, 0) scaleX(var(--bubble-tail-direction, 1));
  pointer-events: none;
  transition: color .32s ease-out, opacity 160ms ease-out, transform 160ms ease-out;
}
.bubble .text:has(> .bubble-tail) { isolation: isolate; }
.bubble.me .bubble-tail {
  right: -.23rem;
}
.bubble.other .bubble-tail {
  left: -.23rem;
  --bubble-tail-direction: -1;
  --bubble-tail-tuck-x: .4rem;
}
.text:is(.is-reply-swiping, .is-reply-settling) > .bubble-tail {
  opacity: 0;
  transition-duration: .32s, 280ms, 280ms;
  transform: translate3d(var(--bubble-tail-tuck-x, -.4rem), -.3rem, 0) scaleX(var(--bubble-tail-direction, 1)) scale(.8);
}
@media (prefers-reduced-motion: reduce) { .bubble-tail { transition: none; } }

.bubble.me .text.highlight {
  --bubble-background: color-mix(in srgb, var(--color-accent-01) 78%, white);
  box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--color-accent-01) 42%, transparent);
}
.bubble.other .text.highlight {
  --bubble-background: color-mix(in srgb, var(--color-message-other) 58%, var(--color-accent-01));
  box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--color-accent-01) 42%, transparent);
}


/* Only the viewer's scrim blurs while media is open. It is an element, not the
   ::backdrop, because it follows the finger while a picture is dragged away.
   The blurred surfaces behind it are named: a universal selector here made
   opening and closing the viewer restyle the whole document. Add new
   backdrop-filter surfaces to this list. */
body.media-viewer-open :is(#nav-bar, #chatViewport, form#form, #scrollBtn, .composer-icon-button, .message-input-area, .composer-permission-notice, .app-navigation, .settings-pane, .chat-date-pill, .floating-voice-orb, .floating-voice-panel, .sidebar-status, #chatSearchBar, #chatSearchPanel, .e2ee-device-notice, .e2ee-device-notice-popover, #accountSettingsSyncStatus, .test-chat-controls, .overlay, .floating-menu, .message-actions-options, .voice-speed-menu, .chat-peek-scrim, .message-actions-scrim, .reaction-magnifier),
body.media-viewer-open :is(#nav-bar, #chatViewport, form#form, #scrollBtn, .composer-icon-button, .message-input-area, .composer-permission-notice, .app-navigation, .settings-pane, .chat-date-pill, .floating-voice-orb, .floating-voice-panel, .sidebar-status, #chatSearchBar, #chatSearchPanel, .e2ee-device-notice, .e2ee-device-notice-popover, #accountSettingsSyncStatus, .test-chat-controls, .overlay, .floating-menu, .message-actions-options, .voice-speed-menu, .chat-peek-scrim, .message-actions-scrim, .reaction-magnifier)::before,
body.media-viewer-open :is(#nav-bar, #chatViewport, form#form, #scrollBtn, .composer-icon-button, .message-input-area, .composer-permission-notice, .app-navigation, .settings-pane, .chat-date-pill, .floating-voice-orb, .floating-voice-panel, .sidebar-status, #chatSearchBar, #chatSearchPanel, .e2ee-device-notice, .e2ee-device-notice-popover, #accountSettingsSyncStatus, .test-chat-controls, .overlay, .floating-menu, .message-actions-options, .voice-speed-menu, .chat-peek-scrim, .message-actions-scrim, .reaction-magnifier)::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.media-viewer-open { overflow: hidden; }
.image-lightbox {
  box-sizing: border-box;
  width: 100vw; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: transparent; color: #fff;
  touch-action: pan-x pan-y; overscroll-behavior: contain;
}
.image-lightbox::backdrop { background: transparent; }
.image-lightbox-scrim { position: absolute; inset: 0; background: rgba(5, 8, 14, .96); }
/* Phones stay plain: a full-screen blur that fades every frame costs the motion. */
@media (hover: hover) and (pointer: fine) {
  .image-lightbox-scrim { background: rgba(5, 8, 14, .8); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
}
.image-lightbox:is(.is-moving, .is-dragging) .image-lightbox-frame { will-change: transform, clip-path; }
.image-lightbox:is(.is-moving, .is-dragging) .image-lightbox-scrim { will-change: opacity; }
.image-lightbox-stage {
  position: absolute;
  inset: max(72px, calc(env(safe-area-inset-top) + 56px)) 64px max(112px, calc(env(safe-area-inset-bottom) + 100px));
  overflow: hidden; touch-action: none; overscroll-behavior: contain;
}
.image-lightbox:is(.is-moving, .is-dragging) .image-lightbox-stage { overflow: visible; }
.image-lightbox-chrome { position: absolute; inset: 0; pointer-events: none; }
.image-lightbox-chrome > * { pointer-events: auto; }
.image-lightbox-frame { width: 100%; height: 100%; display: grid; place-items: center; }
.image-lightbox.is-image-viewer .image-lightbox-stage { inset: 0; }
.image-lightbox.is-image-viewer .image-lightbox-image {
  width: calc(100% - clamp(16px, 10vw, 128px));
  height: calc(100% - 148px);
}
.image-lightbox.is-standalone-image .image-lightbox-image { height: calc(100% - 72px); }
.image-lightbox img.is-loading { visibility: hidden; }
.image-lightbox-image {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  object-fit: contain; user-select: none; -webkit-user-drag: none;
  transform: translate(var(--media-x, 0px), var(--media-y, 0px)) scale(var(--image-lightbox-scale, 1));
  transform-origin: center;
}
.image-lightbox.is-zoomed .image-lightbox-stage { cursor: grab; }
.image-lightbox.is-zoomed .image-lightbox-stage:active { cursor: grabbing; }
.image-lightbox button:not(.floating-menu-item) { color: #fff; cursor: pointer; }
.image-lightbox-close, .image-lightbox-more, .image-lightbox-previous, .image-lightbox-next {
  position: absolute; z-index: 2; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; font: 32px/1 system-ui, sans-serif;
}
.image-lightbox :is(.image-lightbox-close, .image-lightbox-more, .image-lightbox-previous, .image-lightbox-next) svg {
  display: block; width: 24px; height: 24px; margin: 0; padding: 0; pointer-events: none;
}
.image-lightbox-video-badge svg { display: block; width: 20px; height: 20px; }
.image-lightbox-tools {
  position: absolute;
  z-index: 2;
  display: flex;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.image-lightbox-tools :is(.image-lightbox-more, .image-lightbox-close) { position: relative; }
.image-lightbox-previous { left: 10px; top: calc(50% - 22px); }
.image-lightbox-next { right: 10px; top: calc(50% - 22px); }
.image-lightbox button:disabled { opacity: .25; cursor: default; }
.image-lightbox-thumbnails {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  box-sizing: border-box;
  max-width: min(44rem, calc(100% - 24px));
  padding: 6px 8px;
  border-radius: 12px;
  background: #211e25;
  box-shadow: 0 6px 20px #0005;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-padding-inline: 8px;
  scrollbar-width: thin;
  scrollbar-color: #ffffff30 transparent;
}
.image-lightbox-thumbnail {
  position: relative; flex: 0 0 48px; width: 48px; height: 48px; padding: 0;
  border: 1px solid transparent; border-radius: 7px; overflow: hidden; background: #141821;
  opacity: .66; transition: opacity .12s, border-color .12s;
}
.image-lightbox-thumbnail[aria-current="true"] {
  border-color: #e3dce7; opacity: 1;
  background: #514b58;
  box-shadow: inset 0 0 0 2px #e3dce740;
}
.image-lightbox-thumbnail[aria-current="true"] :is(img, video) { padding: 3px; box-sizing: border-box; border-radius: inherit; }
.image-lightbox-thumbnail:hover { opacity: 1; }
.image-lightbox-thumbnail :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-lightbox-video-badge { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-shadow: 0 1px 4px #000; }
.image-lightbox-status { position: absolute; bottom: max(94px, calc(env(safe-area-inset-bottom) + 84px)); left: 15%; right: 15%; padding: 8px; border-radius: 8px; background: #141821dd; color: #fff; text-align: center; font-size: .8rem; }
@media (max-width: 760px) {
  .image-lightbox-stage { left: 8px; right: 8px; }
  .image-lightbox-thumbnail { flex-basis: 44px; width: 44px; height: 44px; }
}

.message-time,
.message-edited,
.message-receipt {
  font-size: 0.74em;
}
.message-meta {
  display: flex;
  min-height: 1rem;
  align-items: center;
  justify-content: flex-end;
  gap: .18rem;
  padding: 0 .65rem .45rem;
  text-align: end;
  line-height: 1;
  opacity: 1;
}
.message-time {
  font-variant-numeric: lining-nums tabular-nums;
}
.message-time-separator {
  display: inline-block;
  /* Keep the ordinary colon glyph optically centered between lining digits. */
  transform: translateY(-.08em);
}
.message-time,
.message-edited {
  display: block;
  padding: 0;
  opacity: .72;
}
body:not(.touch) .message-actions-trigger::before,
body:not(.touch) .message-actions-trigger::after {
  position: absolute;
  content: '';
}
/* Transparent approach lanes keep the corner control hoverable while the
   pointer crosses the bubble's top or right edge. */
body:not(.touch) .message-actions-trigger::before {
  top: 0;
  right: calc(100% - .15rem);
  width: .75rem;
  height: 50%;
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
}
body:not(.touch) .message-actions-trigger::after {
  top: calc(100% - .15rem);
  left: 50%;
  width: 50%;
  height: .75rem;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.message-actions-trigger {
  position: absolute;
  z-index: 8;
  top: calc(var(--overflow-menu-height) * -.5);
  inset-inline-end: calc(var(--overflow-menu-width) * -.5);
}
body:not(.touch) .message-actions-trigger {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-.25rem) scale(.88);
}
body:not(.touch) .text:hover .message-actions-trigger,
body:not(.touch) .message-actions-trigger:is(:hover, :focus-visible) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
body.touch .message-actions-trigger:not(.is-pending-action) { display: none; }
body.touch .message-actions-trigger.is-pending-action::before {
  content: '';
  position: absolute;
  inset: -.75rem -.45rem;
}
body.touch .bubble .text:has(.message-actions-trigger:active) { filter: none; }
.message-receipt {
  display: inline-flex;
  width: 1.15rem;
  height: .85rem;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: .68;
  transform-origin: center;
  transition: color .22s ease, filter .22s ease, opacity .22s ease;
}
.message-receipt svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
  stroke: none;
}
.message-receipt.is-sending { opacity: .48; }
.message-receipt.is-failed { color: #fff; opacity: 1; }
.message-receipt.is-sent { opacity: .58; }
.bubble.me .message-receipt.is-delivered {
  color: #b5bdc2;
  opacity: .72;
}
.bubble.me .message-receipt.is-seen {
  color: #35dcff;
  filter: none;
  opacity: 1;
}
.message-receipt.is-transitioning {
  animation: receipt-status-change .38s cubic-bezier(.2, .8, .2, 1);
}
@keyframes receipt-status-change {
  0% { opacity: .42; transform: scale(.72); }
  58% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .message-receipt { transition: none; }
  .message-receipt.is-transitioning { animation: none; }
}
.image-time {
  position: absolute;
  right: .65rem;
  bottom: .55rem;
  z-index: 2;
  padding: 0;
  color: #fff;
  opacity: 1;
  text-shadow:
    0 1px 2px #000,
    0 0 2px #000c,
    0 0 1px #fff8;
}
/* A time directly in .text belongs to a message without text (chat.js puts a
   text's time inside its .message-body). */
.text > .message-meta:not(.image-time, .file-time) {
  padding-top: .45rem;
}
.bubble.temp {
  opacity: 1;
}

.bubble .error-msg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  padding: .12rem .55rem .42rem;
  color: color-mix(in srgb, #ff8998 76%, var(--color-light-01));
  font-size: .68rem;
  font-weight: 700;
}

.bubble .delivery-error-detail {
  flex-basis: 100%;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.bubble .error-msg button {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .48rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
#chat .bubble .text .delivery-actions {
  display: grid;
  justify-content: stretch;
  gap: .32rem;
  padding: .45rem .65rem .55rem;
  margin: .3rem .25rem .15rem;
  border-radius: .7rem;
  background: color-mix(in srgb, currentColor 7%, transparent);
  color: inherit;
  font-size: .76rem;
  font-weight: 550;
}
.delivery-status, .delivery-buttons {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.delivery-status { color: light-dark(#862a35, #ffc3c7); }
.bubble.me .delivery-status { color: light-dark(#fff, #ffe9ea); }
.delivery-buttons { flex-wrap: wrap; }
#chat .bubble .delivery-buttons button {
  min-height: 2rem;
  padding: .25rem .55rem;
  border: 0;
  border-radius: .45rem;
  background: color-mix(in srgb, currentColor 11%, transparent);
}
#chat .bubble .delivery-buttons button.delivery-retry {
  background: color-mix(in srgb, currentColor 21%, transparent);
}
#chat .bubble .delivery-buttons button:active { background: color-mix(in srgb, currentColor 27%, transparent); }
.delivery-actions .delivery-error-detail { max-block-size: 3.5em; overflow: auto; }
.delivery-actions .ui-icon { width: .9rem; height: .9rem; }
.bubble .text.success {
  --bubble-background: #7cf27c;
  border-left: 2px solid #00d535;
}

/* Button zum schnellen Runterscrollen */
#scrollBtn {
  position: absolute;
  top: calc(-3.05rem - var(--composer-extra-space) - var(--composer-leading-space, 0px));
  right: .35rem;
  z-index: 5;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .72rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 6%, transparent);
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);
  box-shadow: 0 .35rem 1rem #0004;
  cursor: pointer;
  padding-top: .4rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(.2rem) scale(.86);
  transition: background-color var(--anim-time-01) var(--anim-type-01), opacity .2s ease, transform .24s cubic-bezier(.32, .7, .35, 1), visibility 0s linear .24s;
}
#scrollBtn[hidden] {
  display: none !important;
}
#scrollBtn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
  transition-timing-function: ease, ease-out, cubic-bezier(.22, .78, .3, 1.12), linear;
}
@media (prefers-reduced-motion: reduce) {
  #scrollBtn { transition: none; }
}
#scrollBtn .ion-svg { grid-area: 1 / 1; width: 1.25rem; height: 1.25rem; transition: opacity .16s ease, translate .22s cubic-bezier(.3, 1.4, .5, 1), scale .22s ease; }
#scrollBtn { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#scrollBtn .scroll-btn-all { opacity: 0; translate: 0 -.35rem; scale: .7; }
#scrollBtn.is-jump-all .ion-svg:not(.scroll-btn-all) { opacity: 0; translate: 0 .35rem; scale: .7; }
#scrollBtn.is-jump-all .scroll-btn-all { opacity: 1; translate: 0; scale: 1; }
/* Visible around the finger: the button holds a soft halo after one pulse. */
form#form #scrollBtn.is-jump-all:not(#_) { box-shadow: 0 0 0 .8rem color-mix(in srgb, var(--color-light-01) 14%, transparent), 0 2px 6px #0002; }
/* Slid off while armed: still the double chevron, quieter; letting go here cancels. */
form#form #scrollBtn.is-jump-all.is-jump-away:not(#_) { box-shadow: 0 0 0 .8rem color-mix(in srgb, var(--color-light-01) 6%, transparent), 0 2px 6px #0002; opacity: .7; }
#scrollBtn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid color-mix(in srgb, var(--color-light-01) 55%, transparent); opacity: 0; pointer-events: none; }
#scrollBtn.is-jump-all::after { animation: scroll-jump-ring .7s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes scroll-jump-ring { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 2.8; } }
@media (prefers-reduced-motion: reduce) { #scrollBtn .ion-svg { transition: none; } #scrollBtn.is-jump-all::after { animation: none; } }
body:not(.touch) #scrollBtn:hover { background: color-mix(in srgb, var(--color-light-01) 14%, var(--color-background-01)); }
#scrollBtn:active { transform: scale(.92); }

/* Composer. Other forms bring their own component. */
form:where(#form) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-background-03);
  padding: 12px;
  /* border: 1px solid #ddd; */
  backdrop-filter: var(--backdrop-blur-01);
  border-radius: 4px;
}

.message-input-area {
  position: relative;
  width: 100%;
  min-height: 36px;
}

form:where(#form) textarea {
  width: 100%;
  border: 1px solid var(--color-light-01);
  border-radius: .4rem .2rem .2rem .4rem;
  padding: 8px 12px;
  font-size: 14px;
  background-color: transparent;
  color: var(--color-light-01);
	min-height: 36px;
  height: 36px;
	max-height: 150px;
  overflow-y: hidden;
  resize: none;
  font-size: 1rem;
  transition: background-color var(--anim-time-01) var(--anim-type-01);
}
form:where(#form) textarea::placeholder {
  color: var(--color-placeholder);
}

form:where(#form) textarea:focus {
  background-color: #78787843;
  outline: none;
}
/*
form textarea {
  resize: vertical;
  min-height: 60px;
}
*/

body:not(.touch) form:where(#form) button[type="submit"]:not(.camayo-button):hover {
  background: color-mix(in srgb, var(--color-accent-01) 88%, white);
}

.send-form-wrapper {
  position: absolute;
  bottom: 1rem; left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
.send-form-wrapper[hidden] {
  display: none;
}
.send-form-wrapper > #form[hidden] {
  display: none !important;
}
.composer-permission-notice {
  box-sizing: border-box;
  width: min(calc(100% - 1.5rem), 72rem);
  margin: 0;
  padding: .75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 16%, transparent);
  border-radius: .8rem;
  color: color-mix(in srgb, var(--color-light-01) 76%, transparent);
  background: color-mix(in srgb, var(--color-background-01) 88%, transparent);
  box-shadow: 0 .35rem 1.1rem #0003;
  font-size: .85rem;
  line-height: 1.35;
  text-align: center;
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);
}
.composer-permission-notice[hidden] {
  display: none !important;
}
/* A blocked direct chat (docs/BLOCKING.md): the composer stays in place, greyed;
   tapping it asks to unblock. */
form#form.is-blocked :is(.composer-bar, #composerMore) { opacity: .5; filter: grayscale(1); }
form#form.is-blocked #text { cursor: pointer; caret-color: transparent; }
form#form.is-blocked #text::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

form#form {
  position: relative;
  width: 90%;
  max-width: 75rem;
  display: flex;
  flex-direction: row;
  gap: .7rem;
  padding: .5rem .5rem .3rem .5rem;
  border-radius: .9rem;
  /* background: #fff; */

  background: var(--color-background-03);
  backdrop-filter: var(--backdrop-blur-01);
}
.composer-reply {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  padding: .48rem .48rem .48rem .72rem;
  border-left: .18rem solid var(--color-accent-02, var(--color-accent-01));
  border-radius: .72rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 7%, var(--color-background-01));
  box-shadow: 0 .12rem .45rem #0002;
  animation: composer-reply-in .16s cubic-bezier(.2, .8, .2, 1) both;
}
.composer-reply[hidden] { display: none; }
.composer-reply.has-reply-thumbnail { grid-template-columns: 1.35rem minmax(0, 1fr) 3.5rem 2rem; overflow: hidden; }
.composer-reply-thumbnail { display: none; }
.composer-reply.has-reply-thumbnail .composer-reply-thumbnail { display: block; position: relative; align-self: stretch; margin-block: -.48rem; }
.composer-reply-thumbnail img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.composer-reply-icon { display: grid; place-items: center; color: var(--color-accent-02, var(--color-accent-01)); }
.composer-reply-icon .ion-svg { width: 1.1rem; height: 1.1rem; }
.composer-reply-copy { display: grid; min-width: 0; gap: .08rem; }
.composer-reply-copy strong,
.composer-reply-copy > span {
  overflow: hidden;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.composer-reply-copy strong { font-size: .78rem; color: var(--color-accent-02, var(--color-accent-01)); }
.composer-reply-copy > span { font-size: .76rem; opacity: .68; }
.composer-reply-copy .reply-summary { opacity: 1; }
.composer-reply-copy .reply-summary-label { font-size: inherit; }
.composer-reply > button {
  grid-column: -2 / -1;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .55rem;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color .14s ease-out, transform .14s ease-out;
}
.composer-reply > button:is(:hover, :focus-visible) { background: color-mix(in srgb, currentColor 10%, transparent); }
.composer-reply > button:active { transform: scale(.92); }
.composer-reply > button .ion-svg { width: 1rem; height: 1rem; }
@keyframes composer-reply-in {
  from { opacity: 0; transform: translateY(.25rem) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Drop-Area für Dateien */
#fileDropArea {
  border: 1.5px dashed var(--color-light-03);
  padding: 13px;
  width: 45px;
  height: 36px;
  text-align: center;
  color: var(--color-light-01);
  border-radius: .2rem .4rem .4rem .2rem;
  cursor: pointer;

  background-image: url(/images/paper-clip.svg);
  background-position: center center;
  background-size: 40%;
  background-repeat: no-repeat;

  filter: var(--icon-filter-invert);
  transition: opacity var(--anim-time-01) var(--anim-type-01), background-size var(--anim-time-01) var(--anim-type-01);
}
body:not(.touch) #fileDropArea:hover {
  opacity: .6;
  background-size: 50%;
}
#fileDropArea:active {
  background-size: 30% !important;
}
#fileDropArea.dragover {
  background-color: #78787843;
  border-color: var(--color-accent-switch);
}

/* Angeheftete Dateien */
.attachment-frame {
  max-width: 100%;
  overflow: hidden;
  border-radius:
    var(--bubble-radius-top-left)
    var(--bubble-radius-top-right)
    var(--bubble-radius-bottom-right)
    var(--bubble-radius-bottom-left);
}

.attachment-frame > a {
  display: block;
}
.attachment-preview {
  position: relative;
  width: var(--preview-width, 320px);
  max-width: 100%;
  aspect-ratio: var(--preview-ratio, 4 / 3);
  overflow: hidden;
  border-radius: inherit;
  background: var(--color-message-other);
}
.attachment-preview:not(.is-loaded) > .file-preview,
.attachment-video-stage:not(.is-loaded) > .attachment-video-poster {
  visibility: hidden;
}
.attachment-preview.is-loaded.is-arriving > .file-preview,
.attachment-video-stage.is-loaded.is-arriving > .attachment-video-poster {
  animation: attachment-preview-in .16s ease-out both;
}
.attachment-preview > .file-preview { filter: brightness(1); transition: filter 240ms ease; }
.text:not([data-send-quiet]) .attachment-frame.is-pending > .attachment-preview > .file-preview { filter: brightness(.88); transition-delay: 380ms; }
@starting-style {
  .text:not([data-send-quiet]) .attachment-frame.is-pending > .attachment-preview > .file-preview { filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .attachment-preview > .file-preview { transition: none; }
}
.attachment-frame.is-loading-preview :is(.attachment-preview, .attachment-video-stage)::after {
  position: absolute;
  inset: 0;
  width: 1rem;
  height: 1rem;
  margin: auto;
  content: "";
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-block-start-color: color-mix(in srgb, var(--color-light-01) 55%, transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: attachment-preview-in .16s .12s ease-out both, camayo-list-spin .85s linear infinite;
}
.attachment-frame.is-loading-preview .attachment-video-stage::after {
  z-index: 2;
  inset: auto auto .65rem .65rem;
}
@keyframes attachment-preview-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .attachment-preview.is-loaded > .file-preview,
  .attachment-video-stage.is-loaded > .attachment-video-poster,
  .attachment-frame.is-loading-preview :is(.attachment-preview, .attachment-video-stage)::after { animation: none; }
}
.bubble .text.has-media-preview:has(.attachment-message-footer) .attachment-frame {
  border-radius:
    var(--bubble-radius-top-left)
    var(--bubble-radius-top-right)
    0 0;
}

.bubble .text.has-media-preview {
  background: transparent;
}
.bubble .text.has-media-preview:has(> .text-reply) > .text-reply {
  contain: inline-size;
  background-color: color-mix(in srgb, var(--color-accent-01) 16%, var(--bubble-background));
}
.bubble .text.has-media-preview:has(> .text-reply) > .attachment-frame {
  background: var(--bubble-background);
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}
.text-reply[data-reply-to-id]:not([data-reply-to-id=""]) { cursor: pointer; }
.text-reply[role="button"]:focus-visible { outline-offset: -3px; }

.attachment-message-footer {
  background: var(--bubble-background);
  border-radius:
    0 0
    var(--bubble-radius-bottom-right)
    var(--bubble-radius-bottom-left);
  overflow: hidden;
}
.attachment-message-footer .text-content {
  padding: .55rem .65rem .25rem;
}

.attachment-frame img,
.file-preview {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.attachment-video {
  overflow: hidden;
  border-radius: inherit;
  background: var(--color-message-other);
}
.attachment-video-stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: var(--video-preview-ratio, 16 / 9);
  min-height: 9rem;
  max-height: min(62dvh, 30rem);
  place-items: center;
  overflow: hidden;
  color: color-mix(in srgb, var(--color-light-01) 58%, transparent);
  background: color-mix(in srgb, var(--color-dark-01) 94%, white);
}
.attachment-video-stage.is-local-preview { max-width: min(32rem, calc(100vw - 3rem)); }
.attachment-video-stage.is-local-preview video { object-fit: contain; }
.attachment-video-stage > * { grid-area: 1 / 1; }
.attachment-video video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(62dvh, 30rem);
  background: #000;
  object-fit: cover;
}
.attachment-video-poster { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-video-stage.is-playing { aspect-ratio: auto; }
.attachment-video-stage.is-playing video { min-height: 12rem; object-fit: contain; }
.attachment-audio {
  display: grid;
  width: min(31rem, calc(100vw - 3.5rem));
  max-width: 100%;
  gap: .3rem;
  padding: .62rem .78rem .72rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.attachment-audio-name {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.attachment-audio-media { display: none; }
.attachment-audio-timeline { min-width: 0; }
.attachment-audio-elapsed {
  display: block;
  color: color-mix(in srgb, currentColor 72%, transparent);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}
.attachment-audio-controls {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
}
.attachment-audio-controls button {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color .16s ease, opacity .16s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.attachment-audio-controls button:hover,
.attachment-audio-controls button:focus-visible { background: color-mix(in srgb, currentColor 13%, transparent); }
.attachment-audio-controls button:active { transform: scale(.9); }
.attachment-audio-skip { width: 2.55rem; height: 2.55rem; border-radius: 50%; }
.attachment-audio-skip svg { width: 2rem; height: 2rem; overflow: visible; }
.attachment-audio-skip text { fill: currentColor; font: 700 120px/1 sans-serif; }
.attachment-audio-play {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 18%, transparent) !important;
}
.attachment-audio-play .ion-svg {
  grid-area: 1 / 1;
  width: 1.35rem;
  height: 1.35rem;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.attachment-audio-play-glyph { opacity: 1; transform: translateX(.08rem) scale(1); }
.attachment-audio-pause-glyph { opacity: 0; transform: scale(.65); }
.attachment-audio-play.is-playing .attachment-audio-play-glyph { opacity: 0; transform: translateX(.08rem) scale(.65); }
.attachment-audio-play.is-playing .attachment-audio-pause-glyph { opacity: 1; transform: scale(1); }
.attachment-audio.is-encrypted { align-content: center; min-height: 6.5rem; }
.attachment-audio-decryption-status {
  color: color-mix(in srgb, currentColor 68%, transparent);
  font-size: .78rem;
}
.attachment-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #111013b5;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background-color .18s ease, transform .18s ease;
}
.attachment-video-play:hover,
.attachment-video-play:focus-visible { background: color-mix(in srgb, var(--color-accent-01) 78%, #111013); }
.attachment-video-play:active { transform: translate(-50%, -50%) scale(.94); }
.attachment-video-play .ion-svg { width: 1.5rem; height: 1.5rem; transform: translateX(.1rem); }
.attachment-video-stage.is-playing .attachment-video-play { display: none; }
.attachment-video.is-encrypted { background: var(--bubble-background); }
.attachment-video.is-encrypted .attachment-video-stage { min-height: 8.5rem; aspect-ratio: 16 / 7; }
.attachment-video-details {
  display: grid;
  gap: .28rem;
  padding: .65rem .75rem .75rem;
  background: var(--bubble-background);
}
.attachment-video-details > a {
  justify-self: start;
  color: inherit;
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
}
@media (max-width: 520px) {
  .attachment-video-stage { min-height: 8rem; }
  .attachment-video-play { width: 3.25rem; height: 3.25rem; }
}
@keyframes attachment-loading {
  to { transform: translateX(100%); }
}
.composer-popovers {
  position: absolute;
  left: .5rem;
  bottom: calc(100% + .35rem);
  z-index: 4;
  display: flex;
  max-width: min(32rem, calc(100% - 1rem));
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  pointer-events: none;
}
.composer-limit-notice:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  max-width: 100%;
  padding: .55rem .7rem;
  border-radius: .75rem;
  background: var(--composer-surface, var(--color-background-02));
  color: var(--color-light-01);
  box-shadow: 0 .22rem .8rem #0003;
  font-size: .78rem;
  line-height: 1.35;
  pointer-events: auto;
}
.composer-limit-notice .camayo-button {
  --camayo-button-padding: .25rem .6rem;
  min-height: 2rem;
  font-size: inherit;
}
form#form.is-recording #composerLimitNotice { display: none; }
#attachedFiles {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  max-width: 100%;
  pointer-events: auto;
}
/* Highlight beim Drag über Drop-Zone oder Textarea */
.drop-area.dragover,
#text.dragover {
  border: 2px dashed var(--color-accent-01);
  background-color: color-mix(in srgb, var(--color-accent-01) 14%, transparent);
  transition: background-color var(--anim-time-01) var(--anim-type-01), border var(--anim-time-01) var(--anim-type-01);
}
#text{
	padding-right: 2rem;
	field-sizing: fixed;
	box-sizing: border-box;
	height: auto;
	min-height: calc(1.35em + 18px);
	max-height: min(15rem, 40dvh);
	resize: none;
	line-height: 1.35;
	overflow-y: hidden;
}

/* Stil für einzelne angehängte Dateien */
.attached-file {
  position: relative;
  width: min(17rem, calc(100vw - 3rem));
  min-width: 0;
  padding: .35rem 2rem .35rem .35rem;
  background: color-mix(in srgb, var(--color-background-01) 94%, white);
  border-radius: .65rem;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  color: var(--color-light-01);
  box-shadow: 0 .2rem .7rem #0004;
  overflow: hidden;
}
.attached-file-preview {
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: .4rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
}
.attached-file.is-video { width: min(22rem, calc(100vw - 3rem)); }
.attached-file.is-video .attached-file-preview {
  flex-basis: auto;
  width: auto;
  height: 5.25rem;
  max-width: 9.5rem;
  aspect-ratio: var(--attached-preview-ratio, 16 / 9);
}
.attached-file-preview img,
.attached-file-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attached-file.is-video .attached-file-preview video { object-fit: contain; }
.attached-file-preview.is-file {
  background-color: color-mix(in srgb, var(--color-light-01) 10%, transparent);
  background-image: url(/images/paper-clip.svg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 42%;
  filter: var(--icon-filter-invert);
}
.attached-file-details {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: .2rem;
}
.attached-file-name {
  overflow: hidden;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.attached-file-meta {
  color: var(--color-placeholder);
  font-size: .72rem;
  line-height: 1;
}
.attached-file.is-audio {
  width: min(22rem, calc(100vw - 3rem));
  padding-block: .5rem;
}
.attached-file.is-audio audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 2.35rem;
  margin-top: .15rem;
}
.file-info {
  padding: .55rem .75rem;
  text-wrap: wrap;
}
.file-info.nopreview {
  max-inline-size: 100%;
}

.file-info a {
  text-decoration: none;
}

.file-info a::before {
  display: inline-block;
  content: "";
  margin: 0 .2rem 0 0;
  height: 14px; aspect-ratio: 1;
  background-image: url(/images/paper-clip.svg);
  background-position: center 100%;
  background-size: 80%;
  background-repeat: no-repeat;
}
.bubble.other .file-info a {
  color: var(--color-message-other-text);
}
.bubble.me .file-info a {
  color: var(--color-light-03);
}
.bubble.other .file-info a::before {
  filter: var(--icon-filter-message-other);
}

.attached-file button {
  position: absolute;
  top: .3rem;
  right: .3rem;
  background: transparent;
  border: none;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  color: var(--color-placeholder);
  cursor: pointer;
  line-height: 1;
}

.attached-file button:hover {
  color: #ff9ca8;
  background: #ffffff12;
}

.overlay[hidden] {
  display: none !important;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  background: var(--color-background-03);
  backdrop-filter: var(--backdrop-blur-01);
}

.overlay-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--border-radius-01);
  padding: 0;
}

.overlay-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  background-color: var(--color-light-01);
  box-shadow: 0 0 15px #00000080;
  cursor: pointer;
  padding: 0;
}

.attached-file.uploading::after {
  position: absolute;
  right: .55rem;
  bottom: .45rem;
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--color-light-01) 25%, transparent);
  border-top-color: var(--color-light-01);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

.upload-status {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: .3rem .55rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
  border-radius: .45rem;
  color: var(--color-light-03);
  background: color-mix(in srgb, var(--color-background-01) 92%, transparent);
  box-shadow: 0 .2rem .7rem #0004;
  font-size: .73rem;
  line-height: 1.25;
  animation: upload-toast-in .16s ease-out;
  pointer-events: none;
}

.upload-status[data-state="error"] {
  color: #ff9ca8;
}

.upload-status[data-state="warning"] {
  color: #ffd08a;
}

.upload-status[data-state="success"] {
  color: #aee8bd;
}

@keyframes upload-toast-in {
  from { opacity: 0; transform: translateY(.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

dialog {
  padding: 1.5em 2em;
  border: none;
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  font-size: 1rem;
  max-width: 400px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.install-app-dialog {
  position: relative;
  width: min(25rem, calc(100vw - 2rem));
  max-width: 25rem;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.5rem;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-radius: 1rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  box-shadow: 0 1.25rem 4rem #0008;
}
.install-app-dialog::backdrop {
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(3px);
}
.install-app-close { position: absolute; top: .75rem; right: .75rem; }
.install-app-brand {
  display: grid;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto .9rem;
  place-items: center;
  border-radius: 1.1rem;
  background: color-mix(in srgb, var(--color-accent-01) 18%, transparent);
}
.install-app-brand img { width: 4rem; height: 4rem; object-fit: contain; }
.install-app-dialog h2 { margin: 0; text-align: center; font-size: 1.35rem; }
.install-app-dialog > p { margin: .65rem 0 0; line-height: 1.45; text-align: center; }
.install-app-steps {
  display: grid;
  gap: .7rem;
  margin: 1.15rem 0 0;
  padding: 1rem 1rem 1rem 2.6rem;
  border-radius: .75rem;
  background: color-mix(in srgb, var(--color-light-01) 7%, transparent);
  line-height: 1.4;
}
.install-app-steps[hidden] { display: none; }
.install-app-steps li::marker { color: var(--color-accent-01); font-weight: 800; }
.install-share-icon {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: .3rem;
  line-height: 1;
}
.install-app-dialog .install-app-browser-hint {
  padding: .65rem .75rem;
  border-radius: .55rem;
  background: color-mix(in srgb, var(--color-accent-01) 18%, transparent);
  font-size: .86rem;
  text-align: left;
}
.install-app-status { min-height: 1.3rem; font-size: .82rem; opacity: .78; }
.install-app-actions { display: flex; gap: .65rem; margin-top: 1rem; }
.install-app-actions button {
  min-height: 2.8rem;
  padding: .65rem .9rem;
  border: 0;
  border-radius: .6rem;
  color: var(--color-light-01);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}
.install-app-actions .secondary-button { flex: 1; background: color-mix(in srgb, var(--color-light-01) 10%, transparent); }
.install-app-actions .primary-button { flex: 2; color: var(--camayo-on-primary); background: var(--camayo-primary); }
.install-app-actions button:disabled { cursor: default; opacity: .6; }

@media (max-width: 420px) {
  .install-app-dialog { padding: 1.25rem; }
  .install-app-actions { flex-direction: column-reverse; }
  .install-app-actions button { width: 100%; }
}

.group-dialog {
  margin: auto;
  width: min(34rem, calc(100vw - 2rem));
  max-width: 34rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  color: var(--color-light-01);
  background: var(--color-background-01);
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-radius: .9rem;
}
.group-dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.group-dialog-heading h2 {
  color: var(--color-light-01);
  font-size: 1.25rem;
}
.group-dialog-heading p {
  margin-top: .25rem;
  line-height: 1.35;
  opacity: .68;
}
.dialog-close-button {
  all: unset;
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: var(--color-light-01);
  cursor: pointer;
  font-size: 1.4rem;
}
.dialog-close-button:hover,
.dialog-close-button:focus-visible {
  background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
}
.sidebar-conversation-button .sidebar-item-label {
  align-self: end;
  text-overflow: ellipsis;
  --text-overflow-kind: initial;
  -webkit-mask-image: none;
  mask-image: none;
}
.sidebar-item-details {
  display: flex;
  align-items: center;
  gap: .22rem;
  grid-column: 2;
  overflow: hidden;
  color: color-mix(in srgb, var(--color-light-01) 62%, transparent);
  font-size: .64rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-conversation-button .sidebar-item-details.is-typing {
  color: #35dcff;
  font-weight: 720;
}
.sidebar-conversation-button .sidebar-item-details.is-recording {
  color: color-mix(in srgb, #35dcff 78%, var(--color-light-01));
}
.sidebar-presence-icon {
  width: .82rem;
  height: .82rem;
  flex: 0 0 auto;
  fill: currentColor;
  animation: recording-presence-pulse 1.25s ease-in-out infinite;
}
.sidebar-presence-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-preview-copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-conversation-button .sidebar-item-details:not(:has(> *)) { display: block; align-self: center; }
.sidebar-row-status {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: .35rem;
}
.sidebar-preview-receipt {
  display: inline-flex;
  grid-column: 1;
  width: 1.24rem;
  height: .9rem;
  color: #b5bdc2;
  opacity: .72;
}
.sidebar-preview-receipt svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sidebar-preview-receipt.is-sent { opacity: .58; }
.sidebar-preview-receipt.is-seen {
  color: #35dcff;
  filter: none;
  opacity: 1;
}
.sidebar-item-time {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  color: color-mix(in srgb, var(--color-light-01) 54%, transparent);
  font-size: .62rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sidebar-conversation-button.is-active .sidebar-item-time { color: color-mix(in srgb, #fff 72%, transparent); }
.sidebar-conversation-button .sidebar-unread-badge {
  grid-column: 2;
  grid-row: 1;
  box-sizing: border-box;
  width: auto;
  min-width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  padding: 0 .22rem;
  border: 0;
  box-shadow: none;
  background: #0873c4;
  color: white;
  font-size: .66rem;
  font-variant-numeric: tabular-nums;
}
.sidebar-conversation-button .sidebar-unread-dot {
  width: .66rem;
  min-width: 0;
  height: .66rem;
  padding: 0;
  margin-inline: .1rem;
}
.conversation-sections { display: grid; gap: .55rem; }
.sidebar-address-book {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
}
.sidebar-address-book[hidden] { display: none; }
.sidebar-address-book-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.sidebar-address-book-heading h2 {
  margin: 0;
  color: var(--color-light-01);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sidebar-address-book-heading span {
  color: color-mix(in srgb, var(--color-light-01) 62%, transparent);
  font-size: .72rem;
}
#addressBookSearch {
  width: 100%;
  margin: .55rem 0 .35rem;
  padding: .62rem .7rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 20%, transparent);
  border-radius: .55rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 6%, var(--color-background-01));
  font: inherit;
}
.sidebar-address-book-list {
  display: grid;
  gap: .18rem;
  max-height: min(22rem, 38dvh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.sidebar-address-book-list li { list-style: none; }
.sidebar-address-book-list .sidebar-person-button { min-height: 2.9rem; }
#chatList .sidebar-list { display: grid; gap: .22rem; margin-top: .2rem; }
.sidebar-conversation-button {
  grid-template-columns: 2.55rem minmax(0, 1fr) max-content;
  grid-template-rows: 1.2rem 1.5rem;
  align-content: center;
  min-height: 3.55rem;
  column-gap: .65rem;
  row-gap: .08rem;
  padding: .48rem .58rem;
  border: 1px solid transparent;
  border-radius: .82rem;
}
/* Hovered and open chats get a plain band of colour from one edge of the list
   to the other: no border, no rounding. Touch screens show no hover. */
.sidebar-conversation-button:focus-visible { border-color: color-mix(in srgb, var(--color-light-01) 10%, transparent); }
#sidebarListScroller, #sidebarListScroller > #conversationSections { margin-inline: -.65rem; padding-inline: .65rem; }
/* The new-chat picker shares this row band (refined-ui.css). */
.sidebar-conversation-button::before, #newChatDialog .sidebar-person-button::before {
  content: ''; position: absolute; z-index: -1; inset-block: -.11rem; inset-inline: -.65rem;
  background: transparent; transition: background-color 80ms cubic-bezier(.3, 0, .2, 1); pointer-events: none;
}
body .sidebar-conversation-button.is-active:not(#_) { border-color: transparent; border-radius: 0; background: transparent; box-shadow: none; }
.sidebar-conversation-button.is-active::before { background: var(--shell-selection); }
@media (hover: hover) and (pointer: fine) {
  .sidebar-conversation-button:not(.is-active):hover::before, #newChatDialog .sidebar-person-button:not(:disabled):hover::before { background: color-mix(in srgb, var(--color-light-01) 8%, transparent); }
}
#newChatDialog .sidebar-person-button:is(:active, :focus-visible)::before { background: color-mix(in srgb, var(--color-light-01) 8%, transparent); }

.sidebar-conversation-button .sidebar-item-icon {
  grid-row: 1 / span 2;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: .78rem;
  color: var(--color-light-03);
  background: color-mix(in srgb, var(--color-accent-01) 68%, var(--color-background-01));
  font-size: .9rem;
  font-weight: 800;
  opacity: 1;
}
.sidebar-conversation-button .sidebar-item-label { font-size: .9rem; font-weight: 680; }
.sidebar-muted-indicator {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: .3rem;
  vertical-align: -.12rem;
  color: color-mix(in srgb, var(--color-light-01) 75%, transparent);
}
.sidebar-muted-indicator svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-item-details { font-size: .7rem; }
.sidebar-section h3 { margin: .5rem .58rem .18rem; font-size: .65rem; }
.attached-file {
  border: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
  background: var(--color-background-01);
  box-shadow: 0 .45rem 1.4rem #0003;
}
.group-member-options {
  max-height: min(18rem, 42dvh);
  overflow-y: auto;
}
.group-member-search {
  display: grid;
  gap: .4rem;
  margin-bottom: .6rem;
  font-size: .86rem;
  font-weight: 650;
}
.group-member-search input {
  min-height: 2.8rem;
  padding: .65rem .75rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 24%, transparent);
  border-radius: .5rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  font: inherit;
}
.group-member-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.8rem;
  padding: .65rem .45rem;
  border-radius: .4rem;
  color: var(--color-light-01);
  cursor: pointer;
}
.group-member-option:hover {
  background: color-mix(in srgb, var(--color-light-01) 8%, transparent);
}
.group-member-option input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--color-accent-01);
}
.group-dialog-status {
  margin-top: .85rem;
  padding: .55rem .65rem;
  border-radius: .45rem;
  color: #fff;
  background: #8a2634;
  font-size: .82rem;
}
.group-dialog-status[hidden] {
  display: none;
}
.group-dialog-status[data-state="info"] {
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-accent-01) 28%, var(--color-background-01));
}
.group-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1.1rem;
}
.group-dialog-actions button {
  padding: .65rem .85rem;
  border: 0;
  border-radius: .5rem;
  color: var(--color-light-01);
  cursor: pointer;
  font: inherit;
}
.group-dialog-actions .secondary-button {
  background: color-mix(in srgb, var(--color-light-01) 10%, transparent);
}
.group-dialog-actions .primary-button {
  color: var(--camayo-on-primary);
  background: var(--camayo-primary);
}
.group-dialog-actions .secondary-button:hover,
.group-dialog-actions .secondary-button:focus-visible,
.group-dialog-actions .primary-button:hover,
.group-dialog-actions .primary-button:focus-visible {
  filter: brightness(1.12);
}
.group-dialog-actions button:disabled {
  cursor: default;
  opacity: .65;
}
.forward-message-dialog select {
  width: 100%;
  min-height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 28%, transparent);
  border-radius: .45rem;
  padding: .55rem .7rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  font: inherit;
}
.message-forwarded-label {
  padding: .42rem .8rem .3rem;
  color: color-mix(in srgb, currentColor 72%, transparent);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
}
.group-avatar-label {
  color: var(--color-light-01);
  font-size: .82rem;
  font-weight: 700;
}
.file-upload-drop-area {
  all: unset;
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: 4.6rem;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .8rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--color-light-01) 48%, transparent);
  border-radius: .55rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 4%, transparent);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--anim-time-01) var(--anim-type-01), background-color var(--anim-time-01) var(--anim-type-01);
}
.file-upload-drop-area:hover,
.file-upload-drop-area:focus-visible,
.file-upload-drop-area.dragover {
  border-color: var(--color-accent-01);
  background: color-mix(in srgb, var(--color-accent-01) 12%, transparent);
}
.file-upload-drop-area:focus-visible {
  outline: 2px solid var(--color-accent-01);
  outline-offset: 2px;
}
.file-upload-drop-area > * { pointer-events: none; }
.file-upload-icon {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  background: url(/images/paper-clip.svg) center / 70% no-repeat;
  filter: var(--icon-filter-invert);
}
.file-upload-copy {
  display: block;
  min-width: 0;
  line-height: 1.25;
}
.file-upload-copy strong { color: var(--color-accent-01); }
.file-upload-copy small {
  display: block;
  margin-top: .25rem;
  opacity: .62;
}
.desktop-drop-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .desktop-drop-hint { display: inline; }
}
.group-avatar-selection {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .55rem;
  color: var(--color-light-01);
  font-size: .78rem;
}
.group-avatar-selection[hidden] { display: none; }
.group-avatar-selection img {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border-radius: .45rem;
  object-fit: cover;
  background: color-mix(in srgb, var(--color-light-01) 8%, transparent);
}
.group-avatar-selection span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.group-management-actions {
  display: flex;
  flex: 0 0 auto;
  gap: .2rem;
}
.group-management-actions button,
.group-management-actions .danger-button {
  background: #8a2634;
}
.group-management-actions button:disabled,
@media (max-width: 560px) {
  .group-management-actions button {
    flex: 1;
  }
}
.avatar-dialog {
  position: fixed;
  inset: 0;
  width: min(31rem, calc(100vw - 1.5rem));
  max-width: 31rem;
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-radius: 1.1rem;
  color: var(--color-light-01);
  background: var(--color-background-02);
  box-shadow: 0 1.5rem 5rem #000b;
}
.avatar-dialog::backdrop {
  background: #09080bbc;
  backdrop-filter: blur(5px);
}
.avatar-dialog-inner { padding: 1.25rem; }
.avatar-dialog-heading { margin-bottom: 1rem; }
.avatar-dialog-heading h2 { margin: 0; }
.avatar-dialog-heading p {
  margin: .25rem 0 0;
  color: color-mix(in srgb, var(--color-light-01) 68%, transparent);
  line-height: 1.45;
}
.avatar-crop-frame {
  position: relative;
  width: min(100%, 22rem);
  margin: auto;
  overflow: hidden;
  border-radius: 22%;
  background: #17151a;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-light-01) 20%, transparent);
}
.avatar-crop-frame::after {
  position: absolute;
  inset: 0;
  border: 2px solid #fff8;
  border-radius: 22%;
  content: '';
  pointer-events: none;
}
.avatar-crop-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}
.avatar-crop-canvas.is-dragging { cursor: grabbing; }
.avatar-zoom {
  display: grid;
  gap: .4rem;
  margin-top: 1rem;
  font-size: .82rem;
  font-weight: 700;
}
.avatar-zoom input {
  width: 100%;
  accent-color: var(--color-accent-01);
}
.avatar-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1rem;
}
@media (max-width: 560px) {
  .avatar-dialog-actions { flex-direction: column-reverse; }
  .avatar-dialog-actions button { width: 100%; }
}
.contact-invite-dialog label {
  display: block;
  margin: .8rem 0 .35rem;
  color: var(--color-light-01);
  font-size: .82rem;
  font-weight: 700;
}
.contact-invite-email-form > div {
  display: flex;
  gap: .55rem;
}
.contact-invite-email-form input {
  min-width: 0;
  flex: 1;
  padding: .7rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 24%, transparent);
  border-radius: .5rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  font: inherit;
}
.contact-invite-email-form small {
  display: block;
  margin-top: .55rem;
  color: color-mix(in srgb, var(--color-light-01) 68%, transparent);
  line-height: 1.45;
}
.contact-invite-divider {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1rem 0;
  color: color-mix(in srgb, var(--color-light-01) 55%, transparent);
  font-size: .78rem;
}
.contact-invite-divider::before,
.contact-invite-divider::after {
  height: 1px;
  flex: 1;
  background: color-mix(in srgb, var(--color-light-01) 16%, transparent);
  content: '';
}
.contact-invite-create-link { width: 100%; }
#contactInviteShare { margin-top: 1rem; }
.contact-invite-qr {
  width: min(18rem, 100%);
  margin: 0 auto;
  padding: .6rem;
  border-radius: .65rem;
  background: #fff;
}
.contact-invite-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
#contactInviteUrl {
  box-sizing: border-box;
  width: 100%;
  padding: .65rem .7rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 24%, transparent);
  border-radius: .5rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 7%, transparent);
  font: inherit;
  user-select: text;
}
.contact-invite-dialog .group-dialog-status {
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 8%, transparent);
}
@media (max-width: 560px) {
  .contact-invite-email-form > div { align-items: stretch; flex-direction: column; }
}

#aboutCamayoDialog {
  margin: auto;
  width: min(38rem, calc(100vw - 2rem));
  max-width: 38rem;
  max-height: min(46rem, calc(100dvh - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 1.5rem 3rem;
  padding-bottom: 3.5rem;
  color: var(--color-light-01);
  background: var(--color-background-01);
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-radius: 1rem;
}
.about-camayo-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.about-camayo-heading img {
  border-radius: .85rem;
}
.about-camayo-heading p {
  margin-top: .15rem;
  font-size: .8rem;
  opacity: .65;
}
.about-camayo-heading h2,
.about-camayo-heading p,
.about-camayo-links,
.about-camayo-links *,
.about-camayo-copy,
.about-camayo-copy * {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  -webkit-touch-callout: default;
}
.about-camayo-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
}
.about-camayo-links a {
  display: inline-flex;
  padding: .5rem .7rem;
  border: 1px solid color-mix(in srgb, var(--color-accent-01) 60%, white);
  border-radius: .5rem;
  color: color-mix(in srgb, var(--color-accent-01) 50%, white);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.about-camayo-links a:not(.camayo-navigation-row):hover,
.about-camayo-links a:not(.camayo-navigation-row):focus-visible {
  color: white;
  background: color-mix(in srgb, var(--color-accent-01) 25%, transparent);
}
.about-camayo-copy p {
  margin: 0 0 1rem;
  line-height: 1.5;
}
.about-camayo-copy h3 {
  margin: 1.25rem 0 .45rem;
  font-size: 1rem;
}
.about-camayo-copy a {
  color: color-mix(in srgb, var(--color-accent-01) 55%, white);
  text-decoration: underline;
}
.about-camayo-sources {
  font-size: .78rem;
  opacity: .8;
}
#aboutCamayoClose {
  display: block;
  margin: 1.25rem 0 1.5rem auto;
  padding: .65rem 1rem;
  border: 0;
  border-radius: .5rem;
  color: var(--color-light-03);
  background: var(--color-accent-01);
  cursor: pointer;
}

#uploadDialog a {
  color: color-mix(in srgb, var(--color-accent-01) 62%, white);
  text-decoration: none;
  font-weight: bold;
}

/**NAV BAR**/

#nav-bar {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 0 .75rem;
  top: 0; left: 0;
  width: 100%; height: var(--header-height);
  text-align: center;
  z-index: 100;
  
  background: var(--color-background-03);
  border-bottom: 1px solid var(--color-border-subtle);
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);
  
  transition: padding var(--anim-time-01) var(--anim-type-01);
}
#nav-bar.closed-side {
  padding-left: calc(var(--header-height) + .65rem);
}

.chatNameWrapper {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, #000, #000 calc(100% - 6rem), #00000000 100%);
}
.conversation-title-button {
  all: unset;
  box-sizing: border-box;
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: .65rem;
  padding: .32rem .45rem;
  border-radius: .55rem;
  color: var(--color-light-01);
  cursor: pointer;
  text-align: left;
}
.conversation-title-button:not(:disabled):hover,
.conversation-title-button:not(:disabled):focus-visible {
  background: color-mix(in srgb, var(--color-light-01) 9%, transparent);
}
.conversation-title-button:disabled { cursor: default; }
.conversation-title-button > img,
.conversation-header-avatar-fallback {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: .55rem;
}
.conversation-title-button > img {
  object-fit: cover;
}
.conversation-header-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--color-light-03);
  background: color-mix(in srgb, var(--color-accent-01) 68%, var(--color-background-01));
  font-size: .78rem;
  font-weight: 800;
}
.conversation-header-avatar-fallback[hidden] { display: none; }
.conversation-title-button > span {
  display: grid;
  min-width: 0;
}
.conversation-title-button strong {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 650;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.conversation-title-button small {
  overflow: hidden;
  color: color-mix(in srgb, var(--color-light-01) 62%, transparent);
  font-size: .67rem;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
}
.conversation-menu-wrapper {
  position: relative;
  display: grid;
  place-items: center;
  z-index: 2;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: auto;
  isolation: isolate;
}
.overflow-menu-button.conversation-menu-button {
  --overflow-menu-width: 2.25rem;
  border-radius: .58rem;
  background: transparent;
  box-shadow: none;
}
.conversation-menu-button[hidden] { display: none; }
.overflow-menu-button.conversation-menu-button svg { width: 1.1rem; height: 1.1rem; }
.overflow-menu-button.conversation-menu-button:is(:hover, :focus-visible, [aria-expanded="true"]) {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.chatName {
  color: var(--color-light-01);
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 500;
  text-wrap: nowrap;
  text-align: start;
  /* background-color: linear-gradient(90deg #000, #000 calc(100% - 14rem), #00000000 calc(100% - 8rem)); */
}

.tool-bar {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.settings-icon {
  all: unset;
  box-sizing: border-box;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity var(--anim-time-01) var(--anim-type-01), rotate var(--anim-time-01) var(--anim-type-01), background-size var(--anim-time-01) var(--anim-type-01);

  background-image: url(/images/settings.svg);
  background-position: center center;
  background-size: 1.65rem;
  background-repeat: no-repeat;

  filter: var(--icon-filter-invert);
}
body:not(.touch) .settings-icon:hover {
  opacity: .6;
  background-size: 1.8rem;
}
.settings-icon:active {
  background-size: 1.45rem !important;
}
.settings-icon.open {
  rotate: -45deg;
}

.settings-pane {
  position: fixed;
  top: var(--header-height); right: -30rem;
  height: calc(100dvh - var(--header-height)); width: 100%;
  max-width: 30rem;
  display: grid;
  padding: 1.5rem 2rem 2rem 2rem;
  grid-template-columns: 1fr auto;
  grid-template-rows: none;
  grid-auto-rows: auto;
  overflow-y: auto;
  opacity: 0;
  /* The mobile close button stays viewport-fixed over the settings gear.
     Sliding/fading its panel away alone does not stop it intercepting taps. */
  pointer-events: none;
  visibility: hidden;
  gap: 1rem;
  z-index: 80;
  align-items: center;
  background: var(--color-background-03);
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);

  transition: right var(--anim-time-02) var(--anim-type-01), opacity var(--anim-time-02) var(--anim-type-01), visibility 0s linear var(--anim-time-02);
}
.settings-pane.open {
  right: 0;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.settings-pane h3 {
  align-self: start;
  text-align: center;
  grid-column: 1 / -1;
  margin-bottom: .5rem;
}
.settings-test-push {
  grid-column: 1 / -1;
  align-self: flex-start;
  width: 100%;
  margin: .25rem 0 0;
  padding: .45rem .7rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 30%, transparent);
  border-radius: .45rem;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
}
.settings-test-push:disabled {
  cursor: default;
  opacity: .45;
}

.settings-admin-link {
  grid-column: span 2;
  justify-self: stretch;
  min-height: 2.75rem;
  padding: .7rem .9rem;
  border: 2px solid var(--color-accent-01);
  border-radius: .55rem;
  color: var(--color-light-03);
  background: var(--color-accent-01);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  margin-top: .35rem;
  transition: background-color var(--anim-time-02) var(--anim-type-01), border-color var(--anim-time-02) var(--anim-type-01), filter var(--anim-time-02) var(--anim-type-01);
}
.settings-admin-link:hover,
.settings-admin-link:focus-visible {
  filter: brightness(1.12);
}
.settings-admin-link[hidden] {
  display: none;
}


.e2ee-recovery-settings {
  display: grid;
  gap: .75rem;
  margin: .35rem 0;
  padding: .9rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 18%, transparent);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--color-dark-01) 72%, transparent);
}
.e2ee-recovery-settings h5 {
  color: var(--color-light-01);
  font-size: .9rem;
}
.e2ee-recovery-settings > p {
  color: var(--color-light-03);
  font-size: .78rem;
  line-height: 1.45;
}
.e2ee-recovery-status {
  min-height: 1.2em;
  color: var(--color-light-01);
  font-size: .78rem;
  line-height: 1.4;
}
.e2ee-recovery-notice {
  position: absolute;
  right: 0;
  bottom: calc(var(--composer-bar-space) + .5rem);
  left: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 0 1rem;
  padding: .85rem .75rem .85rem 1rem;
  border: 0;
  border-radius: 1rem;
  color: var(--color-light-01);
  background: var(--color-message-other);
  box-shadow: 0 4px 18px #0002;
  font-size: .82rem;
  line-height: 1.45;
}
.e2ee-recovery-notice[hidden] {
  display: none;
}
.e2ee-recovery-copy { min-width: 0; flex: 1; }
.e2ee-recovery-icon { display: grid; place-items: center; width: 1.25rem; height: 1.4rem; color: inherit; opacity: .75; flex: none; }
.e2ee-recovery-icon .ui-icon { width: 1rem; height: 1rem; }
.e2ee-recovery-actions { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .3rem; }
.e2ee-recovery-notice .e2ee-recovery-actions button {
  flex: none;
  padding: .25rem 0;
  border: 0;
  border-radius: .5rem;
  color: var(--color-light-01);
  background: transparent;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
.e2ee-recovery-actions button:hover { color: var(--color-link); }
.e2ee-recovery-notice .e2ee-recovery-dismiss { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; margin-top: -.25rem; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; cursor: pointer; }
.e2ee-recovery-dismiss:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.e2ee-recovery-dismiss .ui-icon { width: 1rem; height: 1rem; }
.e2ee-recovery-notice button:focus-visible { outline: 2px solid var(--camayo-focus-ring); outline-offset: 2px; }

#switchTheme::after {
  top: .2rem; left: calc(0% + .2rem);
  position: absolute;
  display: block;
  content: "";
  box-shadow: 0 0 3px 0 #1f1f1f;
  background-color: #536366;
  height: 1.1rem; aspect-ratio: 1;
  border-radius: .75rem;
  pointer-events: none;
  transition: left var(--anim-time-02) ease-out, background-color var(--anim-time-02) ease-out, scale var(--anim-time-02) ease-out;
}

#switchTheme:has(#radio-dark:checked), #switchTheme:has(#radio-light:checked) {
  background-color: #ffffffc4;
}
body:not(.touch) #switchTheme:hover::after {
  scale: 1.1;
}

#switchTheme:active::after {
  scale: .8 !important;
}

.settings-pane input[type=radio] {
  justify-self: end;
}

#switchTheme {
  all: unset;
  position: relative;
  display: flex;
  background-color: #ffffff77;
  height: 1.5rem; width: 5rem;
  border-radius: .75rem;
  box-shadow: 0 0 3px 0 #1f1f1f;
  cursor: pointer;
  transition: background-color var(--anim-time-02) ease-out;
  margin: 1.1rem 0 1.25rem;
}
#switchTheme::after {
  top: .2rem; left: calc(50% - .55rem);
}

#switchTheme input[type=radio] {
  all: unset;
  height: 100%; width: 100%;
}

#switchTheme:has(#radio-dark:checked)::after, #switchTheme:has(#radio-light:checked)::after {
  left: calc(100% - 1.1rem - .2rem);
  background-color: var(--color-accent-01);
}
#switchTheme:has(#radio-light:checked)::after {
  left: calc(0% + .2rem);
}

#switchTheme p {
  opacity: .3;
  position: absolute;
  width: 100%;
  left: 0; top: 1.9rem;
  font-size: .7rem;
  transition: opacity var(--anim-time-02) ease-out;
}
#switchTheme p:nth-child(5) {
  text-align: center;
  top: -1.1rem
} 
#switchTheme p:nth-child(6) {
  text-align: end;
} 
#switchTheme:has(#radio-light:checked) p:nth-child(4) {
  opacity: 1;
}
#switchTheme:has(#radio-auto:checked) p:nth-child(5) {
  opacity: 1;
}
#switchTheme:has(#radio-dark:checked) p:nth-child(6) {
  opacity: 1;
}


.search-icon {
  position: absolute;
  top: .25rem;
  left: 0;
  width: 2.75rem;
  height: 2.25rem;
  transition: background-size var(--anim-time-01) var(--anim-type-01);

  background-image: url(/images/search.svg);
  background-position: center center;
  background-size: 1.25rem;
  background-repeat: no-repeat;
  pointer-events: none;

  filter: var(--icon-filter-invert);
}
body:not(.touch) #chatSearchWrapper:hover {
  opacity: .7;
}

/* context menu */
/* Reaktionen unter einer Nachricht */
.reactions {
  position: absolute;
  bottom: -1.3rem;
  width: max-content;
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-left: 6px;
  z-index: 5;
  font-size: 0.85em;
}
.reaction {
  z-index: 50;
  padding: 2px 7px 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--anim-time-01) var(--anim-type-01);
}

.bubble.other .reactions {
  left: .3rem;
}
.bubble.me .reactions {
  right: .8rem;
}

.bubble.other .reaction {
  background: var(--color-message-other);
  color: var(--color-message-other-text);
}
.bubble.me .reaction {
  background: var(--color-accent-01);
  color: var(--color-light-03);
}

.bubble.other .reaction:hover {
  background: #a6b1b2;
}
.bubble.me .reaction:hover {
  background: color-mix(in srgb, var(--color-accent-01) 78%, black);
}

.bubble .text-content.deleted {
  font-style: italic;
  opacity: .7;
  padding: .4rem .6rem;
}

.emoji-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  justify-content: flex-start;
}
.emoji-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  line-height: 1;
  font-size: 1.3em;
  cursor: pointer;
  transition: transform var(--anim-time-01) var(--anim-type-01);
}
.emoji-option:hover {
  transform: scale(1.3);
}


/* Touch-Fix: Unter iOS Safari usw. */
/* .bubble .text:active {
  background-color: rgba(255,255,255,0.05);
} */

/* Optionales Intro-Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* floating-menu.css oder in dein styles.css integrieren */

/* Surface and rows: menus.css */
.floating-menu,
.context-menu {
  position: fixed;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  width: max-content;
  transform-origin: top left;
  animation: pointer-menu-in .14s cubic-bezier(.2, .8, .2, 1) both;
}
.context-menu[data-side="left"] { transform-origin: top right; }
.context-menu .emoji-row {
  min-height: 2.75rem;
  padding: .22rem .25rem .35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-01) 11%, transparent);
  border-radius: 0;
  cursor: default;
}
.context-menu .emoji-row:hover { background: transparent; }
.context-menu .emoji-option {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: .65rem;
  background: transparent;
}
.context-menu .emoji-option:is(:hover, :focus-visible) {
  outline: none;
  background: color-mix(in srgb, var(--color-light-01) 11%, transparent);
  transform: scale(1.12);
}
@keyframes pointer-menu-in {
  from { opacity: 0; transform: translateY(-.2rem) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .floating-menu,
  .context-menu { animation: none; }
}

#chat-dialog {
  position: fixed;
  flex-direction: column;
  padding: 0;
  width: clamp(10rem, 80%, 20rem);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-background-01);
  border-radius: var(--border-radius-02);
  overflow: hidden;
}

#dialog-title {
  padding: .7rem 1rem .5rem 1rem;
  font-weight: 100;
  text-align: center;
  font-size: 1rem;
  color: var(--color-accent-01);
}

#reply-to {
  position: relative;
  background-color: color-mix(in srgb, var(--color-accent-01) 38%, transparent);
  padding: .5rem 1rem;

}

#reply-to span {
  display: block;
  max-width: 100%;
  font-size: 14px;
  color: var(--color-light-01);
  text-align: start;
  mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), #00000000);
  text-wrap: nowrap;
}

#dialog-text {
  padding: .7rem 1rem;
  width: 100%;
  margin: 0;
  font-size: 1rem;
  min-height: 3rem;
  max-height: 15rem;
  background-color: var(--color-background-01);
  border: 1px solid color-mix(in srgb, var(--color-accent-01) 58%, transparent);
  color: var(--color-light-01);

  resize: vertical;
}

#dialog-text:focus {
  background-color: color-mix(in srgb, var(--color-accent-01) 30%, transparent);
  outline: none;
}

.confirmation-wrapper {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--color-background-01);
}

.confirmation-wrapper input, .confirmation-wrapper button {
  all: unset;
  display: block;
  font-size: 1rem;
  padding: .5rem 1rem;
  pointer-events: all;
  color: var(--color-light-01);
  text-align: center;
  transition: background-color var(--anim-time-01) var(--anim-type-01);
}
.confirmation-wrapper input {
  background-color: color-mix(in srgb, var(--color-accent-01) 12%, transparent);
}
.confirmation-wrapper button {
  background-color: color-mix(in srgb, var(--color-accent-01) 38%, transparent);
}

.confirmation-wrapper input:hover, .confirmation-wrapper button:hover {
  background-color: var(--color-accent-01);
}
.confirmation-wrapper input:active, .confirmation-wrapper button:active {
  background-color: var(--color-background-01) !important;
}

.text-reply {
  box-sizing: border-box;
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  border-radius: var(--bubble-radius-top-left,1rem) var(--bubble-radius-top-right,1rem) 0 0;
  padding: .45rem .55rem;
  background-color: color-mix(in srgb, var(--color-accent-01) 16%, transparent);
  color: inherit;
  --reply-bar: color-mix(in srgb, var(--color-accent-01) 72%, transparent);
  /* The bar is a straight stripe of the background: the rounded corner clips
     it instead of bending it like a border would. */
  padding-inline-start: calc(.55rem + 4px);
  background-image: linear-gradient(var(--reply-bar), var(--reply-bar));
  background-size: 4px 100%;
  background-repeat: no-repeat;
}
.reply-author {
  color: var(--color-link);
  display: block;
}
.text-reply > :not(.reply-author) { min-inline-size: 0; }
.reply-quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.bubble .text.is-compact-text:has(> .text-reply > .reply-quote) {
  inline-size: min(12rem, 100%);
  min-inline-size: 0;
}
.bubble.me .text-reply {
  background-color: #ffffff24;
  --reply-bar: #ffffff80;
}
.bubble.me .reply-author {
  color: var(--color-on-accent-link);
}

@media only screen and (max-width: 649.98px) {
  .settings-pane {
    padding: 1.25rem 1rem 2rem;
    column-gap: .75rem;
    row-gap: .9rem;
  }
  .settings-pane > label {
    line-height: 1.2;
  }
  #container {
    width: 0;
    overflow: hidden;
  }
  #container.closed-side {
    width: 100%;
  }
  #chatList {
    width: 100%;
  }
  #chatList.closed {
    width: 0;
  }
  #nav-bar {
    padding: 0 .75rem 0 calc(var(--header-height) + .65rem);
  }

}

@media (prefers-color-scheme: light) {
  .text-reply[data-theme="light"] {
    --reply-bar: var(--color-accent-01);
  }
  .reply-author[data-theme="light"] {
    color: var(--color-link);
  }
  .bubble.me .text-reply[data-theme="light"] {
    background-color: #ffffff30;
    --reply-bar: #ffffff80;
  }
  .bubble.me .reply-author[data-theme="light"] {
    color: var(--color-on-accent-link);
  }
}
@media (prefers-color-scheme: light) {
  .text-reply {
    --reply-bar: var(--color-accent-01);
  }
  .reply-author {
    color: var(--color-link);
  }
  .bubble.me .text-reply {
    background-color: #ffffff30;
    --reply-bar: #ffffff80;
  }
  .bubble.me .reply-author {
    color: var(--color-on-accent-link);
  }
}

/* needs styling or change place */

body.touch .bubble {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    /* …rest wie gehabt… */
  /* verhindert den iOS-Kontext bei Longpress */
  -webkit-touch-callout: none;
  /* erleichtert Touch-Interaktionen */
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .sidebar-item-with-action {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Let Safari keep native vertical chat scrolling, but deliver horizontal
   movement anywhere on the message surface to swipe-to-reply. Interactive
   descendants below keep their narrower control-specific touch rules. */
body.touch #chat .bubble .text {
  touch-action: pan-y;
}

body.touch .bubble .text-content,
body.touch .bubble .text-reply,
body.touch .bubble .attachment-caption {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: default;
  touch-action: pan-y;
}

body.touch .message-meta {
  min-height: 1rem;
  cursor: context-menu;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

/* Ausnahmen, falls du doch mal Texte auswählbar machen willst:
   zum Beispiel in Formularfeldern oder an anderen Stellen */
body.touch textarea,
body.touch input {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  touch-action: auto;
}

body.touch .text:active {
  filter: brightness(.9);
}

body.touch .text:has(.message-meta:active) {
  filter: brightness(.84);
}

body.touch .text.is-reply-swiping:active,
body.touch .text.is-reply-swiping:has(.message-meta:active) {
  filter: none;
}

/* A control press belongs to the control, not the message's hold feedback. */
body.touch .text:has(:is(button, a, input, select, textarea, summary, [role="button"], [role="slider"], [contenteditable="true"], .voice-seek-strip):active) {
  filter: none;
}

/* Media previews are message surfaces even though tapping them opens a file. */
.bubble .text:not(.is-reply-swiping):has(:is(.attachment-preview, .attachment-document):active),
.bubble .text.is-message-pressing:not(.is-reply-swiping) {
  filter: brightness(.86);
}

/* Hold a message to focus it, then select text in the focused copy. Keeping the
   selection in a dialog prevents feed refreshes from replacing its DOM nodes. */
body.touch #chat .bubble :is(.text-content, .text-reply, .attachment-caption) {
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none;
}
:is(.mobile-message-actions, .message-actions-return) {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(.75rem, env(safe-area-inset-top)) .9rem max(.75rem, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  color: var(--color-light-01);
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
}
:is(.mobile-message-actions[open], .message-actions-return) {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.message-actions-return { z-index: 1600; box-sizing: border-box; pointer-events: none; overflow: hidden; }
.message-actions-scrim { position: fixed; inset: 0; }
.message-actions-sheet { position: relative; }
.bubble .text.is-lifted { visibility: hidden; }
.message-actions-scrim {
  background: #08070a73;
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
.mobile-message-actions::backdrop { background: transparent; }
.mobile-message-actions > .message-actions-scrim {
  animation: message-actions-backdrop-in .16s ease-out both;
}
.message-actions-sheet {
  width: min(100%, 30rem);
  margin-block: auto;
  padding-block: .35rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  flex-shrink: 0;
}
.is-reactions-only .message-actions-options { order: -1; }
.message-actions-preview {
  max-height: 42dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .35rem .45rem;
  border-radius: 1.25rem;
  /* Programmatic focus keeps selection/scrolling inside the dialog without
     drawing a browser focus ring around the whole selected message. */
  outline: none;
}
.message-actions-preview .bubble {
  max-inline-size: 100%;
  margin-block: 0;
}
.message-actions-preview .bubble .text {
  max-inline-size: 100%;
  filter: none !important;
  animation: none;
}
/* The held message comes forward a little. A scale from its own side (not zoom,
   which breaks WebKit's rounded clipping of cards and pictures); its width
   leaves room for the growth, the padding for the few extra pixels in height. */
.mobile-message-actions .message-actions-preview { padding-block: .6rem; }
.mobile-message-actions .message-actions-preview .bubble .text { max-inline-size: calc(100% / 1.05); scale: 1.05; transform-origin: left center; }
.mobile-message-actions .message-actions-preview .bubble.me .text { transform-origin: right center; }
.message-actions-preview .bubble :is(.text-content, .text-reply, .attachment-caption, .file-info),
.message-actions-preview .bubble :is(.text-content, .text-reply, .attachment-caption, .file-info) * {
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-touch-callout: default;
  touch-action: pan-y;
  cursor: text;
}
.message-actions-preview :is(button, input) { pointer-events: none; }
.message-actions-options {
  display: flex;
  flex-direction: column;
  flex: none;
  overflow: hidden;
}
.message-actions-reactions {
  display: flex;
  justify-content: space-around;
  padding-bottom: .28rem;
  margin-bottom: .2rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-01) 12%, transparent);
}
.message-actions-reactions button {
  min-width: 2.75rem;
  padding-inline: .25rem;
  font-size: 1.55rem;
  text-align: center;
  flex: 1;
}
@keyframes message-actions-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mobile-message-actions > .message-actions-scrim { animation: none; }
  .message-actions-options button { transition: none; }
}

.link-preview,
.text.is-link-preview-only {
  --link-preview-background: color-mix(in srgb, var(--bubble-background, var(--color-message-other)) 85%, black);
}
.bubble.me :is(.link-preview, .text.is-link-preview-only) {
  --link-preview-background: color-mix(in srgb, var(--bubble-background) 78%, black);
}
.link-preview {
  display: grid;
  width: 23rem;
  max-width: 100%;
  flex: none;
  margin: .15rem 0 .55rem;
  border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  border-radius: .9rem;
  overflow: hidden;
  color: var(--color-message-other-text);
  background: var(--link-preview-background);
  text-decoration: none;
  transition: filter .16s ease-out, border-color .16s ease-out;
  -webkit-touch-callout: none;
}
.bubble.me .link-preview {
  color: var(--color-light-03);
}
.link-preview:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, currentColor 24%, transparent);
  filter: brightness(1.04);
}
.link-preview:active { filter: brightness(.98); }
.text-content.is-link-only { display: none; }
.bubble .text > .link-preview {
  margin: 0;
  border: 0;
  border-radius: var(--bubble-radius-top-left) var(--bubble-radius-top-right) 0 0;
}
/* Below a quote the card joins it with straight corners. */
.bubble .text > .text-reply ~ .link-preview { border-top-left-radius: 0; border-top-right-radius: 0; }
.bubble .text.is-link-preview-only { background: var(--link-preview-background); }
.text.is-link-preview-only > .bubble-tail { color: var(--link-preview-background); }
.bubble .text.is-link-preview-only > .link-preview {
  border-radius: inherit;
}
.text.is-link-preview-only > .message-meta {
  position: absolute;
  bottom: .55rem;
  right: .65rem;
  z-index: 1;
  padding: 0;
}
/* The real receipt/actions remain siblings of the link, never nested links.
   Their row belongs inside the darker metadata section, below its URL. */
.text.is-link-preview-only > .link-preview .preview-meta { padding-bottom: 2rem; }
body.touch .text.is-link-preview-only > .link-preview .preview-meta { padding-bottom: 3rem; }
.preview-image {
  width: 100%;
  overflow: hidden;
}
.preview-image img {
  display: block;
  width: 100%;
  height: auto;
}
.preview-meta {
  min-width: 0;
  overflow: hidden;
  padding: .8rem .9rem;
  background: transparent;
}
.preview-heading {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  min-width: 0;
  font-size: .95rem;
}
.preview-heading h4 { min-width: 0; }
.preview-heading .preview-favicon {
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  margin-top: .15em;
}
.preview-meta h4,
#chat .preview-meta p,
.preview-meta p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: inherit;
}
.preview-meta h4 {
  display: block;
  max-height: 2lh;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: multiline;
  mask-image: var(--text-overflow-mask, none);
  -webkit-mask-size: 100% calc(100% - 1lh), 100% 1lh;
  mask-size: 100% calc(100% - 1lh), 100% 1lh;
  -webkit-mask-position: top, bottom;
  mask-position: top, bottom;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  font-size: .95rem;
  line-height: 1.3;
  margin: 0 0 .35rem;
}
#chat .preview-meta p,
.preview-meta p {
  display: block;
  max-height: 3lh;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: multiline;
  mask-image: var(--text-overflow-mask, none);
  -webkit-mask-size: 100% calc(100% - 1lh), 100% 1lh;
  mask-size: 100% calc(100% - 1lh), 100% 1lh;
  -webkit-mask-position: top, bottom;
  mask-position: top, bottom;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  margin: 0 0 .65rem;
  font-size: .82rem;
  line-height: 1.35;
  opacity: .76;
}
#chat .preview-meta p:empty,
.preview-meta p:empty { display: none; }
/* Description lines in chat cards, an account setting (link-preview-display.js).
   YouTube cards show only their title unless the account adds the description.
   Map addresses keep their own line. :is(#chat, .bubble) matches #chat's weight. */
html[data-link-preview-lines="1"] :is(#chat, .bubble) .link-preview:not(.map-preview) .preview-meta p { max-height: 1lh; }
html[data-link-preview-lines="2"] :is(#chat, .bubble) .link-preview:not(.map-preview) .preview-meta p { max-height: 2lh; }
html[data-link-preview-lines="5"] :is(#chat, .bubble) .link-preview:not(.map-preview) .preview-meta p { max-height: 5lh; }
html[data-link-preview-lines="0"] :is(#chat, .bubble) .link-preview:not(.map-preview) .preview-meta p,
html:not([data-link-preview-youtube="on"]) :is(#chat, .bubble) .link-preview.is-youtube .preview-meta p { display: none; }
.preview-url {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  font-size: .72rem;
  line-height: 1.4;
}
.preview-url-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
  opacity: .7;
}
.preview-favicon {
  display: block;
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  border-radius: .2rem;
}
.preview-favicon > img { display: block; width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: inherit; }
body.touch .text:has(.link-preview:active, .text-content a:active) { filter: none; }
@media (prefers-reduced-motion: reduce) {
  .link-preview, .preview-image img { transition: none; }
}

.text-content a {
  color: var(--color-link);
}
.text-content a:visited {
  color: var(--color-link);
}

.bubble.me .text-content a {
  color: var(--color-on-accent-link);
}
.bubble.me .text-content a:visited {
  color: var(--color-on-accent-link);
}

/* 2026 master-detail, compact account header and composer */
.sidebar-account-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  min-height: 4.6rem;
  padding: .65rem calc(var(--header-height) + .35rem) .65rem .8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-01) 12%, transparent);
}
.sidebar-account-header .camayo-brand {
  width: auto;
  min-width: 0;
  padding: .3rem;
  border: 0;
  border-radius: .7rem;
}
.sidebar-account-header .camayo-brand img { width: 2.35rem; height: 2.35rem; }
.sidebar-account-header .camayo-brand strong { font-size: .88rem; }
.profile-switcher { position: relative; min-width: 0; }
.profile-switcher-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .45rem;
  width: 100%;
  min-width: 0;
  padding: .5rem .55rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
  border-radius: .7rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 5%, transparent);
  cursor: pointer;
  text-align: left;
}
.profile-switcher-button:hover,
.profile-switcher-button:focus-visible,
.profile-switcher-button[aria-expanded="true"] { background: color-mix(in srgb, var(--color-light-01) 10%, transparent); }
.profile-switcher-copy { display: grid; min-width: 0; gap: .05rem; }
.profile-switcher-copy small { font-size: .64rem; opacity: .58; }
.profile-switcher-copy strong { overflow: hidden; font-size: .82rem; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; }
.profile-unread-dot { width: .55rem; height: .55rem; border-radius: 50%; }
.profile-unread-dot {
  background: #34a9ff;
  box-shadow: 0 0 0 3px #34a9ff22;
}
.profile-switcher-chevron { width: .9rem; height: .9rem; transition: transform .16s ease; }
.profile-switcher-button[aria-expanded="true"] .profile-switcher-chevron { transform: rotate(180deg); }
.profile-switcher-menu {
  position: absolute;
  z-index: 350;
  top: calc(100% + .45rem);
  right: 0;
  display: grid;
  width: min(20rem, calc(100vw - 1.6rem));
  padding: .35rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: .8rem;
  background: var(--color-background-01);
  box-shadow: 0 .9rem 2.5rem #0008;
}
.profile-switcher-menu[hidden] { display: none; }
.profile-switcher-option {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .6rem;
  border: 0;
  border-radius: .55rem;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.profile-switcher-option:hover,
.profile-switcher-option:focus-visible { background: color-mix(in srgb, var(--color-light-01) 9%, transparent); }
.profile-switcher-option[aria-current="true"] { background: color-mix(in srgb, var(--color-accent-01) 22%, transparent); }
.profile-switcher-avatar { display: grid; width: 2.1rem; height: 2.1rem; place-items: center; border-radius: .65rem; color: #fff; background: var(--color-accent-01); font-weight: 800; }
.profile-switcher-option-copy { display: grid; min-width: 0; }
.profile-switcher-option-copy strong,
.profile-switcher-option-copy small { overflow: hidden; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; }
.profile-switcher-option-copy small { opacity: .58; }
.profile-switcher-option-unread { min-width: 1.35rem; padding: .12rem .35rem; border-radius: 999px; color: #fff; background: #168bd2; font-size: .7rem; font-weight: 800; text-align: center; }
.profile-switcher-apply { margin: .35rem; padding: .62rem .75rem; border: 0; border-radius: .55rem; color: #fff; background: var(--color-accent-01); font: inherit; font-weight: 750; cursor: pointer; }
.profile-switcher-schedule-notice { display: grid; gap: .55rem; margin: .35rem; padding: .7rem; border: 1px solid color-mix(in srgb, var(--color-accent-01) 55%, transparent); border-radius: .65rem; background: color-mix(in srgb, var(--color-accent-01) 16%, transparent); }
.profile-switcher-schedule-notice span { display: grid; gap: .12rem; }
.profile-switcher-schedule-notice small { opacity: .72; line-height: 1.35; }
.profile-switcher-schedule-disable { justify-self: start; padding: .46rem .6rem; border: 0; border-radius: .5rem; color: #fff; background: color-mix(in srgb, var(--color-accent-01) 78%, #000); font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.profile-switcher-manage { display: block; margin: 0 .35rem .35rem; padding: .48rem .7rem; color: inherit; font-size: .78rem; text-align: center; opacity: .78; }
.profile-switcher-invitation { display: grid; gap: .6rem; margin: .35rem; padding: .75rem; border: 1px solid color-mix(in srgb, #4cc38a 55%, transparent); border-radius: .65rem; background: color-mix(in srgb, #4cc38a 13%, transparent); }
.profile-switcher-invitation > span:first-child { display: grid; gap: .12rem; }
.profile-switcher-invitation small { opacity: .72; }
.profile-switcher-invitation-actions { display: flex; gap: .45rem; }
.profile-switcher-invitation-actions button { padding: .46rem .65rem; border: 0; border-radius: .5rem; color: #fff; background: var(--color-accent-01); font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.profile-switcher-invitation-actions button.secondary { background: color-mix(in srgb, var(--color-light-01) 12%, transparent); }
.workspace-invitation-inbox { display: grid; gap: .55rem; margin: .45rem .65rem .15rem; }
.workspace-invitation-inbox[hidden] { display: none; }
.workspace-invitation-card { display: grid; gap: .55rem; padding: .75rem; border: 1px solid color-mix(in srgb, #4cc38a 58%, transparent); border-radius: .75rem; background: color-mix(in srgb, #4cc38a 14%, var(--color-background-01)); box-shadow: 0 .4rem 1.2rem #0003; }
.workspace-invitation-card > span:first-child { display: grid; gap: .15rem; }
.workspace-invitation-card small { color: var(--color-light-03); line-height: 1.35; }
.workspace-invitation-card .profile-switcher-invitation-actions button { flex: 1; }
.settings-icon.has-pending-invitation::after { position: absolute; top: .2rem; right: .2rem; width: .62rem; height: .62rem; border: 2px solid var(--color-background-01); border-radius: 50%; background: #4cc38a; content: ""; }

.sidebar-toolbar { margin-bottom: .2rem; }
.sidebar-toolbar h2 { margin: 0; font-size: 1.05rem; }
.sidebar-archive-toggle {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}
.ion-svg {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  overflow: visible;
  color: inherit;
  fill: currentColor;
  vertical-align: middle;
}
.sidebar-add-button > .ion-svg { width: 1.05rem; height: 1.05rem; }

form#form {
  --composer-control-size: 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--composer-control-size) var(--composer-control-size);
  align-items: end;
  gap: .3rem;
  width: min(calc(100% - 1.5rem), 72rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: grid-template-columns .28s cubic-bezier(.22, .78, .22, 1);
}
.message-input-area {
  position: relative;
  min-height: var(--composer-control-size);
  overflow: hidden;
  border-radius: .72rem;
  background: color-mix(in srgb, var(--color-light-01) 6%, transparent);
  box-shadow: 0 .12rem .45rem #0002;
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);
}
form#form textarea,
form#form textarea:focus {
  display: block;
  box-sizing: border-box;
  min-height: var(--composer-control-size);
  padding: .58rem .85rem;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  transition: opacity .16s ease, visibility 0s linear 0s;
}
#sendBtn {
  position: relative;
  inset: auto;
  display: grid;
  width: var(--composer-control-size);
  height: var(--composer-control-size);
  place-items: center;
  border-radius: .72rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 6%, transparent);
  background-image: none;
  filter: none;
}
#sendBtn:hover { color: var(--color-light-01); background-size: auto; }
.composer-icon-button,
#fileDropArea.composer-icon-button {
  all: unset;
  box-sizing: border-box;
  display: grid;
  width: var(--composer-control-size);
  height: var(--composer-control-size);
  place-items: center;
  border: 0;
  border-radius: .72rem;
  color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 6%, transparent);
  box-shadow: 0 .12rem .45rem #0002;
  -webkit-backdrop-filter: var(--backdrop-blur-01);
  backdrop-filter: var(--backdrop-blur-01);
  cursor: pointer;
  filter: none;
  transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .2, 1), background-color var(--anim-time-01) var(--anim-type-01);
}
#fileDropArea.composer-icon-button {
  transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .2, 1), background-color var(--anim-time-01) var(--anim-type-01);
}
.composer-icon-button:not(.voice-record-button):hover,
.composer-icon-button:focus-visible,
#fileDropArea.composer-icon-button:hover,
#fileDropArea.composer-icon-button:focus-visible,
body:not(.touch) #fileDropArea.composer-icon-button:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--color-light-01) 12%, transparent);
  background-size: auto;
}
/* Touch-generated hover must not linger after a rejected microphone tap. */
@media (hover: hover) and (pointer: fine) {
  .voice-record-button:not(.is-send-guarded):not([aria-pressed="true"]):hover {
    opacity: 1;
    background: color-mix(in srgb, var(--color-light-01) 12%, transparent);
    background-size: auto;
  }
}
.composer-icon-button:not(.is-send-guarded):active,
#fileDropArea.composer-icon-button:active {
  opacity: 1;
  background-size: auto !important;
  transform: scale(.94);
}
.composer-action-slot {
  position: relative;
  display: grid;
  width: var(--composer-control-size);
  height: var(--composer-control-size);
}
.composer-action-slot > button {
  grid-area: 1 / 1;
  transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .2, 1), background-color var(--anim-time-01) var(--anim-type-01);
}
.composer-send-button {
  opacity: 0;
  transform: scale(.45) rotate(-24deg);
  pointer-events: none;
}
.voice-record-button { opacity: 1; transform: scale(1) rotate(0); }
form#form.has-sendable-content .composer-send-button {
  opacity: 1;
  transform: scale(1) rotate(0);
  pointer-events: auto;
}
form#form.has-sendable-content .voice-record-button {
  opacity: 0;
  transform: scale(.45) rotate(24deg);
  pointer-events: none;
}
.composer-send-button .ion-svg { transform: translateX(.05rem); }
.voice-record-send-glyph { display: none; transform: translateX(.05rem); }
.voice-record-button[aria-pressed="true"] { color: #fff; background: var(--color-accent-01); }
.voice-record-button[aria-pressed="true"] .voice-record-glyph { display: none; }
.voice-record-button[aria-pressed="true"] .voice-record-send-glyph { display: inline-block; }
form#form.is-recorder-starting .voice-record-glyph { display: none; }
form#form.is-recorder-starting .voice-record-send-glyph { display: inline-block; }
form#form.is-recorder-starting .voice-record-button,
form#form.is-recording .voice-record-button {
  opacity: 1;
  transform: scale(1) rotate(0);
  pointer-events: auto;
}
form#form.is-recorder-starting #fileDropArea,
form#form.is-recording #fileDropArea {
  opacity: 0;
  transform: translateX(-.3rem) scale(.82);
  pointer-events: none;
}
form#form.is-recorder-starting,
form#form.is-recording { grid-template-columns: minmax(0, 1fr) 0 var(--composer-control-size); }
form#form.is-recorder-starting textarea,
form#form.is-recording textarea {
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s ease, visibility 0s linear .14s;
}
.voice-recorder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 2rem auto minmax(4rem, 1fr) 2rem;
  align-items: center;
  gap: .1rem;
  min-height: 2.5rem;
  padding: .22rem .42rem .22rem .28rem;
  border-radius: inherit;
  background: transparent;
  opacity: 0;
  transform: scaleX(.985);
  transform-origin: right center;
}
.voice-recorder[hidden] { display: none; }
/* Hold to record (voice-hold.js): the microphone follows the finger, left
   discards, up locks. */
.voice-record-button { touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.voice-hold-hint, .voice-hold-lock { display: none; }
form#form.is-voice-holding .composer-bar { overflow: visible; }
/* The growing discard button may reach past the recorder; only the wave clips. */
form#form.is-voice-holding .composer-bar .voice-recorder { grid-template-columns: 2rem max-content minmax(1.5rem, 1fr) max-content; overflow: visible; }
form#form.is-voice-holding .composer-bar .voice-recorder-waveform { overflow: hidden; }
form#form.is-voice-holding .voice-recorder-pause { display: none; }
/* The lock takes the place of the jump button above the microphone. */
form#form.is-voice-holding #scrollBtn { opacity: 0; pointer-events: none; }
form#form.is-voice-holding .voice-recorder-discard { pointer-events: none; scale: calc(1 + var(--hold-discard, 0) * .2); transition: scale .22s cubic-bezier(.3, 1.6, .5, 1), background-color .16s ease; }
form#form[data-hold-zone="discard"].is-voice-holding.is-voice-holding .composer-bar .voice-recorder-discard { scale: 1.32; border-radius: 50%; color: #fff !important; background: #d8394f; }
form#form[data-hold-zone="discard"] .voice-recorder :is(time, .voice-recorder-waveform) { opacity: .35; }
form#form[data-hold-zone="discard"].is-voice-holding.is-voice-holding .composer-bar #voiceRecordButton { background: #d8394f; }
form#form.is-voice-holding .voice-hold-hint {
  display: inline-flex; align-items: center; gap: .15rem; padding-inline: .3rem .5rem;
  color: var(--color-placeholder); font-size: .78rem; white-space: nowrap;
  transform: translateX(calc(var(--hold-x, 0px) * .6)); opacity: calc(1 - var(--hold-discard, 0) * 1.4);
}
.voice-hold-hint .ui-icon { width: .8rem; height: .8rem; rotate: 90deg; }
form#form.is-voice-holding .composer-action-slot { position: relative; z-index: 3; }
form#form.is-voice-holding.is-voice-holding .composer-bar #voiceRecordButton {
  border-radius: 50%; color: #fff; background: var(--color-accent-01);
  transform: translate(var(--hold-x, 0px), var(--hold-y, 0px)) scale(calc(1.45 - var(--hold-discard, 0) * .4)); transition: transform .08s linear;
}
form#form.is-voice-holding.is-voice-holding .composer-bar #voiceRecordButton .voice-record-glyph { display: inline-block; opacity: 1; scale: 1; filter: none; }
form#form.is-voice-holding.is-voice-holding .composer-bar #voiceRecordButton .voice-record-send-glyph { display: none; }
form#form.is-voice-holding .voice-hold-lock {
  position: absolute; bottom: calc(100% + 1.4rem); left: 50%;
  display: grid; justify-items: center; gap: .35rem; padding: .7rem .6rem;
  border-radius: 999px; color: var(--color-light-01);
  background: color-mix(in srgb, var(--color-light-01) 12%, var(--color-background-01));
  box-shadow: 0 .2rem .8rem #0004;
  transform: translate(-50%, calc(var(--hold-lock, 0) * -.4rem)); animation: voice-hold-lock-in .2s ease-out both;
}
form#form[data-hold-zone="lock"].is-voice-holding .voice-hold-lock { color: var(--camayo-on-primary); background: var(--camayo-primary); scale: 1.12; }
form#form[data-hold-zone="lock"] .voice-hold-lock .ui-icon:last-child { display: none; }
.voice-hold-lock { transition: scale .24s cubic-bezier(.3, 1.6, .5, 1), background-color .16s ease, color .16s ease; }
.voice-hold-lock .ui-icon { width: 1.05rem; height: 1.05rem; }
.voice-hold-lock .ui-icon:last-child { width: .85rem; height: .85rem; rotate: 180deg; opacity: calc(.7 - var(--hold-lock, 0) * .7); animation: voice-hold-nudge 1.1s ease-in-out infinite; }
@keyframes voice-hold-lock-in { from { opacity: 0; translate: 0 .6rem; } }
@keyframes voice-hold-nudge { 50% { translate: 0 -.2rem; } }
@media (prefers-reduced-motion: reduce) { .voice-hold-lock, .voice-hold-lock .ui-icon:last-child { animation: none !important; } }
form#form.is-recorder-starting .voice-recorder,
form#form.is-recording .voice-recorder {
  animation: voice-recorder-panel-in .26s cubic-bezier(.22, .78, .22, 1) both;
}
@keyframes voice-recorder-panel-in {
  from { opacity: 0; transform: scaleX(.985); }
  to { opacity: 1; transform: scaleX(1); }
}
.voice-recorder > button {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .52rem;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, opacity .18s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.voice-recorder > button > .ion-svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}
.voice-recorder > button > .ion-svg,
.composer-icon-button > .ion-svg {
  align-self: center;
  justify-self: center;
  margin: 0;
  transform-origin: center;
}
.voice-recorder > button:hover,
.voice-recorder > button:focus-visible { background: color-mix(in srgb, var(--color-light-01) 11%, transparent); }
.voice-recorder > button:active { transform: scale(.91); }
.voice-recorder > button:disabled { cursor: default; opacity: .45; }
.voice-recorder-discard { color: #ff6578 !important; }
.voice-recorder-discard:hover,
.voice-recorder-discard:focus-visible { color: #ff8291 !important; }
.voice-recorder-discard .ion-svg { transform: translateY(-.1rem); }
.voice-recorder-pause[aria-pressed="true"] { color: #fff; background: color-mix(in srgb, var(--color-accent-01) 30%, transparent); }
.voice-recorder-waveform { position: relative; min-width: 0; height: 2rem; overflow: hidden; transition: opacity .2s ease; }
.voice-recorder.has-preview .voice-recorder-waveform { touch-action: none; }
.voice-recorder.is-paused .voice-recorder-waveform { margin-inline-end: .4rem; }
.voice-recorder canvas { display: block; width: 100%; height: 2rem; border-radius: .38rem; background: transparent; transition: width .24s cubic-bezier(.2, .8, .2, 1), margin-left .24s cubic-bezier(.2, .8, .2, 1), opacity .16s ease; }
.voice-recorder:not(.is-paused) canvas {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 .7rem, #000 calc(100% - .7rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 .7rem, #000 calc(100% - .7rem), transparent);
}
.voice-recorder.is-paused:not(.has-preview) canvas { opacity: .16; }
.voice-recorder time { min-width: 1.8rem; color: var(--color-light-01); font-size: .72rem; font-variant-numeric: tabular-nums; font-weight: 750; text-align: left; }
.voice-recorder-preview-play {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 4;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .48rem;
  color: var(--color-light-01);
  background: transparent;
  opacity: 0;
  transform: translateY(-50%) scale(.72);
  pointer-events: none;
  cursor: default;
  transition: color .18s ease, background-color .18s ease, opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.voice-recorder-preview-play[aria-hidden="true"] { visibility: hidden; }
.voice-recorder.has-preview .voice-recorder-preview-play { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; cursor: pointer; }
.voice-recorder.has-preview .voice-recorder-preview-play:hover,
.voice-recorder.has-preview .voice-recorder-preview-play:focus-visible { background: color-mix(in srgb, var(--color-light-01) 11%, transparent); }
.voice-recorder.has-preview .voice-recorder-preview-play:active { transform: translateY(-50%) scale(.9); }
.voice-recorder-preview-play .ion-svg { width: 1.25rem; height: 1.25rem; }
.voice-recorder-preview-play .ion-svg { position: absolute; transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1); }
.voice-recorder-preview-play .recorder-preview-play-glyph { opacity: 1; transform: translateX(.04rem) scale(1); }
.voice-recorder-preview-play .recorder-preview-pause-glyph { opacity: 0; transform: scale(.65); }
.voice-recorder-preview-play.is-playing .recorder-preview-play-glyph { opacity: 0; transform: translateX(.04rem) scale(.65); }
.voice-recorder-preview-play.is-playing .recorder-preview-pause-glyph { opacity: 1; transform: scale(1); }
.voice-recorder.has-preview canvas { margin-left: 2.12rem; width: calc(100% - 2.12rem); }
.voice-recorder-scrubber {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  left: 2.12rem;
  width: calc(100% - 2.12rem);
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  cursor: default;
  transition: opacity .18s ease;
}
.voice-recorder.has-preview .voice-recorder-scrubber { opacity: 1; pointer-events: auto; cursor: pointer; }
.voice-recorder-scrubber, body.touch .voice-recorder-scrubber { touch-action: none; padding: 0; box-sizing: border-box; }
.voice-recorder-scrubber::-webkit-slider-runnable-track { height: 2rem; background: transparent; }
.voice-recorder-scrubber::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: border-box; width: .62rem; height: .62rem; margin-top: .69rem; border: 1px solid #fff9; border-radius: 50%; background: #fff; box-shadow: 0 .08rem .2rem #0008; transition: transform .16s ease, box-shadow .16s ease; }
.voice-recorder-scrubber::-moz-range-track { height: 100%; border: 0; background: transparent; }
.voice-recorder-scrubber::-moz-range-thumb { box-sizing: border-box; width: .62rem; height: .62rem; border: 1px solid #fff9; border-radius: 50%; background: #fff; box-shadow: 0 .08rem .2rem #0008; transition: transform .16s ease, box-shadow .16s ease; }
.voice-recorder-scrubber:hover::-webkit-slider-thumb { transform: scale(1.14); box-shadow: 0 .1rem .3rem #0009; }
.voice-recorder-scrubber:hover::-moz-range-thumb { transform: scale(1.14); box-shadow: 0 .1rem .3rem #0009; }

.voice-message {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 22rem) auto;
  align-items: center;
  gap: .6rem;
  width: 24rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: .42rem .62rem .25rem;
}
.voice-play {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: color-mix(in srgb, currentColor 16%, transparent);
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, opacity .18s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.voice-play:hover,
.voice-play:focus-visible { background: color-mix(in srgb, currentColor 23%, transparent); }
.voice-play:active { transform: scale(.91); }
.voice-play .ion-svg { color: currentColor; }
.voice-play .ion-svg,
.voice-recorder-pause .ion-svg { grid-area: 1 / 1; transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1); }
.voice-play-glyph { opacity: 1; transform: translateX(.08rem) scale(1); }
.voice-pause-glyph { opacity: 0; transform: scale(.65); }
.voice-play.is-playing .voice-play-glyph { opacity: 0; transform: translateX(.08rem) scale(.65); }
.voice-play.is-playing .voice-pause-glyph { opacity: 1; transform: scale(1); }
.recorder-pause-glyph { opacity: 1; transform: scale(1); }
.recorder-resume-glyph { opacity: 0; transform: scale(.65); }
.voice-recorder-pause[aria-pressed="true"] .recorder-pause-glyph { opacity: 0; transform: scale(.65); }
.voice-recorder-pause[aria-pressed="true"] .recorder-resume-glyph { opacity: 1; transform: scale(1); }
.voice-timeline { position: relative; min-width: 0; }
/* The playhead dot never overhangs the track, so the speed chip can sit a
   little closer than the play button. */
.voice-message > .voice-speed-wrap,
.is-compact-player > .voice-speed-wrap { margin-inline-start: -.15rem; }
/* --voice-dot-inset: the range runs from one dot radius inside each end, so
   the dot covers the tapered end bars at 0% and 100% (audio-controls.js). */
.voice-track { --audio-thumb-size: 1.5rem; --voice-dot: .72rem; --voice-dot-inset: calc(var(--voice-dot) / 2); position: relative; height: 2.15rem; overflow: visible; }
.bubble .voice-track { --audio-thumb-size: 1.75rem; }
.voice-waveform { position: absolute; top: 50%; right: 0; left: 0; display: flex; width: 100%; height: 1.35rem; align-items: center; justify-content: space-between; color: currentColor; transform: translateY(-50%); }
.voice-waveform > span { display: block; width: 2px; height: var(--voice-bar-height, 2px); flex: 0 0 2px; border-radius: 999px; background: currentColor; }
/* Fitted to the width (audio-controls.js fitWaveformBars): a fixed pitch from a whole pixel. */
.voice-waveform.is-fitted { justify-content: flex-start; gap: var(--voice-bar-gap, 2px); box-sizing: border-box; }
.voice-bar-2 { --voice-bar-height: 2px; }
.voice-bar-3 { --voice-bar-height: 3px; }
.voice-bar-4 { --voice-bar-height: 4px; }
.voice-bar-5 { --voice-bar-height: 5px; }
.voice-bar-6 { --voice-bar-height: 6px; }
.voice-bar-7 { --voice-bar-height: 7px; }
.voice-bar-8 { --voice-bar-height: 8px; }
.voice-bar-9 { --voice-bar-height: 9px; }
.voice-bar-10 { --voice-bar-height: 10px; }
.voice-bar-11 { --voice-bar-height: 11px; }
.voice-bar-12 { --voice-bar-height: 12px; }
.voice-bar-13 { --voice-bar-height: 13px; }
.voice-bar-14 { --voice-bar-height: 14px; }
.voice-bar-15 { --voice-bar-height: 15px; }
.voice-bar-16 { --voice-bar-height: 16px; }
.voice-bar-17 { --voice-bar-height: 17px; }
.voice-bar-18 { --voice-bar-height: 18px; }
.voice-waveform-base { opacity: .34; }
/* A tapped voice message still arriving: the wave fills in as it downloads and
   the play button rests until it can start. */
.voice-message.is-downloading .voice-waveform-base {
  opacity: .62;
  -webkit-mask-image: linear-gradient(90deg, #000 var(--voice-download, 0%), rgb(0 0 0 / .4) var(--voice-download, 0%));
  mask-image: linear-gradient(90deg, #000 var(--voice-download, 0%), rgb(0 0 0 / .4) var(--voice-download, 0%));
}
.voice-message.is-downloading .voice-play { opacity: .45; cursor: default; transform: none; }
/* The fill ends under the dot's centre, which travels between the insets. */
.voice-waveform-progress {
  opacity: .94;
  clip-path: inset(0 calc(100% - var(--voice-dot-inset) - var(--voice-progress-ratio, 0) * (100% - 2 * var(--voice-dot-inset))) 0 0);
}
/* A solid dot with a faint soft shadow, drawn inside the transparent square
   thumb that is the touch target. Keyboard focus adds a ring around it. */
.voice-scrubber {
  --voice-dot-paint:
    radial-gradient(circle, var(--voice-thumb-color, currentColor) 0 calc(var(--voice-dot) / 2 - .5px), transparent calc(var(--voice-dot) / 2 + .5px)),
    radial-gradient(circle at 50% calc(50% + 1px), rgb(0 0 0 / .2), transparent calc(var(--voice-dot) / 2 + 2px));
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  left: calc(var(--voice-dot-inset) - var(--audio-thumb-size) / 2);
  width: calc(100% + var(--audio-thumb-size) - 2 * var(--voice-dot-inset));
  height: 100%;
  margin: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
body.touch .voice-scrubber { touch-action: pan-y; }
/* In message bubbles, only the native thumb owns seeking. The waveform beneath
   stays available to bubble swipes, long presses and the message context menu. */
.bubble .voice-scrubber, body.touch .bubble .voice-scrubber { z-index: 1; pointer-events: none; touch-action: none; }
.bubble .voice-scrubber:not(:disabled)::-webkit-slider-thumb { pointer-events: auto; }
.bubble .voice-scrubber:not(:disabled)::-moz-range-thumb { pointer-events: auto; }

.voice-scrubber::-webkit-slider-runnable-track { height: 2.15rem; background: transparent; }
.voice-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--audio-thumb-size);
  height: var(--audio-thumb-size);
  margin-top: calc((2.15rem - var(--audio-thumb-size)) / 2);
  border: 0;
  border-radius: 0;
  background: var(--voice-dot-focus, none), var(--voice-dot-paint);
  box-shadow: none;
}
.voice-scrubber::-moz-range-track { height: 2.15rem; border: 0; background: transparent; }
.voice-scrubber::-moz-range-thumb {
  width: var(--audio-thumb-size);
  height: var(--audio-thumb-size);
  border: 0;
  border-radius: 0;
  background: var(--voice-dot-focus, none), var(--voice-dot-paint);
  box-shadow: none;
}
.voice-scrubber:focus-visible { --voice-dot-focus: radial-gradient(circle, transparent calc(var(--voice-dot) / 2 + 1.5px), color-mix(in srgb, var(--voice-thumb-color, currentColor) 34%, transparent) calc(var(--voice-dot) / 2 + 2px) calc(var(--voice-dot) / 2 + 4px), transparent calc(var(--voice-dot) / 2 + 4.5px)); }
.voice-message.is-listened { --voice-thumb-color: #35dcff; }
.voice-elapsed { position: absolute; top: calc(100% - .18rem); left: 0; min-width: 4.7rem; font-size: .64rem; line-height: 1; font-variant-numeric: tabular-nums; opacity: .72; }
.bubble .text > .voice-message ~ .message-meta { margin-top: -.12rem; padding-top: 0; padding-bottom: .22rem; }
.voice-speed-wrap { position: relative; margin-top: 0; }
.voice-speed {
  min-width: 2.55rem;
  min-height: 1.85rem;
  padding: .2rem .42rem;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 999px;
  color: inherit;
  background: color-mix(in srgb, currentColor 10%, transparent);
  box-shadow: none;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  transition: background-color .18s ease, border-color .18s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.voice-speed:hover,
.voice-speed:focus-visible {
  border-color: color-mix(in srgb, currentColor 24%, transparent);
  background: color-mix(in srgb, currentColor 17%, transparent);
  outline: 3px solid color-mix(in srgb, currentColor 18%, transparent);
  outline-offset: 2px;
}
.voice-speed:active { transform: scale(.92); }
.voice-speed-menu {
  /* Surface and options: menus.css and camayo-chip. Only placement lives here. */
  position: fixed;
  z-index: 1300;
  transform-origin: right bottom;
  animation: voice-speed-menu-in .16s cubic-bezier(.2, .8, .2, 1);
}
.voice-speed-menu[data-placement="below"] { transform-origin: right top; }
@keyframes voice-speed-menu-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}
.voice-message[data-error="true"] .voice-play { color: #c63d52; }
.voice-message.is-pending .voice-play:disabled { cursor: default; opacity: .72; }
.voice-message.is-pending .voice-scrubber:disabled,
.voice-message.is-pending .voice-speed:disabled { cursor: default; opacity: .72; }
.bubble.me .voice-play { color: #fff; background: color-mix(in srgb, #fff 22%, transparent); }
.bubble.me .voice-play .ion-svg { color: #fff; }
@media (max-width: 520px) {
  .voice-message { grid-template-columns: 2.2rem minmax(0, 1fr) auto; }
  .voice-play { width: 2.2rem; height: 2.2rem; }
}

.settings-pane { align-content: start; align-items: center; grid-auto-rows: min-content; }
.settings-pane #switchTheme {
  display: flex;
  width: 7.8rem;
  height: 1.7rem;
  margin: 1.3rem 0 1.65rem;
  overflow: visible;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent-01) 48%, var(--color-background-01));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-light-01) 19%, transparent), 0 0 0 3px color-mix(in srgb, var(--color-accent-01) 12%, transparent);
}
.settings-pane #switchTheme::after {
  display: block;
  top: .2rem;
  left: calc(50% - .65rem);
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 .12rem .4rem #0005, inset 0 0 0 1px #0001;
  transition: left var(--anim-time-02) ease-out, transform var(--anim-time-02) ease-out;
}
.settings-pane #switchTheme:has(#radio-light:checked),
.settings-pane #switchTheme:has(#radio-auto:checked),
.settings-pane #switchTheme:has(#radio-dark:checked) { background: color-mix(in srgb, var(--color-accent-01) 48%, var(--color-background-01)); }
.settings-pane #switchTheme:has(#radio-light:checked)::after,
.settings-pane #switchTheme:has(#radio-auto:checked)::after,
.settings-pane #switchTheme:has(#radio-dark:checked)::after { background: #fff; }
.settings-pane #switchTheme:has(#radio-light:checked)::after { left: .2rem; }
.settings-pane #switchTheme:has(#radio-dark:checked)::after { left: calc(100% - 1.5rem); }
.settings-pane #switchTheme input[type=radio] {
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.settings-pane #switchTheme p,
.settings-pane #switchTheme p:nth-child(5),
.settings-pane #switchTheme p:nth-child(6) {
  z-index: 1;
  position: absolute;
  width: auto;
  margin: 0;
  color: var(--color-light-01);
  font-size: .72rem;
  font-weight: 700;
  opacity: .45;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}
.settings-pane #switchTheme p:nth-child(4) { top: 2rem; left: .85rem; transform: translateX(-50%); }
.settings-pane #switchTheme p:nth-child(5) { top: -1.25rem; left: 50%; transform: translateX(-50%); }
.settings-pane #switchTheme p:nth-child(6) { top: 2rem; left: calc(100% - .85rem); transform: translateX(-50%); }
.settings-pane #switchTheme:has(#radio-light:checked) p:nth-child(4),
.settings-pane #switchTheme:has(#radio-auto:checked) p:nth-child(5),
.settings-pane #switchTheme:has(#radio-dark:checked) p:nth-child(6) { color: var(--color-light-01); opacity: 1; }
.typing-indicator {
  display: block;
  overflow: hidden;
  color: color-mix(in srgb, var(--color-accent-01) 72%, var(--color-light-01));
  text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none);
  white-space: nowrap;
  font-weight: 650;
}
.typing-indicator[hidden] { display: none; }
.typing-bubble {
  margin-top: .45rem;
  max-height: 4rem;
  overflow: hidden;
  animation: typing-bubble-in .2s cubic-bezier(.2, .82, .28, 1);
  pointer-events: none;
}
.typing-bubble.is-leaving {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  animation: none;
  transition:
    max-height .2s cubic-bezier(.4, 0, .2, 1),
    margin-top .2s cubic-bezier(.4, 0, .2, 1),
    opacity .14s ease-out;
}
.typing-bubble[hidden] { display: none; }
.typing-bubble .text {
  background: var(--bubble-background);
}
.typing-bubble .typing-bubble-content {
  display: grid;
  min-width: 2.8rem;
  min-height: 2.3rem;
  place-items: center;
}
.typing-bubble-dots {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.typing-bubble-dots > span {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-message-other-text) 76%, transparent);
  animation: typing-dot 1.05s ease-in-out infinite;
}
.typing-bubble-dots > span:nth-child(2) { animation-delay: .13s; }
.typing-bubble-dots > span:nth-child(3) { animation-delay: .26s; }
.typing-bubble-recording-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: color-mix(in srgb, var(--color-accent-01) 72%, var(--color-message-other-text));
  fill: currentColor;
  animation: recording-presence-pulse 1.25s ease-in-out infinite;
}
.typing-bubble-recording-icon[hidden],
.typing-bubble-dots[hidden] { display: none; }
@keyframes typing-bubble-in {
  from { opacity: 0; transform: translateY(.35rem) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes recording-presence-pulse {
  0%, 100% { opacity: .62; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes typing-dot {
  0%, 60%, 100% { opacity: .38; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-.24rem); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble.is-entering,
  .bubble .text.is-entering,
  .typing-bubble,
  .typing-bubble-dots > span,
  .typing-bubble-recording-icon,
  .sidebar-presence-icon,
  .e2ee-device-notice-icon { animation: none; }
}

/* Edge-swipe offsets (ux.js) sit on the two panes and do not inherit, so a
   pointermove restyles one element instead of the whole document. */
@property --sidebar-drag-x { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --chat-drag-x { syntax: '<length>'; inherits: false; initial-value: 0px; }
@media only screen and (max-width: 649.98px) {
  :root { --mobile-pane-duration: .3s; }
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--color-background-01);
  }
  /*
   * Keep one real, opaque safe-area element outside the animated panes. The
   * fixed shell below stays attached to the viewport during navigation too;
   * headers inside transformed panes are not viewport-fixed on their own.
   */
  #appSafeArea {
    position: fixed;
    z-index: 1000;
    top: var(--keyboard-viewport-top, 0px);
    right: 0;
    left: 0;
    height: max(env(safe-area-inset-top, 0px), 1px);
    pointer-events: none;
    background: var(--color-background-01);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .sidebar-account-header {
    z-index: 2;
    min-height: calc(4.6rem + env(safe-area-inset-top, 0px));
    padding-top: calc(.65rem + env(safe-area-inset-top, 0px));
    padding-right: .8rem;
    background: var(--color-background-01);
    isolation: isolate;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #main-container {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--color-background-01);
    overscroll-behavior: none;
  }
  #chatList,
  #container {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100dvh;
    will-change: transform;
    transition: transform var(--mobile-pane-duration) cubic-bezier(.22, .78, .22, 1);
  }
  #chatList,
  #chatList.closed {
    z-index: 35;
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
    visibility: visible;
    transform: translateX(0);
    box-shadow: .8rem 0 2.4rem #0007;
    pointer-events: auto;
    isolation: isolate;
    overflow: hidden;
    background: var(--color-background-01);
    overscroll-behavior: none;
    transition: transform var(--mobile-pane-duration) cubic-bezier(.22, .78, .22, 1), visibility 0s linear 0s;
  }
  .database-sidebar {
    height: calc(100dvh - 4.6rem - env(safe-area-inset-top, 0px));
    padding-bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
    background: var(--color-background-01);
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
  }
  #container,
  #container.closed-side {
    z-index: 30;
    width: 100%;
    overflow: visible;
    visibility: hidden;
    transform: translateX(18%);
    pointer-events: none;
    background-color: var(--color-background-01);
    overscroll-behavior: none;
    touch-action: pan-y;
    transition: transform var(--mobile-pane-duration) cubic-bezier(.22, .78, .22, 1), visibility 0s linear var(--mobile-pane-duration);
  }
  body.conversation-active #chatList,
  body.conversation-active #chatList.closed {
    display: block;
    visibility: hidden;
    transform: translateX(-100%);
    pointer-events: none;
    transition: transform var(--mobile-pane-duration) cubic-bezier(.22, .78, .22, 1), visibility 0s linear var(--mobile-pane-duration);
  }
  body.sidebar-opening #chatList,
  body.sidebar-opening #chatList.closed {
    visibility: visible;
    pointer-events: none;
  }
  body.conversation-active #container,
  body.conversation-active #container.closed-side {
    display: block;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    transition: transform var(--mobile-pane-duration) cubic-bezier(.22, .78, .22, 1), visibility 0s linear 0s;
  }
  body.sidebar-swipe-active #chatList,
  body.sidebar-swipe-active #chatList.closed {
    visibility: visible;
    transform: translateX(calc(-100% + var(--sidebar-drag-x, 0px)));
    transition: none;
  }
  body.sidebar-swipe-active #container,
  body.sidebar-swipe-active #container.closed-side {
    transform: translateX(var(--chat-drag-x, 0px));
    transition: none;
  }
  body:not(.conversation-active) #chatList,
  body:not(.conversation-active) #chatList.closed {
    display: block;
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }
  body:not(.conversation-active) #container { display: block; }
  body:not(.conversation-active) #chatListIcon { display: none; }
  body.conversation-active #chatListIcon {
    display: grid;
    z-index: 32;
    top: calc(var(--keyboard-viewport-top, 0px) + env(safe-area-inset-top, 0px) + .5rem);
    left: .55rem;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--color-light-01);
    background: transparent;
    background-image: none;
    box-shadow: none;
    filter: none;
    touch-action: manipulation;
    transition: color .16s ease, background-color .16s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
  }
  body.conversation-active #chatListIcon .mobile-back-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
  }
  body.conversation-active #chatListIcon:active {
    background-size: auto !important;
    background-color: color-mix(in srgb, var(--color-light-01) 8%, transparent);
    transform: scale(.97);
  }
  /* Keep this opaque during slide-out too, when conversation-active has
     already been removed but the previous header is still visible. */
  #nav-bar {
    top: var(--keyboard-viewport-top, 0px);
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: calc(var(--header-height) + .25rem);
    background: var(--color-background-01);
    isolation: isolate;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #chat {
    padding-top: calc(4rem + env(safe-area-inset-top, 0px) + var(--keyboard-viewport-top, 0px));
  }
  #chatWrapper {
    scroll-padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + var(--keyboard-viewport-top, 0px));
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  .send-form-wrapper {
    bottom: calc(.45rem + env(safe-area-inset-bottom, 0px));
  }
  .send-form-wrapper.keyboard-open {
    /* The keyboard replaces the home-indicator safe area. Follow its visible
       edge directly; a bottom transition would lag behind viewport events. */
    bottom: calc(var(--keyboard-offset, 0px) + .5rem);
  }
  .composer-permission-notice {
    width: calc(100% - .8rem);
    padding: .7rem .85rem;
    border-radius: 1.05rem;
  }
  form#form {
    --composer-control-size: 2.75rem;
    grid-template-columns: minmax(0, 1fr) var(--composer-control-size) var(--composer-control-size);
    gap: .34rem;
    width: calc(100% - .8rem);
  }
  .message-input-area,
  form#form textarea,
  form#form textarea:focus {
    min-height: var(--composer-control-size);
    border-radius: 1.05rem;
  }
  form#form textarea,
  form#form textarea:focus {
    box-sizing: border-box;
    height: var(--composer-control-size);
    padding-block: calc((var(--composer-control-size) - 1.25em) / 2);
    padding-inline: .9rem;
    font-size: 16px;
    line-height: 1.25;
  }
  .composer-icon-button,
  #fileDropArea.composer-icon-button,
  #sendBtn,
  .composer-action-slot {
    width: var(--composer-control-size);
    height: var(--composer-control-size);
    border-radius: 1.05rem;
  }
  form#form.is-recorder-starting,
  form#form.is-recording { grid-template-columns: minmax(0, 1fr) 0 var(--composer-control-size); }
  .voice-recorder { min-height: 2.75rem; padding-right: .55rem; }
  .voice-recorder > button { border-radius: .68rem; }
  .voice-recorder-preview-play { border-radius: .62rem; }
  #scrollBtn {
    top: calc(-3.15rem - var(--composer-extra-space) - var(--composer-leading-space, 0px));
    right: .1rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #chatList,
  #container,
  .composer-action-slot > button { transition: none; }
}

/* Conversation controls and compact settings added by the remote branch.
   These deliberately sit after the local composer/mobile rules so the newer
   message bar, recorder, and pane transitions remain intact. */
.app-bar-icon {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-icon {
  color: var(--color-light-01);
  background-image: none;
  filter: none;
}
body:not(.touch) .settings-icon:hover { background-size: auto; }
.settings-icon:active { background-size: auto !important; transform: scale(.94); }
.settings-icon.open { rotate: 0deg; }

.sidebar-account-header {
  grid-template-columns: auto minmax(0, 1fr) 2.75rem;
  padding-right: .7rem;
}
#chatList .home-profile-link {
  display: grid;
  grid-template-rows: auto auto;
  min-width: 0;
  gap: .08rem;
  padding: .35rem .5rem;
  border-radius: .6rem;
  color: var(--color-light-01);
  text-align: center;
  text-decoration: none;
}
#chatList .home-profile-link:hover,
#chatList .home-profile-link:focus-visible { background: color-mix(in srgb, var(--color-light-01) 9%, transparent); }
#chatList .home-profile-link strong,
#chatList .home-profile-link small { overflow: hidden; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; }
#chatList .home-profile-link strong { font-size: .88rem; }
#chatList .home-profile-link small { display: block; font-size: .64rem; line-height: 1.15; opacity: .58; }
.home-settings-icon { display: none; justify-self: end; }
.chat-settings-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
}
.chat-settings-icon .app-bar-icon { width: 1.7rem; height: 1.7rem; }

.settings-pane {
  display: block;
  padding: 1rem 1.1rem 2rem;
}
.settings-pane > :where(:not(:first-child)) { margin-top: .85rem; }
.settings-pane-heading {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
}
.settings-pane-heading::before { content: ""; }
.settings-pane-heading h3 { grid-column: 2; margin: 0; text-align: center; }
.settings-pane-close {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-light-01);
  background: transparent;
  cursor: pointer;
  font: 300 1.9rem/1 system-ui, sans-serif;
}
.settings-pane-close:hover,
.settings-pane-close:focus-visible { background: color-mix(in srgb, var(--color-light-01) 9%, transparent); }
.settings-profile-selection,
.settings-basic-options,
.settings-group,
.settings-account-actions {
  padding: .8rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 12%, transparent);
  border-radius: .8rem;
  background: color-mix(in srgb, var(--color-light-01) 4%, transparent);
}
.settings-profile-selection h4 { margin: 0 0 .5rem; font-size: .78rem; opacity: .7; }
.settings-profile-selection .profile-switcher-menu {
  position: fixed;
  top: 8.5rem;
  right: 1.1rem;
  width: min(27.8rem, calc(100vw - 2.2rem));
}
.settings-basic-options,
.settings-group-content {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .85rem 1rem;
}
.settings-group > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--color-light-01);
  font-weight: 720;
  list-style: none;
}
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary::after { content: "+"; float: right; font-size: 1.15rem; font-weight: 400; }
.settings-group[open] > summary::after { content: "−"; }
.settings-group[open] > .settings-group-content { margin-top: .9rem; }

.settings-data-content > * { grid-column: 1 / -1; }
.settings-data-content { display: block; }
.settings-data-content > a { display: block; margin-bottom: .8rem; }
.settings-account-actions { display: grid; grid-template-columns: 1fr; gap: .55rem; padding: 0; border: 0; background: none; }
.settings-pane > .settings-admin-link,
.settings-pane > .settings-refresh-app { display: block; box-sizing: border-box; width: 100%; margin-top: .65rem; }
.settings-pane > #refreshAppFilesStatus { margin-top: .35rem; }

#chatSearchWrapper .search-icon {
  position: absolute;
  top: 50%;
  left: .8rem;
  width: 1.35rem;
  height: 1.35rem;
  background: none;
  filter: none;
  transform: translateY(-50%);
}

.conversation-transfer-preview {
  display: grid;
  gap: .45rem;
  padding: .7rem;
  border-radius: .45rem;
  background: color-mix(in srgb, var(--color-background-01) 75%, transparent);
}
.conversation-transfer-preview[hidden] { display: none; }
.conversation-transfer-warning,
.conversation-transfer-removed { color: var(--color-danger-01, #ff9aa2); }

@media only screen and (max-width: 649.98px) {
  .home-settings-icon {
    position: fixed;
    top: calc(.75rem + env(safe-area-inset-top, 0px));
    right: .55rem;
    z-index: 590;
    display: grid;
  }
  .chat-settings-icon { display: none; }
  .settings-pane {
    top: 0;
    right: -100vw;
    z-index: 600;
    width: 100%;
    max-width: none;
    height: 100dvh;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
    background: var(--color-background-01);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overscroll-behavior: none;
  }
  .settings-pane.open { right: 0; }
  .settings-pane-close {
    position: fixed;
    top: calc(.75rem + env(safe-area-inset-top, 0px));
    right: .55rem;
  }
  .sidebar-account-header { padding-right: .55rem; }
  body.conversation-active #nav-bar { padding-right: .45rem; }
}

@media only screen and (max-width: 520px) {
  .sidebar-account-header { grid-template-columns: minmax(6.75rem, auto) minmax(0, 1fr) 2.75rem; }

}

.text-reply a {
  color: var(--color-light-01);
}
.e2ee-device-notice {
  position: absolute;
  z-index: 40;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  right: .75rem;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-accent-01) 38%, transparent);
  border-radius: .9rem;
  background: transparent;
  color: color-mix(in srgb, var(--color-accent-01) 82%, var(--color-light-01));
  box-shadow: 0 .3rem 1rem #0003;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.e2ee-device-notice::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--color-background-03) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.e2ee-device-notice:hover,
.e2ee-device-notice:focus-visible {
  border-color: color-mix(in srgb, var(--color-accent-01) 66%, transparent);
}
.e2ee-device-notice:hover::before, .e2ee-device-notice:focus-visible::before { background: color-mix(in srgb, var(--color-background-03) 90%, transparent); }
.e2ee-device-notice:active { transform: scale(.94); }
.e2ee-device-notice-icon {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
}
.e2ee-device-notice .e2ee-device-sync-icon { display: none; }
.e2ee-device-notice[data-state="transferring"] .e2ee-device-sync-icon { display: block; animation: e2ee-device-sync 1.5s linear infinite; }
.e2ee-device-notice[data-state="transferring"] .e2ee-device-waiting-icon { display: none; }
.e2ee-device-notice-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + .5rem);
  width: min(18rem, calc(100vw - 1.5rem), calc(var(--section-sidebar-width, 100vw) - 1.5rem));
  padding: .65rem .75rem;
  border: 1px solid color-mix(in srgb, var(--color-light-01) 14%, transparent);
  border-radius: .8rem;
  background: color-mix(in srgb, var(--color-background-03) 75%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  color: var(--color-light-01);
  box-shadow: 0 .55rem 1.6rem #0006;
  opacity: 0;
  visibility: hidden;
  transform: translateY(.3rem) scale(.97);
  transform-origin: bottom right;
  pointer-events: none;
  text-align: left;
  font-size: .78rem;
  line-height: 1.35;
  font-weight: 400;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .18s;
}
.e2ee-device-notice.is-expanded .e2ee-device-notice-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}
@keyframes e2ee-device-sync {
  to { transform: rotate(360deg); }
}

.e2ee-device-notice[data-state="error"] {
  border-color: color-mix(in srgb, #ff6578 55%, transparent);
  color: #ff7688;
}
.e2ee-device-notice[data-state="error"] .e2ee-device-notice-icon {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .e2ee-device-notice[data-state="transferring"] .e2ee-device-sync-icon { animation: none; }
  .e2ee-device-notice, .e2ee-device-notice-popover { transition: none; }
}
body.app-starting {
	overflow: hidden;
}

.app-startup-splash {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--color-background-01);
	background-image:
		radial-gradient(circle at center, #24707b24 0, transparent min(44vw, 24rem)),
		linear-gradient(#11101312, #11101308),
		var(--background-patern-url);
	background-size: auto, auto, 318px 327px;
}

.app-startup-splash { flex-direction: column; gap: 1.5rem; }
.app-startup-retry { text-align: center; padding: 0 1rem; }
.app-startup-retry[hidden] { display: none; }
.app-startup-retry p { margin: 0 0 1rem; }

.app-startup-splash[hidden] {
	display: none;
}

.app-startup-splash .camayo-launch-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(9rem, 34vw, 11rem);
	height: clamp(9rem, 34vw, 11rem);
	flex: 0 0 auto;
	padding: clamp(1.35rem, 5vw, 1.75rem);
	border-radius: clamp(1.5rem, 6vw, 2.25rem);
	background: var(--color-background-01);
	overflow: hidden;
}

.app-startup-splash .camayo-launch-brand img {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	display: block;
	object-fit: contain;
	filter: var(--app-startup-logo-filter, none);
	animation: none;
}

:root { --app-startup-logo-filter: none; }
@media (prefers-color-scheme: light) {
	:root { --app-startup-logo-filter: brightness(.42); }
}
:root[data-theme="light"] { --app-startup-logo-filter: brightness(.42); }
:root[data-theme="dark"] { --app-startup-logo-filter: none; }

@keyframes app-startup-breathe {
	from { opacity: .86; transform: scale(.985); }
	to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.app-startup-mark img { animation: none; }
}

/* Push confirmation uses the shared Camayo surfaces and button controls. */
.push-setup {
  position: fixed; z-index: 12000; top: calc(env(safe-area-inset-top, 0px) + .75rem);
  left: 50%; transform: translateX(-50%); width: min(26rem, calc(100% - 2rem));
  box-sizing: border-box; padding: 1.4rem; border-radius: 1rem;
  color: var(--camayo-text); background: var(--camayo-surface);
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 .45rem 1.4rem #0003;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 1.5rem); overflow-y: auto;
}
.push-setup[hidden] { display: none; }
.push-setup > strong { font-size: 1.1rem; line-height: 1.3; }
.push-setup p { margin: .7rem 0 1.25rem; color: var(--camayo-text); opacity: .75; font-size: .95rem; line-height: 1.55; }
.push-setup-actions { display: flex; justify-content: space-between; gap: .65rem; }
.push-setup .camayo-button { flex: 1; min-width: 0; transition: filter .15s ease; }
.push-setup .camayo-button:not(:disabled):hover { filter: brightness(1.12); }
.push-setup .camayo-button:not(:disabled):active { filter: brightness(.94); }
@media (prefers-reduced-motion: reduce) { .push-setup .camayo-button { transition: none; } }

/* Contact details overlay the chat and composer without resizing either. */
.contact-presentation[hidden] { display: none; }
.contact-presentation {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 650;
  width: min(var(--side-panel-width, 22rem), 100vw);
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--color-background-01);
  color: var(--color-light-01);
  border-left: 1px solid var(--color-border-subtle);
}
/* On phones mobile-back-navigation.js moves the panel. A CSS entrance would run
   a second time whenever its transition ends. */
@media (min-width: 650px) { .contact-presentation { animation: chat-details-enter .24s cubic-bezier(.22,.78,.22,1); } }
@keyframes chat-details-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .contact-presentation { animation: none; } }
.contact-presentation-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.contact-presentation-heading h2 { margin: 0; font-size: 1.15rem; }
.contact-presentation-close { border: 0; background: transparent; border-radius: .6rem; width: 2.75rem; padding: .65rem; flex: 0 0 2.75rem; }
.contact-presentation-close svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.contact-presentation-note { margin: .25rem 0 1.5rem; opacity: .65; font-size: .85rem; }
.contact-presentation-preview { display: grid; justify-items: center; gap: .85rem; padding: 1rem 0 2rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--color-border-subtle); }
.contact-presentation-preview img, .contact-presentation-preview span {
  width: 6rem; height: 6rem; border-radius: 1.5rem; object-fit: cover;
  display: grid; place-items: center; background: var(--color-background-01); font-size: 2rem;
}
.contact-presentation-preview [hidden], .contact-presentation [hidden] { display: none; }
.contact-presentation-preview strong { overflow-wrap: anywhere; text-align: center; }
.contact-presentation .camayo-field { margin-bottom: 1rem; }
.contact-presentation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.contact-presentation button, .contact-presentation select { cursor: pointer; }
.contact-presentation :disabled { cursor: default; }
.contact-presentation-status { min-height: 2.5em; margin-top: .75rem; font-size: .85rem; }
.contact-presentation-status[data-error="true"] { color: var(--color-danger-01, #ff9aa2); }
.sidebar-person-avatar { position: relative; }
.sidebar-person-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
@media (max-width: 649.98px) {
  .contact-presentation {
    inset-inline: 0;
    width: auto;
    border-inline: 0;
    border-radius: 0;
  }
}


/* A voice player determines its bubble width; quoted text wraps inside it. */
.bubble .text > :is(.text-reply, .text-content):has(~ .voice-message),
.bubble .text > .voice-message ~ .text-content { contain: inline-size; }
.chat-unread-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.2rem .8rem;
  color: var(--color-link);
  font-size: .8rem;
}
.chat-unread-divider::before, .chat-unread-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: currentColor;
  opacity: .35;
}
/* Status lines (joined, left, renamed …): like the unread divider, without its rule. */
.chat-status-event {
  display: flex;
  justify-content: center;
  margin: .9rem 1.5rem;
  color: color-mix(in srgb, var(--color-light-01) 62%, transparent);
  font-size: .78rem;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.chat-status-event + .chat-status-event { margin-top: -.45rem; }
/* A blocked person's group message, folded away (docs/BLOCKING.md). */
.chat-status-event.blocked-message-line { width: calc(100% - 3rem); padding: 0; border: 0; background: none; font: inherit; font-size: .78rem; text-transform: none; color: inherit; color: color-mix(in srgb, var(--color-light-01) 62%, transparent); cursor: pointer; }
.chat-status-event.blocked-message-line:focus-visible { outline: 2px solid var(--camayo-focus); outline-offset: 2px; border-radius: .4rem; }
.chat-status-event.is-entering { overflow: hidden; animation: date-divider-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .chat-status-event.is-entering { animation: none; } }

.image-lightbox-history-status {
  position: absolute; left: 12px; top: max(22px, env(safe-area-inset-top));
  display: grid; place-items: center; width: 2rem; height: 2rem;
  padding: 0; border: 0; border-radius: 50%; background: #15151bdd; color: #fff;
}
.image-lightbox .image-lightbox-history-status[data-loading] { pointer-events: none; }
.image-lightbox-status[data-loading] {
  inset: 50% auto auto 50%;
  display: grid; place-items: center; width: 2.7rem; height: 2.7rem;
  margin: 0; padding: 0; transform: translate(-50%, -50%); border-radius: 50%;
  font-size: 0; background: #15151bdd; pointer-events: none;
  right: auto; bottom: auto;
}
.image-lightbox-status[hidden] { display: none; }
.image-lightbox :is(.image-lightbox-status, .image-lightbox-history-status)[data-loading]::after {
  content: '';
  width: .85rem; height: .85rem;
  border: 2px solid #fff5; border-top-color: #fff; border-radius: 50%;
  animation: camayo-list-spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .image-lightbox :is(.image-lightbox-status, .image-lightbox-history-status)[data-loading]::after { animation: none; }
}

/* The drop target overlays the existing input; it never contributes layout. */
.message-input-area .composer-file-drop {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center;
  gap: .65rem; padding: .4rem .8rem; box-sizing: border-box;
  opacity: 0; visibility: hidden; pointer-events: none; border-radius: inherit;
  background: var(--color-background-02);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-light-01) 20%, transparent);
  color: var(--color-light-01); font-size: .88rem; overflow: hidden;
  transition: opacity .16s, background-color .16s, visibility .16s;
}
.message-input-area .composer-file-drop svg {
  display: block; flex: 0 0 22px; width: 22px; height: 22px; max-width: 22px;
  fill: none; margin: 0; padding: 0;
}
.message-input-area .composer-file-drop span { overflow: hidden; white-space: nowrap; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); }
.message-input-area.is-file-drag .composer-file-drop { opacity: 1; visibility: visible; }
.message-input-area.is-file-drag #text { opacity: 0 !important; }
.message-input-area.is-file-hover .composer-file-drop { background: color-mix(in srgb, #000 18%, var(--color-background-02)); }

/* Attachment cards keep the same geometry during upload and decryption. */
.bubble:has(.attachment-video) { width: fit-content; max-inline-size: min(85%, 32rem); }
.attachment-video { width: min(var(--video-card-width, 32rem), calc(100vw - 3rem)); max-width: 100%; }
.attachment-video-stage { min-height: 0; max-height: min(62dvh, 30rem); }
.attachment-video-stage .attachment-video-play svg { width: 28px; height: 28px; display: block; }
.attachment-frame { position: relative; }
.attachment-loading { display: block; width: 100%; border: 0; padding: .3rem .6rem; font: inherit; font-size: .7rem; background: transparent; color: inherit; text-align: center; }
.attachment-frame:has(.attachment-preview) > .attachment-loading,
.attachment-frame:has(.attachment-video) > .attachment-loading { position: absolute; bottom: .5rem; left: 0; color: #fff; background: #0008; }
.attachment-document {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .65rem;
  width: min(22rem, calc(100vw - 3rem)); max-width: 100%; padding: .75rem;
  /* The bubble's font, so a time in the card matches the time on other bubbles. */
  border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.attachment-document-icon { display: grid; place-items: center; width: 2.5rem; height: 3rem; background: #ffffff15; border-radius: .4rem; }
.attachment-document-icon svg { display: block; width: 26px; height: 26px; }
.attachment-document-details { min-width: 0; align-self: center; display: grid; gap: .3rem; }
.attachment-document-details strong { font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; }
.attachment-document-details small { opacity: .65; font-size: .68rem; }
/* The title row; while the file opens, a small spinner ends it. */
.attachment-document-title { display: flex; align-items: center; gap: .6rem; min-width: 0; }
/* The kind and size line; a message that is only files ends it with its time. */
.attachment-document-line { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; min-width: 0; }
.attachment-document-line > small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The message's time sits in the bubble's bottom corner, at the same distance
   as on every other bubble, whatever the card's height (icon, PDF page, several
   files); the size line keeps room for it. */
.attachment-document.has-card-time { position: relative; }
.attachment-document-line > .message-meta.file-time { position: absolute; right: .65rem; bottom: .32rem; flex: none; min-height: 0; padding: 0; }
.has-card-time .attachment-document-line > small { max-width: calc(100% - 3.9rem); }
/* Cards meet whatever sits above or below them in the bubble with a straight
   edge, including their hover fill; only the bubble itself is rounded. */
.bubble .text > :is(.message-author, .message-forwarded-label, .text-reply, .message-private-reply) + :is(.attachment-frame, .link-preview),
.bubble .text > :is(.message-author, .message-forwarded-label, .text-reply, .message-private-reply) + .attachment-frame > :is(.attachment-document, .attachment-preview) {
  border-start-start-radius: 0; border-start-end-radius: 0;
}
.bubble .text > .attachment-frame:has(+ :is(.message-body, .attachment-frame, .message-meta)),
.bubble .text > .attachment-frame:has(+ :is(.message-body, .attachment-frame, .message-meta)) > :is(.attachment-document, .attachment-preview) {
  border-end-start-radius: 0; border-end-end-radius: 0;
}
.attachment-open-icon { position: relative; flex: none; width: 0; height: 18px; margin: -.2rem 0 -.2rem auto; opacity: .6; }
:is(.attachment-document[aria-busy="true"], .is-loading-preview > .attachment-document) .attachment-open-icon { width: 18px; }
.attachment-document-details strong { transition: opacity .16s ease; }
:is(.attachment-document[aria-busy="true"], .is-loading-preview > .attachment-document) .attachment-document-details strong { opacity: .72; }
:is(.attachment-document[aria-busy="true"], .is-loading-preview > .attachment-document) .attachment-open-icon::after {
  position: absolute;
  inset: calc(50% - .42rem) auto auto calc(9px - .42rem);
  box-sizing: border-box;
  width: .84rem;
  height: .84rem;
  content: "";
  border: 1.5px solid color-mix(in srgb, currentColor 32%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: camayo-list-spin .85s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .attachment-document-details strong { transition: none; }
  :is(.attachment-document[aria-busy="true"], .is-loading-preview > .attachment-document) .attachment-open-icon::after { animation: none; }
}
.attachment-document.has-document-preview { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
.attachment-document-page { display: grid; place-items: start center; grid-column: 1 / -1; width: 100%; height: 11rem; overflow: hidden; background: #ffffff15; }
.attachment-document-page canvas { display: block; width: 100%; height: auto; opacity: 0; }
.attachment-document-page.is-loaded canvas { opacity: 1; }
.attachment-document.has-document-preview .attachment-document-details { padding: .65rem .75rem; }
.attachment-document:hover { background: #ffffff0c; }

.attachment-audio.is-compact-player { grid-template-columns: 2.35rem minmax(0, 1fr) auto; width: min(29rem, calc(100vw - 3rem)); gap: .3rem .65rem; padding: .55rem .7rem .12rem; }
.attachment-audio-name { padding: 0; margin: 0; border: 0; background: none; text-align: left; font: inherit; font-size: .82rem; font-weight: 600; color: inherit; cursor: pointer; }
.attachment-audio-name:hover { text-decoration: underline; }
.is-compact-player > .attachment-audio-name { grid-column: 1 / -1; grid-row: 2; min-width: 0; margin-top: .12rem; font-size: .68rem; font-weight: 400; opacity: .62; }
.is-compact-player > .attachment-audio-timeline { grid-column: 2; grid-row: 1; }
.is-compact-player > .voice-speed-wrap { grid-column: 3; grid-row: 1; align-self: start; padding-top: .15rem; }
.is-compact-player > .attachment-audio-controls { grid-column: 1; grid-row: 1; min-height: 0; align-self: start; }
.is-compact-player .attachment-audio-controls [data-audio-skip] { display: none; }
.is-compact-player .attachment-audio-play { width: 2.35rem; height: 2.35rem; }
.is-compact-player .attachment-audio-elapsed { text-align: left; }

.image-lightbox-image[hidden], .image-lightbox button[hidden], .image-lightbox-thumbnails[hidden] { display: none; }
.image-lightbox.is-file-viewer .image-lightbox-stage { inset: max(72px, calc(env(safe-area-inset-top) + 56px)) 16px max(16px, env(safe-area-inset-bottom)); touch-action: pan-x pan-y; }
.image-lightbox.is-file-viewer .image-lightbox-frame { display: block; }
.file-viewer-content { width: 100%; height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.file-viewer-content :is(button, select, input) { font: inherit; }
.file-viewer-content :is(button, a):focus-visible { outline: 2px solid #72d1e0; outline-offset: 2px; }
/* The viewer frame shows its own loading state; the reader's second one would overlap it. */
.file-viewer-content .nf-pdf-loading { display: none; }
.music-player { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 36rem; min-height: 100%; box-sizing: border-box; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; color: var(--color-light-01); }
.music-artwork { display: grid; place-items: center; flex: 0 0 auto; width: clamp(6.5rem, 20vh, 10rem); aspect-ratio: 1; border-radius: 1.4rem; color: var(--color-placeholder); background: var(--camayo-settings-card); }
.music-artwork svg { display: block; width: 40%; height: 40%; }
/* A voice message shows who is speaking; it breathes a little while playing. */
.music-artwork.is-portrait { position: relative; width: clamp(7rem, 24vh, 11.5rem); border-radius: 50%; font-size: clamp(2.2rem, 7vh, 3.6rem); box-shadow: 0 .8rem 2.6rem #0000002e; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.music-artwork.is-portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.music-player.is-playing .music-artwork.is-portrait { transform: scale(1.045); }
.music-player h2 { margin: 1.25rem 0 .2rem; max-width: 100%; overflow-wrap: anywhere; text-align: center; font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
.music-player > p { margin: 0; color: var(--color-placeholder); font-size: .8rem; }
.music-controls { width: 100%; margin-top: clamp(1.5rem, 5vh, 2.75rem); }
.is-large-player.attachment-audio { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; padding: 0; gap: 1.4rem .5rem; }
.is-large-player > .attachment-audio-timeline { grid-column: 1 / -1; }
.is-large-player > .attachment-audio-controls { grid-column: 2; grid-row: 2; gap: 1.25rem; }
.is-large-player > .voice-speed-wrap { grid-column: 1; grid-row: 2; justify-self: start; z-index: 1; }
.is-large-player > .music-volume { grid-column: 3; grid-row: 2; justify-self: end; }
.is-large-player > .attachment-audio-name { display: none; }
.is-large-player .attachment-audio-play { width: 4.5rem; height: 4.5rem; }
/* The one filled control; the file page otherwise colours its buttons as text. */
.image-lightbox .music-player .is-large-player .attachment-audio-play { color: var(--camayo-on-primary); background: var(--camayo-primary) !important; }
.image-lightbox .music-player .is-large-player .attachment-audio-play:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--camayo-primary) 86%, transparent) !important; }
.is-large-player .attachment-audio-play .ion-svg { width: 1.65rem; height: 1.65rem; }
.is-large-player .attachment-audio-skip { width: 3rem; height: 3rem; }
.is-large-player .attachment-audio-skip svg { width: 2.25rem; height: 2.25rem; }
.is-large-player .voice-track { --voice-dot-inset: 0px; height: 4rem; }
.is-large-player .voice-waveform { height: 3.4rem; }
.is-large-player .voice-waveform > span { width: 3px; flex-basis: 3px; height: calc(var(--voice-bar-height, 2px) * 3); }
.is-large-player .voice-waveform-base { opacity: .26; }
.is-large-player .voice-waveform-progress { opacity: 1; }
/* The position is a playhead through the waveform, not a dot on a line. */
.is-large-player .voice-scrubber::-webkit-slider-runnable-track { height: 4rem; }
.is-large-player .voice-scrubber::-moz-range-track { height: 4rem; }
.is-large-player .voice-scrubber::-webkit-slider-thumb, .is-large-player .voice-scrubber:hover::-webkit-slider-thumb { height: 4rem; margin-top: 0; border-radius: 0; background: linear-gradient(currentColor, currentColor) center / 3px 100% no-repeat; }
.is-large-player .voice-scrubber::-moz-range-thumb, .is-large-player .voice-scrubber:hover::-moz-range-thumb { height: 4rem; border-radius: 0; background: linear-gradient(currentColor, currentColor) center / 3px 100% no-repeat; }
.is-large-player .voice-scrubber:focus-visible::-webkit-slider-thumb { background: linear-gradient(currentColor, currentColor) center / 5px 100% no-repeat; }
.is-large-player .voice-scrubber:focus-visible::-moz-range-thumb { background: linear-gradient(currentColor, currentColor) center / 5px 100% no-repeat; }
.is-large-player .audio-inline-details { display: flex; justify-content: space-between; margin-top: .4rem; color: var(--color-placeholder); font-size: .78rem; font-variant-numeric: tabular-nums; }
.is-large-player .attachment-audio-elapsed { margin: 0; text-align: left; font-size: inherit; }
.is-large-player .voice-speed { min-height: 2.25rem; }
/* Volume (volume-control.js): the speaker mutes, the thin slider fills up to
   its round thumb like the settings sliders. Phones set the level with their
   own buttons, so touch screens keep only the speaker, and where the page
   cannot set the level (iOS) there is never a slider. With a popover the
   speaker opens a small panel (mute + slider) instead; holding it mutes. */
.media-volume { --volume-fill: 100%; --volume-track: color-mix(in srgb, currentColor 22%, transparent); display: flex; align-items: center; gap: .2rem; color: var(--color-placeholder); }
.media-volume-toggle { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; transition: background-color .16s ease, color .16s ease; }
.media-volume-toggle .ion-svg { width: 1.2rem; height: 1.2rem; pointer-events: none; }
.media-volume-toggle:focus-visible { outline: 2px solid var(--camayo-focus-ring); outline-offset: -2px; }
@media (hover: hover) { .media-volume-toggle:hover { color: var(--color-light-01); background: color-mix(in srgb, currentColor 10%, transparent); } }
.media-volume-slider { -webkit-appearance: none; appearance: none; display: block; width: 5.5rem; height: 2rem; margin: 0; padding: 0 .1rem; border: 0; border-radius: 1rem; background: transparent; color: var(--color-light-01); cursor: pointer; }
.media-volume-slider::-webkit-slider-runnable-track { height: .25rem; border-radius: 1rem; background: linear-gradient(to right, currentColor var(--volume-fill), var(--volume-track) var(--volume-fill)); }
.media-volume-slider::-moz-range-track { height: .25rem; border-radius: 1rem; background: var(--volume-track); }
.media-volume-slider::-moz-range-progress { height: .25rem; border-radius: 1rem; background: currentColor; }
.media-volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: .9rem; height: .9rem; margin-top: -.325rem; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 .1rem .35rem rgb(0 0 0 / .35), 0 0 0 .5px rgb(0 0 0 / .12); transition: scale .16s ease; }
.media-volume-slider::-moz-range-thumb { width: .9rem; height: .9rem; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 .1rem .35rem rgb(0 0 0 / .35), 0 0 0 .5px rgb(0 0 0 / .12); }
.media-volume-slider:active::-webkit-slider-thumb { scale: 1.2; }
.media-volume-slider:focus-visible { outline: 2px solid var(--camayo-focus-ring); outline-offset: 0; }
.media-volume.is-muted .media-volume-toggle { color: var(--color-light-01); }
@media (pointer: coarse) { .media-volume:not(.has-volume-popover) .media-volume-slider { display: none; } }
.media-volume.is-fixed-volume .media-volume-slider { display: none; }
.media-volume.has-volume-popover { position: relative; }
.media-volume-popover {
  position: absolute; z-index: 3; bottom: calc(100% + .55rem); left: 50%; margin-left: -5.6rem;
  display: flex; align-items: center; gap: .15rem; box-sizing: border-box; width: 11.2rem; padding: .3rem .7rem .3rem .3rem;
  border-radius: 1.1rem; background: #242127f2; box-shadow: 0 .3rem 1rem #0007; color: #f3eff4;
  animation: media-volume-in .16s ease-out;
}
.media-volume-popover[hidden] { display: none; }
.media-volume-popover .media-volume-slider { flex: 1 1 auto; width: auto; min-width: 0; height: 2.25rem; color: #fff; --volume-track: #ffffff3d; }
.media-volume-mute { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.media-volume-mute .ion-svg { width: 1.2rem; height: 1.2rem; pointer-events: none; }
@media (hover: hover) { .media-volume-mute:hover { background: #ffffff1c; } }
.media-volume-toggle { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
@keyframes media-volume-in { from { opacity: 0; translate: 0 .3rem; } }
/* A narrow music player has no room beside ±15 s for a slider. */
@media (max-width: 560px) { .music-volume .media-volume-slider { display: none; } }
@media (prefers-reduced-motion: reduce) { .media-volume-toggle { transition: none; } .media-volume-slider::-webkit-slider-thumb { transition: none; } .media-volume-popover { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  .music-artwork.is-portrait { transition: none; }
  .music-player.is-playing .music-artwork.is-portrait { transform: none; }
}
.file-document-view { max-width: 70rem; min-height: 70%; margin: auto; padding: 1.2rem; background: #20232be8; border: 1px solid #ffffff20; border-radius: 12px; }
.file-document-view h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.file-document-view > a { display: inline-block; padding: .7rem 1rem; border-radius: .5rem; color: #fff; background: #357582; }
.file-text-preview { white-space: pre; overflow: auto; padding: 1rem; font: .85rem/1.65 ui-monospace, monospace; color: #ecf0f6; background: #11151b; border-radius: 6px; }
.file-fallback-icon svg { width: 80px; height: 80px; margin: 2rem 0; }
.archive-entries { list-style: none; padding: 0; }
.archive-entries li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem; border-bottom: 1px solid #ffffff15; font-size: .85rem; overflow-wrap: anywhere; }
.archive-entries small { white-space: nowrap; opacity: .65; }
.pdf-reader { height: 100%; display: grid; grid-template-columns: 140px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: #20232b; border: 1px solid #ffffff20; border-radius: 12px; overflow: hidden; }
.pdf-reader.without-sidebar { grid-template-columns: minmax(0, 1fr); }
.pdf-toolbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem; border-bottom: 1px solid #ffffff15; flex-wrap: wrap; }
.pdf-toolbar button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 .55rem; border: 0; border-radius: .35rem; color: #fff; background: #ffffff0e; cursor: pointer; line-height: 1; }
.pdf-toolbar button svg { display: block; width: 18px; height: 18px; margin: 0; }
.pdf-toolbar button:hover { background: #ffffff20; }
.pdf-toolbar input { width: 3rem; height: 30px; box-sizing: border-box; padding: .25rem; border: 1px solid #ffffff30; border-radius: .35rem; color: #fff; background: #ffffff0c; text-align: center; }
.pdf-pages { overflow: auto; padding: .6rem; border-right: 1px solid #ffffff20; }
.pdf-page-thumbnail { display: grid; justify-items: center; width: 100%; gap: .4rem; padding: .5rem; margin-bottom: .5rem; color: #fff; border: 2px solid transparent; border-radius: .4rem; background: transparent; cursor: pointer; font-size: .75rem; }
.pdf-page-thumbnail[aria-current="true"] { border-color: #79cbd8; background: #ffffff10; }
.pdf-page-thumbnail canvas { width: 100%; min-height: 80px; height: auto; background: #fff; box-shadow: 0 3px 10px #0004; }
.pdf-viewport { overflow: auto; padding: 16px; box-sizing: border-box; overscroll-behavior: contain; }
.pdf-page { position: relative; margin: auto; box-shadow: 0 3px 18px #0005; background: #fff; }
.pdf-canvas { display: block; }
.pdf-password { color: #111; padding: 1rem; }
@media (max-width: 760px) {
  .pdf-reader { grid-template-columns: 84px minmax(0, 1fr); }
  .pdf-pages { padding: .25rem; }
  .pdf-page-thumbnail { padding: .2rem; }
  .pdf-toolbar { gap: .15rem; }
  .pdf-toolbar button { padding: 0 .4rem; font-size: .8rem; }
  .music-player { padding: 1rem .5rem 1.5rem; }
  .image-lightbox.is-file-viewer .image-lightbox-stage { left: 6px; right: 6px; }
}

/* A draft reads as one paragraph: wrapped lines start at the row's edge, not under the text. */
.sidebar-conversation-button .sidebar-item-details.is-draft {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--color-light-01) 72%, transparent);
}
.sidebar-conversation-button .sidebar-item-details.is-draft > .sidebar-preview-copy { display: inline; }
.sidebar-draft-label { margin-inline-end: .3em; color: var(--color-accent-01); font-weight: 650; letter-spacing: .01em; }
.sidebar-draft-icon { display: inline-block; width: 1em; height: 1em; margin-inline-end: .25em; vertical-align: -.14em; color: var(--color-accent-01); }
.sidebar-draft-icon svg { display: block; width: 100%; height: 100%; fill: currentColor; }

.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 1.75rem 0 .5rem;
  pointer-events: none;
}
.chat-date-divider:first-child { margin-top: .5rem; }
.chat-date-divider.is-entering { overflow: hidden; animation: date-divider-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes date-divider-in { from { max-height: 0; margin-block: 0; opacity: 0; } to { max-height: 3rem; } }
@media (prefers-reduced-motion: reduce) { .chat-date-divider.is-entering { animation: none; } }
.chat-date-divider + .bubble { margin-top: .5rem; }
.chat-date-pill {
  display: block;
  overflow: hidden;
  isolation: isolate;
  clip-path: inset(0 round 1rem);
  width: fit-content;
  /* A soft frosted chip: no outline, just a quiet fill over the wallpaper. */
  padding: .26rem .7rem;
  border: 0;
  border-radius: 1rem;
  background: color-mix(in srgb, color-mix(in srgb, var(--color-light-01) 9%, var(--color-background-02)) 80%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 6px #0000001f;
  color: color-mix(in srgb, var(--color-light-01) 82%, transparent);
  font-size: .72rem;
  font-weight: 560;
  letter-spacing: .01em;
  line-height: 1.4;
}
.chat-date-badge { position: fixed; z-index: 20; transform: translateX(-50%); pointer-events: none; }
.chat-date-badge[hidden] { display: none; }
.chat-date-divider.is-pinned .chat-date-pill { visibility: hidden; }
.file-document-frame { display: block; width: 100%; height: 100%; border: 0; background: white; border-radius: .65rem; }
/* Error copy stays beneath the same preview instead of widening its bubble. */
.bubble .text.has-media-preview .error-msg { contain: inline-size; min-width: 0; box-sizing: border-box; justify-content: flex-start; padding: .55rem .65rem; background: var(--color-background-02); border-radius: 0 0 .75rem .75rem; }
.bubble .text.has-media-preview.failed { border-left: 0; }
.bubble .text.has-media-preview .delivery-error-detail { font-size: .68rem; line-height: 1.4; }

.attachment-audio { --voice-progress: 0%; }
.attachment-audio .voice-waveform-progress { color: #fff; }
.attachment-audio .voice-scrubber { color: #fff; padding: 0; min-height: 0; border-radius: 0; box-shadow: none; }
.attachment-audio .voice-scrubber:disabled { cursor: default; opacity: .5; }
.bubble .text > :has(.attachment-audio) ~ .message-meta { padding-top: .08rem; padding-bottom: .25rem; }
/* Over the video the viewer stays dark in either theme; no blur over moving frames. */
.image-lightbox .voice-speed-menu { color-scheme: dark; -webkit-backdrop-filter: none; backdrop-filter: none; }
.composer-reply.is-edit-context .composer-reply-copy span[hidden] { display: none; }

/* Let the timestamp share the last text line, wrapping only when it cannot fit. */
.message-body {
  display: flow-root;
  box-sizing: border-box;
  max-width: 100%;
  padding: .4rem .8rem .5rem;
  line-height: 1.35;
}
.bubble .text .message-body > .text-content {
  display: inline;
  padding: 0;
  overflow-wrap: anywhere;
}
/* One to three emojis alone: large, no bubble. Name above and time below stay
   where they would be, on the chat background. */
.bubble .text.is-emoji-only { --bubble-background: transparent; background: transparent; box-shadow: none; }
.bubble .text.is-emoji-only > .bubble-tail { display: none; }
.bubble .text.is-emoji-only > .message-author { padding-inline: .15rem; }
.bubble .text.is-emoji-only > .message-body { padding: .1rem .15rem .2rem; }
.bubble .text.is-emoji-only .text-content { font-size: 3em; line-height: 1.12; letter-spacing: .14em; }
.bubble .text.is-emoji-count-2 .text-content { font-size: 3.5em; }
.bubble .text.is-emoji-count-1 .text-content { font-size: 4.1em; }
/* A ❤️ that may beat (emoji-heartbeat.js): its own box, scaled by transform only. */
.bubble .text.is-emoji-only .emoji-heart { display: inline-block; letter-spacing: 0; margin-inline-end: .14em; transform-origin: 50% 55%; }
/* Own large emoji sit at the right edge, also when "Edited" widens them. */
.bubble.me .text.is-emoji-only, .bubble.me .text.is-emoji-only .text-content { text-align: end; }
.bubble.me .text.is-emoji-only { margin-inline-start: auto; }
/* A little more air around them than between ordinary bubbles. */
.bubble:has(> .text.is-emoji-only) { margin-block: .35rem; }
.bubble .text.is-emoji-only .message-body > .message-meta { float: none; display: flex; justify-content: flex-end; margin: .15rem 0 0; color: color-mix(in srgb, var(--color-light-01) 62%, transparent); }
.bubble.other .text.is-emoji-only .message-body > .message-meta { justify-content: flex-start; }
.bubble.me .text.is-emoji-only .message-body > .message-meta { width: max-content; margin-inline-start: auto; }
.bubble .text.is-compact-text > .message-body {
  padding-inline: .65rem;
}
.bubble .text.is-compact-text > .message-body > .message-meta {
  margin-inline-start: .35rem;
}
/* Long messages: the full text, clipped to a few lines with a soft lower edge
   (chat.js clampLongMessages). Unfolding animates the clip of the same text, so
   nothing reflows and the row below rides on its edge; once it settles, the
   fade slides out below the text. */
.message-body.is-clampable { --message-clamp-lines: 8; position: relative; }
.bubble .text .message-body.is-clampable > .text-content {
  display: block;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 2.6em), #0005); mask-image: linear-gradient(#000 calc(100% - 2.6em), #0005);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% calc(100% + 2.6em); mask-size: 100% calc(100% + 2.6em);
  transition: -webkit-mask-size .2s ease-out, mask-size .2s ease-out;
}
.bubble .text .message-body.is-collapsed > .text-content { max-height: calc(var(--message-clamp-lines) * 1.35em); overflow: hidden; }
.bubble .text .message-body.is-collapsed > .text-content,
.bubble .text .message-body > .text-content.is-unfolding { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
@media (prefers-reduced-motion: reduce) {
  .bubble .text .message-body.is-clampable > .text-content { transition: none; }
}
/* Long messages end with their own row: unfold on the left, time on the right. */
.message-body.is-clampable > .message-meta { float: none; display: flex; clear: both; width: auto; margin: .4rem 0 0; translate: 0 .12rem; }
.message-body:not(.is-clampable) .message-expansion-toggle { display: none; }
.message-expansion-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 1.5rem;
  margin: 0 auto 0 -.2rem;
  padding: .1rem .55rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 13%, transparent);
  color: inherit;
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .message-expansion-toggle:hover { background: color-mix(in srgb, currentColor 20%, transparent); }
}
.message-expansion-toggle .ui-icon {
  width: .7rem;
  height: .7rem;
  transition: rotate .26s cubic-bezier(.2,.75,.3,1);
}
.message-expansion-toggle[aria-expanded="true"] .ui-icon { rotate: 180deg; }
@media (prefers-reduced-motion: reduce) {
  .message-expansion-toggle .ui-icon { transition: none; }
}
.message-expansion-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.message-body > .message-meta {
  float: right;
  display: inline-flex;
  width: max-content;
  min-height: .9rem;
  margin: .25rem 0 0 .5rem;
  padding: 0;
  /* Tucked into the bubble's corner, clear of the text's baseline. */
  translate: .2rem .2rem;
  white-space: nowrap;
}
/* Keep the half-line clock offset without an empty touch-target row below it. */
body.touch .message-body > .message-meta { margin-top: .75rem; }
.bubble .text .message-body > .text-content.is-link-only { display: none; }
.text.is-link-preview-only > .message-body { padding: 0; }
.text.is-link-preview-only > .message-body > .message-meta {
  position: absolute;
  bottom: .55rem;
  right: .65rem;
  z-index: 1;
  margin: 0;
  translate: none;
}

.bubble .text.has-media-preview > .attachment-message-footer.message-body,
.bubble .text > .voice-message ~ .message-body { contain: inline-size; }

/* Keep the expand control within the existing elapsed-time row. */
.voice-details { position: absolute; top: calc(100% - .18rem); left: 0; right: 0; display: flex; align-items: center; gap: .25rem; }
.voice-details .voice-elapsed { position: static; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); }
.voice-expand {
  flex: 0 0 auto;
  margin: -.43rem 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: .4rem;
  color: inherit;
  background: transparent;
  opacity: .65;
  cursor: pointer;
  transition: opacity .15s ease, background-color .15s ease;
}
.voice-expand .ion-svg { width: .8rem; height: .8rem; }
.voice-expand:hover, .voice-expand:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.voice-expand:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.voice-expand:disabled { opacity: .3; cursor: default; }

.bubble:has(.message-code) { inline-size: min(42rem, 60vw); }
.bubble .text:has(.message-code) { inline-size: 100%; min-inline-size: 0; box-sizing: border-box; }
.bubble .text > :has(.message-code) ~ .bubble-tail { display: none; }
.bubble.me .text:has(.message-code):has(> .bubble-tail) { --bubble-radius-bottom-right: 1rem; }
.bubble.other .text:has(.message-code):has(> .bubble-tail) { --bubble-radius-bottom-left: 1rem; }
.bubble .text .message-body > .text-content:has(.message-code) { min-width: 0; }
.message-prose { display: block; }
.message-prose:last-child { display: inline; }
.message-code {
  --code-muted: #afb6c4;
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: .45rem 0;
  overflow: hidden;
  border: 1px solid #ffffff20;
  border-radius: .65rem;
  background: #171b22;
  color: #e3e8ef;
  text-align: left;
  direction: ltr;
  contain: inline-size;
}
.message-code:first-child { margin-top: 0; }
.message-code:last-child { margin-bottom: 0; }
/* A code-only message is one surface. Quotes, attachments and mixed prose
   retain the inset card because they have their own content around it. */
.bubble .text:where(:has(> .message-body:first-child > .text-content > .message-code.is-standalone)) {
  --bubble-background: #171b22;
  color: #e3e8ef;
  box-shadow: inset 0 0 0 1px #ffffff20;
}
.bubble .text > .message-body:first-child:has(> .text-content > .message-code.is-standalone) {
  padding: 0;
  border-radius: inherit;
}
.bubble .text > .message-body:first-child > .text-content:has(> .message-code.is-standalone) {
  display: block;
  border-radius: inherit;
}
.message-body:first-child > .text-content > .message-code.is-standalone {
  margin: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.message-body:first-child > .text-content > .message-code.is-standalone .message-code-scroll { padding-bottom: .3rem; }
.bubble .text > .message-body:first-child > .text-content:has(> .message-code.is-standalone) ~ .message-meta {
  margin: 0;
  padding: .1rem .8rem .5rem;
}
.message-code-header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 2.5rem; padding-left: .75rem; background: #ffffff06; border-bottom: 1px solid #ffffff10; }
.message-code-language { color: var(--code-muted); font-size: .7rem; overflow: hidden; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; }
.message-code-copy { flex: 0 0 2.75rem; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: .5rem; padding: 0; color: var(--code-muted); background: transparent; cursor: pointer; }
.message-code-copy:hover, .message-code-copy:focus-visible { color: #fff; background: #ffffff12; }
.message-code-copy:focus-visible { outline: 2px solid #80d7e6; outline-offset: -3px; }
.message-code-copy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.message-code .message-code-scroll { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: .8rem; overflow: auto; white-space: pre; overflow-wrap: normal; word-break: normal; tab-size: 4; touch-action: pan-x pan-y; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #ffffff40 transparent; }
.message-code code { display: block; width: max-content; min-width: 100%; font: .78rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow-wrap: normal; word-break: normal; user-select: text; -webkit-user-select: text; }
/* Lazy syntax highlighting adds spans; the global reset must not change their font. */
.message-code code * { font: inherit; letter-spacing: inherit; white-space: inherit; user-select: text; -webkit-user-select: text; }
.message-code-scroll:focus-visible { outline: 2px solid #80d7e6; outline-offset: -2px; }
.message-code .hljs-comment, .message-code .hljs-quote { color: #8f9aab; }
.message-code .hljs-keyword, .message-code .hljs-selector-tag, .message-code .hljs-literal { color: #c9a7ff; }
.message-code .hljs-string, .message-code .hljs-regexp, .message-code .hljs-addition { color: #a2d69b; }
.message-code .hljs-number, .message-code .hljs-symbol, .message-code .hljs-attr, .message-code .hljs-variable { color: #e9bd89; }
.message-code .hljs-title, .message-code .hljs-built_in, .message-code .hljs-type, .message-code .hljs-name { color: #8dcaed; }
.message-code .hljs-meta, .message-code .hljs-attribute { color: #9edbd4; }
.message-code .hljs-deletion { color: #f5a1a9; }
.code-clipboard-fallback { position: fixed; left: 0; top: 0; opacity: 0; pointer-events: none; }
body.touch .text:has(.message-code:active) { filter: none; }
/* Native sideways code scrolling must also be allowed by its ancestors. */
body.touch #chat .bubble .text:has(.message-code),
body.touch #chat .bubble .text-content:has(.message-code) { touch-action: pan-x pan-y; }
@media (max-width: 649.98px) { .bubble:has(.message-code) { inline-size: 80%; } }
@media (prefers-reduced-motion: reduce) { .message-code-copy > span { transition: none; } }
.message-send-progress {
  /* A thin white bar inside the own bubble, along its bottom edge below the
     time and tick.
     Absolutely positioned: appearing or leaving never moves anything. */
  --send-progress-track: color-mix(in srgb, #fff 26%, transparent);
  --send-progress-fill: #fff;
  position: absolute;
  inset: auto .9rem 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--send-progress-track);
  box-shadow: 0 0 0 .5px color-mix(in srgb, #000 10%, transparent);
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  transition: opacity .32s ease;
}
/* Over a picture the bar keeps its contrast with a soft shadow. */
.text.has-media-preview > .message-send-progress { box-shadow: 0 1px 3px #0004; }
/* Quick sends show only the clock in the tick slot (send-estimate.js). */
.message-send-progress.is-quiet { opacity: 0; }
.message-send-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--send-progress-fill);
  transform: scaleX(var(--send-progress, 0));
  transform-origin: left center;
  transition: transform .42s cubic-bezier(.2,.65,.25,1);
}
.message-send-progress.is-indeterminate::before {
  width: 40%;
  transform: translateX(-105%);
  animation: message-send-travel 1.55s ease-in-out infinite;
}
@keyframes message-send-travel { to { transform: translateX(255%); } }
.message-send-progress.is-complete { animation: voice-send-complete .65s ease-in-out forwards; }
@keyframes voice-send-complete {
  0%, 36% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .message-send-progress { transition: none; }
  .message-send-progress::before { transition: none; animation: none; }
  .message-send-progress.is-indeterminate::before { transform: none; animation: none; }
  .message-send-progress.is-complete { animation: none; }
}
.voice-play[aria-busy="true"] { opacity: .6; cursor: pointer; }

.settings-group > summary:focus-visible { outline: 3px solid var(--color-accent-01); outline-offset: 3px; border-radius: .4rem; }

.settings-data-content > [hidden] { display: none; }

.settings-group-content > .settings-test-push { min-height: 2.75rem; font-size: .9rem; width: 100%; }

.profile-switcher-menu { color: var(--color-light-01); }
.profile-switcher-menu > [hidden] { display: none; }

.e2ee-device-notice-toggle { all: unset; position: relative; display: grid; place-items: center; box-sizing: border-box; width: 100%; height: 100%; border-radius: inherit; cursor: pointer; }
.e2ee-device-notice-toggle:focus-visible { outline: 2px solid var(--color-accent-01); outline-offset: 3px; }
.e2ee-device-notice.is-expanded .e2ee-device-notice-popover { pointer-events: auto; }
.e2ee-device-notice-popover { z-index: 2; }
#e2eeDeviceNotice .e2ee-recovery-link { display: block; width: fit-content; color: var(--color-link); text-decoration: underline; text-underline-offset: .2em; font-weight: 600; padding: .35rem 0 .15rem; }
#e2eeDeviceNotice .e2ee-recovery-link[hidden] { display: none; }
.e2ee-device-notice:active { transform: none; }
/* The name editor is part of the panel, not a legacy form card. */
.contact-custom-name { display: grid; gap: .75rem; padding: 0; margin: 0 0 1.5rem; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.contact-custom-name .camayo-field { margin-bottom: 0; }
.contact-custom-name button { justify-self: end; min-height: 2.5rem; padding: .55rem .85rem; font-size: .875rem; font-weight: 600; }

@media (max-width: 649.98px) { .app-shell .e2ee-device-notice-popover { bottom: calc(100% + 3.2rem); } }

/* Pointer focus must not draw the browser's keyboard ring on viewer controls. */
.image-lightbox:not(.keyboard-navigation) :is(button,a):not(.floating-menu-item):focus { outline: none; }
.image-lightbox.keyboard-navigation :is(button,a):not(.floating-menu-item):focus-visible { outline: 2px solid #d9d2df; outline-offset: -1px; }
.image-lightbox .media-viewer-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  isolation: isolate;
  border: 0;
  border-radius: .75rem;
  background: transparent;
  color: #f3eff4;
}
.media-viewer-control::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 4px;
  border-radius: .65rem;
  background: #242127f5;
  box-shadow: 0 2px 6px #0003;
  transition: background-color 140ms ease;
}
.media-viewer-control:not(:disabled):is(:hover,[aria-expanded="true"])::before { background: #454149; }
.image-lightbox .media-viewer-control svg { width: 20px; height: 20px; }
.image-lightbox-identity {
  position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left)); max-width: calc(100% - 10rem);
  display: flex; align-items: center; gap: .5rem;
}
.image-lightbox-identity .image-lightbox-close, .image-lightbox-tools > button { position: relative; flex: 0 0 auto; }
.image-lightbox-portrait {
  width: 2rem; height: 2rem; flex: 0 0 2rem; border-radius: 50%; object-fit: cover;
}
span.image-lightbox-portrait { display: grid; place-items: center; background: #ffffff18; font-size: .72rem; }
.image-lightbox-identity-text { display: grid; min-width: 0; gap: .1rem; }
.image-lightbox-identity-text strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; font-weight: 650;
}
.image-lightbox-identity-text time { color: #c4c0c5; font-size: .68rem; white-space: nowrap; }
.image-lightbox-identity[hidden], .image-lightbox-portrait[hidden], .image-lightbox-identity-text time[hidden],
.image-lightbox-footer[hidden] { display: none; }
.image-lightbox-footer {
  position: absolute; bottom: max(.55rem, env(safe-area-inset-bottom)); left: 0; right: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .5rem;
  padding: .25rem max(.65rem, env(safe-area-inset-right)) .25rem max(.65rem, env(safe-area-inset-left));
  pointer-events: none;
}
.image-lightbox-footer :is(button,.image-lightbox-reaction-summary) { pointer-events: auto; }
.image-lightbox-footer-reactions { position: relative; display: flex; align-items: center; gap: .25rem; }
.image-lightbox-footer button:where(:not(.image-lightbox-thumbnail)) {
  display: grid; place-items: center; min-height: 2.1rem; border: 0; border-radius: .65rem;
  padding: .28rem .65rem; background: #242127f5; font: 550 .78rem/1.1 system-ui, sans-serif;
}
.image-lightbox-footer .image-lightbox-reply {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: .32rem;
  border-radius: 999px;
}
.image-lightbox-footer :is(.image-lightbox-reply,.image-lightbox-react) .ui-icon { width: 1rem; height: 1rem; }
.image-lightbox-footer button:where(:not(.image-lightbox-thumbnail)):hover { background: #454149; }
.image-lightbox-reaction-summary {
  position: absolute; bottom: calc(100% + .5rem); left: 0;
  display: flex; align-items: center; gap: .25rem;
  max-width: min(18rem, 65vw); overflow-x: auto; scrollbar-width: none;
  white-space: nowrap;
}
.image-lightbox-reaction-summary[hidden] { display: none; }
.image-lightbox-reaction-pill { display: flex; align-items: center; gap: .3rem; padding: .28rem .5rem; border-radius: 999px; background: #353139f5; font-size: 1.15rem; }
.image-lightbox-reaction-count { font-size: .75rem; font-variant-numeric: tabular-nums; }
/* The current picture stays centered, including the first and last one. */
.image-lightbox.has-chat-media-chrome .image-lightbox-thumbnails {
  position: relative;
  inset: auto;
  transform: none;
  justify-self: stretch;
  gap: 3px;
  width: 100%; min-width: 0; max-width: none;
  padding: 0 calc(50% - 22px);
  border-radius: 0; background: none; box-shadow: none;
  scrollbar-width: none;
  overflow-anchor: none;
  overscroll-behavior-x: contain; touch-action: pan-x;
  pointer-events: auto; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.image-lightbox-thumbnails::-webkit-scrollbar { display: none; }
.image-lightbox.has-chat-media-chrome .image-lightbox-thumbnail {
  flex: 0 0 30px; width: 30px; min-width: 0; height: 44px; border: 0; border-radius: 6px; opacity: .6;
  transition: opacity .18s ease;
}
.image-lightbox.has-chat-media-chrome .image-lightbox-thumbnail[aria-current="true"] { flex-basis: 44px; margin-inline: 6px; opacity: 1; background: none; box-shadow: none; }
.image-lightbox.has-chat-media-chrome .image-lightbox-thumbnail[aria-current="true"] :is(img, video) { padding: 0; }
/* While scrubbing every picture keeps one width, so nothing shifts under the finger. */
.image-lightbox.has-chat-media-chrome .is-scrubbing { cursor: grabbing; }
.image-lightbox.has-chat-media-chrome .is-scrubbing .image-lightbox-thumbnail { flex-basis: 30px; margin-inline: 0; transition: none; pointer-events: none; }
.image-lightbox-thumbnail :is(img, video) { -webkit-user-drag: none; user-select: none; }
.image-lightbox-thumbnail img:not([src]) { visibility: hidden; }
.image-lightbox.has-chat-media-chrome.is-image-viewer .image-lightbox-stage {
  top: calc(max(12px, env(safe-area-inset-top)) + 3rem);
  bottom: calc(max(.55rem, env(safe-area-inset-bottom)) + 4.15rem);
}
.image-lightbox.has-chat-media-chrome.is-image-viewer .image-lightbox-image { height: 100%; }
/* Phones: the filmstrip gets its own edge-to-edge row and never shrinks the actions. */
@media (max-width: 760px) {
  .image-lightbox-footer { grid-template-columns: 1fr auto; gap: .55rem .5rem; padding-inline: 0; }
  .image-lightbox-footer > :not(.image-lightbox-thumbnails) { margin-inline: max(.65rem, env(safe-area-inset-left)) max(.65rem, env(safe-area-inset-right)); }
  .image-lightbox-footer .image-lightbox-reply { grid-column: 2; }
  .image-lightbox-footer-reactions { min-width: 0; gap: .45rem; }
  .image-lightbox-reaction-summary { position: static; max-width: none; min-width: 0; }
  .image-lightbox.has-chat-media-chrome .image-lightbox-thumbnails { grid-column: 1 / -1; grid-row: 1; }
  .image-lightbox.has-chat-media-chrome.is-image-viewer .image-lightbox-stage { bottom: calc(max(.55rem, env(safe-area-inset-bottom)) + 6.6rem); }
  .image-lightbox.has-chat-media-chrome.is-image-viewer:has(.image-lightbox-thumbnails[hidden]) .image-lightbox-stage { bottom: calc(max(.55rem, env(safe-area-inset-bottom)) + 3.4rem); }
}
@media (prefers-reduced-motion: reduce) { .image-lightbox-thumbnail { transition: none !important; } }
.image-lightbox-document-thumbnail { display: grid; place-items: center; height: 100%; }
.image-lightbox.has-chat-media-chrome :is(.image-lightbox-previous,.image-lightbox-next) { transition: opacity .17s ease-out; }
.image-lightbox.has-chat-media-chrome :is(.image-lightbox-previous,.image-lightbox-next):disabled { visibility: hidden; }
.image-lightbox.has-chat-media-chrome:not(.is-left-edge) .image-lightbox-previous:not(:focus-visible),
.image-lightbox.has-chat-media-chrome:not(.is-right-edge) .image-lightbox-next:not(:focus-visible) { opacity: 0; }
.image-lightbox .ui-icon { fill: currentColor; stroke: none; }
.viewer-video-controls {
  position: absolute;
  z-index: 2;
  /* viewer-video-controls.js measures the filmstrip and footer below. */
  bottom: var(--viewer-video-dock, max(.55rem, env(safe-area-inset-bottom)));
  left: 50%;
  translate: -50% 0;
  width: min(44rem, calc(100% - 1rem));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  border-radius: 1.1rem;
  background: #242127d9;
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  color: #f3eff4;
  pointer-events: auto;
}
.image-lightbox .viewer-video-big {
  position: absolute; z-index: 2; inset: 0; margin: auto; display: grid; place-items: center; width: 4.4rem; height: 4.4rem; padding: 0;
  border: 0; border-radius: 50%; background: #14121699; color: #fff; pointer-events: auto;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: opacity .22s ease, scale .22s ease, background-color .16s ease;
}
.viewer-video-big > svg { grid-area: 1 / 1; width: 2.3rem; height: 2.3rem; transition: opacity .16s ease; }
.image-lightbox .viewer-video-big:active { scale: .93; }
.viewer-video-big.is-buffering svg { opacity: 0; }
.viewer-video-big.is-buffering::after { content: ''; grid-area: 1 / 1; width: 1.9rem; height: 1.9rem; border: 3px solid #fff5; border-top-color: #fff; border-radius: 50%; animation: viewer-video-wait .8s linear infinite; }
@keyframes viewer-video-wait { to { rotate: 1turn; } }
.image-lightbox .image-lightbox-chrome > *, .image-lightbox .image-lightbox-controls { transition: opacity .25s ease; }
.image-lightbox.is-video-idle .image-lightbox-chrome > :not(.is-buffering) { opacity: 0 !important; pointer-events: none !important; }
.image-lightbox.is-video-idle { cursor: none; }
@media (hover: hover) and (pointer: fine) { .is-video-playing .viewer-video-big:not(.is-buffering, :focus-visible) { opacity: 0; pointer-events: none; } }
.image-lightbox:has(> .image-lightbox-chrome > .viewer-video-controls) .image-lightbox-stage { bottom: var(--viewer-video-reserve, 7rem); }
.image-lightbox .viewer-video-controls button:not([hidden]) {
  display: grid;
  place-items: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0 .25rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .78rem;
}
.image-lightbox .viewer-video-controls button:hover { background: #ffffff1c; }
.viewer-video-controls button svg { width: 1.1rem; height: 1.1rem; }
.viewer-video-timeline { position: relative; flex: 1 1 0; min-width: 4rem; --progress: 0%; --buffered: 0%; }
.image-lightbox .viewer-video-timeline input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.2rem; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: none; }
.viewer-video-timeline input::-webkit-slider-runnable-track { height: .3rem; border-radius: 1rem; background: linear-gradient(to right, #fff var(--progress), #fff7 var(--progress) var(--buffered), #fff3 var(--buffered)); }
.viewer-video-timeline input::-moz-range-track { height: .3rem; border-radius: 1rem; background: linear-gradient(to right, #fff var(--progress), #fff7 var(--progress) var(--buffered), #fff3 var(--buffered)); }
.viewer-video-timeline input::-webkit-slider-thumb { -webkit-appearance: none; width: .95rem; height: .95rem; margin-top: -.325rem; border-radius: 50%; background: #fff; box-shadow: 0 .1rem .4rem #0007; transition: scale .16s ease; }
.viewer-video-timeline input::-moz-range-thumb { width: .95rem; height: .95rem; border: 0; border-radius: 50%; background: #fff; }
.viewer-video-timeline input:active::-webkit-slider-thumb, .viewer-video-timeline.is-scrubbing input::-webkit-slider-thumb { scale: 1.3; }
.viewer-video-timeline input:focus-visible { outline: 2px solid #fff9; outline-offset: -2px; border-radius: .5rem; }
.viewer-video-volume { color: inherit; }
.viewer-video-volume .media-volume-slider { width: 4.5rem; color: #fff; }
.viewer-video-time { min-width: 2.2rem; font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: center; }
/* Phones: one row. The times sit small under the track's ends, so the
   track keeps its width between play and the buttons on the right. */
@media (max-width: 649.98px) {
  .viewer-video-controls {
    display: grid; align-items: center; column-gap: .1rem;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto;
    grid-template-areas: "play track track track volume speed full" "play elapsed . remaining volume speed full";
    width: calc(100% - max(.5rem, env(safe-area-inset-left)) - max(.5rem, env(safe-area-inset-right)));
    padding: .15rem .3rem;
  }
  .viewer-video-controls > .viewer-video-play { grid-area: play; }
  .viewer-video-controls > .viewer-video-timeline { grid-area: track; min-width: 0; margin-inline: .35rem; }
  .viewer-video-controls > .viewer-video-time { min-width: 0; margin-top: -.45rem; padding-inline: .35rem; font-size: .66rem; line-height: 1.1; opacity: .85; }
  .viewer-video-controls > .is-elapsed { grid-area: elapsed; text-align: left; }
  .viewer-video-controls > .is-remaining { grid-area: remaining; text-align: right; }
  .viewer-video-controls > .viewer-video-volume { grid-area: volume; }
  .viewer-video-controls > .viewer-video-speed { grid-area: speed; }
  .viewer-video-controls > .viewer-video-fullscreen { grid-area: full; }
  .image-lightbox .viewer-video-timeline input { height: 1.9rem; }
}
.viewer-video-hover {
  position: absolute; bottom: 100%; left: 0;
  display: grid; justify-items: center; gap: .2rem; padding: .25rem;
  border-radius: .45rem; background: #242127; font-size: .75rem; font-variant-numeric: tabular-nums; pointer-events: none;
}
.viewer-video-hover[hidden] { display: none; }
/* The hidden copy that draws the timeline stills (video-scrub-preview.js):
   rendered, so WebKit paints the sought frame, but never seen or hit. */
.viewer-video-preview-source { position: absolute; top: 0; left: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.viewer-video-hover .viewer-video-still { display: block; max-width: 9rem; max-height: 5rem; border-radius: .3rem; }
.viewer-video-hover .viewer-video-still[hidden] { display: none; }
/* Above the fingertip, not under it. */
.viewer-video-hover.is-touch { bottom: calc(100% + .9rem); box-shadow: 0 .2rem .8rem #0008; }
.viewer-video-hover.is-touch .viewer-video-still { max-width: 10rem; max-height: 6rem; }
@media (pointer: coarse) {
  .image-lightbox .viewer-video-controls button { min-height: 2.75rem; }
  .image-lightbox .viewer-video-controls button:not([hidden]) { min-width: 2.75rem; }
}
@media (pointer: coarse) and (max-width: 649.98px) { .image-lightbox .viewer-video-controls button:not([hidden]) { min-width: 2.5rem; } }
@media (min-width: 761px) and (pointer: fine) {
  .image-lightbox .media-viewer-control::before { inset: 5px; }
  .image-lightbox .media-viewer-control svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) { .image-lightbox :is(button,a), .viewer-video-timeline input::-webkit-slider-thumb { transition: none; } }

#chat.is-forward-selecting { padding-right: 4.5rem; }
#chat.is-forward-selecting .text { min-height: 44px; }
.forward-selection-toggle {
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-light-01);
  cursor: pointer;
}
.forward-selection-toggle::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid var(--color-border-subtle);
  border-radius: 50%;
  background: var(--color-background-01);
}
.forward-selection-toggle .ui-icon { position: relative; width: 20px; height: 20px; opacity: 0; }
.forward-selection-toggle[aria-pressed="true"] { color: white; }
.forward-selection-toggle[aria-pressed="true"]::before { background: var(--color-accent-01); border-color: var(--color-accent-01); }
.forward-selection-toggle[aria-pressed="true"] .ui-icon { opacity: 1; }
.forward-selection-toggle:focus-visible { outline: 2px solid var(--color-light-01); outline-offset: 1px; }
#chat.is-forward-selecting [data-message-actions] { visibility: hidden; }
.forward-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 48px;
  padding: .48rem .48rem .48rem .72rem;
  border: 0;
  border-left: .18rem solid var(--color-accent-02, var(--color-accent-01));
  border-radius: .72rem;
  background: color-mix(in srgb, var(--color-light-01) 7%, var(--color-background-01));
  box-shadow: 0 .12rem .45rem #0002;
  color: var(--color-light-01);
  margin-bottom: .3rem;
}
.forward-selection-bar[hidden] { display: none; }
.forward-selection-bar button { display: grid; place-items: center; flex: 0 0 2rem; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: .55rem; background: transparent; color: inherit; transition: background-color .14s ease-out, transform .14s ease-out; }
.forward-selection-bar button:is(:hover,:focus-visible) { background: color-mix(in srgb, currentColor 10%, transparent); }
.forward-selection-bar button:active { transform: scale(.92); }
.forward-selection-bar button .ui-icon { display: block; width: 1rem; height: 1rem; fill: currentColor; }
.forward-selection-bar #forwardSelectionNext { color: var(--color-accent-02, var(--color-accent-01)); }
.forward-selection-bar button:disabled { opacity: .4; }
.forward-selection-bar span { text-align: center; font-size: .78rem; font-weight: 600; color: var(--color-accent-02, var(--color-accent-01)); }
.send-form-wrapper:has(.forward-selection-bar:not([hidden])) { flex-direction: column; align-items: center; }
.forward-selection-bar { box-sizing: border-box; width: min(calc(100% - 1.5rem), 72rem); flex-shrink: 0; }
@media (max-width: 649.98px) { .forward-selection-bar { width: calc(100% - .8rem); } }
#chat.is-forward-selecting .text { transform: none; transition: background-color .12s ease-out, box-shadow .12s ease-out; }
#chat.is-forward-selecting .text > .message-swipe-indicator { display: none; }

#newChatDialog .forward-target-footer { flex-shrink: 0; border-top: 1px solid var(--color-border-subtle); padding-top: .75rem; display: grid; gap: .65rem; }
#newChatDialog .forward-target-footer[hidden] { display: none; }
#forwardTargetSummary { margin: 0; font-size: .8rem; line-height: 1.4; max-height: 4.2em; overflow-y: auto; }
#newChatDialog .forward-target-footer .group-dialog-actions { margin-top: 0; }
#forwardTargetSend { min-height: 44px; width: 100%; }
#newChatDialog .forward-target-option { display: flex; align-items: center; gap: .75rem; }
#newChatDialog .forward-target-option .sidebar-item-label { flex: 1; }
.forward-target-check { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 2px solid var(--color-border-subtle); border-radius: 50%; }
.forward-target-check .ui-icon { width: 18px; height: 18px; opacity: 0; }
.forward-target-option[aria-pressed="true"] .forward-target-check { color: white; border-color: var(--color-accent-01); background: var(--color-accent-01); }
.forward-target-option[aria-pressed="true"] .forward-target-check .ui-icon { opacity: 1; }
#newChatDialog.is-forward-target-picker :is(#createGroupButton,#createChannelButton,#discoverChannelsButton,.sidebar-item-action) { display: none; }

.floating-voice {
  position: fixed; right: max(1rem, env(safe-area-inset-right));
  bottom: max(calc(1rem + env(safe-area-inset-bottom)), var(--floating-bottom-clearance, 0px)); z-index: 1250;
  color: var(--color-message-other-text); pointer-events: none; transition: bottom .24s ease;
}
.floating-voice button { color: inherit; cursor: pointer; border: 0; }
.floating-voice-orb {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 4rem; height: 4rem; padding: .7rem; border-radius: 50%;
  background: var(--color-background-02); box-shadow: 0 .4rem 1.8rem #0004;
  opacity: 0; transform: scale(.65); transform-origin: center;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.floating-voice-orb > .ui-icon { width: 1.2rem; height: 1.2rem; }
.floating-voice-time { font-size: .65rem; font-variant-numeric: tabular-nums; margin-top: .1rem; }
.floating-voice-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; transform: rotate(-90deg); }
.floating-voice-ring circle:first-child { opacity: .12; }
.floating-voice-progress { stroke: #27bdd1; stroke-linecap: round; stroke-dasharray: var(--floating-progress, 0) 100; }
.floating-voice-panel {
  position: absolute; right: 0; bottom: 0; width: min(23rem, calc(100vw - 2rem)); padding: 1rem;
  box-sizing: border-box; border-radius: 1.65rem; background: var(--color-background-02);
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent); box-shadow: 0 .65rem 3rem #0004;
  opacity: 0; transform: scale(.25); transform-origin: center;
  transition: opacity .18s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.floating-voice.is-visible:not(.is-expanded) .floating-voice-orb { opacity: 1; transform: none; pointer-events: auto; }
.floating-voice.is-visible.is-expanded .floating-voice-panel { opacity: 1; transform: none; pointer-events: auto; }
.floating-voice-panel header, .floating-voice-panel footer { display: flex; align-items: center; gap: .5rem; }
.floating-voice-panel header { margin-bottom: 1.2rem; }
.floating-voice-panel header button, .floating-voice-panel footer button { background: transparent; min-width: 2.5rem; min-height: 2.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.floating-voice-panel button:hover { background-color: color-mix(in srgb, currentColor 8%, transparent); }
.floating-voice-panel .ui-icon { width: 1.2rem; height: 1.2rem; }
.floating-voice-panel .floating-voice-source { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border-radius: .6rem; padding: .25rem .5rem; text-align: left; }
.floating-voice-source strong { max-width: 100%; overflow: hidden; text-overflow: clip;
  -webkit-mask-image: var(--text-overflow-mask, none);
  --text-overflow-kind: single;
  mask-image: var(--text-overflow-mask, none); white-space: nowrap; font-size: .9rem; }
.floating-voice-source span { font-size: .7rem; opacity: .65; margin-top: .2rem; }
.floating-voice-controls .voice-message { width: 100%; min-width: 0; color: inherit; }
.floating-voice-controls .voice-play { background: #22788a; color: white; }
.floating-voice-controls .voice-play:hover { background: #1b6674; }
.floating-voice-controls .voice-elapsed { font-size: .7rem; }
.floating-voice-panel footer { margin-top: 1.35rem; }
.floating-voice-panel footer button { gap: .15rem; font-size: .65rem; border-radius: .75rem; }
.floating-voice-panel footer [data-float-download] { margin-left: auto; }
.floating-voice-error { font-size: .75rem; margin: .75rem 0 0; }
.floating-voice-orb, .floating-voice-panel { -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
@media (max-width: 649.98px) {
  .floating-voice { bottom: max(calc(5rem + env(safe-area-inset-bottom)), var(--floating-bottom-clearance, 0px)); transition: bottom .24s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .floating-voice-orb, .floating-voice-panel { transition: none; }
}

/* One blurred surface at a time; the hidden form must not blur the visible one. */
.floating-voice:not(.is-expanded) .floating-voice-panel,
.floating-voice.is-expanded .floating-voice-orb { visibility: hidden; -webkit-backdrop-filter: none; backdrop-filter: none; }
.floating-voice-panel { width: min(var(--floating-width, 23rem), calc(100vw - 2rem)); }
.floating-voice { transform: translateX(var(--floating-drag, 0px)); }
.floating-voice.is-dismissing { transform: translateX(100%); opacity: 0; transition: transform .24s ease-in, opacity .22s ease; }
.floating-voice-orb { touch-action: pan-y; }
.floating-voice .voice-scrubber, body.touch .floating-voice .voice-scrubber { touch-action: none; }
.floating-voice-close {
    display: grid; place-items: center; position: absolute; top: -.35rem; right: -.35rem;
    width: 1.65rem; height: 1.65rem; border-radius: 50%; background: var(--color-message-other);
    box-shadow: 0 .1rem .4rem #0003; pointer-events: none; opacity: 0; visibility: hidden;
    transition: opacity .16s ease, visibility .16s;
}
.floating-voice-close .ui-icon { width: .9rem; height: .9rem; }
.floating-voice.is-visible:not(.is-expanded):is(:hover, :focus-within) .floating-voice-close { opacity: 1; visibility: visible; pointer-events: auto; }
@media (max-width: 649.98px) {
  .floating-voice.is-visible:not(.is-expanded) .floating-voice-close { opacity: 1; visibility: visible; pointer-events: auto; }
}
.audio-inline-skip { display: inline-grid; place-items: center; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; opacity: .7; cursor: pointer; }
.audio-inline-skip:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.audio-inline-skip svg { width: 1rem; height: 1rem; overflow: visible; }
.audio-inline-skip text { fill: currentColor; font: 700 135px/1 sans-serif; }
.voice-details { gap: .16rem; }
.voice-details .voice-elapsed { flex: 0 0 auto; margin-inline-end: .4rem; }
.audio-inline-details { display: flex; align-items: center; gap: .16rem; height: 1.15rem; }
.audio-inline-details .attachment-audio-elapsed { flex: 0 0 auto; margin-inline-end: .4rem; white-space: nowrap; }
.is-compact-player > .attachment-audio-name { grid-row: 1; margin: 0 0 .15rem; font-size: .67rem; }
.is-compact-player > .attachment-audio-timeline,
.is-compact-player > .voice-speed-wrap,
.is-compact-player > .attachment-audio-controls { grid-row: 2; }
.is-compact-player > .voice-speed-wrap { margin-bottom: 1.2rem; }
.attachment-audio .voice-scrubber { color: inherit; }
.attachment-audio .voice-waveform-progress { color: inherit; }
.floating-voice-controls .attachment-audio-scrubber { color: inherit; }
@media (prefers-reduced-motion: reduce) { .floating-voice.is-dismissing { transition: opacity .1s; } }
.floating-voice-viewport { position: fixed; inset: 0 auto 0 0; width: 100%; overflow: hidden; pointer-events: none; z-index: 1250; }
.floating-voice-viewport .floating-voice { position: absolute; }
.floating-voice.is-dismissing { transform: translateX(100%); }
.floating-voice-panel [data-float-expand] .ion-svg { width: 1.2rem; height: 1.2rem; }
.attachment-audio.is-compact-player { width: 24rem; max-width: 100%; gap: .3rem .6rem; padding: .42rem .62rem .25rem; }
.is-compact-player > .voice-speed-wrap { margin-bottom: 0; }
.audio-inline-details .voice-expand { margin: -.43rem 0; }
.floating-voice-panel [data-float-skip] svg { width: 1.5rem; height: 1.5rem; overflow: visible; }
.floating-voice-panel [data-float-skip] text { fill: currentColor; font: 700 125px/1 sans-serif; }

/* Attachment audio uses the same elapsed/skip/expand row and message timestamp
   spacing as a voice recording; only its filename adds a row above. */
.is-compact-player .attachment-audio-timeline { position: relative; }
.is-compact-player .audio-inline-details { position: absolute; top: calc(100% - .18rem); left: 0; right: 0; }
.is-compact-player .audio-inline-details .attachment-audio-elapsed { font-size: .64rem; line-height: 1; }
.bubble .text > :has(.attachment-audio.is-compact-player) ~ .message-meta { margin-top: -.12rem; padding-top: 0; padding-bottom: .22rem; }

/* Only a thin seek strip crosses the waveform in bubbles. Above and below it,
   message swipe/hold gestures remain free. */
.voice-seek-strip { display: none; }
.bubble .voice-seek-strip { display: block; position: absolute; inset: calc(50% - .3125rem) 0 auto; height: .625rem; cursor: pointer; touch-action: none; }
.floating-voice-panel {
  border-radius: 1rem;
  transition: opacity .34s ease, transform .42s cubic-bezier(.2,.75,.25,1), visibility 0s .42s;
}
.floating-voice.is-expanded:not(.is-visible) .floating-voice-panel { transform: scale(.96); }
.floating-voice.is-visible.is-expanded .floating-voice-panel { transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .floating-voice:not(.is-dismissing), .floating-voice-panel { transition: none; } }

/* Audio controls extend into the timestamp row, unlike cropped image previews. */
.attachment-frame[data-attachment-kind="audio"] { overflow: visible; }

.floating-voice[hidden] { display: none; }
.floating-voice.is-dismissing { transform: translateX(var(--floating-dismiss-distance, 23rem)); }

.voice-elapsed, .attachment-audio-elapsed, .floating-voice-time, #voiceRecorderTime {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.link-preview.map-preview .preview-image { aspect-ratio: 2 / 1; height: auto; min-height: 0; }
.link-preview.map-preview .preview-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#chat .link-preview.map-preview p.map-address,
.link-preview.map-preview p.map-address { display: flex; align-items: flex-start; gap: .4em; }
.link-preview.map-preview p.map-address > span { font: inherit; }
.link-preview.map-preview .map-address > span:last-child { min-width: 0; }
.link-preview.map-preview .map-pin { display: inline-flex; align-items: center; flex: 0 0 1em; height: 1.35em; }
.link-preview.map-preview .map-pin svg { display: block; flex: none; width: 1em; height: 1em; fill: currentColor; }
.link-preview.map-preview .preview-url { opacity: .7; font-size: .75rem; }
.link-preview.map-preview p:empty { display: none; }

.link-preview.map-preview .preview-image { position: relative; }
.map-attribution { position: absolute; right: 0; bottom: 0; padding: 5px 8px; border-top-left-radius: 8px; font: 10px/1.2 sans-serif; color: #333; background: #fff; white-space: nowrap; cursor: pointer; }

/* Known geometry is reserved before pixels arrive, including restored previews. */
.preview-image { position: relative; }
.preview-image[style*="aspect-ratio"] img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: inherit; opacity: .65; font-size: .75rem; }
.is-media-loading .preview-placeholder::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 20%, #ffffff20 50%, transparent 80%); transform: translateX(-100%); animation: preview-shimmer 1.5s ease-in-out infinite; }
.preview-globe { position: relative; width: 2rem; height: 2rem; border: 1.5px solid currentColor; border-radius: 50%; opacity: .55; }
.preview-globe::before { content: ''; position: absolute; inset: -1px 25%; border: 1px solid currentColor; border-radius: 50%; }
.preview-globe::after { content: ''; position: absolute; left: 0; right: 0; top: 48%; border-top: 1px solid currentColor; }
.preview-image-enter { animation: preview-image-enter 180ms ease-out; }
.is-media-unavailable .preview-placeholder { cursor: pointer; }
@keyframes preview-shimmer { to { transform: translateX(100%); } }
@keyframes preview-image-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .is-media-loading .preview-placeholder::after, .preview-image-enter { animation: none; } }

.link-preview { align-content: start; box-sizing: border-box; }
/* Map provider and timestamp share the footer instead of stacking empty rows. */
.text.is-link-preview-only > .link-preview.map-preview .preview-meta,
body.touch .text.is-link-preview-only > .link-preview.map-preview .preview-meta { padding-bottom: .65rem; }
.text.is-link-preview-only > .link-preview.map-preview .preview-url { padding-inline-end: 6.5rem; min-height: 1.25rem; }

/* Compact semantic lists: wrapped lines align with text, not the marker. */
.message-list { margin: .15em 0; padding-inline-start: 1.35em; white-space: normal; }
.message-list li { padding-inline-start: .12em; margin: 0; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
ul.message-list { list-style-type: disc; }
ol.message-list { padding-inline-start: 1.6em; }
ol.message-list:has(> li:nth-child(10)) { padding-inline-start: 2.2em; }
ol.message-list li::marker { font-variant-numeric: tabular-nums; }
ul.message-list li::marker { font-size: .78em; }
form#form textarea.has-rich-list-editor { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.composer-list-editor { position: relative; box-sizing: border-box; width: 100%; min-height: var(--composer-control-size, 40px); max-height: min(240px, 40vh); overflow-y: auto; padding: .58rem 2.2rem .58rem .85rem; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--color-light-01); white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.composer-list-editor[hidden], .composer-clear-format[hidden] { display: none; }
.composer-list-editor .message-list { margin: 0; }
.composer-clear-format { position: absolute; right: .3rem; bottom: .3rem; width: 1.65rem; height: 1.65rem; display: grid; place-items: center; padding: .3rem; border: 0; border-radius: .3rem; color: var(--color-light-01); background: var(--color-background-02); opacity: .5; cursor: pointer; }
.composer-clear-format svg { width: 100%; height: 100%; }
.composer-clear-format:is(:hover,:focus-visible) { opacity: 1; }
form#form:is(.is-recording,.is-recorder-starting) :is(.composer-list-editor,.composer-clear-format) { visibility: hidden; }

/* Reserve one text line per map field, expanding only for wrapped content. */
.link-preview.map-preview .preview-heading h4 { min-height: 1lh; }
#chat .link-preview.map-preview .preview-meta p,
.link-preview.map-preview .preview-meta p { min-height: 1lh; }
#chat .link-preview.map-preview .preview-meta p:empty,
.link-preview.map-preview .preview-meta p:empty { display: block; }

/* Keep the Apple marker head central in the cropped share snapshot. */
.link-preview.map-preview .preview-image img[data-provider="apple"] { object-position: center 35%; }
#chatWrapper { overflow-anchor: none; }

/* Shared NSB renderer stays inside the existing media dialog. */
.archive-viewer {
  --nf-surface: var(--color-background-01);
  --nf-ink: var(--color-light-01);
  --nf-muted: var(--color-light-01);
  --nf-border: var(--color-light-hover);
  --nf-control: var(--color-background-02);
  --nf-accent: var(--color-accent-01);
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.file-viewer-content:is(.is-archive, .is-shared-document) .file-document-view {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-background-01);
  color: var(--color-light-01);
  border-color: var(--color-light-hover);
}
/* The shared renderer inherits Camayo's surfaces; media players retain their own UI. */
.file-viewer-content{--nf-surface:var(--color-background-01,#20232b);--nf-ink:var(--color-light-01,#e8e8ee);--nf-muted:color-mix(in srgb,var(--nf-ink) 65%,transparent);--nf-border:color-mix(in srgb,var(--nf-ink) 14%,transparent);--nf-control:color-mix(in srgb,var(--nf-ink) 8%,transparent);--nf-accent:var(--color-accent-01,#79cbd8);--nf-radius:.6rem}
.file-viewer-content .nf-document-view button,.file-viewer-content .nf-document-view select{min-height:2.75rem;font:inherit;border:1px solid var(--nf-border);border-radius:.6rem;background:var(--nf-control);color:var(--nf-ink);padding:.4rem .7rem}
.file-viewer-content .nf-document-options button[aria-pressed=true]{background:var(--nf-accent);color:#fff}
.file-viewer-content .nf-document-view{padding:.5rem;box-sizing:border-box}
.file-viewer-content .nf-pdf-reader.nf-pdf-continuous {
  --nf-pdf-sidebar-width: 136px;
  --nf-panel: color-mix(in srgb, var(--nf-surface) 92%, var(--nf-ink));
}
.file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar {
  background: var(--nf-panel);
  border-radius: .6rem;
}
.file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar button { min-height: 0; }
.image-lightbox.is-pdf-viewer .image-lightbox-stage {
  inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.image-lightbox.is-pdf-viewer.has-chat-media-chrome .image-lightbox-stage {
  top: calc(env(safe-area-inset-top) + 54px);
  bottom: calc(max(.55rem, env(safe-area-inset-bottom)) + 4.15rem);
}
.is-pdf-viewer .image-lightbox-tools { right: max(6px, calc(env(safe-area-inset-right) + 6px)); }
.is-pdf-viewer .nf-pdf-continuous > .nf-pdf-toolbar {
  inset-inline: 6px 98px;
  margin-inline: auto;
  max-width: calc(100% - 104px);
  transform: none;
}
.file-viewer-content .nf-pdf-thumbnail-number {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 24px;
  touch-action: none;
}
.nf-pdf-continuous .nf-pdf-page-thumbnail.sidebar-pin-ghost {
  position: fixed;
  margin: 0;
  background: var(--nf-surface);
  border-color: var(--nf-accent);
}
.nf-pdf-continuous .nf-pdf-page-thumbnail.is-pin-placeholder { opacity: .3; }
@media (max-width: 600px) {
  .file-viewer-content .nf-pdf-reader.nf-pdf-continuous { --nf-pdf-sidebar-width: 112px; }
  .file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar { font-size: .76rem; }
  .file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar button { min-width: 26px; }
  .file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar button svg { width: 16px; height: 16px; }
  .file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar .nf-pdf-fit { width: 42px; min-width: 42px; }
  .file-viewer-content .nf-pdf-continuous > .nf-pdf-toolbar .nf-pdf-page-number { width: 36px; }
}
@media (max-width: 480px) {
  .is-pdf-viewer .nf-pdf-continuous > .nf-pdf-toolbar {
    top: 55px;
    inset-inline: 0;
    max-width: calc(100% - 12px);
  }
  .is-pdf-viewer .nf-pdf-continuous .nf-pdf-document { padding-top: 112px; }
}
.is-pdf-viewer.has-chat-media-chrome .nf-pdf-continuous > .nf-pdf-toolbar {
  top: 4px;
  inset-inline: 0;
  max-width: calc(100% - 12px);
}
.is-pdf-viewer.has-chat-media-chrome .nf-pdf-continuous .nf-pdf-document { padding-top: 66px; }

.sidebar-avatar.is-test-chat::after {
  content: '';
  position: absolute;
  inset: auto auto -.1rem -.1rem;
  width: .55rem;
  height: .55rem;
  border: 2px solid var(--sidebar-background, var(--color-background-01));
  border-radius: 50%;
  background: var(--color-accent-01);
  pointer-events: none;
}

.camayo-list-state {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: .65rem;
  padding: clamp(2rem, 6vh, 3.5rem) 1.25rem 1.5rem;
  color: var(--color-placeholder);
  text-align: center;
  list-style: none;
  overflow-wrap: anywhere;
}
.camayo-list-symbol, .camayo-list-spinner { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; }
.camayo-list-symbol svg { width: 1.4rem; height: 1.4rem; }
.camayo-list-spinner {
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, currentColor 24%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: camayo-list-spin .85s linear infinite;
}
@keyframes camayo-list-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .camayo-list-spinner { animation: none; } }
.attachment-frame:has(.attachment-preview, .attachment-video, .attachment-document-page) > button.attachment-loading {
  position: absolute;
  inset: auto auto .55rem 50%;
  width: max-content;
  max-width: calc(100% - 1rem);
  transform: translateX(-50%);
  padding: .35rem .65rem;
  border-radius: .4rem;
  cursor: pointer;
}
.attachment-frame:has(.attachment-document-page) > button.attachment-loading {
  inset-block: 5rem auto;
  background: var(--color-background-01);
}

button.app-reload-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: fit-content;
  max-width: 100%;
  min-height: 2.25rem;
  padding: .45rem .65rem;
  overflow: hidden;
  border: 0;
  border-radius: .55rem;
  background: color-mix(in srgb, var(--color-light-01) 9%, var(--color-background-01));
  color: var(--color-light-01);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color .15s;
}
button.app-reload-control:enabled:hover {
  background: color-mix(in srgb, var(--color-light-01) 15%, var(--color-background-02));
}
button.app-reload-control:focus-visible {
  outline: 2px solid var(--camayo-focus);
  outline-offset: 2px;
}
button.app-reload-control .ui-icon { width: 1rem; height: 1rem; flex: none; }
button.app-reload-control[data-reload-stage] { cursor: default; opacity: 1; }
button.app-reload-control[hidden] { display: none; }
#refreshAppFiles { grid-column: 1 / -1; justify-self: start; }
button.app-update-prompt {
  position: absolute;
  z-index: 4;
  inset-inline-end: max(.65rem, env(safe-area-inset-right, 0px));
  bottom: .75rem;
  box-shadow: 0 2px 12px #0002;
}
#chatList:has(> .app-update-prompt:not([hidden])) #conversationSections { padding-bottom: 3.75rem; }
@media (min-width: 650px) {
  #chatList:has(> #e2eeDeviceNotice) > .app-update-prompt { bottom: 3.75rem; }
  #chatList:has(> #e2eeDeviceNotice):has(> .app-update-prompt:not([hidden])) #conversationSections { padding-bottom: 6.5rem; }
}
@media (max-width: 649.98px) {
  button.app-reload-control { min-height: 2.75rem; }
  button.app-update-prompt { bottom: calc(4.45rem + env(safe-area-inset-bottom, 0px)); }
  body.conversation-active #chatList > .app-update-prompt { display: none; }
  #chatList:has(> .app-update-prompt:not([hidden])) #conversationSections {
    padding-bottom: calc(8.15rem + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  button.app-reload-control { transition: none; }
}


/* Newer messages still on their way below the history: the same quiet shapes
   as an opening chat, where the message will appear. */
.notification-message-loading {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-block: .5rem;
  animation: chat-skeleton-in .35s .25s ease-out both;
}
.notification-message-loading > .chat-skeleton:last-child { inline-size: 34%; }
.attachment-frame.is-loading-preview :is(.attachment-document-page,.attachment-audio)::after {
  content: '';
  display: block;
  width: .9rem;
  height: .9rem;
  border: 2px solid color-mix(in srgb, currentColor 24%, transparent);
  border-block-start-color: currentColor;
  border-radius: 50%;
  animation: camayo-list-spin .85s linear infinite;
}
.attachment-frame.is-loading-preview :is(.attachment-document-page,.attachment-audio) { position: relative; }
.attachment-frame.is-loading-preview :is(.attachment-document-page,.attachment-audio)::after {
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .notification-message-loading,
  .attachment-frame.is-loading-preview :is(.attachment-document-page,.attachment-audio)::after { animation: none; }
}

/* A file is a page: the app's own surface and colours, its name in the header,
   content without a frame. Images, videos and voice messages keep the dark,
   blurred stage. */
.image-lightbox.is-file-page:not(.is-voice-page) { color: var(--color-light-01); }
.image-lightbox.is-file-page:not(.is-voice-page) .image-lightbox-scrim { background: var(--color-background-01); opacity: 1 !important; }
.image-lightbox.is-file-page:not(.is-voice-page) button:not(.floating-menu-item, .camayo-chip) { color: var(--color-light-01); }
.image-lightbox.is-file-page:not(.is-voice-page) .media-viewer-control { color: var(--color-light-01); }
.image-lightbox.is-file-page:not(.is-voice-page) .media-viewer-control::before { background: transparent; box-shadow: none; }
.image-lightbox.is-file-page:not(.is-voice-page) .media-viewer-control:not(:disabled):is(:hover,[aria-expanded="true"])::before { background: var(--camayo-settings-card); }
.image-lightbox.is-file-page .image-lightbox-identity { max-width: calc(100% - 7rem); gap: .65rem; }
.image-lightbox.is-file-page .image-lightbox-identity-text strong { font-size: .95rem; }
.image-lightbox.is-file-page:not(.is-voice-page) .image-lightbox-identity-text time { color: var(--color-placeholder); font-size: .72rem; }
.image-lightbox.is-file-page span.image-lightbox-portrait.is-file-type { width: 2.3rem; height: 2.3rem; flex-basis: 2.3rem; border-radius: .6rem; background: var(--camayo-settings-card); font-size: .6rem; font-weight: 700; letter-spacing: .04em; }
.image-lightbox.is-file-page .image-lightbox-stage { inset: calc(max(12px, env(safe-area-inset-top)) + 3.6rem) 0 0; }
.image-lightbox.is-file-page .file-viewer-content { padding: 0 max(1rem, env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); box-sizing: border-box; }
.image-lightbox.is-file-page .file-document-view { max-width: 52rem; min-height: 0; margin: 0 auto; padding: 0; background: transparent; border: 0; border-radius: 0; }
.image-lightbox.is-file-page .file-document-view.is-unsupported { display: grid; justify-items: center; align-content: center; gap: .35rem; min-height: 100%; text-align: center; }
.file-fallback-icon { position: relative; display: grid; place-items: center; }
.image-lightbox .file-fallback-icon svg { width: 5.5rem; height: 5.5rem; margin: 0; opacity: .85; }
.file-fallback-type { position: absolute; inset: auto 0 1.15rem; font-size: .7rem; font-weight: 800; letter-spacing: .04em; color: var(--color-background-01); }
.file-document-view.is-unsupported h2 { margin: .9rem 0 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.file-document-view.is-unsupported p { margin: 0; color: var(--color-placeholder); font-size: .85rem; }
.image-lightbox .file-document-view.is-unsupported > a.camayo-button { display: inline-flex; gap: .5rem; margin-top: 1.1rem; min-height: 2.9rem; padding-inline: 1.4rem; border-radius: 2rem; color: var(--camayo-on-primary); background: var(--camayo-primary); text-decoration: none; }
.file-document-view.is-unsupported > a .ui-icon { width: 1.1rem; height: 1.1rem; }

/* Text reader: Markdown, JSON, code and plain text. */
.text-view { max-width: 52rem; margin: 0 auto; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.text-view-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: .5rem; padding: .2rem 0 .8rem; background: var(--color-background-01); }
.text-view-bar .camayo-chips { margin: 0; flex: 1; }
.text-view-bar .camayo-chips[hidden] { display: none; }
.text-view-tools { display: flex; gap: .35rem; margin-inline-start: auto; }
.text-view-tools .camayo-chip { min-height: 2.2rem; padding-inline: .7rem; }
.text-view-body { font-size: 1rem; line-height: 1.6; }
.text-view-plain { white-space: pre; font-size: .95rem; overflow-x: auto; }
.text-view.is-wrapped .text-view-plain, .text-view.is-wrapped .text-view-code { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-view-code { margin: 0; padding: 1rem; overflow-x: auto; border-radius: var(--camayo-card-radius); background: var(--camayo-settings-card); font: .84rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.text-view-note { color: var(--color-placeholder); font-size: .8rem; }
.text-view-markdown { overflow-wrap: anywhere; }
.text-view-markdown > :first-child { margin-top: 0; }
.text-view-markdown :is(h1, h2, h3, h4, h5, h6) { margin: 1.6em 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.text-view-markdown h1 { font-size: 1.75rem; }
.text-view-markdown h2 { font-size: 1.35rem; padding-bottom: .3em; border-bottom: 1px solid var(--color-border-subtle); }
.text-view-markdown h3 { font-size: 1.12rem; }
.text-view-markdown :is(h4, h5, h6) { font-size: 1rem; }
.text-view-markdown p { margin: 0 0 1em; }
.text-view-markdown :is(ul, ol) { margin: 0 0 1em; padding-inline-start: 1.5em; }
.text-view-markdown li { margin: .25em 0; }
.text-view-markdown li > :is(ul, ol) { margin: .25em 0 0; }
.text-view-markdown li.is-task { display: flex; flex-wrap: wrap; column-gap: .55em; align-items: flex-start; list-style: none; margin-inline-start: -1.5em; }
.text-view-markdown li.is-task > :is(ul, ol) { flex-basis: 100%; margin-inline-start: 1.7em; }
.text-view-check { display: grid; place-items: center; flex: none; width: 1.15em; height: 1.15em; margin-top: .22em; border-radius: .3em; box-shadow: inset 0 0 0 1.5px var(--color-placeholder); }
.text-view-check.is-done { color: var(--camayo-on-primary); background: var(--camayo-primary); box-shadow: none; }
.text-view-check .ui-icon { width: .8em; height: .8em; }
.text-view-markdown li.is-task > .is-done + span:last-child { color: var(--color-placeholder); text-decoration: line-through; }
.text-view-markdown blockquote { margin: 0 0 1em; padding: .1em 1em; border-inline-start: 3px solid var(--color-border-subtle); color: var(--color-placeholder); }
.text-view-markdown :not(pre) > code { padding: .12em .35em; border-radius: .35em; background: var(--camayo-settings-card); font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-view-markdown pre { margin: 0 0 1em; }
.text-view-markdown a { color: var(--color-link, inherit); text-decoration: underline; text-underline-offset: .18em; }
.text-view-image-link { display: inline-flex; align-items: center; gap: .3em; }
.text-view-image-link .ui-icon { width: 1em; height: 1em; }
.text-view-markdown hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--color-border-subtle); }
.text-view-table { margin: 0 0 1em; overflow-x: auto; border-radius: var(--camayo-card-radius); box-shadow: inset 0 0 0 1px var(--color-border-subtle); }
.text-view-table table { width: 100%; border-collapse: collapse; font-size: .92em; }
.text-view-table :is(th, td) { padding: .55em .8em; text-align: start; border-bottom: 1px solid var(--color-border-subtle); }
.text-view-table th { font-weight: 650; background: var(--camayo-settings-card); }
.text-view-table tr:last-child td { border-bottom: 0; }

/* Documents from the shared renderer get the same skin. */
.image-lightbox.is-file-page .file-viewer-content:is(.is-archive, .is-shared-document) .file-document-view { height: auto; min-height: 100%; background: transparent; border: 0; }
.image-lightbox.is-file-page .nf-document-view { padding: 0; gap: .9rem; }
.image-lightbox.is-file-page .nf-document-view > p:first-child { margin: 0; color: var(--color-placeholder); font-size: .78rem; }
.image-lightbox.is-file-page .nf-document-options { gap: .4rem; }
.image-lightbox.is-file-page .file-viewer-content .nf-document-view :is(button, select) { min-height: 2.3rem; padding: .35rem .85rem; border: 0; border-radius: 2rem; background: var(--camayo-settings-card); color: var(--color-light-01); font-size: .85rem; font-weight: 550; }
.image-lightbox.is-file-page .file-viewer-content .nf-document-options button[aria-pressed=true] { color: var(--camayo-on-primary); background: var(--camayo-primary); }
.image-lightbox.is-file-page .nf-document-content, .image-lightbox.is-file-page .nf-sheet-scroll { border-radius: var(--camayo-card-radius); background: var(--camayo-settings-card); border: 0; }
.image-lightbox.is-file-page .nf-structured-card { border: 0; border-radius: var(--camayo-card-radius); background: var(--camayo-settings-card); padding: 1rem 1.1rem; }
.image-lightbox.is-file-page .nf-structured dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: 0; }
.image-lightbox.is-file-page .nf-structured dt { color: var(--color-placeholder); font-weight: 500; }
.image-lightbox.is-file-page .nf-structured dd { margin: 0; }
.image-lightbox.is-file-page .nf-sheet-table :is(td, th) { padding: .5rem .7rem; border-color: var(--color-border-subtle); }
.image-lightbox.is-file-page .nf-sheet-table th { color: var(--color-placeholder); background: transparent; font-weight: 500; }
html body .image-lightbox.is-file-page:not(.is-voice-page) .camayo-chip:not([aria-selected="true"], [aria-pressed="true"], [aria-checked="true"]) { color: var(--color-light-01); }
