:root {
  --bg: #0f1720;
  --bg-deep: #0b1219;
  --sidebar: #151f29;
  --panel: #1c2733;
  --panel-2: #24303d;
  --hover: #1e2a36;
  --active: #23405b;
  --in: #1a2531;
  --out: #2b5278;
  --text: #e8edf2;
  --muted: #93a4b5;
  --muted-2: #8294a6;
  --accent: #4da3e0;
  --accent-strong: #3a8cc4;
  --danger: #f16a6a;
  --green: #4fd68b;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(94, 181, 247, 0.35);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  height: 100dvh;
  max-width: 1680px;
  margin: 0 auto;
  overflow: hidden;
  border-inline: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------ */
/* Sidebar                                                             */
/* ------------------------------------------------------------------ */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.sidebar-header {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.1px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.new-btn {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: none;
  transition: filter 0.15s ease;
}

.new-btn:hover {
  background: var(--accent-strong);
  color: #fff;
  filter: brightness(1.08);
}

.new-btn .icon {
  width: 21px;
  height: 21px;
  stroke-width: 2.4;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(77, 163, 224, 0.35);
  color: var(--text);
}

.lang-btn .icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.search-box {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 0 12px 10px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-box:focus-within {
  background: #26333f;
  border-color: #33536b;
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 12px;
  scrollbar-gutter: stable;
}

.chat-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.12s ease;
}

.chat-item:hover {
  background: var(--hover);
}

.chat-item.active {
  background: rgba(77, 163, 224, 0.14);
}

.chat-item.active .chat-item-name {
  color: var(--accent);
}

.chat-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-item-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.chat-item-time {
  flex: none;
  color: var(--muted-2);
  font-size: 10.5px;
}

.chat-item-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
}

.chat-item.active .chat-item-time,
.chat-item.active .chat-item-preview {
  color: rgba(255, 255, 255, 0.66);
}

.list-empty {
  padding: 28px 18px;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Avatars                                                             */
/* ------------------------------------------------------------------ */

.avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #24303d;
  color: #dfe9f2;
  font-weight: 650;
  user-select: none;
}

.avatar-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 12%;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    145deg,
    hsl(var(--hue, 210) 42% 34%),
    hsl(var(--hue, 210) 45% 22%)
  );
  text-transform: uppercase;
}

.avatar-44 {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.avatar-42 {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.avatar-48 {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

/* ------------------------------------------------------------------ */
/* Main / empty state                                                  */
/* ------------------------------------------------------------------ */

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
}

.empty-state,
.chat-view {
  position: relative;
  z-index: 1;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.empty-glow {
  display: none;
}

.empty-logo {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.empty-logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.empty-state h1 {
  margin: 18px 0 6px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0.1px;
}

.empty-state > p {
  max-width: 380px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: none;
  transition: filter 0.15s ease;
}

.primary-btn:hover {
  filter: brightness(1.08);
}

.primary-btn:active {
  filter: brightness(0.97);
}

.primary-btn:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.55;
  transform: none;
}

.primary-btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.empty-state .empty-hint {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ */
/* Chat view                                                           */
/* ------------------------------------------------------------------ */

.chat-view {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #0e161e;
}

.chat-view::before {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: -2;
  pointer-events: none;
  background-color: #0e161e;
  background-image: url("/backgrounds/telegram-dark.jpg");
  background-repeat: repeat;
  background-position: center;
  background-size: 380px auto;
  transform: rotate(-7deg);
  opacity: 0.38;
}

.chat-view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 14, 20, 0.5), rgba(9, 14, 20, 0.2) 40%, rgba(9, 14, 20, 0.52));
}

@media (min-width: 600px) {
  .chat-view::before {
    background-size: 460px auto;
  }
}

@media (min-width: 1024px) {
  .chat-view::before {
    background-size: 520px auto;
  }
}

.chat-header {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 25, 34, 0.94);
}

.back-btn {
  display: none;
  margin-left: -6px;
}

.chat-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-name {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sub.typing {
  color: var(--accent);
}

.chat-menu-wrap,
.account-wrap {
  position: relative;
  flex: none;
}

.auth-modal {
  width: min(400px, 100%);
}

.dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #1f2b38;
  box-shadow: var(--shadow);
  animation: pop 0.14s ease;
}

.dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.dropdown button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dropdown button.danger {
  color: var(--danger);
}

.dropdown .icon {
  width: 17px;
  height: 17px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 16px clamp(12px, 5vw, 56px) 14px;
  overscroll-behavior: contain;
}

.date-divider {
  align-self: center;
  margin: 12px 0 10px;
  padding: 4px 11px;
  border-radius: 20px;
  background: #1c2733;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.msg-row {
  display: flex;
  margin: 2px 0;
}

.msg-row.out {
  justify-content: flex-end;
}

.bubble {
  position: relative;
  max-width: min(74%, 600px);
  padding: 9px 13px 8px;
  border-radius: 16px 16px 16px 6px;
  background: var(--in);
  color: var(--text);
  animation: msgIn 0.12s ease;
}

.msg-row.out .bubble {
  border-radius: 16px 16px 6px 16px;
  background: var(--out);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bubble-text {
  overflow-wrap: anywhere;
  font-size: 14.8px;
  line-height: 1.52;
  white-space: normal;
}

.bubble-text em {
  color: #c6d5e2;
  font-style: italic;
}

.msg-row.out .bubble-text em {
  color: #d8e8f5;
}

.bubble-text strong {
  font-weight: 650;
}

.bubble-text code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.92em;
}

.bubble-text a {
  color: #8fd0ff;
  text-decoration: none;
}

.bubble-text a:hover {
  text-decoration: underline;
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 2px;
  color: rgba(233, 237, 240, 0.45);
  font-size: 10.3px;
  line-height: 1;
  user-select: none;
}

.bubble-meta .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.msg-row.out .bubble-meta .icon {
  color: #9fd8ff;
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8da3b5;
  animation: typing 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.notice {
  align-self: center;
  max-width: min(88%, 560px);
  margin: 8px 0;
  padding: 9px 12px;
  border: 1px solid rgba(241, 106, 106, 0.25);
  border-radius: 10px;
  background: rgba(60, 26, 30, 0.55);
  color: #f0b5b5;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.notice button {
  margin-top: 7px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(241, 106, 106, 0.18);
  color: #ffd3d3;
  font-size: 12px;
  font-weight: 600;
}

.notice button:hover {
  background: rgba(241, 106, 106, 0.28);
}

/* ------------------------------------------------------------------ */
/* Composer                                                            */
/* ------------------------------------------------------------------ */

.composer {
  flex: none;
  padding: 10px clamp(10px, 4vw, 54px) 12px;
  border-top: 1px solid var(--border);
  background: rgba(17, 25, 34, 0.96);
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.composer-box:focus-within {
  border-color: rgba(77, 163, 224, 0.55);
  background: #202c39;
}

.composer-box textarea {
  flex: 1;
  min-height: 34px;
  max-height: 140px;
  padding: 8px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14.8px;
  line-height: 1.45;
  overflow-y: auto;
  resize: none;
  scrollbar-width: thin;
}

.composer-box textarea::placeholder {
  color: var(--muted-2);
}

.send-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  box-shadow: none;
  transition: filter 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.send-btn:hover {
  filter: brightness(1.08);
}

.send-btn:active {
  transform: scale(0.96);
}

.send-btn:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.45;
  transform: none;
}

.send-btn .icon {
  width: 19px;
  height: 19px;
  margin-left: 1px;
  stroke-width: 2.6;
}

.composer-hint {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 12, 0.68);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #151f29;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 6px 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.1px;
}

.modal-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.modal-body {
  padding: 8px 20px 20px;
}

.field {
  margin-top: 13px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  color: #b5c4d1;
  font-size: 12.5px;
  font-weight: 600;
}

.req {
  color: var(--accent);
}

.optional {
  color: var(--muted-2);
  font-weight: 400;
}

.field input[type="text"],
.field input[type="url"],
.field input:not([type]),
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: #242f3d;
  color: var(--text);
  font-size: 13.5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.field textarea {
  min-height: 62px;
  max-height: 140px;
  line-height: 1.45;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: #3b6384;
  background: #26333f;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
}

.form-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(241, 106, 106, 0.25);
  border-radius: 8px;
  background: rgba(60, 26, 30, 0.5);
  color: #f0b5b5;
  font-size: 12px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.ghost-btn {
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.modal-actions .primary-btn {
  min-width: 130px;
}

.create-progress {
  padding: 20px 24px 32px;
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 10px auto 18px;
  border: 3px solid rgba(94, 181, 247, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
}

.progress-text {
  min-height: 19px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.progress-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

/* ------------------------------------------------------------------ */
/* Toast / scrollbars / responsive                                     */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  max-width: min(92vw, 460px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: #202c39;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(241, 106, 106, 0.3);
  color: #ffc9c9;
}

.toast.success {
  border-color: rgba(79, 214, 139, 0.28);
}

.chat-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.composer-box textarea::-webkit-scrollbar {
  width: 8px;
}

.chat-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.composer-box textarea::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  background-clip: padding-box;
}

.chat-list::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track,
.composer-box textarea::-webkit-scrollbar-track {
  background: transparent;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    border: 0;
  }

  .sidebar {
    border-right: 0;
  }

  .main {
    display: none;
  }

  .app.chat-open .sidebar {
    display: none;
  }

  .app.chat-open .main {
    display: flex;
  }

  .back-btn {
    display: inline-flex;
  }

  .chat-header {
    padding-left: 8px;
  }

  .messages {
    padding: 12px 12px 10px;
  }

  .bubble {
    max-width: 86%;
  }

  .bubble-text {
    font-size: 15px;
  }

  .composer {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .composer-hint {
    display: none;
  }

  .toast {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .empty-state {
    padding: 24px;
  }

  .empty-state h1 {
    font-size: 23px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal {
    max-height: calc(100dvh - 16px);
  }

  .modal-header {
    padding: 14px 14px 4px 16px;
  }

  .modal-body {
    padding: 6px 16px 18px;
  }
}

@media (max-width: 420px) {
  .empty-state > p {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
