:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 30px;
  --space-7: 38px;
  --space-8: 52px;
  --space-9: 68px;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --pill-radius: 999px;
  --control-height-sm: 32px;
  --control-height-md: 38px;
  --control-height-lg: 44px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --button-pad-x: 14px;
  --sidebar-width: 296px;
  --content-max: 1016px;
  --composer-height: 54px;
  --bg: #0a0d12;
  --bg-layer: #0e1218;
  --surface-1: rgba(13, 17, 24, 0.58);
  --surface-2: rgba(15, 20, 28, 0.8);
  --surface-3: rgba(255, 255, 255, 0.012);
  --surface-4: rgba(255, 255, 255, 0.024);
  --border-subtle: rgba(255, 255, 255, 0.032);
  --border-strong: rgba(255, 255, 255, 0.058);
  --text-primary: #f6f7fb;
  --text-secondary: rgba(246, 247, 251, 0.64);
  --text-muted: rgba(246, 247, 251, 0.34);
  --text-faint: rgba(246, 247, 251, 0.24);
  --nav-hover: rgba(255, 255, 255, 0.026);
  --nav-active: rgba(255, 255, 255, 0.042);
  --accent: #f6f7fb;
  --accent-ink: #0a0d12;
  --assistant-tint: rgba(137, 179, 255, 0.08);
  --user-tint: rgba(255, 255, 255, 0.06);
  --focus-ring: 0 0 0 2px rgba(137, 179, 255, 0.09);
  --shadow-panel: 0 10px 22px rgba(0, 0, 0, 0.16);
  --shadow-soft: 0 6px 12px rgba(0, 0, 0, 0.1);
  --motion-fast: 120ms cubic-bezier(.2,.6,.2,1);
  --motion-base: 180ms cubic-bezier(.2,.6,.2,1);
  --motion-slow: 260ms cubic-bezier(.2,.6,.2,1);
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(112, 146, 216, 0.065), transparent 20%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.018), transparent 16%),
    linear-gradient(180deg, #0b0e14 0%, #090c11 100%);
  color: var(--text-primary);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: opacity var(--motion-slow), transform var(--motion-slow);
}

.shell-mobile-overlay,
.shell-mobile-menu,
.shell-mobile-title {
  display: none;
}

.shell-sidebar {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-6) - 4px);
  padding: 28px 14px 14px;
  background:
    linear-gradient(180deg, rgba(10, 13, 19, 0.94), rgba(9, 12, 18, 0.9));
  border-right: 1px solid rgba(255,255,255,0.018);
  backdrop-filter: blur(14px);
}

.shell-brand {
  display: grid;
  gap: var(--space-3);
}

.shell-brand-row,
.shell-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.shell-logo {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.shell-beta,
.shell-topbar-label,
.shell-sidebar-label,
.shell-page-kicker,
.shell-empty-kicker,
.shell-thread-eyebrow,
.shell-module-eyebrow,
.shell-sidebar-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.shell-beta,
.shell-page-badge,
.shell-thread-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.025);
  border-radius: var(--pill-radius);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.012);
}

.shell-action,
.shell-nav-item,
.shell-thread,
.shell-suggestion {
  cursor: pointer;
  text-decoration: none;
}

.shell-action,
.shell-nav-item,
.shell-thread,
.shell-suggestion,
.shell-inline-action,
.shell-composer-icon,
.shell-send {
  transition:
    background var(--motion-base),
    color var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-base),
    transform var(--motion-fast),
    opacity var(--motion-fast);
}

.shell-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height-lg);
  padding: 0 calc(var(--button-pad-x) + 2px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #fbfcff, #e9edf5);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: -0.015em;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.14);
  transition: transform var(--motion-fast), box-shadow var(--motion-base), border-color var(--motion-fast), background var(--motion-base);
}

.shell-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.shell-action:active {
  transform: translateY(1px) scale(0.995);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
}

.shell-nav {
  display: grid;
  gap: 1px;
}

.shell-nav-item {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 570;
  letter-spacing: -0.01em;
  transition: background var(--motion-base), color var(--motion-fast), border-color var(--motion-fast), padding-left var(--motion-base), box-shadow var(--motion-base);
  border: 0;
  border-left: 0;
}

.shell-nav-item:hover {
  background: var(--nav-hover);
  color: var(--text-primary);
  padding-left: 14px;
}

.shell-nav-item.is-active {
  background: rgba(255,255,255,0.018);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 rgba(246,247,251,0.92);
}

.shell-nav-item:focus-visible,
.shell-thread:focus-visible,
.shell-suggestion:focus-visible,
.shell-inline-action:focus-visible,
.shell-composer-icon:focus-visible,
.shell-send:focus-visible,
.shell-action:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.shell-sidebar-section {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.016);
}

.shell-search {
  display: block;
}

.shell-search-input {
  width: 100%;
  min-height: var(--control-height-md);
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.024);
  border-radius: var(--pill-radius);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-primary);
  outline: none;
}

.shell-search-input:focus {
  border-color: rgba(137, 179, 255, 0.36);
  box-shadow: var(--focus-ring);
}

.shell-sidebar-label,
.shell-sidebar-meta,
.shell-topbar-label,
.shell-page-kicker,
.shell-empty-kicker,
.shell-thread-eyebrow,
.shell-module-eyebrow {
  color: var(--text-muted);
}

.shell-thread-list {
  display: grid;
  gap: 2px;
}

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

.shell-thread {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  width: 100%;
  min-height: 58px;
  padding: 8px 11px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-left: 0;
  color: var(--text-primary);
  transition: border-color var(--motion-fast), background var(--motion-base), transform var(--motion-fast), box-shadow var(--motion-base);
}

.shell-thread:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.014);
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.08);
}

.shell-thread:active {
  transform: translateY(0);
}

.shell-thread.is-active {
  background: rgba(137, 179, 255, 0.038);
  box-shadow: inset 2px 0 0 rgba(169, 194, 255, 0.86);
}

.shell-thread-status {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.shell-thread.is-active .shell-thread-status {
  background: #9fbcff;
  box-shadow: 0 0 0 3px rgba(159, 188, 255, 0.08);
}

.shell-thread-copy {
  display: grid;
  gap: 4px;
}

.shell-thread-title {
  font-size: 0.88rem;
  font-weight: 610;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-thread-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-thread-stamp {
  font-size: 0.66rem;
  color: var(--text-faint);
  padding-right: 1px;
}

.shell-thread-delete {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--pill-radius);
  background: transparent;
  color: var(--text-faint);
  border: 1px solid transparent;
}

.shell-thread-delete:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.shell-thread-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.shell-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 28px 20px 16px;
}

.shell-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-5);
  margin: 0 auto 6px;
  width: min(100%, var(--content-max));
}

.shell-page-greeting {
  margin: 0;
  font-size: clamp(1.38rem, 1.82vw, 1.8rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 665;
}

.shell-profile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 9px 7px 11px;
  border: 1px solid rgba(255,255,255,0.028);
  border-radius: var(--pill-radius);
  background: rgba(255, 255, 255, 0.012);
}

.shell-profile-copy {
  display: grid;
  text-align: right;
}

.shell-profile-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.shell-profile-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shell-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--pill-radius);
  font-weight: 800;
}

.shell-avatar,
.shell-message-row.is-user .shell-message-avatar {
  background: linear-gradient(135deg, #f5f7fb, #cdd8f0);
  color: var(--accent-ink);
}

.shell-avatar-ai,
.shell-message-row.is-assistant .shell-message-avatar {
  background: linear-gradient(135deg, #8eb4ff, #6b86cb);
  color: #f8fbff;
}

.shell-page {
  display: grid;
  gap: 0;
  align-content: start;
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

.shell-page-head {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding-top: 28px;
}

.shell-page-intro {
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 640px;
}

.shell-page-title,
.shell-empty-title,
.shell-placeholder-title,
.shell-thread-heading {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.shell-page-title,
.shell-page-support {
  font-size: 0.98rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--text-secondary);
}

.shell-page-copy,
.shell-empty-copy,
.shell-placeholder-copy,
.shell-module-copy,
.shell-message-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.58;
}

.shell-dashboard-surface,
.shell-placeholder-surface {
  display: grid;
  gap: 0;
}

.shell-dashboard-surface {
  min-height: 66vh;
  grid-template-rows: 1fr;
  align-items: center;
}

.shell-empty-state,
.shell-thread-stage,
.shell-placeholder-surface {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.shell-empty-state {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: center;
  min-height: 56vh;
  padding: 18px 18px 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 56%, rgba(137, 179, 255, 0.12), transparent 18%);
}

.shell-inline-prompt-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.shell-inline-prompt {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.shell-inline-prompt:hover {
  color: var(--text-primary);
}

.shell-inline-prompt + .shell-inline-prompt::before {
  content: "/";
  margin-right: 10px;
  color: var(--text-faint);
}

.shell-composer-slot {
  width: 100%;
  display: grid;
  justify-items: center;
}

.shell-thread-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 64vh;
  max-height: none;
  padding: 6px 0 0;
}

.shell-thread-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
  width: min(100%, 760px);
  margin: 0 auto;
  padding-bottom: 10px;
}

.shell-thread-actions {
  position: relative;
  display: flex;
  justify-content: end;
  gap: 0;
}

.shell-thread-menu-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
}

.shell-thread-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 144px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  background: rgba(16, 20, 28, 0.98);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  z-index: 10;
}

.shell-thread-menu-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.shell-thread-menu-item:hover {
  background: rgba(255,255,255,0.045);
}

.shell-thread-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 9px 11px;
  margin-bottom: var(--space-3);
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
  border: 0;
  border-left: 2px solid rgba(255,255,255,0.16);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.012);
}

.shell-thread-notice.is-info {
  background: rgba(137, 179, 255, 0.08);
  border-color: rgba(137, 179, 255, 0.18);
}

.shell-thread-notice.is-error {
  background: rgba(255, 173, 173, 0.08);
  border-color: rgba(255, 173, 173, 0.18);
}

.shell-thread-notice-copy {
  color: var(--text-secondary);
  line-height: 1.6;
}

.shell-thread-heading {
  font-size: 1.2rem;
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 640;
}

.shell-thread-subcopy {
  margin: 4px 0 0;
  color: var(--text-muted);
  line-height: 1.4;
  font-size: 0.78rem;
}

.shell-thread-rename {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.shell-thread-rename-input {
  min-height: var(--control-height-md);
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.035);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-primary);
  outline: none;
}

.shell-thread-rename-input:focus {
  border-color: rgba(137, 179, 255, 0.36);
  box-shadow: var(--focus-ring);
}

.shell-thread-scroll {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  width: min(100%, 760px);
  margin: 0 auto;
  padding-right: 0;
  scrollbar-width: thin;
}

.shell-message-list {
  display: grid;
  gap: 7px;
  padding-bottom: 4px;
}

.shell-message-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.shell-message-row.is-user .shell-message-bubble {
  background: var(--user-tint);
}

.shell-message-row.is-assistant .shell-message-bubble {
  background: var(--assistant-tint);
}

.shell-message-row.is-system .shell-message-avatar {
  background: linear-gradient(135deg, #f0c3a6, #d48777);
  color: #1c1010;
}

.shell-message-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.72;
}

.shell-message-bubble {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  box-shadow: none;
}

.shell-message-bubble.is-streaming {
  outline: 1px solid rgba(137, 179, 255, 0.14);
}

.shell-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.shell-message-role {
  font-size: 0.78rem;
  font-weight: 680;
  color: var(--text-primary);
}

.shell-message-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.shell-message-row.is-system .shell-message-bubble {
  background: rgba(255, 173, 173, 0.08);
  outline: 1px solid rgba(255, 173, 173, 0.12);
}

.shell-message-caret {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  animation: shellCaret 1s steps(1) infinite;
}

.shell-typing {
  display: grid;
  grid-template-columns: 28px auto;
  align-items: center;
  gap: 8px;
}

.shell-typing-bubble-wrap {
  display: grid;
  gap: var(--space-2);
}

.shell-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  padding: 12px 14px;
  border-radius: var(--pill-radius);
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(137, 179, 255, 0.06);
}

.shell-typing-bubble span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  animation: shellTyping 1.1s infinite ease-in-out;
}

.shell-typing-bubble span:nth-child(2) {
  animation-delay: 120ms;
}

.shell-typing-bubble span:nth-child(3) {
  animation-delay: 240ms;
}

.shell-typing-copy {
  font-size: 0.74rem;
  color: var(--text-muted);
}

@keyframes shellTyping {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes shellCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.shell-composer-wrap {
  display: grid;
  gap: 5px;
  width: min(100%, 780px);
  margin: 0 auto;
}

.shell-composer-wrap.is-inline-empty {
  width: min(100%, 780px);
  margin-top: 0;
}

.shell-composer-wrap.is-thread-mode {
  width: 100%;
  margin-top: 10px;
}

.shell-composer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 3px;
  min-height: 64px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(21, 26, 37, 0.98), rgba(14, 18, 27, 0.985));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.17);
  transition: border-color var(--motion-fast), box-shadow var(--motion-base), transform var(--motion-fast);
}

.shell-composer:focus-within {
  border-color: rgba(137, 179, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), var(--focus-ring);
}

.shell-composer-icon,
.shell-send {
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.shell-composer-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.008);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.shell-composer-icon:hover {
  background: rgba(255, 255, 255, 0.018);
  border-color: rgba(255,255,255,0.026);
  color: var(--text-primary);
}

.shell-composer-icon svg {
  width: 14px;
  height: 14px;
}

.shell-composer-field {
  min-width: 0;
}

.shell-composer-input {
  display: block;
  width: 100%;
  min-height: 24px;
  max-height: 176px;
  padding: 8px 2px 8px 1px;
  border: 0;
  resize: none;
  overflow: auto;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  line-height: 1.4;
  font-size: 0.98rem;
  letter-spacing: -0.012em;
}

.shell-composer-input::placeholder {
  color: rgba(246, 247, 251, 0.36);
}

.shell-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, #ffffff, #edf1f8);
  color: var(--accent-ink);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
  transition: opacity var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-base), background var(--motion-base);
}

.shell-send svg {
  width: 16px;
  height: 16px;
  transform: translateX(0.5px) translateY(-0.5px);
}

.shell-send:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(255, 255, 255, 0.05);
}

.shell-send:not(:disabled):active {
  transform: translateY(1px) scale(0.992);
}

.shell-send:disabled {
  opacity: 0.18;
  cursor: not-allowed;
  box-shadow: none;
}

.shell-disclaimer {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.shell-disclaimer-dashboard {
  max-width: 620px;
}

.shell-placeholder-surface {
  gap: var(--space-6);
  padding: var(--space-7);
  border-radius: var(--radius-xl);
}

.shell-section {
  display: grid;
  gap: var(--space-4);
}

.shell-section-head {
  display: grid;
  gap: var(--space-1);
}

.shell-section-title,
.shell-stack-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.shell-section-copy,
.shell-stack-copy,
.shell-list-meta,
.shell-summary-label {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.shell-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.shell-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height-md);
  padding: 0 var(--button-pad-x);
  border-radius: var(--pill-radius);
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.shell-inline-action:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255,255,255,0.08);
}

.shell-inline-action-strong {
  background: linear-gradient(180deg, #fbfcff, #edf1f8);
  color: var(--accent-ink);
  border-color: rgba(255,255,255,0.18);
}

.shell-inline-action-ghost {
  width: fit-content;
}

.shell-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.shell-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
}

.shell-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.shell-create-input {
  min-height: var(--control-height-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--pill-radius);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  outline: none;
}

.shell-create-input:focus {
  border-color: rgba(137, 179, 255, 0.36);
  box-shadow: var(--focus-ring);
}

.shell-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.shell-card-stack,
.shell-summary-card {
  padding: var(--space-4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.shell-card-stack {
  align-content: start;
}

.shell-stack-card,
.shell-list-row {
  padding: var(--space-3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}

.shell-stack-card {
  display: grid;
  gap: var(--space-2);
}

.shell-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.shell-chip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height-sm);
  padding: 0 10px;
  border-radius: var(--pill-radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.shell-chip-action:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.shell-list {
  display: grid;
  gap: var(--space-2);
}

.shell-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.shell-list-copy {
  display: grid;
  gap: 4px;
}

.shell-list-title {
  font-weight: 600;
}

.shell-list-detail {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.shell-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.shell-summary-item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.shell-summary-item strong {
  font-size: 1.1rem;
  line-height: 1.3;
}

.shell-placeholder-hero {
  display: grid;
  gap: var(--space-3);
  max-width: 760px;
}

.shell-placeholder-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.shell-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.shell-module-card {
  display: grid;
  gap: var(--space-3);
  min-height: 220px;
  padding: var(--space-4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.shell-module-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.shell-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.shell-settings-card {
  min-height: 200px;
}

.shell-connections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.shell-connection-card {
  min-height: 250px;
}

.shell-connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

.shell-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.shell-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.56);
  backdrop-filter: blur(10px);
}

.shell-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(100%, 480px);
  height: 100%;
  padding: var(--space-5);
  border-left: 1px solid rgba(255,255,255,0.05);
  background: rgba(10, 14, 19, 0.98);
  box-shadow: var(--shadow-panel);
}

.shell-drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
}

.shell-drawer-copy {
  display: grid;
  gap: var(--space-2);
}

.shell-drawer-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.shell-drawer-copy-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.shell-drawer-close {
  display: grid;
  place-items: center;
  width: var(--control-height-md);
  height: var(--control-height-md);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 1.4rem;
  border: 1px solid rgba(255,255,255,0.04);
}

.shell-drawer-body {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  overflow: auto;
}

.shell-drawer-section,
.shell-drawer-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.shell-drawer-grid {
  display: grid;
  gap: var(--space-4);
}

.shell-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.shell-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.shell-status-pill.is-ready {
  background: rgba(143, 214, 169, 0.14);
  color: #bdf0cb;
}

.shell-status-pill.is-placeholder {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.shell-empty-card {
  padding: var(--space-4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  line-height: 1.7;
}

.shell-dashboard-surface[hidden],
.shell-placeholder-surface[hidden],
.shell-empty-state[hidden],
.shell-thread-stage[hidden],
.shell-typing[hidden],
.shell-thread-notice[hidden] {
  display: none;
}

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

  .shell-main {
    padding: var(--space-5);
  }
}

@media (max-width: 920px) {
  .shell-page-head,
  .shell-thread-head {
    flex-direction: column;
    align-items: stretch;
  }

  .shell-message-bubble {
    width: 100%;
  }

  .shell-workspace-grid,
  .shell-settings-grid,
  .shell-summary-grid,
  .shell-connections-grid {
    grid-template-columns: 1fr;
  }

  .shell-create-form {
    grid-template-columns: 1fr;
  }

  .shell-thread-rename {
    grid-template-columns: 1fr;
  }

  .shell-module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.is-mobile-drawer-open {
    overflow: hidden;
  }

  .shell-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 15, 0.44);
    backdrop-filter: blur(3px);
    z-index: 30;
  }

  .stage-shell {
    grid-template-columns: 1fr;
  }

  .shell-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    padding: 14px 10px 12px;
    gap: 14px;
    border-right: 1px solid rgba(255,255,255,0.028);
    transform: translateX(-104%);
    transition: transform var(--motion-base);
    z-index: 40;
    overflow: auto;
  }

  .stage-shell.is-mobile-drawer-open .shell-sidebar {
    transform: translateX(0);
  }

  .shell-brand {
    gap: 8px;
  }

  .shell-action,
  .shell-nav-item,
  .shell-thread,
  .shell-search-input,
  .shell-composer-icon,
  .shell-send {
    min-height: 44px;
  }

  .shell-nav-item {
    padding: 0 10px;
  }

  .shell-thread {
    min-height: 52px;
    padding: 6px 10px;
  }

  .shell-thread-delete {
    width: 32px;
    height: 32px;
  }

  .shell-main {
    padding: 0 12px 14px;
  }

  .shell-topbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 52px;
    margin: 0 -12px 6px;
    padding: 4px 12px 0;
    background: linear-gradient(180deg, rgba(10, 13, 19, 0.9), rgba(10, 13, 19, 0.54) 72%, rgba(10, 13, 19, 0));
  }

  .shell-mobile-menu {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
  }

  .shell-mobile-menu span {
    display: block;
    width: 16px;
    height: 1.5px;
    margin: 1.5px 0;
    border-radius: 999px;
    background: currentColor;
  }

  .shell-mobile-title {
    display: block;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    color: var(--text-secondary);
  }

  .shell-profile {
    justify-self: end;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .shell-profile-copy {
    display: none;
  }

  .shell-avatar {
    width: 34px;
    height: 34px;
  }

  .shell-page-head {
    padding-top: 4px;
    gap: 4px;
  }

  .shell-page-intro,
  .shell-page-intro-dashboard {
    max-width: 100%;
    gap: 4px;
  }

  .shell-page-greeting {
    font-size: 1.22rem;
    line-height: 0.96;
  }

  .shell-page-title,
  .shell-page-support {
    font-size: 0.9rem;
    line-height: 1.32;
  }

  .shell-dashboard-surface {
    min-height: auto;
    align-items: start;
  }

  .shell-empty-state {
    min-height: 0;
    align-content: start;
    padding: 4px 0 0;
    gap: 8px;
    background:
      radial-gradient(circle at 50% 88px, rgba(137, 179, 255, 0.09), transparent 120px);
  }

  .shell-composer-wrap,
  .shell-composer-wrap.is-inline-empty,
  .shell-composer-wrap.is-thread-mode {
    width: 100%;
    margin-top: 0;
  }

  .shell-composer {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    min-height: 70px;
  }

  .shell-composer-icon,
  .shell-send {
    width: 48px;
    height: 48px;
  }

  .shell-composer-input {
    font-size: 16px;
    padding: 10px 2px 10px 1px;
  }

  .shell-disclaimer-dashboard {
    display: none;
  }

  .shell-inline-prompt-row {
    gap: 8px;
    padding: 0 2px;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .shell-thread-stage {
    min-height: calc(100vh - 96px);
    padding: 2px 0 0;
  }

  .shell-thread-head {
    gap: 8px;
    padding-bottom: 8px;
  }

  .shell-thread-scroll {
    gap: 6px;
  }

  .shell-composer-slot {
    justify-items: stretch;
  }

  .shell-thread-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .shell-drawer {
    width: 100%;
    padding: var(--space-5);
  }
}
