:root {
  color-scheme: light;
  --page: #f7f8fb;
  --sidebar: #f1f3f7;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --line: #e5e9f0;
  --line-strong: #d7dce6;
  --text: #18212f;
  --muted: #687486;
  --blue: #2f6df6;
  --blue-dark: #1f55d9;
  --teal: #16b8a6;
  --code-bg: #101623;
  --shadow: 0 20px 60px rgba(31, 50, 86, 0.08);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --page: #101318;
  --sidebar: #151922;
  --card: #1b202b;
  --card-soft: #202633;
  --line: #2c3444;
  --line-strong: #3a4558;
  --text: #edf2f7;
  --muted: #a3adba;
  --blue: #6a93ff;
  --blue-dark: #94b0ff;
  --teal: #34d2c0;
  --code-bg: #090c12;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

body[data-theme="ocean"] {
  color-scheme: dark;
  --page: #0b1320;
  --sidebar: #0f1b2c;
  --card: #132338;
  --card-soft: #162a44;
  --line: #24415f;
  --line-strong: #31527a;
  --text: #edf6ff;
  --muted: #9bb6d2;
  --blue: #49a6ff;
  --blue-dark: #82c5ff;
  --teal: #3dd6c6;
  --code-bg: #08111d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body[data-theme="emerald"] {
  color-scheme: dark;
  --page: #0d1513;
  --sidebar: #111d1a;
  --card: #172522;
  --card-soft: #1b2d29;
  --line: #29433d;
  --line-strong: #355650;
  --text: #eefaf6;
  --muted: #9dc1b8;
  --blue: #2fc79a;
  --blue-dark: #6de0bb;
  --teal: #79e7d4;
  --code-bg: #0a1210;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

body[data-theme="sunset"] {
  color-scheme: dark;
  --page: #1a1214;
  --sidebar: #22171a;
  --card: #2b1d22;
  --card-soft: #332229;
  --line: #4a3139;
  --line-strong: #5b3d47;
  --text: #fff1f3;
  --muted: #d1a8b0;
  --blue: #ff6b8a;
  --blue-dark: #ff9bb0;
  --teal: #ffb86b;
  --code-bg: #140c0e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"],
body[data-theme="ocean"],
body[data-theme="emerald"],
body[data-theme="sunset"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(106, 147, 255, 0.1), transparent 30rem),
    var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar {
  padding: 20px 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 255, 0.92)),
    var(--sidebar);
}

body[data-theme="dark"] .sidebar,
body[data-theme="ocean"] .sidebar,
body[data-theme="emerald"] .sidebar,
body[data-theme="sunset"] .sidebar {
  background:
    linear-gradient(180deg, rgba(22, 27, 38, 0.96), rgba(18, 23, 34, 0.96)),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.brand-mark,
.welcome-mark {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 12px 24px rgba(47, 109, 246, 0.18);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 17px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 10px 30px rgba(31, 50, 86, 0.05);
}

.new-chat span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
}

body[data-theme="dark"] .new-chat span {
  background: rgba(106, 147, 255, 0.16);
}

.chat-history {
  min-height: 0;
}

.chat-list {
  display: grid;
  gap: 6px;
}

.chat-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 4px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
}

.chat-list-row:hover,
.chat-list-row.active {
  border-color: var(--line);
  background: var(--card);
}

.chat-list-item {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.chat-delete-btn,
.chat-rename-btn {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
}

.chat-list-row:hover .chat-delete-btn,
.chat-list-row:hover .chat-rename-btn,
.chat-list-row.active .chat-delete-btn,
.chat-list-row.active .chat-rename-btn {
  opacity: 1;
}

.chat-delete-btn:hover {
  background: rgba(255, 91, 91, 0.1);
  color: #d44;
}

.chat-rename-btn:hover {
  background: rgba(47, 109, 246, 0.1);
  color: var(--blue);
}

.sidebar-spacer {
  flex: 1 1 auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-footer button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: default;
}

.sidebar-footer svg,
.chat-rename-btn svg,
.chat-delete-btn svg,
.copy-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.panel {
  display: grid;
  gap: 10px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topic-list,
.topic-form {
  display: grid;
  gap: 8px;
}

.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.topic-item:hover {
  border-color: var(--line);
  background: var(--card);
}

.topic-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-item small {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8eef8;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

textarea {
  min-height: 118px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 109, 246, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.1);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.send-btn {
  border: 0;
  cursor: pointer;
}

.primary-btn {
  min-height: 42px;
  border-radius: 12px;
  background: #202938;
  color: #ffffff;
  font-weight: 750;
}

.primary-btn:hover {
  background: #151c28;
}

.ghost-btn,
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}

.ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-weight: 800;
}

.chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 109, 246, 0.09), transparent 29rem),
    var(--page);
}

.chat {
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 109, 246, 0.16), transparent 24rem),
    linear-gradient(180deg, rgba(228, 238, 255, 0.72), rgba(247, 248, 251, 0.38) 24%, rgba(247, 248, 251, 0)),
    var(--page);
}

body[data-theme="dark"] .chat,
body[data-theme="ocean"] .chat,
body[data-theme="emerald"] .chat,
body[data-theme="sunset"] .chat {
  background:
    radial-gradient(circle at 50% 0%, rgba(106, 147, 255, 0.18), transparent 24rem),
    linear-gradient(180deg, rgba(28, 38, 58, 0.52), rgba(16, 19, 24, 0.22) 24%, rgba(16, 19, 24, 0)),
    var(--page);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 14px 28px;
  flex-shrink: 0;
}

.chat-header {
  min-height: 84px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(47, 109, 246, 0.1);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  letter-spacing: 0;
}

.chat-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

body[data-theme="dark"] .theme-toggle,
body[data-theme="ocean"] .theme-toggle,
body[data-theme="emerald"] .theme-toggle,
body[data-theme="sunset"] .theme-toggle {
  background: rgba(27, 32, 43, 0.82);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 14px 28px 22px;
  scroll-behavior: smooth;
}

.messages {
  padding: 18px 24px 18px;
}

.welcome {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  width: min(760px, 100%);
  min-height: 58vh;
  margin: 0 auto;
  text-align: center;
}

.welcome {
  width: min(780px, 100%);
  min-height: auto;
  padding-top: 18px;
  align-content: start;
  gap: 18px;
}

.welcome.hidden {
  display: none;
}

.welcome-mark {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  font-size: 27px;
}

.welcome h2 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 760;
  letter-spacing: 0;
}

.welcome p {
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.quick-prompts {
  justify-content: center;
  max-width: 720px;
}

.quick-prompts button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #314056;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 10px 30px rgba(31, 50, 86, 0.05);
}

body[data-theme="dark"] .quick-prompts button {
  background: rgba(27, 32, 43, 0.86);
  color: var(--text);
}

.quick-prompts button:hover {
  border-color: rgba(47, 109, 246, 0.28);
  color: var(--blue-dark);
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: min(820px, 100%);
  margin: 0 auto;
  animation: message-in 220ms ease-out both;
}

.message {
  width: min(760px, 100%);
}

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

.message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.message.user .avatar {
  grid-column: 2;
  background: #dce7ff;
  border-color: #cbd9ff;
}

body[data-theme="dark"] .message.user .avatar {
  background: #24314a;
  border-color: #344868;
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  max-width: min(680px, 100%);
  border-color: #d5e1fb;
  background: #eef4ff;
  color: #182a4a;
}

body[data-theme="dark"] .message.user .bubble {
  border-color: #334867;
  background: #202b3e;
  color: var(--text);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #cfdcf7;
  border-radius: 11px;
  background: linear-gradient(135deg, #edf4ff, #e8fbf8);
}

body[data-theme="dark"] .avatar {
  border-color: #344868;
  background: linear-gradient(135deg, #24314a, #1c3a3a);
}

.avatar::before {
  content: "N";
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.message.user .avatar::before {
  content: "U";
}

.bubble {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 17px;
  color: #202938;
  line-height: 1.62;
  white-space: pre-wrap;
  box-shadow: 0 12px 36px rgba(31, 50, 86, 0.06);
}

body[data-theme="dark"] .bubble {
  background: rgba(27, 32, 43, 0.92);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.bubble strong {
  color: var(--blue-dark);
  font-weight: 780;
}

.bubble code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #eef2f8;
  color: #12315f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

body[data-theme="dark"] .bubble code {
  background: #111723;
  color: #d7e5ff;
}

.bubble pre {
  overflow: auto;
  margin: 12px 0 0;
  padding: 15px;
  border: 1px solid #202b3f;
  border-radius: 13px;
  background: var(--code-bg);
  color: #e9f2ff;
  white-space: pre;
}

.bubble pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
}

.typing {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1s infinite ease-in-out;
}

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

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

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto 16px;
  padding: 10px;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: sticky;
  bottom: 0;
  z-index: 5;
  flex-shrink: 0;
}

body[data-theme="dark"] .composer,
body[data-theme="ocean"] .composer,
body[data-theme="emerald"] .composer,
body[data-theme="sunset"] .composer {
  background: rgba(27, 32, 43, 0.92);
}

.composer input {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.composer input:focus {
  box-shadow: none;
}

.attach-btn,
.send-btn {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.attach-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
}

.attach-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.attach-btn:hover {
  border-color: rgba(47, 109, 246, 0.28);
  color: var(--blue-dark);
}

.send-btn:hover {
  background: var(--blue-dark);
}

body[data-theme="dark"] .attach-btn,
body[data-theme="ocean"] .attach-btn,
body[data-theme="emerald"] .attach-btn,
body[data-theme="sunset"] .attach-btn {
  background: rgba(27, 32, 43, 0.82);
}

.attachment-tray {
  width: min(760px, calc(100% - 40px));
  margin: -10px auto 14px;
}

.composer-hint {
  width: min(760px, calc(100% - 40px));
  margin: -4px auto 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 36px rgba(31, 50, 86, 0.06);
}

body[data-theme="dark"] .attachment-chip,
body[data-theme="ocean"] .attachment-chip,
body[data-theme="emerald"] .attachment-chip,
body[data-theme="sunset"] .attachment-chip {
  background: rgba(27, 32, 43, 0.92);
}

.attachment-chip img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.attachment-chip-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-chip-meta strong {
  font-size: 13px;
}

.attachment-chip-meta span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.user-attachment {
  margin-bottom: 10px;
}

.user-attachment img {
  display: block;
  max-width: min(280px, 100%);
  border-radius: 14px;
}

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

body.is-dragging-image::after {
  content: "Отпустите фото, чтобы прикрепить";
  position: fixed;
  inset: 22px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(47, 109, 246, 0.46);
  border-radius: 24px;
  background: rgba(47, 109, 246, 0.08);
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 700;
  z-index: 60;
  pointer-events: none;
}

.copy-btn {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-top: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.copy-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

body[data-theme="dark"] .copy-btn,
body[data-theme="ocean"] .copy-btn,
body[data-theme="emerald"] .copy-btn,
body[data-theme="sunset"] .copy-btn {
  background: #151b26;
}

.copy-all-btn {
  display: inline-grid;
  width: fit-content;
}

.copy-all-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(47, 109, 246, 0.12);
}

body[data-theme="dark"] .copy-all-row,
body[data-theme="ocean"] .copy-all-row,
body[data-theme="emerald"] .copy-all-row,
body[data-theme="sunset"] .copy-all-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 20, 30, 0.34);
  backdrop-filter: blur(8px);
}

.chat-modal-card {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.chat-modal-card h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.delete-popover {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 20, 30, 0.34);
  backdrop-filter: blur(8px);
}

.delete-popover-card {
  display: grid;
  gap: 10px;
  width: min(340px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.delete-popover-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.danger-btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: #df4b4b;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.admin-editor {
  display: grid;
  gap: 10px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-note {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat {
    min-height: 62vh;
  }

  .chat-header {
    min-height: 66px;
    padding: 14px 18px 10px;
  }

  .messages {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer {
    width: calc(100% - 28px);
  }
}

@media (max-width: 640px) {
  .chat-header {
    padding: 12px 16px;
  }

  .messages {
    padding: 10px 14px 18px;
  }

  .welcome {
    min-height: 48vh;
  }

  .welcome h2 {
    font-size: 30px;
  }

  .message {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .message.user {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .bubble {
    border-radius: 14px;
    padding: 13px 14px;
  }

  .composer {
    width: calc(100% - 28px);
    margin-bottom: 14px;
  }

  .attachment-tray {
    width: calc(100% - 28px);
  }

  .composer-hint {
    width: calc(100% - 28px);
  }
}
