@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #050811;
  --bg-secondary: #0b1018;
  --bg-tertiary: #111827;
  --bg-elevated: rgba(13, 19, 31, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(120, 142, 174, 0.18);
  --border-strong: rgba(84, 223, 199, 0.28);
  --text-primary: #f5f7fb;
  --text-secondary: #aab8cb;
  --text-muted: #7b889c;
  --accent: #19d3c5;
  --accent-strong: #0ce6d0;
  --accent-blue: #4d7cff;
  --success: #41d39f;
  --warning: #f0bc67;
  --error: #ff7d7d;
  --thinking: #93a4ff;
  --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  --font-sans: 'Manrope', 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Manrope', sans-serif;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(24, 211, 197, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(77, 124, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #07101c 0%, #050811 36%, #04070f 100%);
  color: var(--text-primary);
}

.app-container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  isolation: isolate;
}

.app-glow {
  position: absolute;
  inset: auto;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.8;
  z-index: 0;
}

.app-glow-1 {
  top: -120px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: rgba(26, 211, 197, 0.18);
}

.app-glow-2 {
  top: -80px;
  right: -80px;
  width: 380px;
  height: 300px;
  background: rgba(77, 124, 255, 0.18);
}

.header,
.main-content,
.modal-overlay {
  position: relative;
  z-index: 1;
}

.header {
  background: linear-gradient(180deg, rgba(8, 13, 23, 0.96), rgba(8, 13, 23, 0.86));
  border-bottom: 1px solid rgba(120, 142, 174, 0.14);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  backdrop-filter: blur(18px);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(146, 165, 195, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-login-btn,
.auth-quota-pill,
.auth-user-btn,
.auth-logout-btn {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-primary);
  font: 700 12px/1 var(--font-sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.auth-login-btn {
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.95), rgba(77, 124, 255, 0.9));
  color: #041018;
  box-shadow: 0 14px 30px rgba(25, 211, 197, 0.18);
}

.auth-login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-user-btn {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(65, 211, 159, 0.1);
  border-color: rgba(65, 211, 159, 0.22);
  color: #dffcf3;
}

.auth-quota-pill {
  background: rgba(25, 211, 197, 0.08);
  border-color: rgba(25, 211, 197, 0.22);
  color: #d8fffb;
}

.auth-logout-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(146, 165, 195, 0.14);
  color: var(--text-secondary);
}

.auth-login-btn:not(:disabled):hover,
.auth-quota-pill:hover,
.auth-user-btn:hover,
.auth-logout-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 211, 197, 0.34);
}

.model-picker-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: clamp(220px, 22vw, 320px);
  min-width: 220px;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(25, 211, 197, 0.95), rgba(77, 124, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 18px 40px rgba(13, 230, 208, 0.24);
  color: #061018;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-stack > span:first-child {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.model-select,
.settings-btn,
.api-status,
.sandbox-status,
.status-badge {
  border: 1px solid rgba(118, 140, 174, 0.15);
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(14px);
}

.model-select {
  border-radius: 999px;
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  width: 100%;
  min-width: 0;
}

.model-select:focus {
  border-color: var(--border-strong);
}

.model-policy-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 16px;
  border: 1px solid rgba(118, 140, 174, 0.15);
  background: rgba(255,255,255,0.035);
  color: var(--text-secondary);
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

.model-policy-card.is-strong {
  border-color: rgba(25, 211, 197, 0.28);
  background: rgba(13, 44, 47, 0.46);
}

.model-policy-card.is-warning {
  border-color: rgba(255, 183, 77, 0.28);
  background: rgba(51, 33, 10, 0.42);
}

.model-policy-card.is-neutral {
  border-color: rgba(118, 140, 174, 0.2);
}

.model-policy-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

.model-policy-mode {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.model-policy-body {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: none;
  width: min(340px, 84vw);
  padding: 12px 14px;
  border: 1px solid rgba(118, 140, 174, 0.2);
  border-radius: 16px;
  background: rgba(7, 12, 22, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.model-picker-stack:hover .model-policy-body,
.model-picker-stack:focus-within .model-policy-body {
  display: block;
}

.settings-btn {
  border-radius: 999px;
  color: var(--text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.settings-btn:hover {
  color: var(--text-primary);
  border-color: rgba(25, 211, 197, 0.3);
  transform: translateY(-1px);
}

.app-install-btn {
  color: var(--accent);
}

.status-badge,
.api-status,
.sandbox-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.idle,
.api-status.connected,
.sandbox-status.connected {
  color: var(--success);
}

.status-badge.running {
  color: var(--warning);
}

.status-badge.error,
.api-status.disconnected {
  color: var(--error);
}

.sandbox-status.disconnected {
  color: var(--text-muted);
}

.status-dot,
.api-status-dot,
.sandbox-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}

.status-badge.running .status-dot {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.9); }
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-width: 0;
}

.sidebar {
  width: 282px;
  background: rgba(8, 13, 23, 0.82);
  border-right: 1px solid rgba(120, 142, 174, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(16px);
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(120, 142, 174, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.new-chat-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  border: none;
  border-radius: 999px;
  color: #051018;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 14px 30px rgba(11, 221, 203, 0.18);
}

.new-chat-btn:hover {
  transform: translateY(-1px);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chat-item {
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.02);
}

.chat-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(120, 142, 174, 0.12);
  transform: translateY(-1px);
}

.chat-item.active {
  background: linear-gradient(180deg, rgba(25, 211, 197, 0.08), rgba(77, 124, 255, 0.08));
  border-color: rgba(25, 211, 197, 0.18);
}

.chat-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 20px;
}

.chat-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-item-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}

.chat-item:hover .chat-item-delete {
  opacity: 1;
}

.chat-item-delete:hover {
  color: var(--error);
  background: rgba(255, 125, 125, 0.1);
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background:
    radial-gradient(circle at top center, rgba(77, 124, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(10, 16, 28, 0.65), rgba(5, 8, 17, 0));
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(120, 142, 174, 0.1);
  background: rgba(8, 13, 23, 0.45);
  backdrop-filter: blur(14px);
}

.workspace-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.workspace-pill,
.settings-chip,
.mini-inline-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 142, 174, 0.14);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--text-secondary);
}

.workspace-pill-secondary {
  display: none;
}

.activity-banner {
  width: min(980px, calc(100% - 40px));
  margin: 12px auto 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(25, 211, 197, 0.14);
  background:
    linear-gradient(90deg, rgba(10, 21, 34, 0.92), rgba(12, 19, 34, 0.84)),
    radial-gradient(circle at left center, rgba(25, 211, 197, 0.12), transparent 24%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.activity-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(25, 211, 197, 0.9), rgba(77, 124, 255, 0.55));
  box-shadow: 0 0 18px rgba(25, 211, 197, 0.25);
}

.activity-banner-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.activity-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(120, 142, 174, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px rgba(25, 211, 197, 0.06);
}

.activity-copy {
  min-width: 0;
}

.activity-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.activity-detail,
.activity-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.activity-meta {
  color: var(--text-muted);
  text-align: right;
  max-width: 320px;
  font-family: var(--font-mono);
}

.activity-banner.is-running {
  border-color: rgba(25, 211, 197, 0.16);
}

.activity-banner.is-completed {
  border-color: rgba(65, 211, 159, 0.16);
  background:
    linear-gradient(90deg, rgba(10, 22, 28, 0.88), rgba(10, 18, 28, 0.8)),
    radial-gradient(circle at left center, rgba(65, 211, 159, 0.1), transparent 24%);
}

.activity-banner.is-completed .activity-spinner {
  border-color: rgba(65, 211, 159, 0.2);
  border-top-color: var(--success);
  animation-duration: 1.4s;
}

.activity-banner.is-failed {
  border-color: rgba(255, 125, 125, 0.16);
  background:
    linear-gradient(90deg, rgba(27, 16, 20, 0.9), rgba(18, 14, 24, 0.84)),
    radial-gradient(circle at left center, rgba(255, 125, 125, 0.1), transparent 24%);
}

.activity-banner.is-failed .activity-spinner {
  border-color: rgba(255, 125, 125, 0.18);
  border-top-color: var(--error);
}

.system-notice {
  width: min(980px, calc(100% - 40px));
  margin: 10px auto 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.84);
}

.system-notice.info {
  border-color: rgba(96, 165, 250, 0.24);
}

.system-notice.warning {
  border-color: rgba(245, 158, 11, 0.28);
}

.system-notice.error {
  border-color: rgba(248, 113, 113, 0.28);
}

.system-notice-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.system-notice-body {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.long-task-panel {
  width: min(980px, calc(100% - 40px));
  margin: 10px auto 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(120, 142, 174, 0.12);
  background:
    linear-gradient(180deg, rgba(9, 15, 25, 0.9), rgba(8, 14, 23, 0.82)),
    radial-gradient(circle at top left, rgba(77, 124, 255, 0.08), transparent 30%);
  backdrop-filter: blur(14px);
}

.long-task-panel-head,
.long-task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.long-task-actions,
.long-task-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.long-task-panel-head {
  margin-bottom: 12px;
}

.long-task-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.long-task-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.long-task-list {
  display: grid;
  gap: 10px;
}

.long-task-item {
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.025);
}

.long-task-item.is-terminal {
  border-color: rgba(118, 140, 174, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.long-task-dismiss {
  border: 1px solid rgba(120, 142, 174, 0.14);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.long-task-dismiss:hover {
  color: var(--text-primary);
  border-color: rgba(25, 211, 197, 0.22);
}

.long-task-cancel {
  border: 1px solid rgba(240, 188, 103, 0.2);
  background: rgba(240, 188, 103, 0.055);
  color: #f0bc67;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.long-task-cancel:hover {
  color: var(--text-primary);
  border-color: rgba(240, 188, 103, 0.34);
  background: rgba(240, 188, 103, 0.1);
}

.long-task-cancel:disabled {
  opacity: 0.62;
  cursor: wait;
}

.diagnostics-panel {
  margin-top: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.55);
}

.diagnostics-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.diagnostics-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.diagnostics-subtitle,
.diagnostics-meta,
.diagnostics-note {
  font-size: 12px;
  color: var(--text-muted);
}

.diagnostics-output {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.diagnostics-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.diagnostics-list {
  display: grid;
  gap: 10px;
}

.diagnostics-item {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(9, 17, 29, 0.72);
}

.diagnostics-item.ok {
  border-color: rgba(34, 197, 94, 0.26);
}

.diagnostics-item.fail {
  border-color: rgba(248, 113, 113, 0.24);
}

.diagnostics-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.diagnostics-tool,
.diagnostics-state {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.diagnostics-preview {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  word-break: break-word;
}

.long-task-item.empty {
  background: rgba(255, 255, 255, 0.018);
}

.long-task-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
}

.long-task-meta,
.long-task-result {
  font-size: 12px;
  line-height: 1.55;
}

.long-task-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  word-break: break-all;
}

.long-task-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(118, 140, 174, 0.08);
  color: var(--text-secondary);
}

.long-task-transcript {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.long-task-line {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(10, 15, 24, 0.55);
  border: 1px solid rgba(118, 140, 174, 0.08);
}

.long-task-line-role {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.long-task-line-content {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.long-task-line.assistant .long-task-line-role,
.long-task-line.stream .long-task-line-role {
  color: var(--accent);
}

.long-task-line.tool_start .long-task-line-role,
.long-task-line.tool_end .long-task-line-role {
  color: var(--accent-blue);
}

.long-task-line.status .long-task-line-role {
  color: var(--warning);
}

.long-task-line.user .long-task-line-role {
  color: var(--text-primary);
}

.long-task-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.long-task-state.queued {
  color: var(--warning);
}

.long-task-state.running {
  color: var(--accent);
  border-color: rgba(25, 211, 197, 0.24);
}

.long-task-state.completed {
  color: var(--success);
  border-color: rgba(65, 211, 159, 0.24);
}

.long-task-state.failed {
  color: var(--error);
  border-color: rgba(255, 125, 125, 0.24);
}

.file-rail {
  width: min(980px, calc(100% - 40px));
  margin: 10px auto 0;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(120, 142, 174, 0.12);
  background: rgba(10, 15, 24, 0.76);
  backdrop-filter: blur(14px);
}

.file-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.file-rail-title,
.file-studio-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-rail-open {
  border: 1px solid rgba(120, 142, 174, 0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.file-rail-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.file-chip-card {
  min-width: 210px;
  display: grid;
  gap: 7px;
}

.file-chip,
.file-studio-item {
  border: 1px solid rgba(120, 142, 174, 0.12);
  background: rgba(255,255,255,0.035);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.file-chip {
  width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
}

.file-chip:hover,
.file-studio-item:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 211, 197, 0.24);
}

.file-chip.active,
.file-studio-item.active {
  border-color: rgba(25, 211, 197, 0.32);
  background: linear-gradient(180deg, rgba(14, 36, 40, 0.92), rgba(12, 20, 34, 0.84));
}

.file-chip-name,
.file-studio-item-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.file-chip-meta,
.file-studio-item-path {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.file-chip-download,
.file-studio-download,
.file-studio-delete {
  border: 1px solid rgba(25, 211, 197, 0.18);
  background: rgba(25, 211, 197, 0.08);
  color: #d8fffb;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.file-chip-download:hover,
.file-studio-download:hover {
  border-color: rgba(25, 211, 197, 0.34);
  background: rgba(25, 211, 197, 0.14);
}

.file-studio-delete {
  border-color: rgba(255, 125, 125, 0.18);
  background: rgba(255, 125, 125, 0.08);
  color: #ffdada;
}

.file-studio-delete:hover {
  border-color: rgba(255, 125, 125, 0.34);
  background: rgba(255, 125, 125, 0.14);
}

.artifact-download-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.artifact-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(25, 211, 197, 0.18);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.1), rgba(77, 124, 255, 0.08));
  color: var(--text-primary);
  border-radius: 14px;
  padding: 10px 12px;
  text-decoration: none;
}

.artifact-download-card:hover {
  border-color: rgba(25, 211, 197, 0.34);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.16), rgba(77, 124, 255, 0.12));
}

.artifact-download-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.artifact-download-meta {
  flex: 0 0 auto;
  color: #d8fffb;
  font-size: 12px;
  font-weight: 800;
}

.dropzone-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(3, 8, 18, 0.56);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-card {
  width: min(520px, calc(100% - 32px));
  padding: 28px 24px;
  border-radius: 28px;
  border: 1px dashed rgba(25, 211, 197, 0.4);
  background: linear-gradient(180deg, rgba(10, 20, 32, 0.96), rgba(10, 16, 28, 0.92));
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.dropzone-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 16px;
}

.message {
  width: min(920px, 100%);
  margin: 0 auto 22px;
  animation: fadeIn 0.24s ease-out;
}

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

.message-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: rgba(77, 124, 255, 0.16);
  color: #8eb2ff;
}

.message.assistant .message-avatar {
  background: rgba(25, 211, 197, 0.14);
  color: #7df0e5;
}

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

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.message-content {
  margin-left: 42px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(120, 142, 174, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.72;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.message.user .message-content {
  background: linear-gradient(180deg, rgba(77, 124, 255, 0.08), rgba(77, 124, 255, 0.04));
  border-color: rgba(77, 124, 255, 0.14);
}

.message-content p {
  margin-bottom: 10px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content code {
  background: rgba(255,255,255,0.06);
  padding: 2px 7px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.message-content pre {
  background: #0b1120;
  border: 1px solid rgba(120, 142, 174, 0.14);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
}

.message-content pre code {
  background: transparent;
  padding: 0;
}

.thinking-block {
  width: min(920px, calc(100% - 42px));
  margin: 10px auto 10px calc((100% - min(920px, 100%)) / 2 + 42px);
  background: rgba(147, 164, 255, 0.08);
  border: 1px solid rgba(147, 164, 255, 0.15);
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 13px;
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--thinking);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}

.thinking-content {
  color: #c5d0ff;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.tool-call {
  width: min(920px, calc(100% - 42px));
  margin: 10px auto 10px calc((100% - min(920px, 100%)) / 2 + 42px);
  background: rgba(11, 16, 24, 0.86);
  border: 1px solid rgba(120, 142, 174, 0.14);
  border-radius: 18px;
  overflow: hidden;
}

.tool-header {
  background: rgba(255,255,255,0.03);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(120, 142, 174, 0.12);
}

.tool-icon,
.tool-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.tool-args,
.tool-result,
.tool-running {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-x: auto;
}

.tool-result {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid rgba(120, 142, 174, 0.12);
  background: rgba(255,255,255,0.02);
}

.tool-running {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(120, 142, 174, 0.12);
  color: var(--warning);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(120, 142, 174, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 10px;
  text-align: center;
}

.welcome-shell {
  width: min(720px, 100%);
  display: grid;
  gap: 14px;
  min-width: 0;
}

.welcome-hero,
.welcome-status-stack {
  background: var(--bg-elevated);
  border: 1px solid rgba(118, 140, 174, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.welcome-hero {
  padding: 18px 18px 16px;
  background:
    radial-gradient(circle at top left, rgba(25, 211, 197, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(77, 124, 255, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(12, 18, 30, 0.95), rgba(10, 15, 24, 0.88));
}

.welcome-title {
  max-width: 560px;
  margin: 0 auto 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.welcome-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.5;
  margin: 0 auto 14px;
}

.welcome-actions,
.settings-summary-row,
.settings-grid {
  display: grid;
  gap: 12px;
}

.welcome-actions {
  width: min(460px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-btn,
.workspace-action {
  border: 1px solid rgba(118, 140, 174, 0.15);
  background: rgba(255,255,255,0.045);
  color: var(--text-primary);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quick-action-btn:hover,
.workspace-action:hover {
  border-color: rgba(25, 211, 197, 0.28);
  background: rgba(25, 211, 197, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(12, 230, 208, 0.12);
}

.quick-action-btn {
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

.quick-action-btn.primary {
  background: linear-gradient(180deg, rgba(15, 55, 74, 0.96), rgba(8, 29, 40, 0.94));
  border-color: rgba(25, 211, 197, 0.26);
}

.quick-action-btn.secondary {
  background: rgba(255,255,255,0.03);
}

.welcome-status-stack {
  padding: 14px;
  gap: 10px;
}

.sandbox-card,
.no-sandbox-msg {
  border-radius: 20px;
}

.sandbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(65, 211, 159, 0.08);
  border: 1px solid rgba(65, 211, 159, 0.2);
  justify-content: flex-start;
}

.sandbox-card-icon {
  font-size: 18px;
  line-height: 1.3;
  margin-top: 2px;
}

.sandbox-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sandbox-card-title {
  font-weight: 700;
  color: var(--success);
  margin-bottom: 2px;
}

.sandbox-card-path {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.sandbox-card-meta {
  font-size: 11px;
  color: rgba(214, 225, 245, 0.72);
  overflow-wrap: anywhere;
}

.sandbox-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.no-sandbox-msg {
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px dashed rgba(120, 142, 174, 0.18);
  text-align: center;
}

.no-sandbox-msg p {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.app-setup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.install-help-panel {
  margin-top: 12px;
  text-align: left;
}

.install-help-panel summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.no-sandbox-msg code {
  display: block;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  font-size: 12px;
  color: var(--accent);
  margin-top: 8px;
}

.sandbox-pairing-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(118, 140, 174, 0.18);
  border-radius: 18px;
  background: rgba(3, 8, 17, 0.34);
}

.sandbox-pairing-head,
.sandbox-pairing-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sandbox-pairing-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sandbox-pairing-subtitle,
.sandbox-pairing-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.sandbox-platform-select {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(118, 140, 174, 0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--text-primary);
  outline: none;
}

.sandbox-command-box {
  margin: 12px 0;
  max-height: 230px;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(25, 211, 197, 0.18);
  border-radius: 16px;
  background: rgba(1, 5, 12, 0.72);
  color: #d9fff9;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.welcome-meta {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.welcome-meta-line,
.modal-subtitle,
.form-help,
.empty-panel {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.welcome-mini-lists,
.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.input-area {
  padding: 18px 20px 22px;
  background: linear-gradient(180deg, rgba(8, 13, 23, 0), rgba(8, 13, 23, 0.84) 32%);
  border-top: 1px solid rgba(120, 142, 174, 0.1);
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  max-width: 980px;
  margin: 0 auto;
}

.attach-button,
.send-button {
  flex-shrink: 0;
}

.input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-context {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(120, 142, 174, 0.12);
  border-radius: 14px;
  padding: 9px 12px;
}

.message-input {
  width: 100%;
  background: rgba(10, 15, 24, 0.95);
  border: 1px solid rgba(118, 140, 174, 0.16);
  border-radius: 24px;
  padding: 16px 18px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  resize: none;
  min-height: 56px;
  max-height: 220px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.message-input:focus {
  border-color: rgba(25, 211, 197, 0.34);
  box-shadow: 0 0 0 4px rgba(25, 211, 197, 0.08);
}

.message-input::placeholder {
  color: var(--text-muted);
}

.attach-button {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(118, 140, 174, 0.14);
  border-radius: 18px;
  color: var(--text-secondary);
  width: 52px;
  height: 52px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.18s ease;
}

.attach-button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.long-task-toggle {
  width: auto;
  min-width: 72px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.long-task-toggle.active {
  color: var(--text-primary);
  border-color: rgba(25, 211, 197, 0.28);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.16), rgba(77, 124, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.send-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  border: none;
  border-radius: 18px;
  color: #07121a;
  min-width: 118px;
  height: 52px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 20px 34px rgba(25, 211, 197, 0.18);
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.send-button:active:not(:disabled) {
  transform: translateY(0);
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 14, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(8px);
}

.modal {
  background: rgba(10, 15, 24, 0.96);
  border: 1px solid rgba(118, 140, 174, 0.14);
  border-radius: 24px;
  width: 90%;
  max-width: 520px;
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideIn 0.22s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(118, 140, 174, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 18px 22px;
  border-top: 1px solid rgba(118, 140, 174, 0.12);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-modal {
  max-width: 860px;
}

.file-studio-modal {
  width: min(1680px, calc(100vw - 44px));
  max-width: none;
  max-height: calc(100vh - 44px);
  height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(25, 211, 197, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(13, 19, 31, 0.98), rgba(7, 11, 19, 0.98));
}

.file-studio-modal .modal-header {
  flex-shrink: 0;
}

.file-studio-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.file-studio-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  height: 100%;
}

.file-studio-sidebar,
.file-studio-main {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.035);
  border-radius: 24px;
  padding: 16px;
  min-height: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.file-studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-studio-section-spaced {
  margin-top: 8px;
}

.temporary-files-summary {
  border: 1px solid rgba(25, 211, 197, 0.14);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.11), rgba(77, 124, 255, 0.08));
  color: #d8fffb;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 800;
}

.temporary-file-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0;
}

.temporary-crumb {
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.temporary-crumb:hover {
  color: var(--text-primary);
  border-color: rgba(25, 211, 197, 0.24);
}

.temporary-file-explorer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 285px;
  overflow: auto;
  padding-right: 2px;
}

.temporary-file-card {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  border-radius: 18px;
  padding: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.temporary-file-card.is-folder {
  border-color: rgba(77, 124, 255, 0.2);
  background: linear-gradient(180deg, rgba(77, 124, 255, 0.08), rgba(255,255,255,0.025));
}

.temporary-file-card:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 211, 197, 0.24);
}

.temporary-file-open {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon meta";
  column-gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  padding: 2px;
}

.temporary-file-icon {
  grid-area: icon;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.temporary-file-name {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 850;
}

.temporary-file-meta {
  grid-area: meta;
  color: var(--text-muted);
  font-size: 11px;
}

.temporary-file-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-start;
  margin-top: 8px;
}

.file-studio-search {
  width: 100%;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(7, 11, 19, 0.76);
  color: var(--text-primary);
  font-size: 13px;
}

.file-studio-search::placeholder {
  color: var(--text-muted);
}

.file-studio-search:focus {
  outline: none;
  border-color: rgba(25, 211, 197, 0.3);
  box-shadow: 0 0 0 3px rgba(25, 211, 197, 0.08);
}

.file-studio-list {
  display: grid;
  gap: 8px;
  min-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.file-studio-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
}

.file-studio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
}

.file-row-actions {
  display: flex;
  gap: 7px;
}

.file-row-actions .file-studio-download,
.file-row-actions .file-studio-delete {
  flex: 1;
  min-height: 34px;
}

.file-conversation-group {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(118, 140, 174, 0.1);
  background: rgba(255,255,255,0.025);
  border-radius: 18px;
  padding: 11px;
}

.file-conversation-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.file-conversation-heading small {
  color: var(--text-muted);
  font-weight: 800;
}

.file-studio-download,
.file-studio-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.file-studio-current {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.file-studio-actions {
  display: flex;
  gap: 8px;
}

.file-studio-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.file-studio-surface {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(7, 11, 19, 0.76);
  border-radius: 22px;
  padding: 18px;
  overflow: auto;
}

.file-studio-empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
}

.file-studio-empty-orb {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px solid rgba(25, 211, 197, 0.18);
  background:
    radial-gradient(circle at 30% 20%, rgba(25, 211, 197, 0.18), transparent 55%),
    rgba(255,255,255,0.04);
  font-size: 42px;
}

.file-studio-empty-state h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-family: var(--font-display);
}

.file-studio-empty-state p {
  max-width: 560px;
  margin: 0;
  line-height: 1.7;
}

.file-studio-empty-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.file-studio-empty-hints span {
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.immersive-editor-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 360px;
  gap: 18px;
  min-height: min(72vh, 900px);
}

.immersive-editor-text {
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.immersive-editor-document,
.immersive-editor-presentation {
  align-items: stretch;
}

.studio-panel-primary,
.studio-panel-secondary {
  min-height: 100%;
}

.studio-panel-canvas {
  padding: 18px;
}

.studio-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

.studio-workbench.single-preview {
  grid-template-columns: 1fr;
}

.studio-panel {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.025);
  border-radius: 18px;
  padding: 14px;
  min-width: 0;
}

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

.studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(18, 213, 196, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.studio-badge.muted {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

.studio-panel-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.studio-editor-textarea {
  min-height: 420px;
}

.studio-preview-surface,
.studio-rich-preview,
.document-preview-pane {
  min-height: 420px;
}

.studio-rich-preview {
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  background: rgba(10, 15, 24, 0.78);
  padding: 18px;
  color: var(--text-primary);
  overflow: auto;
}

.studio-rich-preview h2,
.studio-rich-preview h3,
.studio-rich-preview h4 {
  margin: 0 0 12px;
  color: var(--text-primary);
}

.studio-rich-preview p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.studio-rich-preview ul {
  margin: 0 0 14px 18px;
  color: var(--text-secondary);
}

.studio-code-preview {
  min-height: 420px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  background: rgba(10, 15, 24, 0.92);
  color: var(--text-primary);
  padding: 18px;
  overflow: auto;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.document-visual-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  background: #fff;
}

.presentation-studio {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.presentation-studio-sidebar {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 14px;
}

.presentation-slide-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}

.presentation-slide-chip {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.presentation-slide-chip.active {
  border-color: rgba(25, 211, 197, 0.32);
  background: linear-gradient(180deg, rgba(14, 36, 40, 0.92), rgba(12, 20, 34, 0.84));
}

.presentation-slide-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

.presentation-slide-chip-title {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-primary);
}

.presentation-workbench {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.92fr);
  align-items: start;
  gap: 16px;
}

.slide-visual-stage {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
}

.slide-visual-frame {
  width: 100%;
  min-height: 320px;
  max-height: 420px;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(38, 211, 197, 0.1), transparent 34%),
    linear-gradient(165deg, #111827 0%, #121b2d 55%, #17243a 100%);
  border: 1px solid rgba(118, 140, 174, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.slide-visual-frame.has-preview {
  background: transparent;
}

.slide-visual-stage-large {
  min-height: min(74vh, 860px);
  padding: 6px 0;
}

.slide-canvas-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.slide-zoom-label {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

.slide-canvas-scroll {
  overflow: auto;
  padding-bottom: 8px;
}

.presentation-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.presentation-workbench.has-reference {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
}

.presentation-edit-surface,
.presentation-reference-panel {
  min-height: 0;
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 16, 28, 0.94), rgba(9, 14, 24, 0.9));
  padding: 16px;
}

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

.presentation-edit-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
}

.presentation-edit-head span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.slide-canvas-scale {
  position: relative;
}

.slide-canvas-absolute {
  position: relative;
}

.slide-edit-canvas {
  background:
    linear-gradient(rgba(118, 140, 174, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 140, 174, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(10, 14, 24, 0.98));
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.slide-canvas-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.slide-canvas-background.visible {
  opacity: 0.9;
}

.slide-visual-frame.has-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.05), rgba(6, 10, 18, 0.015));
  z-index: 0;
  pointer-events: none;
}

.slide-canvas-element {
  position: absolute;
  border: 1px dashed rgba(164, 182, 212, 0.24);
  border-radius: 14px;
  overflow: visible;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  z-index: 1;
}

.slide-canvas-element.active {
  border-color: rgba(25, 211, 197, 0.65);
  box-shadow: 0 0 0 3px rgba(25, 211, 197, 0.16);
}

.slide-canvas-element.is-text {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(1px);
}

.slide-canvas-element.is-image {
  background: rgba(255, 255, 255, 0.02);
}

.slide-canvas-element-grab {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(5, 8, 17, 0.7);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: grab;
  z-index: 2;
}

.slide-canvas-element-grab::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(25, 211, 197, 0.7);
}

.slide-canvas-element-resize {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(5, 8, 17, 0.7);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: nwse-resize;
  z-index: 2;
}

.slide-canvas-element-resize::before {
  content: "";
  position: absolute;
  inset: 4px;
  background:
    linear-gradient(135deg, transparent 45%, rgba(25, 211, 197, 0.85) 45%, rgba(25, 211, 197, 0.85) 55%, transparent 55%);
}

.slide-canvas-text {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  color: #f4f7fb;
  line-height: 1.45;
  overflow: auto;
  outline: none;
  white-space: pre-wrap;
}

.slide-canvas-text p,
.slide-canvas-text ul,
.slide-canvas-text ol {
  margin-bottom: 8px;
}

.slide-canvas-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.slide-canvas-image-placeholder,
.slide-canvas-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 16px;
}

.slide-canvas-empty {
  border: 1px dashed rgba(118, 140, 174, 0.2);
  border-radius: 18px;
}

.slide-visual-frame-large {
  min-height: min(74vh, 860px);
  max-height: none;
  padding: 20px;
  border-radius: 26px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.04);
}

.presentation-reference-frame {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(118, 140, 174, 0.12);
}

.presentation-reference-image {
  display: block;
  width: 100%;
  height: auto;
}

.slide-visual-kicker {
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(166, 219, 255, 0.82);
}

.slide-visual-title {
  font-size: clamp(18px, 1.5vw, 26px);
  line-height: 1.2;
  margin: 0 0 14px;
  color: #f4f7fb;
  max-height: 4.8em;
  overflow: hidden;
}

.slide-visual-frame-large .slide-visual-title {
  font-size: clamp(28px, 2.4vw, 44px);
  margin-bottom: 26px;
}

.slide-visual-body {
  color: rgba(227, 235, 244, 0.88);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  max-height: 220px;
}

.slide-visual-frame-large .slide-visual-body {
  font-size: clamp(18px, 1.1vw, 21px);
  line-height: 1.78;
  max-height: none;
}

.slide-visual-body p,
.slide-visual-body ul {
  margin-bottom: 8px;
}

.slide-visual-frame-large .slide-visual-body ul,
.slide-visual-frame-large .slide-visual-body ol {
  padding-left: 22px;
}

.slide-form {
  display: grid;
  gap: 10px;
}

.slide-position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.slide-inspector-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slide-layer-list {
  display: grid;
  gap: 8px;
}

.slide-layer-items {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.slide-layer-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.035);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.slide-layer-item.active {
  border-color: rgba(25, 211, 197, 0.3);
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(14, 36, 40, 0.92), rgba(12, 20, 34, 0.84));
}

.slide-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.file-editor-text.compact {
  min-height: 180px;
}

.studio-assistant-dock,
.studio-assistant-workspace {
  margin-top: 14px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
}

.studio-assistant-dock {
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.studio-assistant-workspace {
  padding: 20px;
  display: none;
  background:
    radial-gradient(circle at top left, rgba(25, 211, 197, 0.06), transparent 28%),
    rgba(255,255,255,0.03);
}

.studio-assistant-workspace.open {
  display: block;
}

.studio-assistant-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.studio-assistant-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.studio-assistant-copy {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.studio-assistant-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.studio-assistant-config,
.studio-assistant-compose {
  display: grid;
  gap: 14px;
}

.studio-assistant-group {
  display: grid;
  gap: 8px;
}

.studio-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-target-chip {
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.studio-target-chip.active {
  color: var(--text-primary);
  border-color: rgba(25, 211, 197, 0.34);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.18), rgba(77, 124, 255, 0.14));
}

.studio-assistant-input {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid rgba(118, 140, 174, 0.16);
  background: rgba(10, 15, 24, 0.95);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  line-height: 1.55;
}

.studio-assistant-detail-input {
  font-family: var(--font-sans);
}

.studio-assistant-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.studio-assistant-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.document-guidance-card {
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  background: rgba(10, 15, 24, 0.7);
  padding: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.document-guidance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.studio-suggestion-chip {
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  cursor: pointer;
}

.file-editor-text,
.file-editor-input {
  width: 100%;
  border: 1px solid rgba(118, 140, 174, 0.16);
  background: rgba(10, 15, 24, 0.95);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  outline: none;
}

.file-editor-text {
  min-height: 420px;
  resize: vertical;
  line-height: 1.55;
}

.presentation-inspector-panel,
.visual-document-inspector {
  position: sticky;
  top: 0;
}

.presentation-guidance-card {
  margin-top: 6px;
}

.slide-editor-list {
  display: grid;
  gap: 14px;
}

.slide-editor-card {
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 14px;
}

.slide-editor-label {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slide-body {
  min-height: 140px;
  margin-top: 10px;
}

.file-preview-readonly {
  display: grid;
  gap: 12px;
}

.file-preview-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.file-preview-readonly pre {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.file-preview-image {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(118, 140, 174, 0.14);
}

.studio-panel-preview-large {
  min-height: 100%;
}

.document-visual-frame-large {
  min-height: min(76vh, 980px);
  border-radius: 22px;
  background: #0a0f1b;
}

.document-preview-pane-large {
  min-height: min(76vh, 980px);
  max-height: none;
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 22px;
  background: rgba(10, 15, 24, 0.84);
}

.document-preview-pane-large pre {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-primary);
}

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

.settings-panel {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(118, 140, 174, 0.12);
  border-radius: 20px;
  padding: 18px;
}

.settings-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.workspace-choice-btn,
.workspace-mini-btn,
.workspace-favorite-chip,
.workspace-crumb,
.workspace-entry-open,
.workspace-entry-use {
  border: 1px solid rgba(118, 140, 174, 0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.workspace-choice-btn {
  min-height: 46px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  padding: 0 14px;
}

.workspace-choice-btn.primary,
.workspace-mini-btn.accent,
.workspace-entry-use:hover {
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.2), rgba(77, 124, 255, 0.18));
  border-color: rgba(25, 211, 197, 0.26);
}

.workspace-choice-btn:hover,
.workspace-mini-btn:hover,
.workspace-favorite-chip:hover,
.workspace-crumb:hover,
.workspace-entry-open:hover,
.workspace-entry-use:hover {
  transform: translateY(-1px);
}

.workspace-current-card {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 14px 15px;
  margin-bottom: 12px;
}

.workspace-current-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.workspace-current-path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.55;
  word-break: break-word;
}

.workspace-favorites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.workspace-favorite-chip,
.workspace-mini-btn,
.workspace-entry-use,
.workspace-crumb {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
}

.workspace-browser {
  border: 1px solid rgba(118, 140, 174, 0.12);
  background: rgba(255,255,255,0.025);
  border-radius: 18px;
  padding: 14px;
}

.workspace-browser-top,
.workspace-entry,
.workspace-create-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-browser-top {
  justify-content: space-between;
  margin-bottom: 10px;
}

.workspace-browser-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.workspace-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.workspace-crumb {
  padding: 6px 10px;
}

.workspace-crumb-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.workspace-entry-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.workspace-entry {
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(118, 140, 174, 0.1);
  background: rgba(255,255,255,0.02);
}

.workspace-entry-open {
  flex: 1;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
}

.workspace-entry-open:hover {
  color: var(--text-primary);
  transform: none;
}

.workspace-entry-use {
  min-width: 62px;
}

.workspace-entry-delete {
  min-width: 74px;
  border: 1px solid rgba(255, 125, 125, 0.18);
  background: rgba(255, 125, 125, 0.08);
  color: #ffdada;
  border-radius: 12px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.workspace-entry-download {
  min-width: 82px;
  border: 1px solid rgba(25, 211, 197, 0.18);
  background: rgba(25, 211, 197, 0.08);
  color: #d8fffb;
  border-radius: 12px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.workspace-entry-download:hover {
  border-color: rgba(25, 211, 197, 0.34);
  background: rgba(25, 211, 197, 0.14);
}

.workspace-entry-delete:hover {
  border-color: rgba(255, 125, 125, 0.34);
  background: rgba(255, 125, 125, 0.14);
}

.workspace-create-row {
  align-items: stretch;
}

.workspace-create-row .form-input {
  margin: 0;
}

.workspace-empty {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.advanced-path-panel {
  margin-top: 12px;
  border-top: 1px solid rgba(118, 140, 174, 0.1);
  padding-top: 12px;
}

.advanced-path-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
}

.advanced-path-panel summary::-webkit-details-marker {
  display: none;
}

.settings-summary-row {
  grid-auto-flow: column;
  justify-content: start;
  margin-bottom: 16px;
}

.settings-chip.ready {
  color: var(--success);
  border-color: rgba(65, 211, 159, 0.3);
  background: rgba(65, 211, 159, 0.08);
}

.settings-chip.pending {
  color: var(--warning);
  border-color: rgba(240, 188, 103, 0.24);
  background: rgba(240, 188, 103, 0.08);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(118, 140, 174, 0.14);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-input:focus {
  border-color: rgba(25, 211, 197, 0.3);
  box-shadow: 0 0 0 4px rgba(25, 211, 197, 0.08);
}

.btn {
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  color: #061119;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border: 1px solid rgba(118, 140, 174, 0.14);
}

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

.btn-danger {
  background: #d44e64;
  color: white;
}

.btn-danger:hover {
  background: #c64059;
}

.permission-args {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow-y: auto;
}

.streaming-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent);
  margin-left: 8px;
}

.streaming-dots {
  display: flex;
  gap: 3px;
}

.streaming-dots span {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.streaming-dots span:nth-child(2) { animation-delay: 0.2s; }
.streaming-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.empty-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(120, 142, 174, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 142, 174, 0.3);
}

@media (max-width: 980px) {
  .header {
    padding: 14px 16px;
  }

  .header-right {
    gap: 8px;
  }

  .model-select {
    min-width: 0;
    width: 100%;
  }

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

  .workspace-choice-grid {
    grid-template-columns: 1fr;
  }

  .messages-container {
    padding: 22px 18px 14px;
  }

  .message-content,
  .thinking-block,
  .tool-call {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .sidebar {
    display: none;
  }

  .header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-left,
  .header-right {
    width: 100%;
  }

  .header-right {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .logo {
    width: 100%;
  }

  .model-select,
  .settings-btn,
  .api-status,
  .sandbox-status,
  .status-badge {
    width: 100%;
    justify-content: center;
  }

  .logo-subtitle,
  .workspace-pill-secondary {
    display: none;
  }

  .welcome-screen {
    padding: 20px 14px 12px;
  }

  .welcome-shell {
    width: 100%;
  }

  .welcome-hero,
  .welcome-status-stack {
    padding-left: 16px;
    padding-right: 16px;
  }

  .welcome-title {
    font-size: 24px;
  }

  .welcome-subtitle {
    font-size: 12px;
  }

  .sandbox-card {
    padding: 12px;
  }

  .sandbox-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sandbox-card-actions .quick-action-btn {
    width: 100%;
  }

  .welcome-actions {
    grid-template-columns: 1fr;
  }

  .app-setup-actions {
    grid-template-columns: 1fr;
  }

  .workspace-entry,
  .workspace-create-row,
  .workspace-browser-top {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-bar {
    padding: 10px 14px;
  }

  .workspace-badges {
    width: 100%;
  }

  .activity-banner {
    width: calc(100% - 28px);
    margin-top: 10px;
    padding: 11px 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-meta {
    text-align: left;
    max-width: none;
  }

  .file-rail {
    width: calc(100% - 28px);
    margin-top: 10px;
    padding: 11px 12px;
  }

  .file-studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-workbench,
  .presentation-studio,
  .presentation-workbench,
  .immersive-editor-stage {
    grid-template-columns: 1fr;
  }

  .file-studio-toolbar,
  .file-rail-header,
  .studio-assistant-workspace-head,
  .studio-assistant-dock {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-studio-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .studio-assistant-grid,
  .immersive-editor-stage {
    grid-template-columns: 1fr;
  }

  .input-area {
    padding: 14px;
  }

  .input-container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .input-wrapper {
    min-width: 0;
    width: 100%;
  }

  .long-task-panel,
  .activity-banner,
  .file-rail {
    width: calc(100% - 24px);
  }

  .messages-container {
    padding: 18px 12px 12px;
  }

  .message-content {
    margin-left: 0;
    padding: 14px;
  }

  .message-header {
    flex-wrap: wrap;
  }

  .long-task-panel-head,
  .long-task-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .long-task-actions,
  .long-task-row-actions {
    width: 100%;
  }

  .attach-button {
    width: 48px;
    height: 48px;
  }

  .long-task-toggle {
    min-width: 64px;
    padding: 0 12px;
  }

  .send-button {
    min-width: 96px;
    height: 48px;
  }

  .slide-visual-frame {
    min-height: 280px;
    aspect-ratio: auto;
  }

  .slide-visual-frame-large {
    min-height: 360px;
    padding: 24px 20px;
  }

  .slide-position-grid {
    grid-template-columns: 1fr;
  }

  .presentation-inspector-panel,
  .visual-document-inspector {
    position: static;
  }
}

/* Visual refresh integration */
:root {
  --content-max: 1220px;
  --composer-max: 1220px;
  --radius-xl: 30px;
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.22);
  --ring: 0 0 0 4px rgba(25, 211, 197, 0.12);
}

.app-glow-3 {
  bottom: -120px;
  left: 20%;
  width: 420px;
  height: 320px;
  background: rgba(25, 211, 197, 0.12);
}

.icon-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(120, 142, 174, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 211, 197, 0.28);
  background: rgba(25, 211, 197, 0.08);
}

.mobile-sidebar-btn {
  flex-shrink: 0;
}

.topbar-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-action {
  min-width: 84px;
}

.sidebar-caption {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar-backdrop {
  display: none;
}

.chat-area::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(43, 232, 211, 0.06), transparent 34%);
}

.workspace-deck,
.welcome-screen,
.messages-container,
.input-area {
  position: relative;
  z-index: 1;
}

.workspace-deck {
  flex-shrink: 0;
  display: grid;
  gap: 10px;
  padding: 12px 20px 0;
}

.workspace-bar,
.system-notice,
.activity-banner,
.long-task-panel,
.file-rail {
  width: min(var(--content-max), 100%);
  margin-left: auto;
  margin-right: auto;
}

.workspace-bar {
  display: grid;
  grid-template-columns: minmax(160px, 0.72fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(146, 165, 195, 0.13);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 17, 30, 0.72), rgba(8, 14, 25, 0.58));
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.15);
}

.workspace-context-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workspace-context-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.workspace-context-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-badges {
  justify-content: flex-start;
  min-width: 0;
}

.workspace-pill,
.settings-chip,
.mini-inline-item {
  min-height: 30px;
  padding: 6px 10px;
  border-color: rgba(146, 165, 195, 0.13);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pill:first-child {
  color: var(--accent);
  border-color: rgba(43, 232, 211, 0.18);
  background: rgba(43, 232, 211, 0.065);
}

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

.workspace-mini-btn,
.file-rail-open {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(146, 165, 195, 0.15);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.workspace-mini-btn:hover,
.file-rail-open:hover,
.settings-btn:hover {
  color: var(--text-primary);
  border-color: rgba(43, 232, 211, 0.28);
  background: rgba(43, 232, 211, 0.07);
  transform: translateY(-1px);
}

.system-notice,
.activity-banner {
  margin-top: 0;
  border-radius: 18px;
}

.activity-banner {
  padding: 10px 13px;
  background:
    linear-gradient(90deg, rgba(10, 20, 34, 0.88), rgba(10, 15, 26, 0.76)),
    radial-gradient(circle at left center, rgba(43, 232, 211, 0.12), transparent 24%);
}

.long-task-panel {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8, 15, 26, 0.86), rgba(7, 12, 22, 0.72));
  border-color: rgba(146, 165, 195, 0.12);
  box-shadow: var(--shadow-soft);
}

.long-task-panel.has-active {
  border-color: rgba(43, 232, 211, 0.2);
  background:
    linear-gradient(180deg, rgba(8, 20, 31, 0.9), rgba(7, 13, 22, 0.78)),
    radial-gradient(circle at top left, rgba(43, 232, 211, 0.1), transparent 28%);
}

.long-task-panel.is-compact {
  padding: 8px 12px;
}

.long-task-panel-head {
  margin-bottom: 8px;
  align-items: center;
}

.long-task-panel.is-compact .long-task-panel-head {
  margin-bottom: 0;
}

.long-task-heading {
  min-width: 0;
}

.long-task-eyebrow {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.long-task-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.long-task-title {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.long-task-panel-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(146, 165, 195, 0.12);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.long-task-panel.has-active .long-task-panel-state {
  color: var(--accent);
  border-color: rgba(43, 232, 211, 0.23);
  background: rgba(43, 232, 211, 0.07);
}

.long-task-subtitle {
  max-width: 720px;
  font-size: 11px;
  line-height: 1.45;
}

.long-task-list {
  gap: 8px;
}

.long-task-item {
  padding: 10px 11px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.028);
  border-color: rgba(146, 165, 195, 0.11);
}

.long-task-name {
  font-size: 12px;
}

.long-task-meta,
.long-task-result,
.long-task-line-content {
  font-size: 11px;
}

.long-task-transcript {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.long-task-more {
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px dashed rgba(146, 165, 195, 0.14);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.file-rail {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(8, 14, 25, 0.72);
  border-color: rgba(146, 165, 195, 0.12);
}

.file-rail-header {
  margin-bottom: 8px;
}

.file-rail-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.file-rail-list {
  gap: 8px;
}

.file-chip {
  min-width: 166px;
  padding: 9px 10px;
  border-radius: 14px;
}

.file-chip-name {
  font-size: 12px;
}

.welcome-screen {
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 22px 24px 18px;
}

.welcome-shell {
  width: min(var(--content-max), 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.welcome-hero,
.welcome-status-stack {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(146, 165, 195, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.welcome-hero {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at 16% 12%, rgba(43, 232, 211, 0.22), transparent 26%),
    radial-gradient(circle at 86% 6%, rgba(114, 149, 255, 0.24), transparent 30%),
    linear-gradient(155deg, rgba(13, 23, 39, 0.94), rgba(7, 12, 22, 0.86));
}

.welcome-hero::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -42%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 80px rgba(43, 232, 211, 0.06);
}

.hero-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(43, 232, 211, 0.18);
  background: rgba(43, 232, 211, 0.07);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(43, 232, 211, 0.08), 0 0 18px rgba(43, 232, 211, 0.55);
}

.welcome-title {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 0 14px;
  font-size: clamp(36px, 5.3vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.welcome-subtitle {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 0 0 22px;
  color: rgba(216, 226, 242, 0.78);
  font-size: 14px;
}

.welcome-actions {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-action-btn,
.workspace-action {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(146, 165, 195, 0.15);
}

.quick-action-btn {
  min-height: 46px;
  padding: 13px 14px;
  text-align: left;
}

.quick-action-btn.primary {
  color: #061119;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 42px rgba(43, 232, 211, 0.16);
}

.quick-action-btn.secondary {
  color: var(--accent);
}

.welcome-status-stack {
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgba(10, 17, 30, 0.82), rgba(7, 12, 22, 0.74));
}

.welcome-orbit {
  display: grid;
  gap: 10px;
}

.orbit-card {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(146, 165, 195, 0.11);
}

.orbit-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.orbit-card strong {
  font-size: 13px;
  color: var(--text-primary);
}

.sandbox-card,
.no-sandbox-msg {
  border-radius: 20px;
}

.sandbox-card {
  align-items: stretch;
  padding: 14px;
  background: rgba(85, 223, 172, 0.08);
  border-color: rgba(85, 223, 172, 0.19);
}

.sandbox-card-icon {
  width: 20px;
  color: var(--success);
  font-size: 17px;
}

.sandbox-card-title {
  color: var(--success);
}

.no-sandbox-msg {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
}

.welcome-meta {
  justify-items: stretch;
}

.welcome-meta-line {
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(146, 165, 195, 0.1);
}

.messages-container {
  flex: 1;
  padding: 30px 32px 18px;
  scroll-behavior: smooth;
}

.message {
  width: min(940px, 100%);
  margin-bottom: 24px;
}

.message-header {
  margin-bottom: 7px;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 13px;
}

.message-content {
  margin-left: 44px;
  padding: 17px 19px;
  border-radius: 20px;
  line-height: 1.78;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(146, 165, 195, 0.12);
}

.message.assistant .message-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.026));
}

.message.user .message-content {
  background: linear-gradient(180deg, rgba(114, 149, 255, 0.11), rgba(114, 149, 255, 0.055));
  border-color: rgba(114, 149, 255, 0.18);
}

.tool-call,
.thinking-block {
  border-radius: 18px;
  background: rgba(9, 15, 25, 0.78);
  backdrop-filter: blur(14px);
}

.input-area {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(146, 165, 195, 0.09);
  background: linear-gradient(180deg, rgba(3, 6, 16, 0), rgba(3, 6, 16, 0.78) 28%, rgba(3, 6, 16, 0.96));
  backdrop-filter: blur(18px);
}

.composer-panel {
  width: min(var(--composer-max), 100%);
  margin: 0 auto;
  padding: 10px;
  border-radius: 26px;
  border: 1px solid rgba(43, 232, 211, 0.22);
  background:
    linear-gradient(180deg, rgba(10, 17, 30, 0.9), rgba(7, 12, 22, 0.88)),
    radial-gradient(circle at 12% 0%, rgba(43, 232, 211, 0.16), transparent 34%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

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

.input-context {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(146, 165, 195, 0.1);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-shortcuts {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.input-container {
  max-width: none;
  gap: 10px;
  align-items: stretch;
}

.input-wrapper {
  justify-content: center;
  gap: 0;
}

.message-input {
  min-height: 56px;
  max-height: 190px;
  border-radius: 20px;
  background: rgba(3, 7, 14, 0.68);
  border-color: rgba(146, 165, 195, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.message-input:focus {
  border-color: rgba(43, 232, 211, 0.42);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.attach-button,
.send-button {
  height: 56px;
  border-radius: 19px;
}

.attach-button {
  width: 56px;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(146, 165, 195, 0.14);
}

.long-task-toggle {
  width: auto;
  min-width: 78px;
}

.long-task-toggle.active {
  color: #061119;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 38px rgba(43, 232, 211, 0.15);
}

.send-button {
  min-width: 124px;
  color: #051018;
  box-shadow: 0 20px 44px rgba(43, 232, 211, 0.18);
}

.modal-overlay {
  background: rgba(1, 4, 11, 0.78);
  backdrop-filter: blur(14px);
}

.modal {
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.98), rgba(7, 12, 22, 0.98));
  border-color: rgba(146, 165, 195, 0.16);
}

.file-studio-modal {
  border-radius: 30px;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.62);
}

.file-studio-sidebar,
.file-studio-main,
.file-studio-surface,
.settings-panel,
.workspace-browser,
.workspace-current-card,
.diagnostics-panel,
.studio-panel,
.presentation-edit-surface,
.presentation-reference-panel {
  border-color: rgba(146, 165, 195, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.file-studio-surface {
  background:
    radial-gradient(circle at 50% 0%, rgba(43, 232, 211, 0.06), transparent 32%),
    rgba(4, 8, 16, 0.82);
}

body.focus-mode .sidebar {
  width: 0;
  opacity: 0;
  transform: translateX(-18px);
  overflow: hidden;
  border-right: 0;
}

body.focus-mode .workspace-bar,
body.focus-mode .file-rail:not([style*="display: none"]) {
  opacity: 0.84;
}

body.focus-mode .workspace-context-copy,
body.focus-mode .workspace-pill-secondary,
body.focus-mode .composer-shortcuts {
  display: none;
}

body.focus-mode .workspace-bar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.focus-mode .workspace-badges {
  grid-column: 1;
}

body.focus-mode .workspace-bar-actions {
  grid-column: 2;
}

@media (max-width: 1180px) {
  .header-right {
    flex-wrap: wrap;
  }

  .topbar-status-group {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }

  .model-select {
    max-width: none;
  }

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

  .welcome-status-stack {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .welcome-meta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    display: flex;
  }

  .sidebar {
    display: flex;
    position: fixed;
    z-index: 1200;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    opacity: 1;
    border-right: 1px solid rgba(146, 165, 195, 0.16);
    box-shadow: 26px 0 80px rgba(0, 0, 0, 0.5);
  }

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

  body.focus-mode .sidebar {
    width: min(86vw, 320px);
    opacity: 1;
    transform: translateX(-105%);
  }

  body.focus-mode.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(1, 4, 11, 0.58);
    backdrop-filter: blur(5px);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .chat-area {
    width: 100%;
  }

  .workspace-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workspace-bar-actions {
    justify-content: stretch;
  }

  .workspace-bar-actions .workspace-mini-btn {
    width: 100%;
  }

  .workspace-badges {
    justify-content: flex-start;
  }

  .welcome-status-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    min-height: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .mobile-sidebar-btn {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 2;
  }

  .header-left {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
  }

  .header-left .logo {
    min-width: 220px;
  }

  .header-right {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-status-group {
    grid-column: 1 / -1;
    order: 0;
    display: grid;
    grid-template-columns: 1fr;
  }

  .model-picker-stack,
  .auth-control {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .auth-control {
    justify-content: stretch;
    border-radius: 18px;
  }

  .auth-login-btn,
  .auth-quota-pill,
  .auth-user-btn,
  .auth-logout-btn {
    flex: 1;
    min-width: 0;
  }

  .api-status,
  .sandbox-status,
  .status-badge,
  .model-select,
  .settings-btn {
    width: 100%;
    max-width: none;
  }

  .status-badge {
    display: none;
  }

  .logo-subtitle {
    display: none;
  }

  .workspace-deck {
    padding: 10px 12px 0;
    gap: 8px;
  }

  .workspace-context-hint,
  .composer-shortcuts {
    display: none;
  }

  .welcome-screen {
    padding: 16px 12px 12px;
    align-items: flex-start;
  }

  .welcome-hero {
    padding: 22px 18px;
  }

  .welcome-title {
    font-size: clamp(31px, 10vw, 44px);
  }

  .welcome-subtitle {
    font-size: 13px;
  }

  .welcome-actions,
  .app-setup-actions {
    grid-template-columns: 1fr;
  }

  .quick-action-btn {
    text-align: center;
  }

  .long-task-panel-head,
  .long-task-row,
  .file-rail-header,
  .sandbox-pairing-head,
  .sandbox-pairing-actions,
  .composer-topline {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .sandbox-platform-select {
    width: 100%;
  }

  .long-task-title-row {
    flex-wrap: wrap;
  }

  .long-task-actions,
  .long-task-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .file-rail-list {
    padding-bottom: 4px;
  }

  .file-chip {
    min-width: 148px;
  }

  .messages-container {
    padding: 20px 12px 12px;
  }

  .message-content,
  .thinking-block,
  .tool-call {
    margin-left: 0;
    width: 100%;
  }

  .input-area {
    padding: 10px 10px 12px;
  }

  .composer-panel {
    padding: 8px;
    border-radius: 22px;
  }

  .input-context {
    white-space: normal;
  }

  .input-container {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 76px;
    gap: 8px;
    align-items: stretch;
  }

  .input-wrapper {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .attach-button {
    width: 50px;
    height: 54px;
  }

  .long-task-toggle {
    grid-column: 1 / 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    height: 48px;
  }

  .send-button {
    grid-column: 2 / 4;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    height: 48px;
  }
}

@media (max-width: 520px) {
  .header-left {
    min-width: 0;
  }

  .logo-stack > span:first-child {
    font-size: 14px;
  }

  .header-right {
    grid-template-columns: 1fr;
  }

  .topbar-action:not(.auth-login-btn):not(.auth-quota-pill):not(.auth-user-btn):not(.auth-logout-btn) {
    display: none;
  }

  .auth-control {
    display: flex;
  }

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

  .workspace-pill {
    max-width: 100%;
  }

  .workspace-pill-secondary {
    display: none;
  }

  .welcome-hero,
  .welcome-status-stack {
    border-radius: 24px;
  }

  .hero-kicker {
    font-size: 10px;
  }

  .modal,
  .file-studio-modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 22px;
  }
}

.auth-modal-overlay {
  z-index: 3000;
  backdrop-filter: blur(18px);
}

.auth-modal {
  width: min(440px, calc(100vw - 28px));
}

.auth-form {
  display: grid;
  gap: 12px;
  padding: 8px 0 2px;
}

.auth-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.profile-modal {
  width: min(720px, calc(100vw - 28px));
}

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

.profile-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(146, 165, 195, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.profile-card.accent {
  border-color: rgba(25, 211, 197, 0.28);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.12), rgba(77, 124, 255, 0.09));
}

.profile-label,
.profile-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-card strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.profile-note {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(240, 188, 103, 0.18);
  background: rgba(240, 188, 103, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.auth-error {
  color: #ffd3d3;
  background: rgba(180, 34, 34, 0.18);
  border: 1px solid rgba(255, 96, 96, 0.28);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
}

.user-menu-btn {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-setup-hint {
  color: #fff2d6;
  background: rgba(240, 188, 103, 0.13);
  border: 1px solid rgba(240, 188, 103, 0.28);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}


/* =========================================================
   AuAI Workspace V3.1 Minimal Premium Frontend Override
   Safe layer: keeps existing IDs and backend wiring intact.
   ========================================================= */
:root {
  --v31-bg: #070b12;
  --v31-bg-2: #0a101a;
  --v31-surface: rgba(255, 255, 255, 0.045);
  --v31-surface-strong: rgba(255, 255, 255, 0.075);
  --v31-border: rgba(255, 255, 255, 0.105);
  --v31-border-soft: rgba(255, 255, 255, 0.07);
  --v31-text: #f6f8fb;
  --v31-muted: #9aa6b8;
  --v31-dim: #687386;
  --v31-accent: #d8ecff;
  --v31-accent-2: #82d9ff;
  --v31-cyan: #8be4ff;
  --v31-radius-xl: 34px;
  --v31-radius-lg: 24px;
  --v31-radius-md: 16px;
  --v31-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--v31-bg); }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--v31-text);
  background:
    radial-gradient(circle at 50% -10%, rgba(142, 203, 255, 0.12), transparent 34rem),
    radial-gradient(circle at 15% 15%, rgba(96, 165, 250, 0.07), transparent 27rem),
    linear-gradient(180deg, #070b12 0%, #070b12 42%, #05070c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.app-container.auai-v31-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.app-glow {
  position: fixed;
  pointer-events: none;
  filter: blur(28px);
  opacity: 0.55;
  z-index: 0;
}
.app-glow-1 { width: 28rem; height: 28rem; left: 50%; top: -14rem; transform: translateX(-50%); background: rgba(111, 190, 255, 0.13); border-radius: 50%; }
.app-glow-2 { width: 20rem; height: 20rem; right: -9rem; top: 14rem; background: rgba(80, 130, 255, 0.08); border-radius: 50%; }
.app-glow-3 { width: 18rem; height: 18rem; left: -9rem; bottom: 5rem; background: rgba(139, 228, 255, 0.07); border-radius: 50%; }

.v31-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 72px;
  padding: 0 clamp(18px, 3vw, 38px);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 420px) minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  background: rgba(7, 11, 18, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(24px);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}
.header-left { gap: 12px; }
.header-right { justify-content: flex-end; gap: 10px; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #071018;
  background: linear-gradient(135deg, #ffffff, #d8ecff 48%, #9fe6ff);
  border-radius: 13px;
  font-weight: 850;
  letter-spacing: -0.05em;
  box-shadow: 0 16px 42px rgba(123, 205, 255, 0.2);
}
.logo-stack { display: grid; gap: 1px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.logo-subtitle { color: var(--v31-muted); font-size: 12px; font-weight: 500; }

.icon-btn,
.details-btn,
.new-task-btn,
.settings-btn,
.auth-login-btn,
.auth-user-btn,
.auth-logout-btn,
.auth-quota-pill,
.command-palette-btn,
.composer-detail-link,
.quick-action-btn,
.workspace-mini-btn,
.new-chat-btn,
.attach-button,
.send-button {
  appearance: none;
  border: 1px solid var(--v31-border);
  color: var(--v31-text);
  background: rgba(255, 255, 255, 0.045);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}
.icon-btn:hover,
.details-btn:hover,
.settings-btn:hover,
.auth-login-btn:hover,
.auth-user-btn:hover,
.auth-logout-btn:hover,
.auth-quota-pill:hover,
.command-palette-btn:hover,
.composer-detail-link:hover,
.quick-action-btn:hover,
.workspace-mini-btn:hover,
.new-chat-btn:hover,
.attach-button:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.16);
}
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(139, 228, 255, 0.78);
  outline-offset: 3px;
}

.mobile-sidebar-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  font-size: 16px;
}

.command-palette-btn {
  justify-self: center;
  width: min(100%, 420px);
  height: 42px;
  padding: 0 10px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  color: var(--v31-muted);
  font-size: 13px;
  letter-spacing: -0.01em;
}
.command-palette-btn kbd {
  padding: 3px 8px;
  color: var(--v31-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
}

.details-btn,
.new-task-btn,
.settings-btn,
.auth-login-btn,
.auth-user-btn,
.auth-logout-btn,
.auth-quota-pill {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.new-task-btn {
  width: 38px;
  padding: 0;
  color: #071018;
  background: linear-gradient(135deg, #ffffff, #d8ecff 55%, #a9eaff);
  border-color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 16px 42px rgba(112, 196, 255, 0.18);
}
.auth-control { display: inline-flex; align-items: center; gap: 7px; }
.auth-logout-btn { opacity: 0.72; }

.v31-main-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: block;
}
.v31-chat-area {
  min-height: calc(100dvh - 72px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
  padding: 18px clamp(18px, 4vw, 40px) max(22px, env(safe-area-inset-bottom));
}

.sidebar {
  position: fixed;
  inset: 86px auto 18px 18px;
  width: min(320px, calc(100vw - 36px));
  z-index: 75;
  transform: translateX(calc(-100% - 28px));
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  border: 1px solid var(--v31-border);
  border-radius: var(--v31-radius-lg);
  background: rgba(8, 13, 21, 0.9);
  backdrop-filter: blur(24px);
  box-shadow: var(--v31-shadow);
  padding: 16px;
  overflow: hidden;
}
body.sidebar-open .sidebar { transform: translateX(0); }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sidebar-title { font-size: 14px; font-weight: 750; }
.sidebar-caption { color: var(--v31-muted); font-size: 12px; margin-top: 2px; }
.new-chat-btn { min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chat-list { display: grid; gap: 8px; overflow: auto; max-height: calc(100% - 56px); padding-right: 4px; }
.chat-item { border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.chat-item.active { background: rgba(139,228,255,0.1); border-color: rgba(139,228,255,0.22); }

.v31-operational-deck {
  display: grid;
  gap: 10px;
  width: 100%;
  align-self: start;
}
.v31-context-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  background: rgba(255,255,255,0.028);
  color: var(--v31-muted);
}
.workspace-context-copy { display: flex; align-items: center; gap: 9px; min-width: 0; }
.workspace-context-label { color: var(--v31-text); font-size: 12px; font-weight: 760; white-space: nowrap; }
.workspace-context-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.workspace-badges { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.workspace-pill {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #d9e4f2;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-pill-secondary { display: none; }
.workspace-bar-actions { display: inline-flex; }
.workspace-mini-btn { min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.workspace-mini-btn.accent,
.quick-action-btn.primary { color: #071018; background: linear-gradient(135deg, #fff, #d7efff 55%, #9be7ff); border-color: rgba(255,255,255,0.55); }

.system-notice,
.activity-banner,
.long-task-panel,
.file-rail {
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 22px !important;
  background: rgba(255,255,255,0.045) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
}

.v31-welcome {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(40px, 10vh, 118px) 0 24px;
}
.v31-welcome-shell {
  width: min(820px, 100%);
  display: block;
  text-align: center;
}
.v31-hero {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--v31-muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8be4ff;
  box-shadow: 0 0 18px rgba(139,228,255,0.78);
}
.welcome-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(56px, 7vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.07em;
  font-weight: 860;
  color: var(--v31-text);
}
.welcome-subtitle {
  max-width: 630px;
  margin: 0;
  color: var(--v31-muted);
  font-size: clamp(16px, 1.65vw, 19px);
  line-height: 1.68;
  letter-spacing: -0.012em;
}
.v31-suggestion-row {
  width: min(690px, 100%);
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-action-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 720;
  font-size: 13px;
  color: #dbe7f6;
  cursor: pointer;
}
.quick-action-btn.secondary { color: var(--v31-muted); background: rgba(255,255,255,0.025); }

.messages-container {
  min-height: 0;
  overflow: auto;
  padding: 18px 0 22px;
}
.message {
  border-radius: 24px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.045) !important;
}
.message.user-message,
.message.assistant-message { box-shadow: none !important; }

.v31-input-area {
  width: 100%;
  padding: 0 0 4px;
  background: transparent;
  border: 0;
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
}
.v31-composer-panel {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: 14px;
  border-radius: var(--v31-radius-xl);
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.082), rgba(255,255,255,0.046)),
    rgba(8, 13, 21, 0.8);
  box-shadow: 0 26px 80px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.065);
  backdrop-filter: blur(26px);
}
.composer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
}
.input-context { color: var(--v31-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-shortcuts { display: none; }
.composer-detail-link {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--v31-muted);
  font-size: 12px;
  font-weight: 700;
}
.v31-input-container {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: end;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
}
.input-wrapper { min-width: 0; }
.message-input {
  width: 100%;
  min-height: 92px;
  max-height: 220px;
  resize: none;
  color: var(--v31-text);
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 24px;
  padding: 18px 18px;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.message-input::placeholder { color: rgba(226,235,245,0.42); }
.attach-button {
  min-width: 44px;
  height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  font-weight: 760;
  color: var(--v31-muted);
  background: rgba(255,255,255,0.045);
}
.long-task-toggle { min-width: 92px; font-size: 12px; }
.send-button {
  height: 46px;
  min-width: 116px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  color: #071018;
  background: linear-gradient(135deg, #ffffff, #d8ecff 54%, #9be6ff);
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 17px 48px rgba(133, 213, 255, 0.2);
  font-weight: 820;
}
.send-button:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.details-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(2px);
}
.details-drawer-backdrop[hidden] { display: none; }
.details-drawer {
  position: fixed;
  z-index: 95;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(8, 13, 21, 0.94);
  backdrop-filter: blur(28px);
  box-shadow: var(--v31-shadow);
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  overflow: auto;
}
.details-drawer.is-open { transform: translateX(0); }
.details-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.details-drawer h2 { margin: 0; font-size: 24px; letter-spacing: -0.04em; }
.details-eyebrow { color: var(--v31-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.details-close { width: 40px; height: 40px; }
.details-section { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.075); }
.details-section-title { color: #eaf3ff; font-size: 13px; font-weight: 760; }
.details-action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.details-action-grid .settings-btn { width: 100%; padding: 0 10px; }
.model-picker-stack { display: grid; gap: 9px; width: 100%; }
.model-select {
  width: 100%;
  min-height: 42px;
  border-radius: 15px;
  color: var(--v31-text);
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0 12px;
}
.model-policy-card,
.sandbox-card,
.no-sandbox-msg {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  padding: 13px;
}
.model-policy-topline,
.topbar-status-group,
.app-setup-actions,
.sandbox-card-actions,
.sandbox-pairing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.model-policy-badge,
.model-policy-mode,
.api-status,
.sandbox-status,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #d7e3f3;
  font-size: 12px;
}
.api-status-dot,
.sandbox-status-dot,
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6f7b8e;
}
.api-status.connected .api-status-dot,
.sandbox-status.connected .sandbox-status-dot,
.status-badge.done .status-dot,
.status-badge.idle .status-dot { background: #8be4ff; box-shadow: 0 0 12px rgba(139,228,255,0.5); }
.status-badge.running .status-dot { background: #facc15; box-shadow: 0 0 12px rgba(250,204,21,0.5); }
.api-status.disconnected .api-status-dot,
.sandbox-status.disconnected .sandbox-status-dot { background: #f87171; }
.model-policy-body,
.no-sandbox-msg p,
.sandbox-card-meta,
.sandbox-pairing-note { color: var(--v31-muted); font-size: 13px; line-height: 1.5; }
.sandbox-card { display: flex; gap: 12px; }
.sandbox-card-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 13px; background: rgba(139,228,255,0.1); color: var(--v31-cyan); }
.sandbox-card-content { min-width: 0; display: grid; gap: 6px; }
.sandbox-card-title { font-weight: 760; }
.sandbox-card-path { color: #edf7ff; font-size: 13px; overflow-wrap: anywhere; }
.sandbox-pairing-panel { margin-top: 12px; }
.sandbox-pairing-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.sandbox-platform-select { max-width: 190px; min-height: 36px; color: var(--v31-text); background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.1); border-radius: 13px; }
.sandbox-command-box {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 230px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  color: #dff5ff;
  padding: 12px;
  font-size: 12px;
}
.install-help-panel { margin-top: 12px; color: var(--v31-muted); }
.install-help-panel code { display: block; margin-top: 8px; overflow-wrap: anywhere; color: #dff5ff; }

.modal-overlay { z-index: 120; backdrop-filter: blur(8px); }
.modal {
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(8, 13, 21, 0.96) !important;
  box-shadow: var(--v31-shadow) !important;
}
.modal-title { letter-spacing: -0.04em; }
.modal-subtitle { color: var(--v31-muted); }

body.focus-mode .v31-context-strip,
body.focus-mode .v31-welcome .hero-kicker,
body.focus-mode .v31-suggestion-row { display: none; }
body.focus-mode .v31-chat-area { max-width: 880px; }

@media (max-width: 900px) {
  .v31-header {
    height: 62px;
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }
  .command-palette-btn { display: none; }
  .logo-icon { width: 34px; height: 34px; border-radius: 12px; }
  .logo-subtitle { display: none; }
  .auth-control { display: none; }
  .details-btn { min-height: 36px; padding: 0 12px; }
  .new-task-btn { width: 36px; height: 36px; font-size: 22px; }
  .v31-chat-area {
    min-height: calc(100dvh - 62px);
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  }
  .v31-context-strip {
    min-height: 34px;
    padding: 0 10px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
  }
  .workspace-context-copy { display: none; }
  .workspace-badges { max-width: calc(100vw - 52px); }
  .workspace-pill { max-width: 46vw; min-height: 26px; padding: 0 9px; font-size: 11px; }
  .workspace-bar-actions,
  #workspaceToolsPill,
  #workspaceArtifactsPill { display: none !important; }
  .v31-welcome { padding: clamp(30px, 8vh, 58px) 0 18px; align-items: start; }
  .v31-hero { gap: 14px; }
  .hero-kicker { min-height: 28px; font-size: 10px; padding: 0 10px; }
  .welcome-title {
    max-width: 360px;
    font-size: clamp(40px, 12vw, 52px);
    line-height: 0.98;
    letter-spacing: -0.065em;
  }
  .welcome-subtitle {
    max-width: 360px;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .v31-suggestion-row {
    width: calc(100vw - 32px);
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 3px 2px 8px;
    margin-top: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .v31-suggestion-row::-webkit-scrollbar { display: none; }
  .quick-action-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    scroll-snap-align: start;
  }
  .v31-input-area { bottom: max(8px, env(safe-area-inset-bottom)); }
  .v31-composer-panel {
    border-radius: 28px;
    padding: 12px;
  }
  .composer-topline { padding: 0 2px 10px; }
  .input-context { font-size: 11px; max-width: calc(100vw - 132px); }
  .composer-detail-link { min-height: 26px; padding: 0 9px; font-size: 11px; }
  .v31-input-container {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "input input input"
      "attach mode send";
    gap: 10px;
    align-items: center;
  }
  .input-wrapper { grid-area: input; }
  .message-input {
    min-height: 178px;
    font-size: 15px;
    border-radius: 22px;
    padding: 16px;
  }
  #attachBtn { grid-area: attach; width: 42px; height: 42px; min-width: 42px; }
  #longTaskBtn { grid-area: mode; min-width: 92px; height: 42px; justify-self: start; font-size: 12px; }
  #sendBtn { grid-area: send; min-width: 106px; height: 42px; justify-self: end; }
  .details-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 80dvh;
    border-radius: 28px 28px 0 0;
    transform: translateY(calc(100% + 24px));
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  }
  .details-drawer.is-open { transform: translateY(0); }
  .details-action-grid { grid-template-columns: 1fr; }
  .sandbox-pairing-head { display: grid; }
  .sandbox-platform-select { max-width: none; width: 100%; }
}

@media (max-width: 430px) {
  .v31-header { padding: 0 14px; }
  .logo-stack > span:first-child { font-size: 13px; }
  .mobile-sidebar-btn { width: 34px; height: 34px; }
  .details-btn { font-size: 12px; padding: 0 10px; }
  .new-task-btn { width: 34px; height: 34px; }
  .v31-chat-area { padding-left: 14px; padding-right: 14px; }
  .welcome-title { font-size: clamp(38px, 12vw, 46px); }
  .message-input { min-height: 170px; }
  #longTaskBtn { min-width: 88px; }
  #sendBtn { min-width: 100px; }
}

@media (max-width: 370px) {
  .details-btn { display: none; }
  .welcome-title { font-size: 38px; }
  .welcome-subtitle { font-size: 13px; }
  #sendBtn { min-width: 94px; padding: 0 14px; }
  #longTaskBtn { min-width: 82px; padding: 0 10px; }
}

/* AuAI V3.2 final integration: match packaged desktop/mobile previews. */
body.is-empty-chat .app-container.auai-v31-shell {
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    radial-gradient(circle at 78% 0%, rgba(71, 181, 255, 0.18), transparent 30rem),
    linear-gradient(180deg, #070b12 0%, #04070d 100%);
  background-size: 152px 152px, 152px 152px, auto, auto;
}

body.is-empty-chat .v31-header {
  height: 68px;
  background: rgba(5, 8, 14, 0.86);
  border-bottom-color: rgba(255,255,255,0.06);
}

body.is-empty-chat .command-palette-btn {
  width: auto;
  min-width: 0;
  height: 36px;
  justify-self: center;
  gap: 22px;
  padding: 0 14px;
  color: #dce5f1;
  background: rgba(255,255,255,0.045);
}

body.is-empty-chat .command-palette-btn span {
  font-size: 0;
}

body.is-empty-chat .command-palette-btn span::before {
  content: "opencode-tui";
  font-size: 13px;
}

body.is-empty-chat .command-palette-btn kbd {
  display: none;
}

body.is-empty-chat .v31-chat-area {
  min-height: calc(100dvh - 68px);
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 106px 24px 14px;
}

body.is-empty-chat .v31-operational-deck {
  order: 0;
  width: auto;
  max-width: calc(100vw - 40px);
  margin: 0 auto 50px;
  justify-items: center;
}

body.is-empty-chat .v31-context-strip {
  width: auto;
  min-height: 34px;
  justify-content: center;
  padding: 0 16px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.075);
}

body.is-empty-chat .workspace-context-copy,
body.is-empty-chat .workspace-bar-actions,
body.is-empty-chat #workspaceToolsPill,
body.is-empty-chat #workspaceArtifactsPill {
  display: none !important;
}

body.is-empty-chat .workspace-badges {
  gap: 8px;
}

body.is-empty-chat .workspace-pill {
  max-width: none;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #c9d3e1;
}

body.is-empty-chat #workspaceProjectPill {
  display: none;
}

body.is-empty-chat #workspaceSandboxPill::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #66e2b4;
  box-shadow: 0 0 16px rgba(102,226,180,0.45);
  flex: 0 0 auto;
}

body.is-empty-chat .system-notice,
body.is-empty-chat .activity-banner,
body.is-empty-chat .long-task-panel,
body.is-empty-chat .file-rail {
  width: min(820px, 100%);
}

body.is-empty-chat .v31-welcome {
  order: 1;
  flex: 0 0 auto;
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
}

body.is-empty-chat .v31-welcome-shell {
  width: min(1040px, 100%);
}

body.is-empty-chat .v31-hero,
body.is-empty-chat .welcome-hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: grid;
  justify-items: center;
  gap: 18px;
}

body.is-empty-chat .hero-kicker {
  display: none;
}

body.is-empty-chat .hero-kicker::after {
  content: "";
}

body.is-empty-chat .welcome-title {
  max-width: 1240px;
  font-size: clamp(70px, 6.8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.074em;
  font-weight: 850;
  text-align: center;
}

body.is-empty-chat .welcome-title::first-letter {
  letter-spacing: -0.09em;
}

body.is-empty-chat .welcome-subtitle {
  max-width: 640px;
  font-size: 17px;
  line-height: 1.55;
  color: #9aa5b7;
  margin-top: -2px;
  text-align: center;
}

body.is-empty-chat .v31-input-area {
  order: 2;
  position: static;
  width: min(822px, 100%);
  margin: 78px auto 0;
  padding: 0;
}

body.is-empty-chat .v31-composer-panel {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  border-color: rgba(255,255,255,0.11);
  background:
    linear-gradient(180deg, rgba(31, 40, 54, 0.92), rgba(19, 26, 38, 0.92));
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body.is-empty-chat .composer-topline {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

body.is-empty-chat .v31-input-container {
  min-height: 190px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  grid-template-areas:
    "input input input input"
    "attach mode spacer send";
  gap: 0;
  align-items: end;
}

body.is-empty-chat .input-wrapper {
  grid-area: input;
  align-self: stretch;
}

body.is-empty-chat .message-input {
  min-height: 132px;
  height: 132px;
  max-height: 132px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 34px 30px 18px;
  font-size: 17px;
  line-height: 1.65;
}

body.is-empty-chat .message-input:focus {
  box-shadow: none;
}

body.is-empty-chat #attachBtn {
  grid-area: attach;
  width: auto;
  min-width: 140px;
  height: 44px;
  margin: 0 0 12px 24px;
  border-radius: 999px;
  font-size: 0;
  background: rgba(255,255,255,0.035);
}

body.is-empty-chat #attachBtn::after {
  content: "Contexto";
  font-size: 13px;
  color: #8b95a6;
}

body.is-empty-chat #longTaskBtn {
  grid-area: mode;
  width: auto;
  min-width: 124px;
  height: 44px;
  margin: 0 0 12px -12px;
  border-radius: 999px;
  color: #dfe7f2;
  background: rgba(255,255,255,0.045);
}

body.is-empty-chat #longTaskBtn::before {
  content: "Modo ";
  color: #7f899a;
  font-weight: 500;
}

body.is-empty-chat #sendBtn {
  grid-area: send;
  min-width: 132px;
  height: 44px;
  margin: 0 12px 12px 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #dbeeff);
  box-shadow: none;
}

body.is-empty-chat .v31-suggestion-row {
  order: 3;
  width: min(780px, 100%);
  position: fixed;
  z-index: 19;
  left: 50%;
  top: min(700px, calc(100dvh - 300px));
  transform: translateX(-50%);
  margin: 0;
  gap: 42px;
}

body.is-empty-chat .quick-action-btn {
  min-width: 135px;
  height: 50px;
  padding: 0 20px;
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.065);
  box-shadow: none;
}

body.is-empty-chat .quick-action-btn.primary {
  color: #071018;
  background: linear-gradient(135deg, #ffffff, #bdefff);
}

body.has-chat-messages .v31-chat-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100dvh - 72px);
  max-height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

body.has-chat-messages .v31-welcome,
body.has-chat-messages .welcome-screen {
  display: none !important;
}

body.has-chat-messages .messages-container {
  display: block !important;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: clamp(28px, 5vh, 64px);
  scroll-padding-bottom: 190px;
}

body.has-chat-messages .v31-input-area {
  position: relative;
  bottom: auto;
  z-index: 12;
  padding-top: 12px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0), rgba(7, 11, 18, 0.82) 28%, rgba(7, 11, 18, 0.96));
}

body.has-chat-messages .v31-composer-panel {
  width: min(900px, 100%);
}

body.has-chat-messages .long-task-panel:not(.has-active):not(.is-history-open) {
  display: none !important;
}

@media (max-width: 900px) {
  body.has-chat-messages .v31-chat-area {
    height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
  }

  body.has-chat-messages .messages-container {
    scroll-padding-bottom: 170px;
  }
}

@media (max-width: 900px) {
  body.is-empty-chat .v31-header {
    height: 58px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
  }

  body.is-empty-chat .mobile-sidebar-btn,
  body.is-empty-chat .command-palette-btn,
  body.is-empty-chat .auth-control {
    display: none !important;
  }

  body.is-empty-chat .header-left,
  body.is-empty-chat .header-right {
    width: auto;
  }

  body.is-empty-chat .header-left {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  body.is-empty-chat .header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  body.is-empty-chat .logo {
    width: auto;
  }

  body.is-empty-chat .logo-stack > span:first-child {
    font-size: 14px;
  }

  body.is-empty-chat .logo-subtitle {
    display: block;
    font-size: 12px;
  }

  body.is-empty-chat .v31-chat-area {
    min-height: calc(100dvh - 58px);
    padding: 26px 18px max(18px, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  body.is-empty-chat .v31-operational-deck {
    margin-bottom: 54px;
  }

  body.is-empty-chat .v31-context-strip {
    min-height: 34px;
    padding: 0 13px;
  }

  body.is-empty-chat #workspaceProjectPill {
    display: inline-flex;
  }

  body.is-empty-chat .workspace-pill {
    font-size: 12px;
    max-width: 78vw;
  }

  body.is-empty-chat .hero-kicker {
    display: none;
  }

  body.is-empty-chat .welcome-title {
    max-width: 360px;
    font-size: clamp(42px, 12vw, 54px);
    line-height: 0.98;
  }

  body.is-empty-chat .welcome-subtitle {
    max-width: 350px;
    font-size: 14px;
    line-height: 1.55;
  }

  body.is-empty-chat .v31-input-area {
    width: 100%;
    margin-top: 30px;
  }

  body.is-empty-chat .v31-composer-panel {
    border-radius: 28px;
  }

  body.is-empty-chat .v31-input-container {
    min-height: 264px;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "input input input"
      "attach mode send";
  }

  body.is-empty-chat .message-input {
    min-height: 194px;
    height: 194px;
    max-height: 194px;
    padding: 30px 22px 14px;
    font-size: 16px;
  }

  body.is-empty-chat #attachBtn {
    min-width: 96px;
    height: 42px;
    margin: 0 0 12px 14px;
  }

  body.is-empty-chat #longTaskBtn {
    min-width: 98px;
    height: 42px;
    margin: 0 0 12px 6px;
  }

  body.is-empty-chat #sendBtn {
    min-width: 118px;
    height: 42px;
    margin: 0 14px 12px 6px;
  }

  body.is-empty-chat .v31-suggestion-row {
    width: calc(100vw - 36px);
    margin-top: 46px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 0 4px 8px;
  }

  body.is-empty-chat .quick-action-btn {
    flex: 0 0 auto;
    min-width: 145px;
    height: 44px;
  }
}

@media (max-width: 430px) {
  body.is-empty-chat .v31-chat-area {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.is-empty-chat .header-right {
    gap: 8px;
  }

  body.is-empty-chat .details-btn {
    display: inline-flex;
  }
}

/* V3.2 refinement pass: prevent composer/action overlap across breakpoints. */
body.is-empty-chat .v31-suggestion-row {
  position: static;
  transform: none;
  margin: 22px auto 0;
}

body.is-empty-chat .quick-action-btn {
  white-space: nowrap;
}

body.is-empty-chat .v31-input-container {
  column-gap: 10px;
}

body.is-empty-chat #attachBtn,
body.is-empty-chat #longTaskBtn,
body.is-empty-chat #sendBtn {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  body.is-empty-chat .v31-input-container {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.08fr);
    grid-template-areas:
      "input input input"
      "attach mode send";
    gap: 10px;
    padding: 0 14px 14px;
  }

  body.is-empty-chat .input-wrapper {
    margin: 0 -14px;
  }

  body.is-empty-chat #attachBtn,
  body.is-empty-chat #longTaskBtn,
  body.is-empty-chat #sendBtn {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 10px;
  }

  body.is-empty-chat #longTaskBtn::before {
    content: "";
  }

  body.is-empty-chat .v31-suggestion-row {
    position: static;
    transform: none;
    margin: 14px auto 0;
  }
}

@media (max-width: 430px) {
  body.is-empty-chat .v31-input-container {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.95fr) minmax(0, 1fr);
    gap: 8px;
    padding: 0 14px 14px;
  }

  body.is-empty-chat #attachBtn,
  body.is-empty-chat #longTaskBtn,
  body.is-empty-chat #sendBtn {
    height: 42px;
    font-size: 12px;
    border-radius: 999px;
  }

  body.is-empty-chat #attachBtn::after {
    content: "Contexto";
    font-size: 12px;
  }

  body.is-empty-chat #sendBtn span:first-child {
    font-size: 13px;
  }

  body.is-empty-chat #sendBtn span:last-child {
    display: none;
  }

  body.is-empty-chat .v31-suggestion-row {
    width: 100%;
    margin-top: 14px;
  }
}

@media (max-width: 360px) {
  body.is-empty-chat .v31-input-container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "input input"
      "attach mode"
      "send send";
  }

  body.is-empty-chat #sendBtn {
    justify-self: stretch;
  }
}

/* V3.1 minimal premium alignment: frontend-only target composition. */
.v31-header {
  height: 68px;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  padding: 0 28px;
}

.v31-header .mobile-sidebar-btn {
  display: none;
}

.v31-header .logo {
  gap: 12px;
}

.v31-header .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #e8f7ff;
  color: #071018;
}

.v31-header .logo-stack > span:first-child {
  font-size: 15px;
  letter-spacing: -0.025em;
}

.v31-header .logo-subtitle {
  font-size: 12px;
  text-transform: lowercase;
}

.v31-header-pills {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
}

.header-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(235, 242, 255, 0.82);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.header-status-pill-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #72f0bf;
  box-shadow: 0 0 0 4px rgba(114, 240, 191, 0.1);
}

.header-status-pill-live .live-dot {
  display: none;
}

.v31-header .header-right {
  gap: 10px;
}

.v31-header .details-btn,
.v31-header .command-palette-btn,
.v31-header .new-task-btn {
  height: 38px;
  border-radius: 999px;
}

.v31-header .details-btn {
  padding: 0 18px;
}

.v31-header .command-palette-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
  justify-content: center;
}

.v31-header .command-palette-btn kbd {
  display: none;
}

.v31-header .command-palette-btn span {
  display: inline;
  font-size: 15px;
}

.v31-header .command-palette-btn span::before {
  content: none !important;
}

body.welcome-mode .v31-header .command-palette-btn span,
body.is-empty-chat .v31-header .command-palette-btn span {
  font-size: 15px !important;
}

body.welcome-mode .v31-header .command-palette-btn span::before,
body.is-empty-chat .v31-header .command-palette-btn span::before {
  content: none !important;
}

.v31-header .new-task-btn {
  width: auto;
  min-width: 82px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 750;
}

.v31-header .new-task-btn span {
  display: inline;
}

.v31-header .auth-control {
  display: none !important;
}

.details-auth-control {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
}

body.welcome-mode .v31-chat-area,
body.is-empty-chat .v31-chat-area {
  height: calc(100dvh - 68px);
  min-height: calc(100dvh - 68px);
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(78px, 10vh, 112px) 24px 18px;
  overflow: hidden;
}

body.welcome-mode .v31-operational-deck,
body.is-empty-chat .v31-operational-deck {
  display: none !important;
}

body.welcome-mode .v31-welcome,
body.is-empty-chat .v31-welcome {
  order: 1;
  display: flex !important;
  width: 100%;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
}

body.welcome-mode .v31-welcome-shell,
body.is-empty-chat .v31-welcome-shell {
  width: min(1320px, 100%);
  display: block;
}

body.welcome-mode .v31-hero,
body.is-empty-chat .v31-hero,
body.welcome-mode .welcome-hero,
body.is-empty-chat .welcome-hero {
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

body.welcome-mode .hero-kicker,
body.is-empty-chat .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 17px;
  margin: 0 auto 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(231, 239, 255, 0.76);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
}

body.welcome-mode .hero-kicker::before,
body.is-empty-chat .hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #72f0bf;
  box-shadow: 0 0 0 4px rgba(114, 240, 191, 0.1);
}

body.welcome-mode .hero-kicker .live-dot,
body.is-empty-chat .hero-kicker .live-dot {
  display: none;
}

body.welcome-mode .welcome-title,
body.is-empty-chat .welcome-title {
  max-width: none;
  margin: 0 auto;
  font-size: clamp(72px, 6.9vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.078em;
  font-weight: 850;
  white-space: nowrap;
  color: rgba(248, 250, 255, 0.98);
}

body.welcome-mode .welcome-title span,
body.is-empty-chat .welcome-title span {
  color: #bdefff;
  text-shadow: 0 0 26px rgba(54, 210, 255, 0.18);
}

body.welcome-mode .welcome-title::first-letter,
body.is-empty-chat .welcome-title::first-letter {
  color: inherit;
}

body.welcome-mode .welcome-subtitle,
body.is-empty-chat .welcome-subtitle {
  max-width: 650px;
  margin: 18px auto 0;
  color: rgba(174, 186, 207, 0.86);
  font-size: 17px;
  line-height: 1.65;
}

body.welcome-mode .v31-input-area,
body.is-empty-chat .v31-input-area {
  order: 2;
  position: relative;
  bottom: auto;
  width: min(820px, 100%);
  margin: clamp(54px, 8vh, 76px) auto 0;
  padding: 0;
  background: transparent;
  z-index: 2;
}

body.welcome-mode .v31-composer-panel,
body.is-empty-chat .v31-composer-panel {
  width: 100%;
  min-height: 192px;
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.115);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.026)),
    rgba(17, 25, 38, 0.82);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(26px);
}

body.welcome-mode .composer-topline,
body.is-empty-chat .composer-topline {
  display: none;
}

body.welcome-mode .v31-input-container,
body.is-empty-chat .v31-input-container {
  min-height: 192px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  grid-template-rows: minmax(126px, 1fr) 58px;
  grid-template-areas:
    "input input input input"
    "attach mode spacer send";
  gap: 0;
  align-items: center;
  padding: 0;
}

body.welcome-mode .input-wrapper,
body.is-empty-chat .input-wrapper {
  grid-area: input;
  height: 100%;
  min-height: 126px;
  padding: 32px 30px 18px;
  border: 0;
  background: transparent;
}

body.welcome-mode .message-input,
body.is-empty-chat .message-input {
  height: 100% !important;
  min-height: 82px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(239, 246, 255, 0.92);
  font-size: 16px;
  line-height: 1.7;
  resize: none;
}

body.welcome-mode .message-input:focus,
body.is-empty-chat .message-input:focus {
  outline: 0;
  box-shadow: none;
}

body.welcome-mode .v31-input-container::after,
body.is-empty-chat .v31-input-container::after {
  content: "";
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: start;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

body.welcome-mode #attachBtn,
body.is-empty-chat #attachBtn,
body.welcome-mode #longTaskBtn,
body.is-empty-chat #longTaskBtn {
  height: 36px;
  margin-left: 22px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.032);
  color: rgba(223, 232, 247, 0.76);
  box-shadow: none;
  font-size: 13px;
  font-weight: 560;
}

body.welcome-mode #attachBtn,
body.is-empty-chat #attachBtn {
  grid-area: attach;
  min-width: 132px;
}

body.welcome-mode #attachBtn::after,
body.is-empty-chat #attachBtn::after {
  content: "Contexto";
  margin-left: 8px;
}

body.welcome-mode #longTaskBtn,
body.is-empty-chat #longTaskBtn {
  grid-area: mode;
  min-width: 126px;
  margin-left: 0;
}

body.welcome-mode #longTaskBtn::before,
body.is-empty-chat #longTaskBtn::before {
  content: "Modo";
  margin-right: 8px;
  color: rgba(151, 163, 184, 0.78);
  font-weight: 520;
}

body.welcome-mode #longTaskBtn.active,
body.is-empty-chat #longTaskBtn.active {
  border-color: rgba(137, 225, 255, 0.24);
  background: rgba(85, 207, 245, 0.08);
  color: #c7f3ff;
}

body.welcome-mode #sendBtn,
body.is-empty-chat #sendBtn {
  grid-area: send;
  justify-self: end;
  width: 132px;
  min-width: 132px;
  height: 44px;
  margin-right: 12px;
  padding: 0 24px;
  border-radius: 999px;
  color: #071018;
  background: linear-gradient(135deg, #eff9ff, #d9edff);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

body.welcome-mode #sendBtn:disabled,
body.is-empty-chat #sendBtn:disabled {
  opacity: 0.62;
  filter: saturate(0.72);
}

body.welcome-mode .v31-suggestion-row,
body.is-empty-chat .v31-suggestion-row {
  order: 3;
  display: flex;
  width: min(820px, 100%);
  margin: 28px auto 0;
  justify-content: center;
  gap: 42px;
  flex-wrap: nowrap;
}

body.welcome-mode .quick-action-btn,
body.is-empty-chat .quick-action-btn,
body.welcome-mode .quick-action-btn.primary,
body.is-empty-chat .quick-action-btn.primary {
  min-width: 136px;
  height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.026);
  color: rgba(225, 234, 248, 0.84);
  box-shadow: none;
  font-size: 14px;
  font-weight: 620;
}

body.has-messages .v31-suggestion-row,
body.has-chat-messages .v31-suggestion-row {
  display: none !important;
}

@media (min-width: 901px) {
  .v31-header .mobile-sidebar-btn {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .v31-header {
    height: 58px;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0 14px;
  }

  .v31-header .mobile-sidebar-btn,
  .v31-header-pills {
    display: none !important;
  }

  .v31-header .logo-icon {
    width: 32px;
    height: 32px;
  }

  .v31-header .logo-stack > span:first-child {
    font-size: 14px;
  }

  .v31-header .logo-subtitle {
    font-size: 11px;
  }

  .v31-header .details-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
  }

  .v31-header .command-palette-btn {
    display: none;
  }

  .v31-header .new-task-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 22px;
  }

  .v31-header .new-task-btn span {
    display: none;
  }

  .v31-header .new-task-btn::before {
    content: "+";
  }

  body.welcome-mode .v31-chat-area,
  body.is-empty-chat .v31-chat-area {
    height: calc(100dvh - 58px);
    min-height: calc(100dvh - 58px);
    padding: 26px 18px max(18px, env(safe-area-inset-bottom));
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.welcome-mode .v31-welcome,
  body.is-empty-chat .v31-welcome {
    margin-top: 0;
  }

  body.welcome-mode .hero-kicker,
  body.is-empty-chat .hero-kicker {
    margin-bottom: 22px;
    min-height: 34px;
    font-size: 12px;
  }

  body.welcome-mode .welcome-title,
  body.is-empty-chat .welcome-title {
    max-width: 350px;
    font-size: clamp(42px, 12vw, 56px);
    line-height: 0.98;
    letter-spacing: -0.065em;
    white-space: normal;
  }

  body.welcome-mode .welcome-subtitle,
  body.is-empty-chat .welcome-subtitle {
    max-width: 330px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
  }

  body.welcome-mode .v31-input-area,
  body.is-empty-chat .v31-input-area {
    width: 100%;
    margin-top: 28px;
  }

  body.welcome-mode .v31-composer-panel,
  body.is-empty-chat .v31-composer-panel {
    min-height: 264px;
    border-radius: 28px;
  }

  body.welcome-mode .v31-input-container,
  body.is-empty-chat .v31-input-container {
    min-height: 264px;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: minmax(188px, 1fr) 68px;
    grid-template-areas:
      "input input input"
      "attach mode send";
  }

  body.welcome-mode .input-wrapper,
  body.is-empty-chat .input-wrapper {
    min-height: 188px;
    padding: 30px 22px 18px;
  }

  body.welcome-mode .message-input,
  body.is-empty-chat .message-input {
    font-size: 16px;
    line-height: 1.55;
  }

  body.welcome-mode #attachBtn,
  body.is-empty-chat #attachBtn,
  body.welcome-mode #longTaskBtn,
  body.is-empty-chat #longTaskBtn {
    height: 42px;
    min-width: 0;
    margin-left: 14px;
    padding: 0 18px;
  }

  body.welcome-mode #attachBtn,
  body.is-empty-chat #attachBtn {
    width: 96px;
    font-size: 0;
  }

  body.welcome-mode #attachBtn::after,
  body.is-empty-chat #attachBtn::after {
    content: "Contexto";
    margin-left: 0;
    font-size: 13px;
  }

  body.welcome-mode #longTaskBtn,
  body.is-empty-chat #longTaskBtn {
    width: 96px;
    margin-left: 8px;
    font-size: 13px;
  }

  body.welcome-mode #longTaskBtn::before,
  body.is-empty-chat #longTaskBtn::before {
    display: none;
  }

  body.welcome-mode #sendBtn,
  body.is-empty-chat #sendBtn {
    width: 116px;
    min-width: 116px;
    height: 48px;
    margin-right: 14px;
    padding: 0 18px;
  }

  body.welcome-mode .v31-suggestion-row,
  body.is-empty-chat .v31-suggestion-row {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: calc(100vw - 36px);
    margin-top: 38px;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 34px 4px 10px;
  }

  body.welcome-mode .v31-suggestion-row::before,
  body.is-empty-chat .v31-suggestion-row::before {
    content: "Acciones rápidas";
    position: absolute;
    top: 0;
    left: 4px;
    color: rgba(189, 201, 222, 0.72);
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  body.welcome-mode .quick-action-btn,
  body.is-empty-chat .quick-action-btn {
    flex: 0 0 auto;
    min-width: 138px;
    height: 44px;
    scroll-snap-align: start;
  }
}

@media (max-width: 390px) {
  body.welcome-mode #attachBtn,
  body.is-empty-chat #attachBtn,
  body.welcome-mode #longTaskBtn,
  body.is-empty-chat #longTaskBtn {
    width: 92px;
    padding: 0 12px;
  }

  body.welcome-mode #sendBtn,
  body.is-empty-chat #sendBtn {
    width: 108px;
    min-width: 108px;
  }
}

/* Session access and explicit click affordance. */
.v31-header .mobile-sidebar-btn {
  display: inline-flex !important;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  cursor: pointer;
}

body.welcome-mode .v31-header .mobile-sidebar-btn,
body.is-empty-chat .v31-header .mobile-sidebar-btn,
body.has-messages .v31-header .mobile-sidebar-btn,
body.has-chat-messages .v31-header .mobile-sidebar-btn {
  display: inline-flex !important;
}

.v31-header .details-btn,
.v31-header .command-palette-btn,
.v31-header .new-task-btn,
.v31-header .mobile-sidebar-btn,
.new-chat-btn,
.chat-item,
.sidebar-backdrop {
  cursor: pointer;
}

.v31-header .details-btn:disabled,
.v31-header .command-palette-btn:disabled,
.v31-header .new-task-btn:disabled,
.v31-header .mobile-sidebar-btn:disabled {
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .v31-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v31-header .mobile-sidebar-btn {
    display: inline-flex !important;
  }
}

/* Compact session history list. */
.sidebar .chat-list {
  display: grid;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  gap: 6px;
  padding: 4px 2px 8px 0;
  overflow-y: auto;
  max-height: calc(100% - 56px);
}

.sidebar .chat-item {
  align-self: start;
  height: auto !important;
  min-height: 0;
  padding: 8px 38px 8px 10px;
  margin: 0;
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.sidebar .chat-item:hover {
  background: rgba(121, 222, 255, 0.105);
  border-color: rgba(121, 222, 255, 0.26);
  transform: translateX(2px);
}

.sidebar .chat-item.active {
  background:
    linear-gradient(135deg, rgba(121, 222, 255, 0.18), rgba(110, 132, 255, 0.12));
  border-color: rgba(121, 222, 255, 0.38);
}

.sidebar .chat-item-title {
  height: auto !important;
  min-width: 0;
  padding-right: 0;
  color: rgba(239, 246, 255, 0.9);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .chat-item-date {
  height: auto !important;
  color: rgba(166, 180, 203, 0.72);
  font-size: 10.5px;
  line-height: 1.2;
}

.sidebar .chat-item-delete {
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.sidebar .chat-item:hover .chat-item-delete,
.sidebar .chat-item.active .chat-item-delete {
  opacity: 1;
}

/* ==================== AuAI V4 Chat Workflow ==================== */
:root[data-theme="light"] {
  --bg-primary: #f6f3ec;
  --bg-secondary: #fbfaf7;
  --bg-tertiary: #ece7dc;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(20, 31, 46, 0.055);
  --surface-strong: rgba(20, 31, 46, 0.085);
  --border: rgba(40, 55, 78, 0.14);
  --border-strong: rgba(14, 137, 130, 0.24);
  --text-primary: #14202f;
  --text-secondary: #526174;
  --text-muted: #7a8695;
  --accent: #0b9388;
  --accent-strong: #067e75;
  --accent-blue: #355ed8;
  --success: #16875f;
  --warning: #9d6b18;
  --error: #c84949;
  --shadow: 0 24px 70px rgba(42, 52, 66, 0.13);
  --v31-bg: #f6f3ec;
  --v31-panel: rgba(255, 255, 255, 0.74);
  --v31-panel-strong: rgba(255, 255, 255, 0.9);
  --v31-text: #14202f;
  --v31-muted: #607083;
  --v31-line: rgba(40, 55, 78, 0.13);
  --v31-cyan: #0b9388;
}

:root[data-theme="light"] body {
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(11,147,136,0.14), transparent 28rem),
    radial-gradient(circle at top right, rgba(53,94,216,0.12), transparent 34rem),
    linear-gradient(180deg, #fbfaf7 0%, #f6f3ec 48%, #efe9dc 100%);
}

:root[data-theme="light"] .v31-header,
:root[data-theme="light"] .details-drawer,
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .v31-composer,
:root[data-theme="light"] .message,
:root[data-theme="light"] .modal-content {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .message-content,
:root[data-theme="light"] .details-section-title,
:root[data-theme="light"] .sidebar-title,
:root[data-theme="light"] .v31-hero-title {
  color: var(--text-primary);
}

.theme-toggle-btn,
.message-action-btn,
.primary-action-btn,
.secondary-action-btn {
  min-height: 30px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-soft, rgba(255,255,255,.06));
  color: var(--text-secondary, #9aa8b8);
  border-radius: 999px;
  padding: 0 11px;
  font: 800 11px/1 var(--font-sans, inherit);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.theme-toggle-btn:hover,
.message-action-btn:hover,
.primary-action-btn:hover,
.secondary-action-btn:hover {
  color: var(--text-primary, #fff);
  border-color: var(--border-strong, rgba(25,211,197,.28));
  background: var(--surface-strong, rgba(255,255,255,.1));
  transform: translateY(-1px);
}

.message-action-btn.danger,
.secondary-action-btn.danger {
  color: var(--error, #ff6b6b);
}

.primary-action-btn {
  color: #041016;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent, #19d3c5), var(--accent-blue, #4d7cff));
}

.message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 42px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .18s ease, transform .18s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.agent-plan-card,
.agent-run-card {
  width: min(920px, 100%);
  margin: 14px auto 22px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: linear-gradient(180deg, var(--bg-elevated, rgba(18,25,39,.8)), rgba(12,18,29,.64));
  border-radius: 24px;
  box-shadow: var(--shadow, 0 24px 70px rgba(0,0,0,.28));
  overflow: hidden;
  animation: v4-card-in .28s cubic-bezier(.2,.8,.2,1);
}

:root[data-theme="light"] .agent-plan-card,
:root[data-theme="light"] .agent-run-card {
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
}

@keyframes v4-card-in {
  from { opacity: 0; transform: translateY(10px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-plan-card {
  padding: 20px;
}

.plan-kicker,
.run-card-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-soft, rgba(255,255,255,.06));
  padding: 7px 10px;
  color: var(--text-muted, #7f8ea3);
  font: 850 11px/1 var(--font-sans, inherit);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.agent-plan-card h3 {
  margin: 14px 0 8px;
  font: 850 20px/1.2 var(--font-display, var(--font-sans, inherit));
  color: var(--text-primary, #fff);
}

.agent-plan-card p,
.agent-plan-card li,
.run-card-head p,
.run-event p {
  color: var(--text-secondary, #9aa8b8);
  line-height: 1.6;
}

.agent-plan-card ol {
  margin: 14px 0 0 18px;
  padding: 0;
}

.plan-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.plan-files span {
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-soft, rgba(255,255,255,.06));
  color: var(--text-secondary, #9aa8b8);
  border-radius: 999px;
  padding: 6px 9px;
  font: 760 11px/1 var(--font-mono, monospace);
}

.plan-actions,
.run-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.agent-run-card {
  padding: 0;
}

.run-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
}

.run-card-head strong {
  display: block;
  margin-top: 9px;
  color: var(--text-primary, #fff);
  font: 850 15px/1.2 var(--font-display, var(--font-sans, inherit));
}

.run-card-head p {
  margin: 5px 0 0;
  font-size: 12px;
}

.run-progress {
  position: relative;
  height: 3px;
  background: var(--surface-soft, rgba(255,255,255,.06));
  overflow: hidden;
}

.run-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 24px;
  background: linear-gradient(90deg, var(--accent, #19d3c5), var(--accent-blue, #4d7cff));
  overflow: hidden;
}

.run-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transform: translateX(-100%);
  animation: auai-shimmer 1.4s ease-in-out infinite;
}

@keyframes auai-shimmer { to { transform: translateX(100%); } }

.run-card-events {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border, rgba(255,255,255,.12));
  padding: 16px 20px 18px;
  background: rgba(0,0,0,.08);
}

:root[data-theme="light"] .run-card-events {
  background: rgba(20,31,46,.035);
}

.run-event {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  color: var(--text-secondary, #9aa8b8);
}

.run-event-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent, #19d3c5);
  box-shadow: 0 0 16px rgba(25,211,197,.26);
}

.run-event strong {
  color: var(--text-primary, #fff);
  font: 800 12px/1.3 var(--font-sans, inherit);
}

.run-event p {
  margin: 3px 0 0;
  font-size: 12px;
}

.run-event.error .run-event-dot { background: var(--error, #ff6b6b); }
.run-event.warning .run-event-dot { background: var(--warning, #f1a93b); }
.run-event.success .run-event-dot { background: var(--success, #45d483); }
.run-event.muted { opacity: .72; }

@media (max-width: 720px) {
  .message-actions {
    opacity: 1;
    margin-left: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .agent-plan-card,
  .agent-run-card {
    border-radius: 20px;
    margin: 12px auto 18px;
  }
  .run-card-head {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
