:root {
  --bg: #edf2f7;
  --sidebar: #f7fafc;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 23, 42, 0.08);
  --ink: #162032;
  --muted: #6a768b;
  --accent: #1d7dfa;
  --accent-soft: rgba(29, 125, 250, 0.12);
  --assistant: #ffffff;
  --user: linear-gradient(135deg, #1d7dfa, #0f66dc);
  --shadow: 0 28px 70px rgba(31, 47, 72, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(29, 125, 250, 0.12), transparent 24%),
    linear-gradient(180deg, #eef4f9 0%, #f6f9fc 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-copy h1 {
  margin: 0;
  font-size: 2rem;
}

.login-copy p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-btn {
  width: 100%;
  justify-self: stretch;
}

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

.sidebar,
.chat-stage {
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(247, 250, 252, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-head h1 {
  margin: 0;
  font-size: 1.15rem;
}

.sidebar-head-stack {
  display: grid;
  justify-content: stretch;
  gap: 14px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-nav-btn:hover {
  background: rgba(29, 125, 250, 0.08);
}

.sidebar-nav-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f66dc);
  box-shadow: 0 16px 36px rgba(29, 125, 250, 0.22);
}

.sidebar-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar-footer {
  margin-top: auto;
}

.settings-card h3 {
  margin: 0;
}

.new-chat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px dashed rgba(29, 125, 250, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.new-chat-card:hover {
  border-color: rgba(29, 125, 250, 0.5);
  background: rgba(29, 125, 250, 0.06);
  transform: translateY(-1px);
}

.new-chat-card-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: rgba(29, 125, 250, 0.1);
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.new-chat-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.new-chat-card-copy strong {
  display: block;
}

.new-chat-card-copy small {
  color: var(--muted);
}

.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  background: rgba(148, 163, 184, 0.75);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.service-dot.is-pending {
  background: rgba(148, 163, 184, 0.75);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.service-dot.is-up {
  background: #1fab66;
  box-shadow: 0 0 0 4px rgba(31, 171, 102, 0.18);
}

.service-dot.is-down {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.chat-topbar.status-pending {
  border-color: rgba(29, 125, 250, 0.12);
}

.chat-topbar.status-up {
  background: linear-gradient(135deg, rgba(31, 171, 102, 0.12), rgba(255, 255, 255, 0.92));
  border-color: rgba(31, 171, 102, 0.28);
}

.chat-topbar.status-down {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), rgba(255, 255, 255, 0.92));
  border-color: rgba(220, 38, 38, 0.28);
}

.sidebar-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f66dc);
  cursor: pointer;
}

.chat-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.settings-panel {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.settings-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

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

.settings-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.settings-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(23, 35, 54, 0.06);
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.settings-field input,
.settings-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
}

.settings-save-notice {
  margin: 0 auto 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 185, 154, 0.12);
  color: #0f766e;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.settings-save-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-logout-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 14px;
}

.logout-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.logout-icon svg {
  width: 100%;
  height: 100%;
}

.settings-panel .settings-card {
  align-content: start;
}

.accounts-list-card {
  align-content: start;
}

.accounts-list {
  display: grid;
  gap: 12px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.account-row-meta {
  display: grid;
  gap: 4px;
}

.account-row-meta strong {
  font-size: 0.98rem;
}

.account-row-meta small {
  color: var(--muted);
  text-transform: capitalize;
}

.account-password-field {
  min-width: 0;
}

.chat-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 20px;
  background: transparent;
}

.chat-item.active {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(27, 44, 70, 0.08);
}

.chat-item-main,
.chat-delete-btn {
  border: none;
  background: transparent;
  cursor: pointer;
}

.chat-item-main {
  text-align: left;
  padding: 10px 12px;
  min-width: 0;
}

.chat-item-main strong,
.chat-item-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item-main strong {
  color: var(--ink);
}

.chat-item-main small {
  margin-top: 5px;
  color: var(--muted);
}

.chat-delete-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 1.3rem;
}

.chat-delete-btn:hover,
.chat-item-main:hover {
  background: rgba(29, 125, 250, 0.08);
}

.chat-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 24px;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(29, 125, 250, 0.12), transparent 24%),
    linear-gradient(180deg, #eef4f9 0%, #f6f9fc 100%);
}

.main-view {
  min-height: 0;
}

#conversation-view {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

#conversation-view::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 4;
}

#conversation-view::after {
  bottom: 0;
  height: 164px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(
    180deg,
    rgba(246, 249, 252, 0) 0%,
    rgba(246, 249, 252, 0.12) 18%,
    rgba(246, 249, 252, 0.92) 52%,
    rgba(246, 249, 252, 1) 100%
  );
}

.chat-topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 46%,
    rgba(255, 255, 255, 0.68) 78%,
    rgba(255, 255, 255, 0.24) 100%
  );
  border: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(3, 8, 15, 0.045);
  backdrop-filter: blur(26px) saturate(1.7);
  -webkit-backdrop-filter: blur(26px) saturate(1.7);
  isolation: isolate;
  overflow: visible;
}

.topbar-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.chat-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 52%, rgba(255, 255, 255, 0.04) 100%),
    radial-gradient(circle at top left, rgba(126, 168, 255, 0.16), transparent 42%);
  pointer-events: none;
  z-index: -1;
}

.chat-topbar::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(126, 168, 255, 0.32), rgba(173, 198, 238, 0.06));
  pointer-events: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #101828, #2b4160);
}

.topbar-copy h2 {
  margin: 0;
  font-size: 1.15rem;
}

.topbar-copy p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-service-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.service-status-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #9f1239;
  max-width: none;
  white-space: nowrap;
  font-weight: 800;
}

.chat-topbar.status-down .service-status-note {
  color: #991b1b;
}

.gateway-toggle {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.92rem;
}

.memory-toggle {
  gap: 6px;
}

.memory-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  padding: 0;
}

.help-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 26, 41, 0.94);
  color: #f8fbff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 16px 36px rgba(10, 18, 31, 0.24);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 80;
}

.help-chip:hover::after,
.help-chip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.switch-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.gateway-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  transition: background 0.18s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.gateway-toggle input:checked + .toggle-slider {
  background: rgba(29, 125, 250, 0.86);
}

.gateway-toggle input:checked + .toggle-slider::after {
  transform: translateX(26px);
}

.chat-feed {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 176px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 156px 4px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 168, 255, 0.32) transparent;
  clip-path: inset(0 round 32px);
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0,
    transparent 28px,
    rgba(0, 0, 0, 0.18) 52px,
    rgba(0, 0, 0, 0.78) 82px,
    #000 110px,
    #000 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0,
    transparent 28px,
    rgba(0, 0, 0, 0.18) 52px,
    rgba(0, 0, 0, 0.78) 82px,
    #000 110px,
    #000 100%
  );
}

.login-card .status-line {
  display: block !important;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-feed::-webkit-scrollbar {
  width: 7px;
}

.chat-feed::-webkit-scrollbar-thumb {
  background: rgba(126, 168, 255, 0.24);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.message {
  display: flex;
  width: 100%;
  align-items: flex-start;
}

.message-user {
  justify-content: flex-end;
}

.message-assistant {
  justify-content: flex-start;
}

.message-bubble {
  display: inline-flex;
  flex-direction: column;
  width: auto;
  max-width: min(520px, 68%);
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.55;
  box-shadow: 0 18px 44px rgba(23, 35, 54, 0.08);
  word-break: break-word;
  align-self: flex-start;
  position: relative;
}

.message-content {
  white-space: pre-wrap;
}

.message-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.message-copy-btn svg {
  width: 16px;
  height: 16px;
}

.message-bubble:hover .message-copy-btn,
.message-copy-btn:focus-visible,
.message-copy-btn.copied,
.message-copy-btn.copy-failed {
  opacity: 1;
}

.message-copy-btn:hover {
  background: rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
}

.message-copy-btn.copied {
  background: rgba(24, 185, 154, 0.18);
}

.message-copy-btn.copy-failed {
  background: rgba(190, 24, 93, 0.16);
}

.message-user .message-copy-btn {
  background: rgba(255, 255, 255, 0.18);
}

.message-user .message-copy-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.message-user .message-bubble {
  color: #fff;
  background: var(--user);
  border-bottom-right-radius: 8px;
}

.message-assistant .message-bubble {
  background: var(--assistant);
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
}

.message-error .message-bubble {
  background: rgba(190, 24, 93, 0.08);
  border: 1px solid rgba(190, 24, 93, 0.18);
  color: #8f1239;
  box-shadow: 0 12px 28px rgba(190, 24, 93, 0.08);
}

.message-pending .message-bubble {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(126, 168, 255, 0.18);
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(29, 125, 250, 0.52);
  animation: thinkingPulse 1.1s ease-in-out infinite;
}

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

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

@keyframes thinkingPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.38;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.62) 36%,
    rgba(255, 255, 255, 0.94) 58%,
    rgba(255, 255, 255, 0.98) 100%
  );
  border: 1px solid var(--line);
  box-shadow: 0 -8px 18px rgba(3, 8, 15, 0.06);
  backdrop-filter: blur(24px) saturate(1.55);
  -webkit-backdrop-filter: blur(24px) saturate(1.55);
  isolation: isolate;
  overflow: hidden;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.16) 24%, rgba(255, 255, 255, 0.02) 100%),
    radial-gradient(circle at top left, rgba(126, 168, 255, 0.12), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

.composer::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(126, 168, 255, 0.06), rgba(126, 168, 255, 0.34), rgba(173, 198, 238, 0.08));
  pointer-events: none;
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.attach-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.attach-btn:hover {
  background: rgba(29, 125, 250, 0.08);
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 220px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  padding: 8px 10px 0;
}

.attachment-strip,
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-chip,
.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(29, 125, 250, 0.08);
  border: 1px solid rgba(29, 125, 250, 0.12);
}

.attachment-chip-copy,
.attachment-pill {
  min-width: 0;
}

.attachment-chip-copy strong,
.attachment-chip-copy small,
.attachment-pill-name,
.attachment-pill-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip-copy strong,
.attachment-pill-name {
  font-size: 0.92rem;
}

.attachment-chip-copy small,
.attachment-pill-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.attachment-remove {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}

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

.attachment-list-compact {
  margin-bottom: 12px;
}

.attachment-pill {
  padding: 8px 10px;
  gap: 4px;
  flex-direction: column;
  align-items: flex-start;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
}

.send-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f66dc);
  cursor: pointer;
}

.status-line {
  margin: -4px 4px 0;
  min-height: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-line.status-error {
  color: #c73947;
  font-weight: 700;
}

.status-line.status-success {
  color: #14805f;
}

.status-line.status-busy {
  color: #9a6400;
}

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

  .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

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

  .topbar-controls {
    gap: 10px;
  }

  .gateway-toggle {
    font-size: 0.84rem;
  }
}

.empty-state,
.empty-list {
  padding: 22px 18px;
  border-radius: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

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

  .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

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

  .chat-topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .gateway-toggle {
    justify-items: start;
  }
}
