:root {
  --bg: #212121;
  --bg-elevated: #171717;
  --bg-soft: #2a2a2a;
  --panel: #2f2f2f;
  --panel-strong: #343541;
  --panel-hover: #3a3b47;
  --line: #3f4047;
  --line-soft: #2c2d34;
  --text: #ececf1;
  --muted: #a9a9b3;
  --muted-strong: #c3c3cc;
  --accent: #10a37f;
  --accent-soft: rgba(16, 163, 127, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --success-soft: rgba(16, 163, 127, 0.14);
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(180deg, #202123, #1b1c20 45%, #191a1d);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
  z-index: 20;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--line-soft);
  z-index: 30;
}

.sidebar-top,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.sidebar-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-card,
.sidebar-section,
.workspace-top,
.composer-shell,
.workspace-edit-card {
  border: 1px solid var(--line-soft);
  background: rgba(37, 38, 45, 0.92);
  box-shadow: var(--shadow);
}

.brand-card,
.sidebar-section,
.workspace-top,
.composer-shell,
.workspace-edit-card,
.message-card,
.stat-tile,
.mini-stat,
.usage-card,
.user-card,
.session-state,
.client-alert,
.client-success,
.empty-placeholder,
.quick-pill {
  border-radius: var(--radius-lg);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.brand-mark,
.hero-orb {
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #d7d8e1 100%);
  color: #111215;
  font-weight: 700;
}

.brand-mark {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.hero-orb {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  font-size: 18px;
}

.brand-copy h1,
.workspace-top h2,
.empty-state h3,
.thread-head h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy h1 {
  font-size: 20px;
}

.eyebrow,
.thread-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.new-chat-btn,
.provider-button,
.primary-btn,
.secondary-btn,
.mini-btn,
.conversation-item,
.quick-pill {
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.new-chat-btn,
.primary-btn,
.secondary-btn,
.provider-button {
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
}

.new-chat-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.new-chat-btn:hover,
.provider-button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.conversation-item:hover,
.quick-pill:hover {
  transform: translateY(-1px);
}

.new-chat-btn:hover,
.provider-button:hover,
.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-section {
  padding: 14px;
}

.chat-list-card {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-head,
.thread-head,
.usage-row,
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ghost-link,
.mini-btn {
  color: var(--muted-strong);
  text-decoration: none;
}

.mini-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.conversation-item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.conversation-item.active {
  background: var(--panel-strong);
  border-color: var(--line);
}

.conversation-title {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.conversation-preview,
.conversation-meta,
.card-copy,
.hero-subcopy,
.session-state,
.tiny-note,
.composer-hint,
.user-copy span,
.usage-row span,
.usage-row strong {
  color: var(--muted);
}

.conversation-preview,
.conversation-meta {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.conversation-meta {
  margin-top: 6px;
}

.server-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.card-copy,
.hero-subcopy {
  margin: 0;
  line-height: 1.6;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-stat,
.stat-tile,
.usage-card,
.user-card,
.session-state,
.empty-placeholder {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.mini-stat {
  padding: 12px;
}

.mini-stat span,
.stat-tile span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.mini-stat strong,
.stat-tile strong {
  font-size: 13px;
  color: var(--text);
}

.session-state,
.client-alert,
.client-success,
.empty-placeholder {
  padding: 12px 14px;
}

.client-alert {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.client-success {
  background: var(--success-soft);
  border: 1px solid rgba(16, 163, 127, 0.18);
  color: #c7f9eb;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-top: 14px;
}

.avatar-ring {
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #8c8f99);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
  background: #2d2d32;
}

.user-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-copy strong {
  font-size: 14px;
}

.user-meta,
.user-copy span {
  font-size: 11px;
}

.usage-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-top: 14px;
}

.usage-row {
  font-size: 12px;
}

.auth-block {
  margin-top: 16px;
}

.auth-title {
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-button,
.secondary-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
}

.secondary-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.provider-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.provider-split span:first-child,
.provider-split span:last-child {
  height: 1px;
  background: var(--line-soft);
}

.email-login {
  display: grid;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #1f2025;
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.primary-btn {
  border: 0;
  padding: 0 18px;
  background: #ffffff;
  color: #111215;
  font-weight: 600;
}

.secondary-btn {
  padding: 0 18px;
}

.wide {
  width: 100%;
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.sidebar-actions {
  margin-top: 14px;
}

.compact-auth-card {
  position: relative;
  padding: 8px;
  overflow: visible;
}

.account-toggle-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.account-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-toggle-copy strong {
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
}

.account-toggle-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.account-toggle-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mini-plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted-strong);
  font-size: 11px;
}

.account-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-height: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.account-toggle-btn.open .account-caret {
  color: var(--text);
}

.account-panel {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 10px);
  z-index: 12;
  width: min(340px, calc(100vw - 48px));
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(20, 22, 28, 0.96);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 12px;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 28px 24px;
}

.workspace-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 14px 18px;
}

.workspace-top h2 {
  font-size: clamp(30px, 4vw, 40px);
}

.workspace-copy {
  max-width: 760px;
}

.top-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 10px;
}

.stat-tile {
  padding: 12px;
}

.empty-state,
.thread-panel {
  flex: 1;
  min-height: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 32px 0 20px;
}

.empty-shell {
  width: min(760px, 100%);
  text-align: center;
}

.empty-state h3 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

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

.quick-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
}

.thread-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 0 8px;
}

.thread-head {
  width: min(820px, 100%);
  margin: 0 auto 12px;
}

.thread-head h3 {
  font-size: 22px;
}

.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mini-action-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  cursor: pointer;
}

.mini-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.message-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.message-card {
  width: min(820px, 100%);
  margin: 0 auto 14px;
  border: 1px solid var(--line-soft);
  background: rgba(52, 53, 65, 0.74);
  padding: 16px 18px;
}

.message-card.user {
  background: rgba(255, 255, 255, 0.04);
}

.message-card.assistant {
  background: rgba(52, 53, 65, 0.9);
}

.message-card.pending {
  border-style: dashed;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.message-role {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.message-time {
  color: var(--muted);
}

.message-body {
  line-height: 1.75;
}

.message-body > :first-child {
  margin-top: 0;
}

.message-body > :last-child {
  margin-bottom: 0;
}

.message-paragraph {
  margin: 0 0 12px;
  color: var(--text);
  white-space: pre-wrap;
}

.code-block {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #16171c;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.code-lang {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-code-btn,
.message-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  text-decoration: none;
}

.copy-code-btn:hover,
.message-tool-btn:hover,
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.code-content {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  color: #e5e7eb;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
}

.message-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.meta-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.composer-shell {
  position: sticky;
  bottom: 12px;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 10px;
}

.composer-shell.dragover {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.composer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-hidden {
  display: none !important;
}

.badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
}

.badge-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  cursor: pointer;
}

.badge-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.badge.muted {
  color: var(--muted);
}

.composer-field {
  display: block;
}

.composer-field textarea {
  min-height: 48px;
  background: #22232a;
  max-height: 170px;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 13px;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.compact-toolbar {
  justify-content: flex-end;
}

.composer-mini-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.composer-tool-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.compact {
  min-height: 28px;
  padding: 0 9px;
  font-size: 10.5px;
}

.attachment-tray {
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.attachment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.attachment-drop-copy {
  color: var(--muted);
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.attachment-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.attachment-file {
  display: grid;
  gap: 8px;
}

.attachment-file strong {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.attachment-file span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.attachment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attachment-ext {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.attachment-remove {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
}

.attachment-remove:hover {
  background: rgba(255, 255, 255, 0.08);
}

.workspace-config {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.workspace-config-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-config-copy {
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.65;
}

.composer-actions {
  margin-top: 8px;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.composer-notice,
.composer-meta {
  font-size: 12px;
}

.composer-notice {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
}

.composer-notice.error {
  border-color: rgba(239, 68, 68, 0.22);
  background: var(--danger-soft);
  color: #fecaca;
}

.composer-notice.success {
  border-color: rgba(16, 163, 127, 0.24);
  background: var(--success-soft);
  color: #c7f9eb;
}

.composer-notice.info {
  color: var(--muted-strong);
}

.composer-meta {
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
}

.composer-hint {
  font-size: 11px;
  line-height: 1.5;
}

.composer-mode-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.workspace-edit-card {
  width: min(820px, 100%);
  margin: 18px auto 8px;
  padding: 18px;
}

.workspace-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.workspace-picker-row,
.workspace-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.file-dropzone,
.picked-files-summary {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.6;
}

.file-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.picked-files-summary {
  color: var(--muted-strong);
  white-space: pre-wrap;
}

.workspace-check-row {
  color: var(--muted-strong);
  font-size: 13px;
}

.workspace-check-row input {
  width: auto;
}

.workspace-edit-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  white-space: pre-wrap;
  line-height: 1.7;
}

.workspace-edit-result a {
  color: var(--text);
}

.workspace-warning-block {
  margin-bottom: 12px;
  border-radius: 12px;
  white-space: pre-wrap;
}

.sidebar-toggle-btn {
  display: none;
  min-height: 38px;
  margin: 0 0 10px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 2px;
}

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(360px, 88vw);
    transform: translateX(-102%);
    transition: transform 180ms ease;
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
    overflow-y: auto;
  }

  .client-app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    min-height: auto;
  }

  .sidebar-toggle-btn,
  .sidebar-mobile-head {
    display: flex;
  }
}

@media (max-width: 860px) {
  .workspace {
    padding: 16px;
  }

  .workspace-top,
  .top-stats,
  .quick-grid,
  .sidebar-bottom,
  .workspace-edit-grid {
    grid-template-columns: 1fr;
  }

  .composer-actions,
  .thread-head,
  .section-head,
  .composer-toolbar,
  .attachment-head {
    align-items: flex-start;
  }

  .composer-actions,
  .composer-toolbar {
    flex-direction: column;
  }

  .thread-head,
  .composer-footer {
    flex-direction: column;
  }

  .account-panel {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .thread-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .sidebar,
  .workspace {
    padding: 12px;
  }

  .brand-card,
  .sidebar-section,
  .workspace-top,
  .composer-shell,
  .message-card {
    border-radius: 14px;
  }

  .quick-pill {
    padding: 14px;
  }
}
