@font-face {
  font-family: Manrope;
  src: url("/web/manrope.ttf") format("truetype");
  font-display: swap;
}
.call-device-dialog { width: min(480px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px)); max-height: calc(calc(100dvh / var(--ui-zoom, 1)) - 24px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); overflow: auto; }
.call-device-dialog::backdrop { background: #0009; }
.call-device-dialog > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.call-device-dialog h2 { margin: 0; font-size: 18px; }
.call-device-dialog > header button { width: 36px; height: 36px; flex: 0 0 36px; padding: 8px; }
.call-device-body { display: grid; gap: 16px; padding: 16px; }
.call-device-body label { display: grid; gap: 6px; min-width: 0; margin: 0; }
.call-device-body select { width: 100%; min-width: 0; }
.call-device-tests { display: flex; flex-wrap: wrap; gap: 8px; }
.call-device-tests button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; min-height: 40px; font-size: 13px; }
.call-device-tests .icon { flex: 0 0 18px; width: 18px; height: 18px; }
.call-device-body video { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #101815; }
.call-device-body meter { width: 100%; height: 24px; }
.call-device-body p { margin: 0; overflow-wrap: anywhere; }
.call-device-error { color: var(--danger, #c33); }
:root {
  --composer-height: 92px;
  --keyboard-offset: 0px;
}
.call-dialog {
  width: min(430px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px));
  height: min(760px, calc(calc(100dvh / var(--ui-zoom, 1)) - 24px));
  max-height: calc(calc(100dvh / var(--ui-zoom, 1)) - 24px);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 30px;
  color: #f7fbf8;
  background: #101815;
}
.call-dialog.with-video {
  width: min(1120px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px));
}
.call-dialog::backdrop {
  background: #07100ccc;
  backdrop-filter: blur(2px);
}
.call-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, #31473d 0 18%, transparent 42%),
    linear-gradient(180deg, #18231f 0%, #101815 58%, #0d1412 100%);
}
.call-dialog.with-video .call-shell {
  background: #07100d;
}
.call-heading {
  position: relative;
  z-index: 2;
  padding: 42px 24px 16px;
  text-align: center;
  flex-shrink: 0;
}
.call-dialog.with-video .call-heading {
  padding-top: 36px;
  background: #0006;
}
.call-dialog.controls-hidden .call-heading,
.call-dialog.controls-hidden .call-dock,
.call-dialog.controls-hidden .call-error { visibility: hidden; pointer-events: none; }
.call-kind,
.call-status {
  margin: 0;
  color: #b8c6bf;
}
.call-heading h2 {
  margin: 6px 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.2;
}
.call-status {
  color: #eef4f0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.call-avatar-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.call-avatar-wrap .avatar {
  width: 136px;
  height: 136px;
  font-size: 42px;
}
.call-video-area {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  margin: 0 16px;
  border-radius: 16px;
  background: #070d0b;
}
.call-dialog.with-video .call-video-area {
  position: relative;
  margin: 0;
  border-radius: 0;
}
.call-remote {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.call-local {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
  object-fit: contain;
  background: #080a09;
}
.group-call-dialog.controls-hidden .group-call-header,
.group-call-dialog.controls-hidden .group-call-controls,
.group-call-dialog.controls-hidden .group-call-error { visibility: hidden; pointer-events: none; }
.call-preview { position: absolute; z-index: 3; width: min(176px, max(136px, 36%)); height: min(220px, 60%); border: 1px solid #ffffff55; border-radius: 8px; overflow: hidden; background: #101815; touch-action: none; cursor: move; }
.call-preview.is-expanded { width: auto; height: auto; cursor: default; }
.call-preview.is-minimized { width: 80px; height: 36px; }
.call-preview.is-minimized .call-local { display: none; }
.call-preview-drag { position: absolute; inset: 0; }
.call-preview-tools { position: absolute; top: 0; right: 0; display: flex; flex-wrap: wrap; max-width: 100%; justify-content: flex-end; }
.call-preview-tools button { width: 36px; height: 36px; min-width: 36px; padding: 8px; border: 0; border-radius: 0; background: transparent; color: #fff; cursor: pointer; }
.call-preview-tools .icon { width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: #10181599; }
.call-preview.is-minimized .call-preview-flip { display: none; }
.call-minimize { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); width: 44px; height: 44px; padding: 10px; color: #fff; background: transparent; border: 0; }
.group-call-header .call-minimize { position: static; flex-shrink: 0; }
.call-minimized-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 8px; background: #086e62; color: #fff; }
.call-minimized-restore { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; border: 0; background: transparent; }
.call-minimized-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.call-minimized-status { flex-shrink: 0; max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-variant-numeric: tabular-nums; }
.call-minimized-end { width: 44px; min-width: 44px; height: 44px; padding: 12px; border: 0; border-radius: 50%; color: #fff; background: #e5484f; }
.call-minimized-end .icon { transform: none; }
body.has-minimized-call .workspace { height: calc(calc(100dvh / var(--ui-zoom, 1)) - 48px - env(safe-area-inset-top)); margin-top: calc(48px + env(safe-area-inset-top)); }
.call-local.rear-camera {
  transform: none;
}
.call-controls,
.call-primary-controls {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
}
.call-dock { flex-shrink: 0; position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: #101815; }
.call-overflow { position: absolute; bottom: 100%; right: 12px; padding: 8px; display: flex; max-width: calc(100% - 24px); flex-wrap: wrap; gap: 8px; border: 1px solid #ffffff44; border-radius: 8px; background: #17231f; }
.call-dock .call-controls, .call-dock .call-primary-controls { gap: 4px; padding: 0; }
.call-dock .call-control { width: 44px; min-width: 44px; min-height: 48px; gap: 0; }
.call-dock .call-control > span { display: none; }
.call-dock .call-control .icon { width: 44px; height: 44px; padding: 12px; }
.call-dialog.recording-active .call-heading::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #f05258; }
.call-control.recording-active[aria-pressed="true"] { background: #8b2938; color: #fff; }
.call-dialog.with-video .call-controls {
  margin: 0;
  padding: 0;
}
.call-primary-controls {
  gap: 8px;
}
.call-dialog.with-video .call-primary-controls {
  padding: 0;
}
.call-control {
  width: 84px;
  min-height: 88px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #f7fbf8;
  font-size: 10px;
  line-height: 1.25;
}
.call-control .icon {
  width: 62px;
  height: 62px;
  padding: 17px;
  border-radius: 999px;
  background: #2f3d38;
}
.call-control.active .icon {
  color: #17231a;
  background: #eef4f0;
}
.call-answer .icon {
  background: #378854;
}
.call-hangup .icon {
  background: #e4484d;
  transform: rotate(135deg);
}
.call-error {
  margin: 8px 18px;
  color: #ffbbc0;
  text-align: center;
}
.call-code { width: 100%; min-height: 110px; font-family: monospace; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .call-dialog {
    width: calc(100vw / var(--ui-zoom, 1));
    height: calc(100dvh / var(--ui-zoom, 1));
    max-height: calc(100dvh / var(--ui-zoom, 1));
    max-width: calc(100vw / var(--ui-zoom, 1));
    margin: 0;
    border-radius: 0;
  }
  .call-dialog.with-video { width: calc(100vw / var(--ui-zoom, 1)); }
  .call-dialog.with-video .call-video-area { position: absolute; inset: 0; }
  .call-dialog.with-video .call-heading { position: absolute; top: 0; left: 0; right: 0; }
  .call-dialog.with-video .call-dock { position: absolute; bottom: 0; left: 0; right: 0; background: #0006; }
  .call-heading {
    padding-top: max(32px, env(safe-area-inset-top));
  }
  .call-control {
    width: 76px;
  }
  .call-control .icon {
    width: 58px;
    height: 58px;
    padding: 16px;
  }
  .call-heading, .call-dialog.with-video .call-heading { padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
}
:root {
  color-scheme: light;
  --ink: #202e2a;
  --muted: #6b7972;
  --accent: #407344;
  --accent-text: #fff;
  --lime: #d5edb5;
  --line: #e8ece5;
  --surface: #fff;
  --canvas: #edf1e8;
  --rail: #f6f8f3;
  --hover: #f0f4ec;
  --out: #e0efcd;
  --danger: #b64146;
  --shadow: 0 12px 48px #23302716;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf0f2;
  --muted: #aeb7bf;
  --accent: #84d8c9;
  --accent-text: #122c28;
  --lime: #31544e;
  --line: #3a3f44;
  --surface: #25282c;
  --canvas: #191b1e;
  --rail: #202327;
  --hover: #31353a;
  --out: #304c48;
  --danger: #f39091;
  --shadow: 0 12px 48px #0005;
}
:root[data-theme="azure"] {
  --ink: #202e3b; --muted: #677582; --accent: #087ab5; --accent-text: #fff;
  --lime: #dceff9; --line: #dce4e9; --surface: #fff; --canvas: #edf3f7;
  --rail: #f7fafc; --hover: #eaf3f9; --out: #dceff9;
}
.preferences { display: grid; gap: 18px; }
.preference-section { border-top: 1px solid var(--line); padding-top: 16px; }
.preference-section h3 { color: var(--accent); font-size: 15px; margin-bottom: 12px; }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 52px; margin: 0; }
.preference-row span { min-width: 0; overflow-wrap: anywhere; }
.preference-row select { flex: 0 0 64px; width: 64px; padding-inline: 10px; }
.preference-row input { appearance: none; flex: 0 0 38px; width: 38px; height: 22px; padding: 2px; border: 0; border-radius: 12px; background: var(--muted); cursor: pointer; }
.preference-row input::before { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.preference-row input:checked { background: var(--accent); }
.preference-row input:checked::before { transform: translateX(16px); }
.design-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.design-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12px; cursor: pointer; }
.design-choice input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.design-swatch { display: block; width: 100%; height: 70px; border: 1px solid var(--line); border-radius: 6px; background: #eff4e8; box-shadow: inset 12px 0 #fff, inset 0 -20px #dceec9; }
.design-swatch[data-design="azure"] { background: #edf3f7; box-shadow: inset 12px 0 #fff, inset 0 -20px #dceff9; }
.design-swatch[data-design="dark"] { background: #191b1e; box-shadow: inset 12px 0 #25282c, inset 0 -20px #304c48; }
.scale-control { display: flex; align-items: center; gap: 18px; }
.scale-control input { padding: 0; accent-color: var(--accent); }
.scale-control output { min-width: 4em; text-align: right; font-variant-numeric: tabular-nums; }
.settings-footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.settings-footer .web-mode-switch { display: block; width: auto; min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 400; text-align: left; }
.settings-footer .web-mode-switch:hover { text-decoration: underline; text-underline-offset: 3px; }
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  width: calc(100vw / var(--ui-zoom, 1));
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 44px;
  font-weight: 650;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  filter: brightness(0.96);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
textarea {
  resize: none;
  max-height: 140px;
  line-height: 1.55;
}
label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
p {
  line-height: 1.6;
}
.icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 10px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover {
  background: var(--hover);
  color: var(--ink);
}
.sidebar-head .icon-button.with-label {
  width: auto;
  gap: 6px;
  padding-inline: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar-head .icon-button.with-label .icon {
  width: 18px;
  height: 18px;
}
.quiet {
  background: transparent;
  color: var(--accent);
  font-size: 13px;
}
.wide {
  width: 100%;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
#verify-destination { overflow-wrap: anywhere; }
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--muted);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.tone-1 {
  background: #e4daf0;
  color: #654b7e;
}
.avatar.tone-2 {
  background: #d4e6f4;
  color: #3e6888;
}
.avatar.tone-3 {
  background: #f5dfcd;
  color: #86613c;
}
.avatar.tone-4 {
  background: #d3e9df;
  color: #467a64;
}
.workspace {
  height: calc(100dvh / var(--ui-zoom, 1));
  display: grid;
  grid-template-columns: 76px 340px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  background: var(--surface);
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.has-minimized-call .workspace { padding-top: 0; }
.rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 12px 16px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.rail-logo {
  object-fit: cover;
  border-radius: 13px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.nav-active {
  background: var(--lime);
  color: var(--ink);
}
.rail-main,
.rail-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 0;
}
.rail-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.rail-account,
.rail button {
  flex-shrink: 0;
}
.rail-main::-webkit-scrollbar {
  display: none;
}
.self-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 14px;
  padding: 0;
}
.sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 22px 20px;
}
.sidebar-head h1 {
  margin-top: 5px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rail);
  border-radius: 13px;
  margin: 0 18px 14px;
  padding-left: 12px;
  color: var(--muted);
}
.search-field input {
  padding: 12px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline-offset: -2px;
}
.search-field input:focus,
.message-search input:focus,
.group-call-picker > input:focus {
  outline: none;
  box-shadow: none;
}
.search-field:focus-within {
  box-shadow: inset 0 0 0 1px var(--muted);
}
.message-search input:focus-visible,
.group-call-picker > input:focus-visible {
  border-color: var(--muted);
}
.search-field .icon-button {
  min-width: 36px;
  width: 36px;
  transform: rotate(180deg);
}
.search-field > .icon {
  width: 18px;
}
.chat-tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 18px 8px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  scrollbar-width: none;
  overflow-x: auto;
}
.chat-filter-buttons, .chat-folder-buttons {
  display: contents;
}
.list-section-label { display: none; color: var(--muted); font-size: 10px; line-height: 16px; }
.chat-folder-buttons > .folder-tab-wrap > button:not(.list-row-more) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-folder-buttons .folder-icon { display: grid; place-items: center; }
.chat-folder-buttons .folder-icon .icon { width: 16px; height: 16px; }
.chat-tabs[hidden] { display: none; }
.chat-tabs::-webkit-scrollbar { display: none; }
.chat-tabs #folder-tabs { display: contents; }
.chat-tabs #create-folder { min-width: 24px; display: grid; place-items: center; }
.chat-tabs #create-folder .icon { width: 16px; height: 16px; }
.chat-tabs .folder-icon { display: none; }
.chat-tabs button {
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0 15px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.chat-tabs button.selected {
  color: var(--accent);
  border-color: var(--accent);
}
.chat-tabs .list-count, .chat-tabs #chat-count, .chat-tabs #unread-count {
  font-size: 10px;
  background: var(--hover);
  padding: 2px 5px;
  border-radius: 5px;
  margin-left: 3px;
}
.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.chat-button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  padding: 13px 12px;
  min-height: 80px;
  border-radius: 14px;
  overflow: hidden;
}
.chat-button:hover {
  background: var(--hover);
}
.chat-button.active {
  background: var(--out);
}
.chat-button .chat-copy {
  flex: 1;
  min-width: 0;
}
.chat-button strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-button small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.contact-list-row {
  display: flex;
  align-items: center;
  min-width: 0;
}
.chat-list-row, .call-list-row { position: relative; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.chat-list-row > .chat-button, .call-list-row > .chat-button { flex: 1; min-width: 0; width: auto; }
.list-row-more { flex: none; width: 32px; min-width: 32px; height: 40px; color: var(--muted); }
.contact-list-row .list-row-more { width: 28px; min-width: 28px; }
.call-list-row .call-row-delete { position: absolute; right: 0; inset-block: 0; min-width: 78px; background: #d83d46; color: white; border-radius: 8px; opacity: 0; pointer-events: none; }
.call-list-row.swiped .call-row-delete { opacity: 1; pointer-events: auto; }
.call-list-row > .chat-button, .call-list-row > .list-row-more, .call-list-row > .contact-row-info, .call-list-row > .call-row-time { position: relative; z-index: 1; background: var(--surface); transition: transform 160ms ease; }
.call-list-row.swiped > .chat-button, .call-list-row.swiped > .list-row-more, .call-list-row.swiped > .contact-row-info, .call-list-row.swiped > .call-row-time { transform: translateX(-80px); }
.call-row-time { color: var(--muted); font-size: 11px; flex: none; }
.new-call-contact { display: flex; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--line); }
.new-call-contact strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-call-contact .icon-button { flex: none; }
@media (max-width: 767px) { .call-list-row > .list-row-more { display: none; } }
.list-menu .menu-item { width: 100%; }
.list-menu .menu-item.danger { color: #cf333b; }
.contact-row-main {
  flex: 1;
  min-width: 0;
  width: auto;
}
.contact-row-info {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 6px;
  color: var(--accent);
}
.contact-mode-icon {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.contact-mode-icon .icon {
  width: 19px;
  height: 19px;
}
.contact-request-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.contact-request-actions .icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
}
.call-sidebar-row {
  background: var(--hover);
  margin-bottom: 6px;
}
.chat-trailing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  align-self: stretch;
  justify-content: center;
}
.chat-trailing time {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.badge {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 10px;
  border-radius: 12px;
  padding: 3px 7px;
  min-width: 20px;
  text-align: center;
}
.sidebar-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.sidebar-footer button {
  margin-left: auto;
  min-height: 30px;
  padding: 4px;
  font-size: 10px;
}
.connection-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.sidebar-empty {
  padding: 36px 22px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.sidebar-empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 8px;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--line) 0.8px, transparent 0.8px);
  background-size: 18px 18px;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 88px;
  min-height: 88px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
}
.contact-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  background: none;
  color: var(--ink);
  padding: 0;
  text-align: left;
  min-width: 0;
}
.contact-heading:disabled {
  opacity: 1;
}
.contact-heading > span:last-child {
  min-width: 0;
}
.contact-heading strong {
  display: block;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.contact-heading small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
  margin-top: 5px;
}
.chat-actions {
  display: flex;
  margin-left: auto;
  gap: 4px;
}
#pinned-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 40px 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
#pinned-bar[hidden] {
  display: none;
}
.pinned-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--lime);
}
.pinned-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.pinned-copy strong,
.pinned-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pinned-copy small {
  color: var(--muted);
  font-size: 12px;
}
.unavailable {
  color: var(--muted);
}
#timeline {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
#messages {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 860px;
  margin: 0 auto;
}
.bubble {
  position: relative;
  background: var(--surface);
  border-radius: 16px 16px 16px 5px;
  padding: 10px 13px 7px;
  max-width: min(78%, 560px);
  min-width: 110px;
  align-self: flex-start;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 14px;
  box-shadow: 0 1px 2px #1b351109;
}
.bubble.mine {
  background: var(--out);
  align-self: flex-end;
  border-radius: 16px 16px 5px 16px;
}
.message-sender {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}
.message-text {
  white-space: pre-wrap;
}
.bubble.call-transcript { width: min(78%, 560px); }
.transcript-heading { display: block; font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.transcript-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.transcript-actions button { min-height: 34px; padding: 5px 9px; font-size: 12px; }
.transcript-full { white-space: pre-wrap; overflow-wrap: anywhere; max-height: calc(65dvh / var(--ui-zoom, 1)); overflow: auto; font: inherit; }
.bubble.is-pinned {
  outline: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.message-pin-mark {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 14px;
  height: 14px;
  margin: 4px 3px 0 auto;
  color: var(--accent);
  vertical-align: middle;
}
.message-pin-mark .icon {
  width: 13px;
  height: 13px;
}
.bubble time {
  display: block;
  text-align: right;
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 5px;
}
.reaction-chip {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 17px;
}
.reaction-chip.own {
  border-color: var(--accent);
  background: var(--lime);
}
.message-more {
  position: absolute;
  right: -34px;
  top: 0;
  width: 30px;
  min-width: 30px;
  height: 32px;
  min-height: 32px;
  opacity: 0;
  padding: 6px;
  border-radius: 10px;
}
.mine .message-more {
  right: auto;
  left: -34px;
}
.bubble:hover .message-more,
.bubble:focus-within .message-more {
  opacity: 1;
}
.day-separator {
  align-self: center;
  font-size: 10px;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 20px;
  margin: 18px 0 12px;
}
.reply-quote {
  display: block;
  background: var(--hover);
  border-left: 3px solid var(--accent);
  color: var(--ink);
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  min-height: 0;
  padding: 7px 9px;
  margin-bottom: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble[data-deleted] {
  font-style: italic;
  color: var(--muted);
}
.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  padding: 10px 0;
  overflow-wrap: anywhere;
}
.file-card .file-icon {
  padding: 10px;
  background: var(--lime);
  border-radius: 12px;
}
.file-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.file-card.has-document-preview { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.file-card-document-preview {
  grid-column: 1 / -1;
  display: block;
  width: min(320px, 100%);
  height: 140px;
  padding: 12px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
}
.file-card-document-preview canvas { display: block; width: 100%; height: auto; }
.file-card-document-preview table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-card-document-preview td { padding: 4px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.file-card.photo-loading {
  justify-content: center;
  width: 120px;
  height: 120px;
  padding: 0;
}
.file-card.inline-photo {
  width: auto;
  max-width: 100%;
  padding: 0;
}
.inline-attachment-image {
  display: block;
  width: auto;
  max-width: min(420px, 100%);
  max-height: 420px;
  border-radius: 7px;
  object-fit: contain;
}
.message-media-grid { display: grid; gap: 4px; max-width: min(540px, 100%); min-width: 0; }
.message-media-grid:has(.inline-photo:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.message-media-grid:has(.inline-photo:nth-child(2)) .inline-attachment-image { width: 100%; aspect-ratio: 1; object-fit: cover; }
.file-card-thumbnail { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
#picks .file-pick img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.attachment-dialog { width: min(520px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px)); max-height: calc(calc(100dvh / var(--ui-zoom, 1)) - 24px); padding: 20px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); overflow: auto; }
.attachment-dialog::backdrop { background: #0008; }
.attachment-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.attachment-dialog h2 { font-size: 19px; margin: 0; }
.attachment-dialog header button { flex-shrink: 0; }
.attachment-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 16px; }
.attachment-preview-tile { position: relative; min-width: 0; aspect-ratio: 1.25; overflow: hidden; background: var(--soft); border-radius: 6px; }
.attachment-preview-tile:only-child { grid-column: 1 / -1; aspect-ratio: 1.5; }
.attachment-preview-grid.odd > :first-child { grid-column: 1 / -1; aspect-ratio: 1.5; }
.message-media-grid:has(.inline-photo:nth-child(2)) .inline-photo:last-child:nth-child(odd) { grid-column: 1 / -1; }
.message-media-grid:has(.inline-photo:nth-child(2)) .inline-photo:last-child:nth-child(odd) img { aspect-ratio: 2; }
.attachment-preview-tile img, .attachment-preview-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-preview-tile img { cursor: zoom-in; }
.attachment-remove { position: absolute; top: 5px; right: 5px; width: 32px; height: 32px; padding: 6px; background: #172820c9; color: white; border-radius: 6px; }
.attachment-name { position: absolute; bottom: 0; left: 0; right: 0; background: #172820bf; color: white; padding: 5px 8px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 15px; }
.attachment-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.attachment-dialog textarea { box-sizing: border-box; width: 100%; min-height: 68px; margin-top: 12px; resize: vertical; }
.attachment-dialog footer { display: flex; gap: 8px; justify-content: space-between; margin-top: 16px; }
.attachment-dialog footer button { font-size: 13px; padding: 10px 12px; }
.attachment-dialog footer .icon-button { width: 44px; height: 44px; flex: 0 0 44px; padding: 10px; }
.bubble audio {
  display: block;
  width: 280px;
  max-width: 100%;
  height: 40px;
  margin: 8px 0;
}
.file-preview {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, var(--hover));
}
.file-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-preview-head strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.file-preview-head a {
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
  font-weight: 700;
}
.file-preview-head .icon-button { flex: none; }
.file-preview small {
  color: var(--muted);
  font-size: 10px;
}
.file-preview img,
.file-preview video,
.file-preview iframe {
  display: block;
  width: min(360px, 100%);
  max-width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--hover);
}
.file-preview img {
  max-height: 260px;
  object-fit: contain;
}
.file-preview video {
  max-height: 280px;
}
.file-preview video::-webkit-media-controls-fullscreen-button,
.file-viewer-body video::-webkit-media-controls-fullscreen-button {
  display: none;
}
.file-preview iframe {
  height: 360px;
}
.file-preview pre {
  max-width: min(460px, 100%);
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.file-viewer {
  width: min(calc(100vw / var(--ui-zoom, 1)), 960px);
  height: min(calc(100dvh / var(--ui-zoom, 1)), 760px);
  max-width: calc(100vw / var(--ui-zoom, 1));
  max-height: calc(100dvh / var(--ui-zoom, 1));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.file-viewer[open] { display: flex; flex-direction: column; }
.file-window .file-viewer {
  display: flex;
  flex-direction: column;
  width: calc(100vw / var(--ui-zoom, 1));
  height: calc(100dvh / var(--ui-zoom, 1));
  max-width: calc(100vw / var(--ui-zoom, 1));
  max-height: calc(100dvh / var(--ui-zoom, 1));
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}
body.file-window { overflow: hidden; background: #fff; }
.file-window .file-viewer-head { min-height: 44px; padding: 6px 10px; gap: 4px; background: #fff; flex-wrap: wrap; }
.file-window .file-viewer-head .icon-button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 7px; border-radius: 4px; flex: 0 0 32px; }
.file-window .file-viewer-head .icon { width: 18px; height: 18px; }
#file-window-zoom-level { width: 44px; flex: 0 0 44px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.file-window .file-viewer-body { background: #fff; }
.file-window .file-viewer-body:has(> img, > video) { display: block; }
.file-window .file-viewer-body > img, .file-window .file-viewer-body > video { max-width: none; max-height: none; margin: auto; }
.file-window .markdown-preview { height: 100%; background: #fff; }
.file-window .pdf-preview { height: 100%; }
.file-window .pdf-preview canvas { max-width: none; flex-shrink: 0; }
.pdf-print-pages { display: none; }
#file-window-error { position: fixed; bottom: 12px; left: 12px; right: 12px; margin: 0; padding: 12px; background: #fff; color: #a32626; border: 1px solid #a32626; border-radius: 6px; }
.file-window-content {
  position: fixed;
  inset: 44px 0 0;
  z-index: 1;
  padding: 24px;
  background: #fff;
  color: var(--muted);
}
.file-window-content .file-preview { max-width: 720px; margin: 0 auto; color: var(--ink); }
@media print {
  body.file-window, .file-window .file-viewer, .file-window .file-viewer-body { display: block; width: 100%; height: auto; max-width: none; max-height: none; overflow: visible; background: #fff; color: #000; }
  .file-window .file-viewer-head, .file-window-content, #file-window-error, .file-window select, .file-window .pdf-preview { display: none; }
  .file-window .file-viewer-body > * { zoom: 1 !important; height: auto; overflow: visible; }
  .file-window .file-viewer-body > img { width: 100% !important; height: auto !important; max-height: 250mm; object-fit: contain; }
  .file-window .markdown-preview { padding: 0; }
  .file-window .markdown-article { max-width: none; }
  .file-window pre, .file-window .markdown-article pre, .file-window .sheet-preview > div { height: auto; max-height: none; overflow: visible; white-space: pre-wrap; }
  .file-window .sheet-preview table { width: 100%; table-layout: fixed; }
  .file-window .pdf-print-pages { display: block; }
  .pdf-print-pages img { display: block; width: 100%; height: 250mm; object-fit: contain; break-after: page; }
  .pdf-print-pages img:last-child { break-after: auto; }
}
.file-viewer::backdrop {
  background: rgba(10, 25, 20, 0.82);
}
.file-viewer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.file-viewer-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.file-viewer-head a {
  display: grid;
  place-items: center;
  color: var(--ink);
}
.file-viewer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: auto;
}
.file-viewer-body img,
.file-viewer-body video {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}
.pdf-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #e8ebea;
}
.pdf-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}
.pdf-preview-toolbar button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.pdf-preview-toolbar button:disabled { opacity: .4; }
.pdf-preview canvas {
  display: block;
  max-width: 100%;
  margin: 0 auto 16px;
  box-shadow: 0 1px 7px #0003;
}
.file-viewer-body pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.markdown-preview {
  align-self: stretch;
  width: 100%;
  min-width: 0;
  overflow: auto;
  padding: 28px 32px 40px;
}
.markdown-article {
  max-width: 760px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.markdown-article > :first-child { margin-top: 0; }
.markdown-article h1,
.markdown-article h2,
.markdown-article h3,
.markdown-article h4 {
  line-height: 1.3;
  margin: 1.5em 0 .55em;
  font-weight: 700;
}
.markdown-article h1 { font-size: 23px; }
.markdown-article h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.markdown-article h3 { font-size: 16px; }
.markdown-article h4 { font-size: 14px; }
.markdown-article p,
.markdown-article ul,
.markdown-article ol,
.markdown-article blockquote,
.markdown-article table { margin: 0 0 1em; }
.markdown-article ul,
.markdown-article ol { padding-left: 24px; }
.markdown-article li { margin: 4px 0; }
.markdown-article li > p { margin: 0; }
.markdown-article blockquote {
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.markdown-article a { color: var(--accent); text-decoration: underline; }
.markdown-article code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--hover);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.file-viewer-body .markdown-article pre {
  width: 100%;
  height: auto;
  max-height: 420px;
  margin: 0 0 1em;
  padding: 12px 14px;
  white-space: pre;
  overflow: auto;
  border-radius: 6px;
  background: var(--hover);
}
.markdown-article pre code { padding: 0; background: none; }
.markdown-article table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown-article th,
.markdown-article td { padding: 7px 9px; border: 1px solid var(--line); text-align: left; }
.markdown-article hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.sheet-preview {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  gap: 8px;
}
.sheet-preview select {
  align-self: flex-start;
  max-width: 100%;
}
.sheet-preview > div {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.sheet-preview table {
  border-collapse: collapse;
  font-size: 12px;
}
.sheet-preview td {
  min-width: 64px;
  max-width: 280px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .file-viewer { width: calc(100vw / var(--ui-zoom, 1)); height: calc(100dvh / var(--ui-zoom, 1)); border-radius: 0; }
  .markdown-preview { padding: 20px 16px 32px; }
}
@media (max-width: 900px) and (pointer: coarse) {
  .file-viewer { width: calc(100vw / var(--ui-zoom, 1)); height: calc(100dvh / var(--ui-zoom, 1)); max-width: calc(100vw / var(--ui-zoom, 1)); max-height: calc(100dvh / var(--ui-zoom, 1)); border-radius: 0; }
}
.group-mark {
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
}
.group-form {
  display: grid;
  gap: 12px;
}
.group-form input,
.group-form textarea,
.group-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}
.group-form textarea {
  resize: vertical;
}
.member-picker {
  display: grid;
  gap: 8px;
}
.member-choice {
  display: grid;
  grid-template-columns: auto 40px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-radius: 14px;
  padding: 8px 10px;
  background: var(--soft);
}
.member-choice .avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 13px;
}
.empty {
  text-align: center;
  max-width: 330px;
  margin: calc(15vh / var(--ui-zoom, 1)) auto;
  color: var(--muted);
  font-size: 13px;
}
.welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: calc(100% - 60px);
  padding: 32px 12px;
  text-align: center;
}
.welcome-mark {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}
.welcome-mark img {
  display: block;
  border-radius: 23px;
}
.welcome h2 {
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -1.1px;
  margin: 12px 0 16px;
  font-weight: 650;
}
.welcome p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
}
.welcome button {
  margin-top: 24px;
  background: var(--lime);
  color: var(--ink);
  font-size: 12px;
}
.welcome small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 42px;
}
.older {
  display: block;
  margin: 0 auto 15px;
  background: var(--surface);
  min-height: 32px;
  border-radius: 20px;
  font-size: 11px;
}
#pinned-bar {
  display: block;
  max-width: 940px;
  width: calc(100% - 64px);
  margin: 0 auto;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 2px 10px #24361c05;
}
.pinned-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pinned-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 5px 6px;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  color: var(--ink);
}
.pinned-icon {
  color: var(--accent);
  flex: none;
}
.pinned-copy {
  min-width: 0;
}
.pinned-copy strong,
.pinned-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pinned-copy strong {
  font-size: 12px;
}
.pinned-copy small,
.pinned-screen-item small {
  color: var(--muted);
  font-size: 10px;
}
.pinned-arrow {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 7px;
  color: var(--muted);
}
.pinned-screen {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.pinned-screen-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.pinned-screen-search .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.pinned-screen-search input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.pinned-screen-list {
  display: grid;
  gap: 4px;
}
.pinned-screen-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 4px 7px 0;
  border-bottom: 1px solid var(--line);
}
.pinned-screen-mark {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.pinned-screen-controls {
  display: flex;
  gap: 2px;
  align-items: center;
}
.pinned-screen-drag,
.pinned-screen-move {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 7px;
  color: var(--muted);
}
.pinned-screen-drag { cursor: grab; }
.pinned-screen-drag:active { cursor: grabbing; }
.pinned-screen-drag .icon { transform: rotate(90deg); }
.pinned-move-up .icon { transform: rotate(90deg); }
.pinned-move-down .icon { transform: rotate(-90deg); }
.pinned-dragging { opacity: 0.55; }
.pinned-drop-before { box-shadow: inset 0 2px var(--accent); }
.pinned-drop-after { box-shadow: inset 0 -2px var(--accent); }
.pinned-order-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.pinned-screen-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.pinned-screen-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.pinned-screen-remove {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 7px;
  color: var(--muted);
}
.pin-confirm {
  display: grid;
  gap: 16px;
}
.pin-confirm > p {
  margin: 0;
  font-size: 16px;
}
.pin-confirm-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  color: var(--ink);
}
.pin-confirm-option input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}
.pin-confirm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.pin-confirm-actions button:not(.quiet) {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.composer-area {
  max-width: 940px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 16px;
}
#compose {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  background: var(--surface);
  padding: 9px;
  border-radius: 18px;
  box-shadow: 0 3px 20px #24361c06;
  border: 1px solid var(--line);
}
#draft {
  border: 0;
  background: transparent;
  resize: none;
  padding: 11px 5px;
  font-size: 14px;
  height: 46px;
  max-height: 140px;
}
#draft:focus {
  outline: none;
}
.send-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 13px;
  background: var(--lime);
  color: var(--ink);
  border-radius: 14px;
}
#send:not(:has(svg)) {
  width: auto;
}
.compose-hint {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  padding: 8px 14px 0;
}
.reply-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 15px;
  margin-bottom: 6px;
  font-size: 12px;
}
.reply-bar > div {
  flex: 1;
  min-width: 0;
}
.reply-bar strong {
  color: var(--accent);
  font-size: 11px;
}
.reply-bar p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
#filebar {
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: 6px;
}
#picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px;
}
#picks:not(:empty) {
  padding: 8px;
}
#picks button {
  font-size: 11px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  background: var(--hover);
}
#picks .file-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#picks .file-pick .icon {
  width: 15px;
  height: 15px;
}
#recording-state {
  padding: 8px 14px;
  color: var(--danger);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.record-active {
  color: var(--danger);
  background: var(--hover);
}
.pending {
  font-size: 11px;
  color: var(--danger);
  padding: 6px 12px;
}
.to-bottom {
  position: absolute;
  bottom: calc(var(--composer-height) + 22px);
  right: 20px;
  transform: rotate(90deg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.message-search {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.message-search input {
  font-size: 13px;
  border: 0;
}
.message-search span {
  white-space: nowrap;
  font-size: 10px;
}
.is-match {
  outline: 2px solid var(--accent);
}
.dragging {
  outline: 3px dashed var(--accent);
  outline-offset: -12px;
}
dialog {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 24px;
  width: min(430px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px));
  max-height: calc(90dvh / var(--ui-zoom, 1));
  overflow: auto;
}
dialog::backdrop {
  background: #18271f55;
  backdrop-filter: blur(3px);
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
dialog h2 {
  font-size: 19px;
}
dialog p {
  margin: 12px 0;
  font-size: 13px;
}
dialog label {
  margin: 14px 0;
}
dialog .menu-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: none;
  color: var(--ink);
  width: 100%;
  text-align: left;
  font-size: 13px;
  border-radius: 10px;
}
dialog .menu-item:hover {
  background: var(--hover);
}
.quality-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--hover);
}
.quality-row button {
  min-width: 0;
  min-height: 38px;
  padding: 8px;
  border-radius: 10px;
  color: var(--muted);
}
.quality-row button.selected {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 10px #15231e12;
}
.forward-list {
  display: grid;
  gap: 8px;
}
.forward-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.forward-row:hover {
  background: var(--hover);
}
.forward-row-copy {
  min-width: 0;
}
.forward-row-copy strong,
.forward-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forward-row-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
dialog .danger {
  color: var(--danger);
}
dialog .section-label {
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.message-menu {
  position: fixed;
  inset: auto;
  left: var(--message-menu-left, 24px);
  top: var(--message-menu-top, 24px);
  width: min(280px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px));
  max-height: min(320px, calc(calc(100dvh / var(--ui-zoom, 1)) - 24px));
  margin: 0;
  padding: 8px;
  border-radius: 12px;
  overflow: auto;
}
.message-menu::backdrop {
  background: transparent;
  backdrop-filter: none;
}
.message-menu header {
  gap: 8px;
  margin: 0 0 4px;
  padding-left: 8px;
}
.message-menu h2 {
  font-size: 13px;
}
.message-menu .menu-item {
  min-height: 42px;
  padding: 10px 12px;
}
.message-menu.list-menu { width: min(300px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px)); max-height: min(420px, calc(calc(100dvh / var(--ui-zoom, 1)) - 24px)); }
.chat-tabs .folder-tab-wrap { display: inline-flex; align-items: center; flex: none; margin: 0; padding: 0; background: none; border-radius: 0; }
.chat-tabs .folder-tab-wrap > .list-row-more { padding: 0; min-width: 20px; width: 20px; height: 28px; border: 0; }
.folder-tab-wrap[draggable], .folder-tab-wrap > button[draggable="true"] { cursor: grab; }
.folder-dragging { opacity: 0.5; }
.chat-tabs .folder-drop-before { box-shadow: -3px 0 var(--accent); }
.chat-tabs .folder-drop-after { box-shadow: 3px 0 var(--accent); }
.chat-pin-icon { display: inline-flex; vertical-align: middle; margin-right: 5px; color: var(--accent); }
.chat-pin-icon .icon { width: 13px; height: 13px; }
.reaction-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.reaction-choice {
  min-width: 0;
  min-height: 36px;
  padding: 4px;
  border-radius: 12px;
  background: var(--hover);
  color: var(--ink);
  font-size: 19px;
}
.reaction-choice.selected {
  background: var(--lime);
  outline: 1px solid var(--accent);
}
.side-panel {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  border-radius: 8px 0 0 8px;
  height: calc(100dvh / var(--ui-zoom, 1));
  max-height: calc(100dvh / var(--ui-zoom, 1));
  width: 360px;
  padding: calc(24px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  overflow: hidden;
}
.side-panel[open] { display: flex; flex-direction: column; }
.side-panel > header { flex-shrink: 0; }
#panel-body { min-height: 0; overflow-y: auto; flex: 1; scrollbar-gutter: stable; }
.profile-card {
  text-align: center;
  padding: 16px 0;
}
.profile-card .avatar {
  width: 90px;
  height: 90px;
  font-size: 32px;
  margin: 8px auto 16px;
}
.profile-card h3 {
  font-size: 22px;
  overflow-wrap: anywhere;
}
.contact-detail .profile-card .avatar {
  width: 104px;
  height: 104px;
  font-size: 36px;
}
.contact-detail .profile-card {
  padding: 4px 0 8px;
}
.contact-detail .profile-card .avatar {
  margin-bottom: 12px;
}
.contact-detail {
  gap: 10px;
}
.contact-detail .detail-row {
  padding: 10px 0;
}
.contact-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.contact-card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 72px;
  border-radius: 8px;
  background: var(--hover);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.contact-card-action:hover { background: var(--lime); }
.contact-card-action:focus-visible { outline: 2px solid var(--accent); }
.contact-card-action .icon { width: 22px; height: 22px; }
.contact-copyable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
}
.contact-copyable small { grid-column: 1; }
.contact-copyable > span { grid-column: 1; }
.contact-copyable .icon-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin: 0;
}
.contact-editor { padding: 12px 0; }
.shared-file-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.shared-file-tabs button { min-width: 0; border-radius: 8px; padding: 10px 4px; }
.shared-file-tabs [aria-pressed="true"] { background: var(--lime); color: var(--ink); }
.shared-file-list { display: grid; gap: 8px; }
.shared-file { width: 100%; min-width: 0; text-align: left; }
.shared-file > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.detail-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.detail-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}
.detail-row button {
  margin-top: 6px;
}
.device-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
}
.device-row p {
  margin: 3px 0;
}
.device-row .quiet {
  padding: 8px 0;
  font-size: 11px;
}
.settings-actions {
  display: grid;
  gap: 6px;
}
#delete-account {
  display: grid;
  gap: 10px;
}
.emoji-panel {
  width: 350px;
}
.emoji-panel header {
  margin-bottom: 12px;
}
#emojis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
#emojis button {
  background: transparent;
  font-size: 24px;
  padding: 4px;
}
.auth {
  max-width: 430px;
  margin: calc(6vh / var(--ui-zoom, 1)) auto;
  padding: 32px;
  display: grid;
  gap: 20px;
  background: var(--surface);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 24px;
  font-weight: 750;
  margin-bottom: 10px;
}
.auth-brand img {
  border-radius: 20px;
}
.auth h1 {
  font-size: 28px;
  line-height: 1.25;
}
.auth form {
  display: grid;
  gap: 16px;
}
.auth-mode {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--hover);
}
.auth-mode button {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.auth-mode button.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 10px #15231e12;
}
.auth form > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.auth .check {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
  line-height: 1.5;
  font-size: 11px;
}
.check input {
  width: 18px;
  flex-shrink: 0;
}
.auth-foot {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}
#verify input {
  font-size: 26px;
  letter-spacing: 10px;
  text-align: center;
}
#status {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(600px, calc(calc(100vw / var(--ui-zoom, 1)) - 24px));
  background: var(--ink);
  color: var(--surface);
  border-radius: 12px;
  z-index: 30;
  font-size: 12px;
  box-shadow: var(--shadow);
}
#status:not(:empty) {
  padding: 13px 20px;
}
@media (min-width: 768px) {
  #back {
    display: none !important;
  }
}
@media (max-width: 1099px) {
  .workspace {
    grid-template-columns: 64px 290px minmax(0, 1fr);
    height: calc(100dvh / var(--ui-zoom, 1));
  }
  .rail {
    padding: 20px 8px;
  }
  .sidebar-head {
    padding: 22px 18px;
  }
  .chat-head {
    padding: 14px 18px;
  }
  #timeline {
    padding: 20px 30px;
  }
  #pinned-bar {
    margin: 0 30px 8px;
  }
  .composer-area {
    padding: 0 18px 12px;
  }
  .chat-actions {
    gap: 0;
  }
  .chat-actions .icon-button {
    width: 36px;
    min-width: 36px;
  }
  .chat-tabs {
    gap: 8px;
    padding: 0 12px;
  }
  .contact-heading .avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .bubble {
    max-width: 85%;
  }
  .compose-hint {
    display: none;
  }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .workspace {
    grid-template-columns: 64px minmax(240px, calc(34vw / var(--ui-zoom, 1))) minmax(0, 1fr);
  }
  .chat-button {
    padding-right: 10px;
  }
  .panel-card,
  .group-call-picker {
    max-width: min(520px, calc(calc(100vw / var(--ui-zoom, 1)) - 28px));
  }
}
@media (max-width: 767px) {
  html,
  body,
  #workspace {
    height: calc(100dvh / var(--ui-zoom, 1));
    overflow: hidden;
  }
  .workspace {
    grid-template-columns: 58px minmax(0, 1fr);
    width: calc(100vw / var(--ui-zoom, 1));
    max-width: calc(100vw / var(--ui-zoom, 1));
    overflow: hidden;
  }
  .rail {
    gap: 12px;
    padding: 18px 5px;
  }
  .rail-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
  }
  .sidebar-head {
    padding: 24px 20px 20px;
  }
  .conversation {
    display: none;
  }
  .workspace.open {
    grid-template-columns: 1fr;
  }
  .workspace.open .rail,
  .workspace.open .sidebar {
    display: none;
  }
  .workspace.open .conversation {
    display: flex;
  }
  .chat-head {
    height: 76px;
    min-height: 76px;
    padding: 12px 10px;
    gap: 2px;
    max-width: calc(100vw / var(--ui-zoom, 1));
  }
  .chat-head .avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 13px;
  }
  .contact-heading {
    gap: 7px;
    flex: 1;
  }
  .contact-heading strong {
    font-size: 13px;
  }
  .contact-heading small {
    font-size: 10px;
  }
  .chat-actions .icon-button {
    width: 32px;
    min-width: 32px;
    padding: 6px;
  }
  #timeline {
    padding: 12px 34px calc(var(--composer-height) + 22px);
  }
  #pinned-bar {
    width: 100%;
    margin: 0 0 8px;
    padding: 5px;
    border-left: 0;
    border-right: 0;
  }
  .pinned-top {
    gap: 4px;
  }
  .pinned-main {
    gap: 7px;
    padding-inline: 6px;
  }
  .pinned-arrow {
    width: 30px;
    min-width: 30px;
    height: 32px;
    padding: 7px;
  }
  .bubble {
    font-size: 13px;
    max-width: 92%;
  }
  .message-more {
    opacity: 0.7;
    right: -31px;
    width: 28px;
    min-width: 28px;
  }
  .mine .message-more {
    left: -31px;
  }
  .composer-area {
    position: fixed;
    left: env(safe-area-inset-left);
    right: env(safe-area-inset-right);
    bottom: var(--keyboard-offset);
    z-index: 8;
    max-width: none;
    width: auto;
    background: var(--canvas);
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
  }
  #compose {
    padding: 5px;
    gap: 0;
    border-radius: 16px;
  }
  #compose .icon-button {
    width: 36px;
    min-width: 36px;
    padding: 8px;
  }
  #emoji-toggle {
    display: none;
  }
  #draft {
    font-size: 16px;
    min-width: 0;
  }
  .send-button {
    width: 42px;
    min-width: 42px;
    height: 44px;
    padding: 12px;
  }
  .side-panel {
    width: calc(100vw / var(--ui-zoom, 1));
    max-width: calc(100vw / var(--ui-zoom, 1));
    border-radius: 0;
  }
  .call-dialog {
    width: calc(100vw / var(--ui-zoom, 1));
    height: calc(100dvh / var(--ui-zoom, 1));
    max-height: calc(100dvh / var(--ui-zoom, 1));
    border-radius: 0;
  }
  .call-heading, .call-dialog.with-video .call-heading {
    padding: calc(12px + env(safe-area-inset-top)) max(56px, env(safe-area-inset-right)) 12px max(56px, env(safe-area-inset-left));
  }
  .call-controls {
    gap: 4px;
    padding-inline: 8px;
  }
  .call-control {
    width: 72px;
    min-height: 78px;
  }
  .call-control .icon {
    width: 54px;
    height: 54px;
    padding: 15px;
  }
  .message-search {
    padding: 6px 12px;
  }
  .message-search > span {
    display: none;
  }
  .auth {
    margin: 24px 12px;
    padding: 26px;
    max-width: none;
  }
  .auth h1 {
    font-size: 27px;
  }
  .bubble audio {
    width: 210px;
  }
  .sidebar-footer {
    padding: 12px;
    font-size: 10px;
  }
  .chat-button {
    gap: 10px;
    padding: 12px 8px;
  }
  .chat-button .avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .welcome h2 {
    font-size: 27px;
  }
}
@media (max-height: 640px) {
  .rail {
    gap: 4px;
    padding: 8px 5px max(8px, env(safe-area-inset-bottom));
  }
  .rail-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
  }
  .rail-main,
  .rail-account {
    gap: 4px;
  }
}
@media (max-width: 767px) and (max-height: 520px) {
  .sidebar-head { padding: 8px 12px; }
  .search-field { margin-bottom: 6px; }
  .chat-tabs { gap: 2px; }
  .chat-tabs .list-section-label { line-height: 12px; font-size: 9px; }
  .chat-tabs button { padding: 6px 0; min-height: 36px; }
}
@media (min-width: 768px) {
  .workspace { grid-template-columns: 88px 340px minmax(0, 1fr); }
  .rail { padding-inline: 8px; }
  .rail .chat-tabs {
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 0;
    margin-top: 4px;
    border-bottom: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .rail .chat-filter-buttons, .rail .chat-folder-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    overflow: visible;
  }
  .rail .list-section-label { display: block; align-self: center; margin-top: 4px; }
  .rail .chat-tabs .folder-drop-before { box-shadow: 0 -3px var(--accent); }
  .rail .chat-tabs .folder-drop-after { box-shadow: 0 3px var(--accent); }
  .rail .chat-tabs button:not(.list-row-more) {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 52px;
    padding: 8px 4px;
    border: 0;
    border-radius: 8px;
    white-space: normal;
  }
  .rail .chat-tabs button.selected { background: var(--lime); color: var(--ink); }
  .rail .chat-tabs button:hover { background: var(--hover); }
  .rail .chat-tabs .folder-icon { display: grid; place-items: center; }
  .rail .chat-tabs .folder-icon .icon { width: 22px; height: 22px; }
  .rail .chat-tabs .folder-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    max-width: 100%;
    line-height: 1.3;
  }
  .rail .chat-tabs .list-count, .rail .chat-tabs #chat-count, .rail .chat-tabs #unread-count {
    position: absolute;
    top: 4px;
    right: 2px;
    margin: 0;
  }
  .rail .chat-tabs .folder-tab-wrap { position: relative; width: 100%; }
  .rail .chat-tabs .folder-tab-wrap > .list-row-more {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    opacity: 0;
  }
  .rail .folder-tab-wrap:hover > .list-row-more,
  .rail .folder-tab-wrap:focus-within > .list-row-more { opacity: 1; }
  .rail .chat-tabs #create-folder { min-height: 44px; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .workspace { grid-template-columns: 88px minmax(240px, calc(34vw / var(--ui-zoom, 1))) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      color 0.15s;
  }
  dialog[open] {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      translate: 0 6px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}
.secret-dialog {
  width: min(620px, calc(calc(100vw / var(--ui-zoom, 1)) - 20px));
  height: min(760px, calc(calc(100dvh / var(--ui-zoom, 1)) - 20px));
  max-height: calc(calc(100dvh / var(--ui-zoom, 1)) - 20px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}
.secret-dialog::backdrop { background: #07100ccc; }
.secret-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.secret-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.secret-head strong { font-size: 17px; }
.secret-status { min-height: 25px; margin: 0; padding: 6px 16px; color: var(--muted); font-size: 13px; }
.secret-messages { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.secret-bubble { align-self: flex-start; max-width: min(80%, 420px); overflow-wrap: anywhere; background: var(--rail); border-radius: 8px; padding: 9px 12px; white-space: pre-wrap; }
.secret-bubble.own { align-self: flex-end; background: var(--out); }
.secret-invitation { display: flex; gap: 8px; justify-content: center; padding: 12px; }
.secret-compose { display: flex; align-items: end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.secret-compose textarea { flex: 1; min-width: 0; max-height: 120px; resize: vertical; }
.secret-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.secret-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.secret-toggle input { appearance: none; width: 38px; height: 24px; min-width: 38px; padding: 2px; margin: 0; border: 1px solid var(--muted); border-radius: 20px; background: var(--line); cursor: pointer; }
.secret-toggle input::before { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0003; }
.secret-toggle input:checked { background: var(--accent); border-color: var(--accent); }
.secret-toggle input:checked::before { transform: translateX(14px); }
.secret-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.secret-toolbar select { width: auto; min-height: 36px; padding: 4px 8px; }
.secret-inline { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #e0f0f2; color: #15393b; }
.secret-active > #timeline, .secret-active > .composer-area, .secret-active > #pinned-bar,
.secret-active > .message-search, .secret-active > .to-bottom { display: none !important; }
.secret-bubble small { display: block; margin-top: 5px; font-size: 10px; opacity: .7; }
@media print { .secret-inline { display: none !important; } }
