:root {
  color-scheme: dark;
  --bg: #090a12;
  --panel: rgba(18, 16, 32, 0.58);
  --panel-strong: rgba(27, 23, 48, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.3);
  --text: #fbf8ff;
  --muted: rgba(251, 248, 255, 0.68);
  --soft: rgba(246, 248, 251, 0.1);
  --gold: #e9c76b;
  --teal: #31c3b0;
  --violet: #8e6cff;
  --violet-soft: #c6b6ff;
  --plum: #4b2b74;
  --red: #ec5d7b;
  --glass: rgba(255, 255, 255, 0.078);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 90px rgba(4, 3, 12, 0.44);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.24), transparent 36%),
    linear-gradient(225deg, rgba(49, 195, 176, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(233, 199, 107, 0.09), transparent 48%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-chat-open {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.cabinet-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(14px, 2.4vw, 32px);
}

body.is-chat-open .cabinet-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.cabinet-auth,
.chat-view {
  width: min(1280px, 100%);
  margin: auto;
  min-height: 0;
}

.cabinet-auth {
  display: grid;
  gap: 24px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.034) 48%, rgba(233, 199, 107, 0.06)),
    linear-gradient(155deg, rgba(142, 108, 255, 0.18), rgba(49, 195, 176, 0.06)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow);
  backdrop-filter: blur(22px) saturate(190%) contrast(112%);
  -webkit-backdrop-filter: blur(22px) saturate(190%) contrast(112%);
}

.cabinet-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.cabinet-brand img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: contain;
  background: #090a12;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(142, 108, 255, 0.28),
    0 12px 34px rgba(142, 108, 255, 0.16);
}

.cabinet-brand.compact img {
  width: 36px;
  height: 36px;
}

.auth-copy {
  display: grid;
  gap: 10px;
}

.auth-copy span,
.chat-title-block span,
.sidebar-section span {
  color: var(--violet-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-copy h1,
.chat-title-block h1 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.auth-copy h1 {
  font-size: clamp(34px, 7vw, 58px);
  line-height: 0.98;
}

.auth-copy p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  color: rgba(251, 248, 255, 0.72);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: #110d1b;
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(246, 248, 251, 0.78);
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.052);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 26px rgba(0, 0, 0, 0.08);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input {
  min-height: 52px;
  padding: 0 14px;
}

select {
  min-height: 52px;
  padding: 0 14px;
  appearance: none;
}

textarea {
  min-height: 86px;
  padding: 13px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(142, 108, 255, 0.72);
  background: rgba(142, 108, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 3px rgba(142, 108, 255, 0.12);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button.primary {
  color: #100e18;
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 12px 34px rgba(142, 108, 255, 0.2);
}

.button.secondary {
  color: var(--text);
  border-color: var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.052);
}

.cabinet-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.cabinet-status.is-error {
  color: #ffb4b4;
}

.cabinet-status.is-ok {
  color: #9ef3d9;
}

.chat-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  align-self: stretch;
}

body.is-chat-open .chat-view {
  height: 100%;
  overflow: hidden;
}

.chat-header,
.chat-layout {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.032) 50%, rgba(233, 199, 107, 0.04)),
    linear-gradient(155deg, rgba(142, 108, 255, 0.12), rgba(49, 195, 176, 0.045)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 18px 55px rgba(4, 3, 12, 0.22);
  backdrop-filter: blur(18px) saturate(180%) contrast(112%);
  -webkit-backdrop-filter: blur(18px) saturate(180%) contrast(112%);
}

.chat-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
}

.chat-title-block {
  min-width: 0;
}

.chat-title-block h1 {
  overflow: hidden;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.presence-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(49, 195, 176, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  color: rgba(214, 255, 246, 0.9);
  background:
    linear-gradient(135deg, rgba(49, 195, 176, 0.15), rgba(142, 108, 255, 0.07)),
    rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.presence-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(49, 195, 176, 0.13);
}

.logout-button {
  min-width: 96px;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-sidebar {
  display: none;
}

.sidebar-section {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.sidebar-section.accent {
  border-color: rgba(142, 108, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.18), rgba(233, 199, 107, 0.07)),
    rgba(255, 255, 255, 0.05);
}

.sidebar-section strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sidebar-section small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 0;
  border-radius: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 10%, rgba(233, 199, 107, 0.12), transparent 28%),
    radial-gradient(circle at 18% 8%, rgba(142, 108, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(10, 12, 24, 0.42), rgba(11, 13, 25, 0.72)),
    rgba(10, 14, 20, 0.32);
  box-shadow: none;
}

.chat-presence-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: clamp(14px, 2vw, 22px) clamp(14px, 2.4vw, 28px) 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.038)),
    rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 40px rgba(0, 0, 0, 0.16);
}

.chat-presence-card span,
.chat-presence-card small {
  color: var(--violet-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-presence-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-presence-card small {
  justify-self: end;
  border: 1px solid rgba(233, 199, 107, 0.2);
  border-radius: 999px;
  padding: 7px 9px;
  color: rgba(255, 239, 191, 0.9);
  background: rgba(233, 199, 107, 0.08);
}

.manager-orb {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(9, 10, 18, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(142, 108, 255, 0.16);
}

.manager-orb img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: clamp(14px, 2.2vw, 24px) clamp(16px, 2.6vw, 30px) clamp(16px, 2.4vw, 26px);
  overflow: auto;
  scrollbar-color: rgba(198, 182, 255, 0.38) transparent;
}

.message {
  display: grid;
  gap: 7px;
  max-width: min(620px, 72%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 12px 14px 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 34px rgba(0, 0, 0, 0.16);
}

.message.is-client {
  justify-self: end;
  border-color: rgba(233, 199, 107, 0.3);
  border-bottom-right-radius: 6px;
  background:
    linear-gradient(135deg, rgba(233, 199, 107, 0.22), rgba(198, 182, 255, 0.18)),
    rgba(255, 255, 255, 0.066);
}

.message.is-manager {
  justify-self: start;
  border-color: rgba(142, 108, 255, 0.32);
  border-bottom-left-radius: 6px;
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.2), rgba(49, 195, 176, 0.11)),
    rgba(255, 255, 255, 0.055);
}

.message.is-empty {
  justify-self: center;
  max-width: 380px;
  margin-top: clamp(12px, 8vh, 84px);
  color: var(--muted);
  text-align: center;
  place-items: center;
  padding: 18px;
}

.empty-badge {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(233, 199, 107, 0.28);
  border-radius: 999px;
  color: #13101c;
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(142, 108, 255, 0.18);
}

.message-text {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-meta {
  color: rgba(246, 248, 251, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.message-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px clamp(14px, 2vw, 22px) 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.042);
  box-shadow: 0 -18px 54px rgba(0, 0, 0, 0.16);
}

.quick-message-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-message-row button {
  min-height: 32px;
  border: 1px solid rgba(142, 108, 255, 0.3);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.14), rgba(49, 195, 176, 0.06)),
    rgba(255, 255, 255, 0.048);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quick-message-row button:hover {
  border-color: rgba(233, 199, 107, 0.34);
  transform: translateY(-1px);
}

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, 100%);
  border: 1px solid rgba(198, 182, 255, 0.32);
  border-radius: 20px;
  padding: 8px 10px;
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.18), rgba(233, 199, 107, 0.1)),
    rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 34px rgba(0, 0, 0, 0.12);
}

.attachment-preview-media {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  color: #17121e;
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
}

.attachment-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-icon {
  display: inline-grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.attachment-preview-icon::before {
  content: "";
  width: 15px;
  height: 18px;
  border-radius: 4px 4px 3px 3px;
  background: currentColor;
  box-shadow: inset -5px 5px 0 rgba(255, 255, 255, 0.36);
}

.attachment-preview-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attachment-preview-copy strong,
.attachment-preview-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.attachment-preview-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attachment-preview button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.composer-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(10, 10, 19, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.message-form.is-recording .composer-shell {
  border-color: rgba(236, 93, 123, 0.5);
  background:
    linear-gradient(135deg, rgba(236, 93, 123, 0.11), rgba(142, 108, 255, 0.075)),
    rgba(10, 10, 19, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 3px rgba(236, 93, 123, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.18);
}

.composer-shell textarea {
  min-height: 42px;
  max-height: 150px;
  border: 0;
  border-radius: 16px;
  padding: 10px 6px;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.composer-shell textarea:focus {
  background: transparent;
  box-shadow: none;
}

.composer-icon-button,
.composer-send {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(142, 108, 255, 0.13), rgba(233, 199, 107, 0.06)),
    rgba(255, 255, 255, 0.052);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.composer-icon-button:hover,
.composer-send:hover {
  border-color: rgba(233, 199, 107, 0.38);
  transform: translateY(-1px);
}

.composer-icon-button svg,
.composer-send svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.attachment-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.voice-button {
  position: relative;
  color: var(--violet-soft);
}

.voice-icon-stop {
  display: none;
}

.voice-button.is-recording {
  width: 108px;
  gap: 7px;
  padding: 0 12px;
  border-color: rgba(236, 93, 123, 0.58);
  color: #ffcad4;
  background:
    linear-gradient(135deg, rgba(236, 93, 123, 0.22), rgba(142, 108, 255, 0.14)),
    rgba(255, 255, 255, 0.064);
  box-shadow: 0 0 0 5px rgba(236, 93, 123, 0.08);
}

.voice-button.is-recording .voice-icon-mic {
  display: none;
}

.voice-button.is-recording .voice-icon-stop {
  display: block;
}

.recording-timer {
  position: static;
  min-width: 54px;
  color: #ffb4c2;
  font-size: 12px;
  font-weight: 900;
}

.composer-send {
  color: #100e18;
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
}

.message-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: min(380px, 100%);
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 9px 10px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.message-attachment.has-image-preview {
  width: min(420px, 100%);
  padding: 8px;
}

.message-image-preview {
  display: block;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.message-image-preview img {
  display: block;
  width: 100%;
  max-height: min(340px, 38vh);
  object-fit: cover;
}

.message-attachment[data-kind="audio"] {
  grid-template-columns: auto minmax(0, 152px) minmax(0, 1fr);
  width: min(430px, 100%);
}

.message-attachment-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #17121e;
  background: linear-gradient(135deg, var(--violet-soft), var(--gold));
}

.message-attachment-icon::before {
  content: "";
  width: 15px;
  height: 18px;
  border-radius: 4px 4px 3px 3px;
  background: currentColor;
  box-shadow: inset -5px 5px 0 rgba(255, 255, 255, 0.36);
}

.message-attachment-icon[data-kind="audio"]::before,
.attachment-preview-icon[data-kind="audio"]::before {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 5px currentColor,
    inset 0 0 0 8px rgba(255, 255, 255, 0.3);
}

.message-attachment-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.message-attachment-copy strong,
.message-attachment-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-copy strong {
  font-size: 13px;
  font-weight: 900;
}

.message-attachment-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.voice-wave {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  gap: 3px;
  align-items: center;
  min-width: 0;
}

.voice-wave i {
  display: block;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--violet-soft), rgba(233, 199, 107, 0.84));
  opacity: 0.84;
}

.voice-wave i:nth-child(2n) {
  height: 20px;
}

.voice-wave i:nth-child(3n) {
  height: 8px;
}

.voice-wave i:nth-child(5n) {
  height: 26px;
}

.message-actions {
  display: block;
  min-height: 22px;
}

@media (max-width: 860px) {
  .chat-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .chat-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .cabinet-shell {
    padding: 8px;
  }

  .cabinet-auth {
    min-height: calc(100vh - 16px);
    align-content: center;
  }

  .chat-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .chat-header .cabinet-brand {
    display: none;
  }

  .chat-header-actions {
    gap: 7px;
  }

  .presence-pill {
    display: none;
  }

  .chat-sidebar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    min-height: 0;
    padding: 12px;
  }

  .message {
    max-width: 94%;
  }

  .chat-presence-card {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 10px 10px 0;
    border-radius: 16px;
  }

  .chat-presence-card small {
    display: none;
  }

  .quick-message-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quick-message-row button {
    flex: 0 0 auto;
  }

  .composer-shell {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 6px;
  }

  .composer-icon-button,
  .composer-send {
    width: 40px;
    height: 40px;
  }

  .voice-button.is-recording {
    width: 92px;
    padding: 0 9px;
  }

  .recording-timer {
    min-width: 44px;
  }

  .attachment-preview {
    width: 100%;
  }

  .message-attachment[data-kind="audio"] {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .message-attachment[data-kind="audio"] .voice-wave {
    grid-column: 1 / -1;
  }

  .message-actions {
    grid-template-columns: 1fr;
  }

  .message-actions .button {
    width: 100%;
  }
}
